@sankhyalabs/sankhyablocks 1.0.6 → 1.0.7
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 +2 -2
- package/dist/index.js +150 -5
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Projeto para integração do design system ez-ui com as regras de negocio/framework do ERP Sankhya
|
|
4
4
|
|
|
5
5
|
## Comandos NPM
|
|
6
|
-
- `npm run dev`: Esse comando foi criado com o intuito de facilitar
|
|
6
|
+
- `npm run dev`: Esse comando foi criado com o intuito de 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. Alteração na assinatura de métodos não são refletidas nesse modo.
|
|
7
7
|
|
|
8
|
-
- `npm run build`: Esse comando foi criado para fazer o build do projeto para produção,
|
|
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/dist/index.js
CHANGED
|
@@ -6401,9 +6401,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6401
6401
|
|
|
6402
6402
|
// EXPORTS
|
|
6403
6403
|
__webpack_require__.d(__webpack_exports__, {
|
|
6404
|
+
"Action": () => (/* reexport */ Action),
|
|
6404
6405
|
"ApplicationConfigFetcher": () => (/* reexport */ ApplicationConfigFetcher),
|
|
6406
|
+
"AuthorizedServiceCaller": () => (/* reexport */ AuthorizedServiceCaller),
|
|
6407
|
+
"Change": () => (/* reexport */ Change),
|
|
6408
|
+
"DataType": () => (/* reexport */ DataType),
|
|
6409
|
+
"DataUnit": () => (/* reexport */ DataUnit),
|
|
6410
|
+
"DataUnitAction": () => (/* reexport */ DataUnitAction),
|
|
6405
6411
|
"DataUnitFetcher": () => (/* reexport */ DataUnitFetcher),
|
|
6406
|
-
"
|
|
6412
|
+
"DateUtils": () => (/* reexport */ DateUtils),
|
|
6413
|
+
"FloatingManager": () => (/* reexport */ FloatingManager),
|
|
6414
|
+
"HttpFetcher": () => (/* reexport */ HttpFetcher),
|
|
6415
|
+
"HttpProvider": () => (/* reexport */ HttpProvider),
|
|
6416
|
+
"LoadStateManager": () => (/* reexport */ LoadStateManager),
|
|
6417
|
+
"LoadStatus": () => (/* reexport */ LoadStatus),
|
|
6418
|
+
"MaskFormatter": () => (/* reexport */ MaskFormatter),
|
|
6419
|
+
"NumberUtils": () => (/* reexport */ NumberUtils),
|
|
6420
|
+
"RequestMetadata": () => (/* reexport */ RequestMetadata),
|
|
6421
|
+
"SankhyaAppProvider": () => (/* reexport */ SankhyaAppProvider),
|
|
6422
|
+
"SkwHttpProvider": () => (/* reexport */ SkwHttpProvider),
|
|
6423
|
+
"StringUtils": () => (/* reexport */ StringUtils),
|
|
6424
|
+
"TimeFormatter": () => (/* reexport */ TimeFormatter),
|
|
6425
|
+
"UserInterface": () => (/* reexport */ UserInterface)
|
|
6407
6426
|
});
|
|
6408
6427
|
|
|
6409
6428
|
;// CONCATENATED MODULE: ./node_modules/@sankhyalabs/core/dist/utils/StringUtils.js
|
|
@@ -6886,6 +6905,131 @@ MaskFormatter.CharCharacter = class extends MaskFormatter.MaskCharacter {
|
|
|
6886
6905
|
}
|
|
6887
6906
|
};
|
|
6888
6907
|
//# sourceMappingURL=MaskFormatter.js.map
|
|
6908
|
+
;// CONCATENATED MODULE: ./node_modules/@sankhyalabs/core/dist/ui/FloatingManager.js
|
|
6909
|
+
class FloatingEntry {
|
|
6910
|
+
constructor(parent, content, opts) {
|
|
6911
|
+
try {
|
|
6912
|
+
this.weakRefParent = new WeakRef(parent);
|
|
6913
|
+
this.weakRefContent = new WeakRef(content);
|
|
6914
|
+
}
|
|
6915
|
+
catch (error) {
|
|
6916
|
+
this.strongRefParent = parent;
|
|
6917
|
+
this.strongRefContent = content;
|
|
6918
|
+
}
|
|
6919
|
+
this.options = opts;
|
|
6920
|
+
}
|
|
6921
|
+
get parent() {
|
|
6922
|
+
if (this.weakRefParent) {
|
|
6923
|
+
return this.weakRefParent.deref();
|
|
6924
|
+
}
|
|
6925
|
+
return this.strongRefParent;
|
|
6926
|
+
}
|
|
6927
|
+
get content() {
|
|
6928
|
+
if (this.weakRefContent) {
|
|
6929
|
+
return this.weakRefContent.deref();
|
|
6930
|
+
}
|
|
6931
|
+
return this.strongRefContent;
|
|
6932
|
+
}
|
|
6933
|
+
}
|
|
6934
|
+
class FloatingManager {
|
|
6935
|
+
static init() {
|
|
6936
|
+
FloatingManager.entries = [];
|
|
6937
|
+
document.addEventListener('mousedown', FloatingManager.handleDocumentEvent);
|
|
6938
|
+
document.addEventListener('keydown', FloatingManager.handleKeyboardEvent);
|
|
6939
|
+
FloatingManager.initialized = true;
|
|
6940
|
+
}
|
|
6941
|
+
static innerClick(container, node) {
|
|
6942
|
+
if (container.contains(node)) {
|
|
6943
|
+
return true;
|
|
6944
|
+
}
|
|
6945
|
+
if (container.shadowRoot && container.shadowRoot.contains(node)) {
|
|
6946
|
+
return true;
|
|
6947
|
+
}
|
|
6948
|
+
return false;
|
|
6949
|
+
}
|
|
6950
|
+
static doClose(id, entry, target) {
|
|
6951
|
+
if (!target || entry.options.autoClose) {
|
|
6952
|
+
const parent = entry.parent;
|
|
6953
|
+
const content = entry.content;
|
|
6954
|
+
if (parent && content) {
|
|
6955
|
+
const innerClickFunction = entry.options.innerClickTest ? entry.options.innerClickTest : FloatingManager.innerClick;
|
|
6956
|
+
if (!target || !innerClickFunction(content, target)) {
|
|
6957
|
+
content.remove();
|
|
6958
|
+
delete FloatingManager.entries[id];
|
|
6959
|
+
}
|
|
6960
|
+
}
|
|
6961
|
+
else {
|
|
6962
|
+
delete FloatingManager.entries[id];
|
|
6963
|
+
}
|
|
6964
|
+
}
|
|
6965
|
+
}
|
|
6966
|
+
static handleDocumentEvent(event) {
|
|
6967
|
+
FloatingManager.entries.forEach((entry, index) => {
|
|
6968
|
+
FloatingManager.doClose(index, entry, event.composedPath()[0]);
|
|
6969
|
+
});
|
|
6970
|
+
}
|
|
6971
|
+
static handleKeyboardEvent(event) {
|
|
6972
|
+
if (event.key === 'Escape') {
|
|
6973
|
+
for (let index = FloatingManager.entries.length; index >= 0; index--) {
|
|
6974
|
+
const entry = FloatingManager.entries[index];
|
|
6975
|
+
if (entry) {
|
|
6976
|
+
FloatingManager.close(index);
|
|
6977
|
+
break;
|
|
6978
|
+
}
|
|
6979
|
+
}
|
|
6980
|
+
}
|
|
6981
|
+
}
|
|
6982
|
+
static applyStyle(element, propertyName, value) {
|
|
6983
|
+
if (value) {
|
|
6984
|
+
element.style.setProperty(propertyName, value);
|
|
6985
|
+
}
|
|
6986
|
+
}
|
|
6987
|
+
static getFloatIndex(content, parent) {
|
|
6988
|
+
for (let index = 0; index < FloatingManager.entries.length; index++) {
|
|
6989
|
+
const entry = FloatingManager.entries[index];
|
|
6990
|
+
if (entry && content === entry.content && parent === entry.parent) {
|
|
6991
|
+
return index;
|
|
6992
|
+
}
|
|
6993
|
+
}
|
|
6994
|
+
return -1;
|
|
6995
|
+
}
|
|
6996
|
+
static isFloating(id) {
|
|
6997
|
+
return FloatingManager.entries[id] !== undefined;
|
|
6998
|
+
}
|
|
6999
|
+
static float(content, parent, options = { autoClose: true }) {
|
|
7000
|
+
if (!FloatingManager.initialized) {
|
|
7001
|
+
FloatingManager.init();
|
|
7002
|
+
}
|
|
7003
|
+
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
7004
|
+
if (alreadyFloatingIndex > -1) {
|
|
7005
|
+
return alreadyFloatingIndex;
|
|
7006
|
+
}
|
|
7007
|
+
content.style.position = 'absolute';
|
|
7008
|
+
FloatingManager.applyStyle(content, "top", options.top);
|
|
7009
|
+
FloatingManager.applyStyle(content, "left", options.left);
|
|
7010
|
+
FloatingManager.applyStyle(content, "right", options.right);
|
|
7011
|
+
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
7012
|
+
parent.appendChild(content);
|
|
7013
|
+
FloatingManager.entries.push(new FloatingEntry(parent, content, options));
|
|
7014
|
+
return FloatingManager.entries.length - 1;
|
|
7015
|
+
}
|
|
7016
|
+
static updateFloatPosition(content, parent, options = { autoClose: true }) {
|
|
7017
|
+
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
7018
|
+
if (alreadyFloatingIndex > -1) {
|
|
7019
|
+
FloatingManager.applyStyle(content, "top", options.top);
|
|
7020
|
+
FloatingManager.applyStyle(content, "left", options.left);
|
|
7021
|
+
FloatingManager.applyStyle(content, "right", options.right);
|
|
7022
|
+
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
7023
|
+
}
|
|
7024
|
+
;
|
|
7025
|
+
}
|
|
7026
|
+
static close(id) {
|
|
7027
|
+
if (FloatingManager.entries[id]) {
|
|
7028
|
+
FloatingManager.doClose(id, FloatingManager.entries[id], undefined);
|
|
7029
|
+
}
|
|
7030
|
+
}
|
|
7031
|
+
}
|
|
7032
|
+
//# sourceMappingURL=FloatingManager.js.map
|
|
6889
7033
|
;// CONCATENATED MODULE: ./node_modules/@sankhyalabs/core/dist/utils/DateUtils.js
|
|
6890
7034
|
class DateUtils {
|
|
6891
7035
|
static clearTime(date, adjustDayLightSavingTime = true) {
|
|
@@ -7033,7 +7177,7 @@ TimeFormatter._maskFormatter = new MaskFormatter("##:##");
|
|
|
7033
7177
|
/**
|
|
7034
7178
|
* Representa as propriedades necessárias para se executar uma requisição.
|
|
7035
7179
|
*/
|
|
7036
|
-
class
|
|
7180
|
+
class RequestMetadata {
|
|
7037
7181
|
/**
|
|
7038
7182
|
* @param {string} url A URL que deve ser chamada.
|
|
7039
7183
|
* @param {Method} method O Método da requisição (GET, PUT, POST ou DELETE).
|
|
@@ -7047,13 +7191,13 @@ class RequestMetadata_RequestMetadata {
|
|
|
7047
7191
|
}
|
|
7048
7192
|
}
|
|
7049
7193
|
/** Representa os verbos HTTP suportados */
|
|
7050
|
-
var
|
|
7194
|
+
var Method;
|
|
7051
7195
|
(function (Method) {
|
|
7052
7196
|
Method[Method["GET"] = 0] = "GET";
|
|
7053
7197
|
Method[Method["PUT"] = 1] = "PUT";
|
|
7054
7198
|
Method[Method["POST"] = 2] = "POST";
|
|
7055
7199
|
Method[Method["DELETE"] = 3] = "DELETE";
|
|
7056
|
-
})(
|
|
7200
|
+
})(Method || (Method = {}));
|
|
7057
7201
|
//# sourceMappingURL=RequestMetadata.js.map
|
|
7058
7202
|
;// CONCATENATED MODULE: ./node_modules/@sankhyalabs/core/dist/http/HttpProvider.js
|
|
7059
7203
|
|
|
@@ -8601,7 +8745,7 @@ var ParametersFetcher = /*#__PURE__*/function () {
|
|
|
8601
8745
|
parameters_fecher_createClass(ParametersFetcher, [{
|
|
8602
8746
|
key: "buldTemplates",
|
|
8603
8747
|
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$:
|
|
8748
|
+
this.templateByQuery.set("fetchParam", (0,dist.gql)(parameters_fecher_templateObject || (parameters_fecher_templateObject = parameters_fecher_taggedTemplateLiteral(["query($name: String!) {\n $queryAlias$: fetchResource(name: $name){\n name\n value\n }\n }"]))));
|
|
8605
8749
|
}
|
|
8606
8750
|
}, {
|
|
8607
8751
|
key: "getParam",
|
|
@@ -9170,6 +9314,7 @@ var ApplicationConfigFetcher = /*#__PURE__*/function () {
|
|
|
9170
9314
|
|
|
9171
9315
|
|
|
9172
9316
|
|
|
9317
|
+
|
|
9173
9318
|
})();
|
|
9174
9319
|
|
|
9175
9320
|
/******/ return __webpack_exports__;
|