@sankhyalabs/ezui 1.1.4 → 1.1.8
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 +72 -72
- package/dist/{ezui/DataUnit-285bec19.js → cjs/DataUnit-28b290cb.js} +382 -369
- package/dist/{ezui/index-919090de.js → cjs/RequestMetadata-2cd01e8a.js} +4 -383
- package/dist/cjs/ez-action-chip.cjs.entry.js +52 -0
- package/dist/cjs/ez-button_14.cjs.entry.js +3341 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +131 -0
- package/dist/cjs/ez-modal.cjs.entry.js +115 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +248 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +180 -0
- package/dist/cjs/ezui.cjs.js +19 -0
- package/dist/cjs/form-metadata.cjs.entry.js +74 -0
- package/dist/cjs/index-9403fe8f.js +1322 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +82 -0
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +109 -0
- package/dist/collection/components/ez-button/ez-button.css +94 -0
- package/dist/collection/components/ez-button/ez-button.js +125 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css +210 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js +215 -0
- package/dist/collection/components/ez-check/ez-check.css +266 -0
- package/dist/collection/components/ez-check/ez-check.js +168 -0
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +68 -0
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +108 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-interfaces.js +2 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +167 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +363 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css +39 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js +172 -0
- package/dist/collection/components/ez-form/ez-form.css +19 -0
- package/dist/collection/components/ez-form/ez-form.js +368 -0
- package/dist/collection/components/ez-form/store/Form.actions.js +132 -0
- package/dist/collection/components/ez-form/store/Form.reducer.js +194 -0
- package/dist/collection/components/ez-form/store/Form.selectors.js +44 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +207 -0
- package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +16 -0
- package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +24 -0
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +173 -0
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +14 -0
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +71 -0
- package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +27 -0
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +40 -0
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +27 -0
- package/dist/collection/components/ez-icon/ez-icon.css +37 -0
- package/dist/collection/components/ez-icon/ez-icon.js +56 -0
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +117 -0
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +276 -0
- package/dist/collection/components/ez-modal/ez-modal.css +87 -0
- package/dist/collection/components/ez-modal/ez-modal.js +224 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css +144 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +465 -0
- package/dist/collection/components/ez-popover/ez-popover.css +39 -0
- package/dist/collection/components/ez-popover/ez-popover.js +323 -0
- package/dist/collection/components/ez-search/ez-search.css +296 -0
- package/dist/{ezui/ez-search.entry.js → collection/components/ez-search/ez-search.js} +527 -334
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +126 -0
- package/dist/{ezui/ez-tabselector.entry.js → collection/components/ez-tabselector/ez-tabselector.js} +283 -209
- package/dist/collection/components/ez-text-area/ez-text-area.css +140 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +267 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +170 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +395 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css +155 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +326 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/servidor.js +101 -0
- package/dist/collection/utils/FloatingManager.js +16 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/custom-elements/index.js +5071 -0
- package/dist/esm/DataUnit-69e518fa.js +378 -0
- package/dist/esm/RequestMetadata-c265c9d5.js +527 -0
- package/dist/{ezui → esm}/ez-action-chip.entry.js +42 -42
- package/dist/esm/ez-button_14.entry.js +3324 -0
- package/dist/{ezui → esm}/ez-label-chip.entry.js +121 -121
- package/dist/{ezui → esm}/ez-modal.entry.js +105 -96
- package/dist/{ezui → esm}/ez-number-input.entry.js +238 -238
- package/dist/{ezui → esm}/ez-time-input.entry.js +170 -170
- package/dist/esm/ezui.js +17 -0
- package/dist/{ezui → esm}/form-metadata.entry.js +66 -66
- package/dist/esm/index-95bb3fd9.js +1293 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/ezui/ezui.esm.js +1 -122
- package/dist/ezui/index.esm.js +0 -1
- package/dist/ezui/p-10ef58b3.js +1 -0
- package/dist/ezui/p-185c57f4.js +1 -0
- package/dist/ezui/p-22b82efb.entry.js +1 -0
- package/dist/ezui/p-77fdb4fd.entry.js +1 -0
- package/dist/ezui/p-9dfccb16.js +1 -0
- package/dist/ezui/p-b0974f4f.entry.js +1 -0
- package/dist/ezui/p-db11c600.entry.js +1 -0
- package/dist/ezui/p-dd4331b7.entry.js +1 -0
- package/dist/ezui/p-f6fd31ab.entry.js +1 -0
- package/dist/ezui/p-fa260f22.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +16 -16
- package/dist/types/components/ez-button/ez-button.d.ts +20 -20
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +42 -42
- package/dist/types/components/ez-check/ez-check.d.ts +32 -32
- package/dist/types/components/ez-collapsable-box/ez-collapsable-box.d.ts +18 -18
- package/dist/types/components/ez-combo-box/ez-combo-box-interfaces.d.ts +4 -4
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +68 -68
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +31 -31
- package/dist/types/components/ez-form/ez-form.d.ts +31 -27
- package/dist/types/components/ez-form/store/Form.actions.d.ts +111 -104
- package/dist/types/components/ez-form/store/Form.reducer.d.ts +20 -11
- package/dist/types/components/ez-form/store/Form.selectors.d.ts +14 -13
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +55 -48
- package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +41 -41
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +15 -15
- package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +3 -3
- package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +10 -10
- package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +12 -12
- package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +13 -13
- package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +17 -7
- package/dist/types/components/ez-icon/ez-icon.d.ts +5 -5
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +40 -40
- package/dist/types/components/ez-modal/ez-modal.d.ts +32 -26
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +73 -73
- package/dist/types/components/ez-popover/ez-popover.d.ts +52 -52
- package/dist/types/components/ez-search/ez-search.d.ts +95 -95
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +31 -31
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +49 -49
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +64 -64
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +53 -53
- package/dist/types/components.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +13 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +114 -114
- package/react/components.d.ts +22 -0
- package/react/components.js +25 -0
- package/react/components.js.map +1 -0
- package/react/react-component-lib/createComponent.d.ts +10 -0
- package/react/react-component-lib/createComponent.js +59 -0
- package/react/react-component-lib/createComponent.js.map +1 -0
- package/react/react-component-lib/createOverlayComponent.d.ts +20 -0
- package/react/react-component-lib/createOverlayComponent.js +89 -0
- package/react/react-component-lib/createOverlayComponent.js.map +1 -0
- package/react/react-component-lib/index.d.ts +2 -0
- package/react/react-component-lib/index.js +3 -0
- package/react/react-component-lib/index.js.map +1 -0
- package/react/react-component-lib/interfaces.d.ts +29 -0
- package/react/react-component-lib/interfaces.js +1 -0
- package/react/react-component-lib/interfaces.js.map +1 -0
- package/react/react-component-lib/utils/attachProps.d.ts +12 -0
- package/react/react-component-lib/utils/attachProps.js +96 -0
- package/react/react-component-lib/utils/attachProps.js.map +1 -0
- package/react/react-component-lib/utils/case.d.ts +2 -0
- package/react/react-component-lib/utils/case.js +7 -0
- package/react/react-component-lib/utils/case.js.map +1 -0
- package/react/react-component-lib/utils/dev.d.ts +2 -0
- package/react/react-component-lib/utils/dev.js +13 -0
- package/react/react-component-lib/utils/dev.js.map +1 -0
- package/react/react-component-lib/utils/index.d.ts +7 -0
- package/react/react-component-lib/utils/index.js +21 -0
- package/react/react-component-lib/utils/index.js.map +1 -0
- package/dist/ezui/app-globals-0f993ce5.js +0 -3
- package/dist/ezui/css-shim-003e9264.js +0 -4
- package/dist/ezui/dom-1b195079.js +0 -73
- package/dist/ezui/ez-button.entry.js +0 -47
- package/dist/ezui/ez-calendar.entry.js +0 -102
- package/dist/ezui/ez-check.entry.js +0 -62
- package/dist/ezui/ez-collapsable-box.entry.js +0 -32
- package/dist/ezui/ez-combo-box.entry.js +0 -181
- package/dist/ezui/ez-date-input.entry.js +0 -77
- package/dist/ezui/ez-form.entry.js +0 -1907
- package/dist/ezui/ez-icon.entry.js +0 -17
- package/dist/ezui/ez-popover.entry.js +0 -112
- package/dist/ezui/ez-text-area.entry.js +0 -105
- package/dist/ezui/ez-text-input.entry.js +0 -202
- package/dist/ezui/index-39044be2.js +0 -2832
- package/dist/ezui/place-holder.entry.js +0 -15
- package/dist/ezui/shadow-css-c1ad5fdc.js +0 -383
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Classe com utiliários comuns para Strings.
|
|
3
|
-
*/
|
|
4
|
-
class StringUtils {
|
|
5
|
-
/**
|
|
6
|
-
* Verifica se a string está vazia.
|
|
7
|
-
* Valores null e undefined são considerados como vazio.
|
|
8
|
-
*
|
|
9
|
-
* @param value String para ser validada.
|
|
10
|
-
*/
|
|
11
|
-
static isEmpty(value) {
|
|
12
|
-
if (value == undefined || value === null) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
value = value.toString();
|
|
16
|
-
value = value.trim();
|
|
17
|
-
if (value.length === 0) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
'use strict';
|
|
23
2
|
|
|
24
3
|
const NUMBERINPUTS_REGEX_SCIENTIFIC_PARTS = /^([+-])?(\d+).?(\d*)[eE]([-+]?\d+)$/;
|
|
25
4
|
/**
|
|
@@ -51,7 +30,6 @@ NumberUtils.stringToNumber = (value) => {
|
|
|
51
30
|
if (value === '' || value === null || value === undefined) {
|
|
52
31
|
return NaN;
|
|
53
32
|
}
|
|
54
|
-
;
|
|
55
33
|
if (value) {
|
|
56
34
|
value = value.toString();
|
|
57
35
|
var negative = (value.charAt(0) === '-');
|
|
@@ -92,12 +70,10 @@ NumberUtils.format = (value, precision, prettyPrecision = NaN) => {
|
|
|
92
70
|
if (value === '' || value === undefined || value === "NaN") {
|
|
93
71
|
return NaN.toString();
|
|
94
72
|
}
|
|
95
|
-
;
|
|
96
73
|
let newValue = NumberUtils.stringToNumber(value);
|
|
97
74
|
if (newValue === NaN) {
|
|
98
75
|
return NaN.toString();
|
|
99
76
|
}
|
|
100
|
-
;
|
|
101
77
|
//Validation "precision":
|
|
102
78
|
// Case1: precision < 0 => does not use precision
|
|
103
79
|
// Case2: presicion not int => does not use precision
|
|
@@ -105,7 +81,6 @@ NumberUtils.format = (value, precision, prettyPrecision = NaN) => {
|
|
|
105
81
|
//Once stringToNumber returns number format, we need to change to pt-br
|
|
106
82
|
return NumberUtils.changeFormat(newValue.toString());
|
|
107
83
|
}
|
|
108
|
-
;
|
|
109
84
|
//Validation "prettyPrecision"
|
|
110
85
|
let prettyPrecisionInternal = 0;
|
|
111
86
|
// Case1: prettyPrecision < 0 => prettyPrecision does not change de format that means: prettyPrecisionInternal = precision;
|
|
@@ -166,7 +141,6 @@ NumberUtils.changeFormat = (value) => {
|
|
|
166
141
|
//Formatting output following formatnumber
|
|
167
142
|
return value.replace(/\./g, '_').replace(/\,/g, '.').replace(/\_/g, ',');
|
|
168
143
|
};
|
|
169
|
-
;
|
|
170
144
|
|
|
171
145
|
/**
|
|
172
146
|
* `MaskFormatter` é usado para formatar strings. Seu comportamento
|
|
@@ -403,7 +377,6 @@ MaskFormatter.LiteralCharacter = class extends MaskFormatter.MaskCharacter {
|
|
|
403
377
|
return true;
|
|
404
378
|
}
|
|
405
379
|
getChar(aChar) {
|
|
406
|
-
aChar;
|
|
407
380
|
return this._fixedChar;
|
|
408
381
|
}
|
|
409
382
|
};
|
|
@@ -444,152 +417,6 @@ MaskFormatter.CharCharacter = class extends MaskFormatter.MaskCharacter {
|
|
|
444
417
|
}
|
|
445
418
|
};
|
|
446
419
|
|
|
447
|
-
class FloatingEntry {
|
|
448
|
-
constructor(parent, content, opts) {
|
|
449
|
-
this.parent = new WeakRef(parent);
|
|
450
|
-
this.content = new WeakRef(content);
|
|
451
|
-
this.options = opts;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
class FloatingManager {
|
|
455
|
-
static init() {
|
|
456
|
-
FloatingManager.entries = [];
|
|
457
|
-
document.addEventListener('mousedown', FloatingManager.handleDocumentEvent);
|
|
458
|
-
document.addEventListener('keydown', FloatingManager.handleKeyboardEvent);
|
|
459
|
-
FloatingManager.initialized = true;
|
|
460
|
-
}
|
|
461
|
-
static innerClick(container, node) {
|
|
462
|
-
if (container.contains(node)) {
|
|
463
|
-
return true;
|
|
464
|
-
}
|
|
465
|
-
if (container.shadowRoot && container.shadowRoot.contains(node)) {
|
|
466
|
-
return true;
|
|
467
|
-
}
|
|
468
|
-
return false;
|
|
469
|
-
}
|
|
470
|
-
static doClose(id, entry, target) {
|
|
471
|
-
if (!target || entry.options.autoClose) {
|
|
472
|
-
const parent = entry.parent.deref();
|
|
473
|
-
const content = entry.content.deref();
|
|
474
|
-
if (parent && content) {
|
|
475
|
-
const innerClickFunction = entry.options.innerClickTest ? entry.options.innerClickTest : FloatingManager.innerClick;
|
|
476
|
-
if (!target || !innerClickFunction(content, target)) {
|
|
477
|
-
content.remove();
|
|
478
|
-
delete FloatingManager.entries[id];
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
delete FloatingManager.entries[id];
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
static handleDocumentEvent(event) {
|
|
487
|
-
FloatingManager.entries.forEach((entry, index) => {
|
|
488
|
-
FloatingManager.doClose(index, entry, event.composedPath()[0]);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
static handleKeyboardEvent(event) {
|
|
492
|
-
if (event.key === 'Escape') {
|
|
493
|
-
for (let index = FloatingManager.entries.length; index >= 0; index--) {
|
|
494
|
-
const entry = FloatingManager.entries[index];
|
|
495
|
-
if (entry) {
|
|
496
|
-
FloatingManager.close(index);
|
|
497
|
-
break;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
static applyStyle(element, propertyName, value) {
|
|
503
|
-
if (value) {
|
|
504
|
-
element.style.setProperty(propertyName, value);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
static getFloatIndex(content, parent) {
|
|
508
|
-
for (let index = 0; index < FloatingManager.entries.length; index++) {
|
|
509
|
-
const entry = FloatingManager.entries[index];
|
|
510
|
-
if (entry && content === entry.content.deref() && parent === entry.parent.deref()) {
|
|
511
|
-
return index;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
return -1;
|
|
515
|
-
}
|
|
516
|
-
static float(content, parent, options = { autoClose: true }) {
|
|
517
|
-
if (!FloatingManager.initialized) {
|
|
518
|
-
FloatingManager.init();
|
|
519
|
-
}
|
|
520
|
-
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
521
|
-
if (alreadyFloatingIndex > -1) {
|
|
522
|
-
return alreadyFloatingIndex;
|
|
523
|
-
}
|
|
524
|
-
content.style.position = 'absolute';
|
|
525
|
-
FloatingManager.applyStyle(content, "top", options.top);
|
|
526
|
-
FloatingManager.applyStyle(content, "left", options.left);
|
|
527
|
-
FloatingManager.applyStyle(content, "right", options.right);
|
|
528
|
-
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
529
|
-
parent.appendChild(content);
|
|
530
|
-
FloatingManager.entries.push(new FloatingEntry(parent, content, options));
|
|
531
|
-
return FloatingManager.entries.length - 1;
|
|
532
|
-
}
|
|
533
|
-
static updateFloatPosition(content, parent, options = { autoClose: true }) {
|
|
534
|
-
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
535
|
-
if (alreadyFloatingIndex > -1) {
|
|
536
|
-
FloatingManager.applyStyle(content, "top", options.top);
|
|
537
|
-
FloatingManager.applyStyle(content, "left", options.left);
|
|
538
|
-
FloatingManager.applyStyle(content, "right", options.right);
|
|
539
|
-
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
540
|
-
}
|
|
541
|
-
;
|
|
542
|
-
}
|
|
543
|
-
static close(id) {
|
|
544
|
-
if (FloatingManager.entries[id]) {
|
|
545
|
-
FloatingManager.doClose(id, FloatingManager.entries[id], undefined);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
class DateUtils {
|
|
551
|
-
static clearTime(date, adjustDayLightSavingTime = true) {
|
|
552
|
-
const newDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
|
|
553
|
-
return adjustDayLightSavingTime ? DateUtils.adjustDLST(newDate) : newDate;
|
|
554
|
-
}
|
|
555
|
-
static strToDate(strValue, adjustDayLightSavingTime = true, monthYearMode = false) {
|
|
556
|
-
/** monthYearMode é um booleano para usar o formato MM/YYYY.
|
|
557
|
-
* Quando ativado, é retornado o primeiro dia do mês apenas para construir a data.
|
|
558
|
-
* Não há necessidade de verificar o horário de verão quando utilizado esse modo. */
|
|
559
|
-
let parts;
|
|
560
|
-
if (monthYearMode) {
|
|
561
|
-
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);
|
|
562
|
-
}
|
|
563
|
-
else {
|
|
564
|
-
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);
|
|
565
|
-
}
|
|
566
|
-
if (!parts) {
|
|
567
|
-
return undefined;
|
|
568
|
-
}
|
|
569
|
-
var day = monthYearMode ? 1 : Number(parts[1]);
|
|
570
|
-
var month = Number(parts[(monthYearMode ? 1 : 2)]);
|
|
571
|
-
var year = Number(parts[(monthYearMode ? 2 : 3)]);
|
|
572
|
-
var hour = Number(parts[(monthYearMode ? 3 : 4)] || 0);
|
|
573
|
-
var min = Number(parts[(monthYearMode ? 4 : 5)] || 0);
|
|
574
|
-
var sec = Number(parts[(monthYearMode ? 5 : 6)] || 0);
|
|
575
|
-
if (year < 100) {
|
|
576
|
-
year += year < 30 ? 2000 : 1900;
|
|
577
|
-
}
|
|
578
|
-
let date = new Date(year, month - 1, day, hour, min, sec, 0);
|
|
579
|
-
if (adjustDayLightSavingTime === true && !monthYearMode && hour == 0) {
|
|
580
|
-
date = DateUtils.adjustDLST(date);
|
|
581
|
-
}
|
|
582
|
-
return date;
|
|
583
|
-
}
|
|
584
|
-
static adjustDLST(date) {
|
|
585
|
-
//Work around para corrigir o Bug do horário de verão.
|
|
586
|
-
if (date.getHours() == 23) {
|
|
587
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1, 1, 0, 0, 0);
|
|
588
|
-
}
|
|
589
|
-
return date;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
420
|
/**
|
|
594
421
|
* `TimeFormatter` é um utilitário para formatação de strings desformatadas em strings válidas de horários
|
|
595
422
|
*/
|
|
@@ -690,19 +517,6 @@ TimeFormatter._maskFormatter = new MaskFormatter("##:##");
|
|
|
690
517
|
/**
|
|
691
518
|
* Representa as propriedades necessárias para se executar uma requisição.
|
|
692
519
|
*/
|
|
693
|
-
class RequestMetadata {
|
|
694
|
-
/**
|
|
695
|
-
* @param {string} url A URL que deve ser chamada.
|
|
696
|
-
* @param {Method} method O Método da requisição (GET, PUT, POST ou DELETE).
|
|
697
|
-
*/
|
|
698
|
-
constructor(url, method, headers) {
|
|
699
|
-
/** Tempo limite de espera pela resposta */
|
|
700
|
-
this.timeout = 30000;
|
|
701
|
-
this.url = url;
|
|
702
|
-
this.method = method;
|
|
703
|
-
this.headers = headers || [];
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
520
|
/** Representa os verbos HTTP suportados */
|
|
707
521
|
var Method;
|
|
708
522
|
(function (Method) {
|
|
@@ -712,199 +526,6 @@ var Method;
|
|
|
712
526
|
Method[Method["DELETE"] = 3] = "DELETE";
|
|
713
527
|
})(Method || (Method = {}));
|
|
714
528
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
*/
|
|
719
|
-
class HttpProvider {
|
|
720
|
-
/**
|
|
721
|
-
* Faz uma requisição usando o método GET do HTTP para uma URL específica.
|
|
722
|
-
*
|
|
723
|
-
* @param {string} url A URL que deve ser chamada.
|
|
724
|
-
* @param {Array<Header>} headers [Opcional] Cabeçalhos HTTP.
|
|
725
|
-
* @returns {Promise<Object>} Uma promessa de que a requisição será preenchida.
|
|
726
|
-
*/
|
|
727
|
-
static get(url, headers) {
|
|
728
|
-
return this.dispatch(new RequestMetadata(url, Method.GET, headers));
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* Faz uma requisição usando o método POST do HTTP para uma URL específica.
|
|
732
|
-
*
|
|
733
|
-
* @param {string} url A URL que deve ser chamada.
|
|
734
|
-
* @param {Object} payload Informações a serem enviadas.
|
|
735
|
-
* @param {Array<Header>} headers [Opcional] Cabeçalhos HTTP.
|
|
736
|
-
* @returns {Promise<Object>} Uma promessa de que a requisição será preenchida.
|
|
737
|
-
*/
|
|
738
|
-
static post(url, payload, headers) {
|
|
739
|
-
return this.dispatch(new RequestMetadata(url, Method.POST, headers), payload);
|
|
740
|
-
}
|
|
741
|
-
static dispatch(requestMetadata, payload) {
|
|
742
|
-
return new Promise((resolve, reject) => {
|
|
743
|
-
const request = new XMLHttpRequest();
|
|
744
|
-
request.timeout = requestMetadata.timeout;
|
|
745
|
-
request.onerror = function handleError() {
|
|
746
|
-
reject({
|
|
747
|
-
status: 404,
|
|
748
|
-
statusText: 'Not Found'
|
|
749
|
-
});
|
|
750
|
-
};
|
|
751
|
-
request.ontimeout = function handleTimeout() {
|
|
752
|
-
reject({
|
|
753
|
-
status: 408,
|
|
754
|
-
statusText: 'Request Timeout'
|
|
755
|
-
});
|
|
756
|
-
};
|
|
757
|
-
request.onreadystatechange = () => {
|
|
758
|
-
// While readState isn't done, there's nothing to do...
|
|
759
|
-
if (request.readyState != 4) {
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
const status = request.status;
|
|
763
|
-
// The request has failed so we'll handled by onerror instead
|
|
764
|
-
if (status === 0) {
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
const response = {
|
|
768
|
-
status,
|
|
769
|
-
statusText: request.statusText,
|
|
770
|
-
};
|
|
771
|
-
// Anything out of this range is an error, so we just send the status and statusText.
|
|
772
|
-
if (status >= 200 && status < 300) {
|
|
773
|
-
resolve(Object.assign(Object.assign({}, response), { data: request.response, dataAsString: request.responseText }));
|
|
774
|
-
}
|
|
775
|
-
else {
|
|
776
|
-
reject(response);
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
request.open(requestMetadata.method.toString(), requestMetadata.url, true);
|
|
780
|
-
requestMetadata.headers.map((h) => request.setRequestHeader(h.name, h.value));
|
|
781
|
-
if (payload != null) {
|
|
782
|
-
request.send(JSON.stringify(payload));
|
|
783
|
-
}
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
class SkwHttpProvider {
|
|
789
|
-
static callService(serviceName, content) {
|
|
790
|
-
return new Promise((resolve, reject) => {
|
|
791
|
-
let host = "http://192.168.1.218:8503/mge/";
|
|
792
|
-
let appName = "ListaTarefa";
|
|
793
|
-
let module = 'mge';
|
|
794
|
-
this._counter++;
|
|
795
|
-
if (serviceName.indexOf("@") > -1) {
|
|
796
|
-
var s = serviceName.split("@");
|
|
797
|
-
module = s[0];
|
|
798
|
-
serviceName = s[1];
|
|
799
|
-
}
|
|
800
|
-
let url = `${host}/${module}/service.sbr?serviceName=${serviceName}&counter=${this._counter}&application=${appName}&outputType=json&preventTransform=false`;
|
|
801
|
-
let requestContent = {
|
|
802
|
-
serviceName: serviceName,
|
|
803
|
-
requestBody: content
|
|
804
|
-
};
|
|
805
|
-
let headers = new Headers();
|
|
806
|
-
headers.append("Content-Type", "application/json");
|
|
807
|
-
//headers.append("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, PATCH, DELETE");
|
|
808
|
-
//headers.append("Access-Control-Allow-Origin", "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers");
|
|
809
|
-
fetch(url, {
|
|
810
|
-
body: JSON.stringify(requestContent),
|
|
811
|
-
method: 'POST',
|
|
812
|
-
headers: headers
|
|
813
|
-
})
|
|
814
|
-
.then(res => res.json())
|
|
815
|
-
.then((data) => {
|
|
816
|
-
console.log(data);
|
|
817
|
-
});
|
|
818
|
-
/*HttpProvider.post(url, requestContent, headers)
|
|
819
|
-
.then(res => {
|
|
820
|
-
if (!res.hasOwnProperty('status') ||
|
|
821
|
-
res.status == this.STATUS_ERROR ||
|
|
822
|
-
res.status == this.STATUS_TIMEOUT) {
|
|
823
|
-
|
|
824
|
-
let statusMessage = res.statusMessage;
|
|
825
|
-
|
|
826
|
-
if (!statusMessage) {
|
|
827
|
-
statusMessage = 'Erro não identificado.'
|
|
828
|
-
}
|
|
829
|
-
//TODO: No futuro, exibir mensagens de erro. (MessageUtils.showError)
|
|
830
|
-
reject(new Error(statusMessage));
|
|
831
|
-
}else if (res.status == this.STATUS_CANCELED) {
|
|
832
|
-
if (res.statusMessage){
|
|
833
|
-
console.warn(res.statusMessage);
|
|
834
|
-
}
|
|
835
|
-
}else{
|
|
836
|
-
resolve(res);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
if (res.status == this.STATUS_INFO) {
|
|
840
|
-
//TODO: No futuro, exibir mensagens de erro. (MessageUtils.showAlert)
|
|
841
|
-
console.info(res.statusMessage);
|
|
842
|
-
}
|
|
843
|
-
})
|
|
844
|
-
.catch((e)=>{reject(e)});*/
|
|
845
|
-
});
|
|
846
|
-
}
|
|
847
|
-
;
|
|
848
|
-
}
|
|
849
|
-
SkwHttpProvider._counter = 0;
|
|
850
|
-
SkwHttpProvider.STATUS_ERROR = 0;
|
|
851
|
-
SkwHttpProvider.STATUS_OK = 1;
|
|
852
|
-
SkwHttpProvider.STATUS_INFO = 2;
|
|
853
|
-
SkwHttpProvider.STATUS_TIMEOUT = 3;
|
|
854
|
-
SkwHttpProvider.STATUS_CANCELED = 4;
|
|
855
|
-
|
|
856
|
-
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
857
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
858
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
859
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
860
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
861
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
862
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
863
|
-
});
|
|
864
|
-
};
|
|
865
|
-
class AuthorizedServiceCaller {
|
|
866
|
-
constructor(serverURL, unauthorizedPath) {
|
|
867
|
-
this.serverURL = "http://192.168.1.218:8503"; //todo request deve fazer replace de ${serverURL} pelo conteúdo da variável
|
|
868
|
-
this.unauthorizedPath = "/";
|
|
869
|
-
this.serverURL = serverURL;
|
|
870
|
-
this.unauthorizedPath = unauthorizedPath;
|
|
871
|
-
}
|
|
872
|
-
requestService(request, callback) {
|
|
873
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
874
|
-
let token = localStorage.getItem('token');
|
|
875
|
-
let headers;
|
|
876
|
-
let body = request === null || request === void 0 ? void 0 : request.body;
|
|
877
|
-
let method = request === null || request === void 0 ? void 0 : request.method;
|
|
878
|
-
if (!token) {
|
|
879
|
-
window.location.pathname = this.unauthorizedPath;
|
|
880
|
-
}
|
|
881
|
-
else {
|
|
882
|
-
headers = {
|
|
883
|
-
'Authorization': `${token}`,
|
|
884
|
-
'Content-Type': 'application/json',
|
|
885
|
-
'Customer-Host': 'http://localhost:8080/sankhyaw'
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
let response = yield yield fetch(this.serverURL, {
|
|
889
|
-
method: method,
|
|
890
|
-
headers: headers,
|
|
891
|
-
body: body
|
|
892
|
-
})
|
|
893
|
-
.catch(e => {
|
|
894
|
-
console.log(e);
|
|
895
|
-
});
|
|
896
|
-
if (response instanceof Response && response.status === 401) {
|
|
897
|
-
localStorage.removeItem('token');
|
|
898
|
-
window.location.pathname = this.unauthorizedPath;
|
|
899
|
-
}
|
|
900
|
-
if (callback && response instanceof Response) {
|
|
901
|
-
callback(response.json().then());
|
|
902
|
-
}
|
|
903
|
-
else {
|
|
904
|
-
return response;
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
export { DateUtils as D, FloatingManager as F, MaskFormatter as M, NumberUtils as N, TimeFormatter as T };
|
|
529
|
+
exports.MaskFormatter = MaskFormatter;
|
|
530
|
+
exports.NumberUtils = NumberUtils;
|
|
531
|
+
exports.TimeFormatter = TimeFormatter;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-9403fe8f.js');
|
|
6
|
+
|
|
7
|
+
const ezActionChipCss = ":host{--ac--height:36px;--ac--width:100%;--ac__icon--width:48px;--ac--border-radius:var(--border--radius-large, 24px);--ac--font-size:var(--text--medium, 14px);--ac--font-family:var(--font-pattern, Arial);--ac--font-weight:var(--text-weight--large, 500);--ac--space--medium:var(--space--medium, 6px);--ac__border:1px solid;--ac__border-color-strokes:var(--color--strokes, #DCE0E8);--ac__label--title--primary:var(--title--primary, #919191);--ac__label--color-primary:var(--color--primary, #008561);--ac__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ac__label--background-color:#0085610F;--ac__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--ac__label__default--border-color--hover:var(--color--primary-600, #007a5a);--ac__label--text--disabled:var(--text--disable, #AFB6C0);--ac__label--text--primary:var(--text--primary, #626e82);--ac__message_box--font-size:var(--text--small, 12px);--ac__message_box--info--color:var(--color--success, #22085d);--ac__message_box--error--color:var(--color--error, #FF0000);width:100%}.padding-right--small{padding-right:var(--ac--space--medium)}.padding-left--small{padding-left:var(--ac--space--medium)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;align-items:center;align-self:center;color:var(--ac__label--title--primary);fill:var(--ac__label--title--primary);border:var(--ac__border);border-radius:var(--ac--border-radius);border-color:var( --ac__border-color-strokes);padding-right:var(--space--large, 12px);padding-left:var(--space--large, 12px);cursor:pointer}.label__container:hover{border-color:var(--ac__label__default--border-color--hover);background-color:var(--ac__label__default--background-color--hover)}.label__container--active:hover{border-color:var(--ac__label__active--background-color--hover);background-color:var(--ac__label__active--background-color--hover)}label{display:flex;align-items:center;width:calc(100% - var(--ac__icon--width));width:fit-content;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--ac--height);font-family:var(--ac--font-family);font-size:var(--ac--font-size)}";
|
|
8
|
+
|
|
9
|
+
const EzLabelChip = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
13
|
+
/**
|
|
14
|
+
* Deixa o componente disponível ou não para seleção.
|
|
15
|
+
*/
|
|
16
|
+
this.enabled = true;
|
|
17
|
+
}
|
|
18
|
+
//---------------------------------------------
|
|
19
|
+
// Event handlers
|
|
20
|
+
//---------------------------------------------
|
|
21
|
+
handleSlotChange(ev) {
|
|
22
|
+
const slot = ev.target;
|
|
23
|
+
const content = slot.assignedElements()[0];
|
|
24
|
+
if (content) {
|
|
25
|
+
content.style.position = "absolute";
|
|
26
|
+
content.style.display = "flex";
|
|
27
|
+
content.style.alignItems = "center";
|
|
28
|
+
content.style.justifyContent = "center";
|
|
29
|
+
content.style.overflow = "hidden";
|
|
30
|
+
content.style.top = "0px";
|
|
31
|
+
content.style.width = "var(--ac__icon--width)";
|
|
32
|
+
content.style.height = "var(--ac--height)";
|
|
33
|
+
if (slot.name == "leftIcon") {
|
|
34
|
+
content.style.left = "0px";
|
|
35
|
+
this._labelElem.classList.add('padding-left--small');
|
|
36
|
+
}
|
|
37
|
+
else if (slot.name == "rightIcon") {
|
|
38
|
+
content.style.right = "0px";
|
|
39
|
+
this._labelElem.classList.add('padding-right--small');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//---------------------------------------------
|
|
44
|
+
// Lifecycle web component
|
|
45
|
+
//---------------------------------------------
|
|
46
|
+
render() {
|
|
47
|
+
return (index.h("div", { onClick: () => this.actionClick.emit(), class: "label__container" }, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("label", { ref: (el) => this._labelElem = el }, this.label), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
EzLabelChip.style = ezActionChipCss;
|
|
51
|
+
|
|
52
|
+
exports.ez_action_chip = EzLabelChip;
|