@sankhyalabs/ezui 1.1.92 → 1.1.95

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.
Files changed (98) hide show
  1. package/dist/cjs/{CSSVarsUtils-66e86394.js → CSSVarsUtils-8fbdf2e0.js} +1 -0
  2. package/dist/cjs/StringUtils-0ba09df4.js +57 -0
  3. package/dist/cjs/ez-button_3.cjs.entry.js +578 -0
  4. package/dist/cjs/ez-calendar_14.cjs.entry.js +2625 -0
  5. package/dist/cjs/ez-dialog.cjs.entry.js +3 -3
  6. package/dist/cjs/{ez-button_11.cjs.entry.js → ez-grid.cjs.entry.js} +32 -1439
  7. package/dist/cjs/ez-icon.cjs.entry.js +42 -0
  8. package/dist/cjs/ez-modal_2.cjs.entry.js +317 -0
  9. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-time-input.cjs.entry.js +2 -2
  11. package/dist/cjs/ezui.cjs.js +1 -1
  12. package/dist/cjs/{index-a92e6d04.js → index-6164b259.js} +18 -18
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/ez-check/ez-check.css +3 -3
  15. package/dist/collection/components/ez-combo-box/ez-combo-box.js +52 -3
  16. package/dist/collection/components/ez-dialog/ez-dialog.css +14 -2
  17. package/dist/collection/components/ez-dialog/ez-dialog.js +3 -5
  18. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +4 -1
  19. package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +4 -4
  20. package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +2 -2
  21. package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +2 -2
  22. package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +2 -2
  23. package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +6 -6
  24. package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +2 -2
  25. package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +2 -2
  26. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +10 -7
  27. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +19 -2
  28. package/dist/collection/components/ez-grid/ez-grid.css +8 -0
  29. package/dist/collection/components/ez-grid/ez-grid.js +3 -3
  30. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +28 -4
  31. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +6 -5
  32. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -7
  33. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +12 -17
  34. package/dist/collection/components/ez-list/ez-list.css +23 -2
  35. package/dist/collection/components/ez-list/ez-list.js +138 -68
  36. package/dist/collection/components/ez-text-input/ez-text-input.css +2 -2
  37. package/dist/collection/components/ez-text-input/ez-text-input.js +24 -1
  38. package/dist/collection/components/test-du/test-du.js +1 -1
  39. package/dist/collection/utils/CSSVarsUtils.js +1 -0
  40. package/dist/collection/utils/index.js +2 -0
  41. package/dist/custom-elements/index.js +217 -120
  42. package/dist/esm/{CSSVarsUtils-aeee9825.js → CSSVarsUtils-667e0016.js} +1 -0
  43. package/dist/esm/StringUtils-cbf10229.js +55 -0
  44. package/dist/esm/ez-button_3.entry.js +572 -0
  45. package/dist/esm/ez-calendar_14.entry.js +2608 -0
  46. package/dist/esm/ez-dialog.entry.js +3 -3
  47. package/dist/esm/{ez-button_11.entry.js → ez-grid.entry.js} +24 -1421
  48. package/dist/esm/ez-icon.entry.js +38 -0
  49. package/dist/esm/ez-modal_2.entry.js +312 -0
  50. package/dist/esm/ez-popover.entry.js +1 -1
  51. package/dist/esm/ez-time-input.entry.js +2 -2
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/{index-4fb1605f.js → index-74a9c220.js} +17 -17
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/ezui/ezui.esm.js +1 -1
  56. package/dist/ezui/p-0a8018c2.entry.js +1 -0
  57. package/dist/ezui/{p-552a0b2e.entry.js → p-2617733e.entry.js} +1 -1
  58. package/dist/ezui/p-2f84ba72.js +1 -0
  59. package/dist/ezui/{p-d4386e30.entry.js → p-6714a1b2.entry.js} +46 -46
  60. package/dist/ezui/p-90f6d8a0.entry.js +1 -0
  61. package/dist/ezui/p-a943d501.entry.js +1 -0
  62. package/dist/ezui/p-b139372f.entry.js +1 -0
  63. package/dist/ezui/{p-f0137439.js → p-c6762896.js} +1 -1
  64. package/dist/ezui/p-d54c157f.js +1 -0
  65. package/dist/ezui/p-e06e47f1.entry.js +1 -0
  66. package/dist/ezui/{p-7e0281cd.entry.js → p-ef393d36.entry.js} +1 -1
  67. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +8 -0
  68. package/dist/types/components/ez-form/ez-form.d.ts +6 -1
  69. package/dist/types/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.d.ts +2 -1
  70. package/dist/types/components/ez-form/fieldbuilder/tpl/DateInput.tpl.d.ts +2 -1
  71. package/dist/types/components/ez-form/fieldbuilder/tpl/FileInput.tpl.d.ts +2 -1
  72. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +4 -2
  73. package/dist/types/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.d.ts +2 -1
  74. package/dist/types/components/ez-form/fieldbuilder/tpl/TextArea.tpl.d.ts +2 -1
  75. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
  76. package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +6 -4
  77. package/dist/types/components/ez-list/ez-list.d.ts +11 -6
  78. package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
  79. package/dist/types/components.d.ts +28 -4
  80. package/dist/types/utils/index.d.ts +2 -0
  81. package/package.json +1 -1
  82. package/dist/cjs/ApplicationUtils-d1c1db56.js +0 -35
  83. package/dist/cjs/ez-calendar.cjs.entry.js +0 -224
  84. package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +0 -853
  85. package/dist/cjs/ez-combo-box.cjs.entry.js +0 -254
  86. package/dist/cjs/ez-form.cjs.entry.js +0 -753
  87. package/dist/esm/ApplicationUtils-01280a9d.js +0 -33
  88. package/dist/esm/ez-calendar.entry.js +0 -220
  89. package/dist/esm/ez-collapsible-box_7.entry.js +0 -843
  90. package/dist/esm/ez-combo-box.entry.js +0 -250
  91. package/dist/esm/ez-form.entry.js +0 -749
  92. package/dist/ezui/p-0094463f.entry.js +0 -1
  93. package/dist/ezui/p-020f1285.entry.js +0 -1
  94. package/dist/ezui/p-038fd0cb.entry.js +0 -1
  95. package/dist/ezui/p-60469339.entry.js +0 -1
  96. package/dist/ezui/p-7107d7ef.js +0 -1
  97. package/dist/ezui/p-8b099482.js +0 -1
  98. package/dist/ezui/p-d22db59d.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as s,h as t,H as i,g as e}from"./p-89a57641.js";import{M as h,T as r,N as a}from"./p-f0137439.js";import{C as o}from"./p-8b099482.js";import{g as n}from"./p-477bb703.js";let l=class{constructor(t){s(this,t),this.enabled=!0,this.showSeconds=!1}prepareMask(){this.showSeconds?null==this._maskFormatter?this._maskFormatter=new h("##:##:##"):this._maskFormatter.mask="##:##:##":null==this._maskFormatter?this._maskFormatter=new h("##:##"):this._maskFormatter.mask="##:##"}onValueChanged(){NaN===this.value&&(this.value=void 0,this.handleFocusout())}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){this.errorMessage="",this.prepareValue(this.viewValue),r.validateTime(this.viewValue,this.showSeconds)||(this.clearField(),this.errorMessage="Favor inserir um horário válido.")}prepareValue(s){try{this.viewValue=r.prepareValue(s,this.showSeconds)}catch(s){this.clearField(),this.errorMessage=s.message}}clearField(){this.viewValue=this.value=void 0}handleChange(){this.viewValue=this._inputElem.value,this.value=a.stringToNumber(this.viewValue.replace(/\D/g,""))}componentDidLoad(){this.onValueChanged(),o.applyVarsTextInput(this._elem,this._inputElem)}componentWillLoad(){this.prepareMask(),this.value?this.prepareValue(this.value.toString()):this.viewValue&&this.prepareValue(this.viewValue)}render(){return t(i,null,t("ez-text-input",{ref:s=>this._inputElem=s,value:this.viewValue,enabled:this.enabled,label:this.label,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()},errorMessage:this.errorMessage},t("ez-icon",{slot:"leftIcon",href:n("timer-outline")})))}static get assetsDirs(){return["../assets"]}get _elem(){return e(this)}static get watchers(){return{showSeconds:["prepareMask"],value:["onValueChanged"]}}};l.style=":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";export{l as ez_time_input}
1
+ import{r as s,h as t,H as i,g as e}from"./p-89a57641.js";import{M as h,T as r,N as a}from"./p-c6762896.js";import{C as o}from"./p-d54c157f.js";import{g as n}from"./p-477bb703.js";let l=class{constructor(t){s(this,t),this.enabled=!0,this.showSeconds=!1}prepareMask(){this.showSeconds?null==this._maskFormatter?this._maskFormatter=new h("##:##:##"):this._maskFormatter.mask="##:##:##":null==this._maskFormatter?this._maskFormatter=new h("##:##"):this._maskFormatter.mask="##:##"}onValueChanged(){NaN===this.value&&(this.value=void 0,this.handleFocusout())}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){this.errorMessage="",this.prepareValue(this.viewValue),r.validateTime(this.viewValue,this.showSeconds)||(this.clearField(),this.errorMessage="Favor inserir um horário válido.")}prepareValue(s){try{this.viewValue=r.prepareValue(s,this.showSeconds)}catch(s){this.clearField(),this.errorMessage=s.message}}clearField(){this.viewValue=this.value=void 0}handleChange(){this.viewValue=this._inputElem.value,this.value=a.stringToNumber(this.viewValue.replace(/\D/g,""))}componentDidLoad(){this.onValueChanged(),o.applyVarsTextInput(this._elem,this._inputElem)}componentWillLoad(){this.prepareMask(),this.value?this.prepareValue(this.value.toString()):this.viewValue&&this.prepareValue(this.viewValue)}render(){return t(i,null,t("ez-text-input",{ref:s=>this._inputElem=s,value:this.viewValue,enabled:this.enabled,label:this.label,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()},errorMessage:this.errorMessage},t("ez-icon",{slot:"leftIcon",href:n("timer-outline")})))}static get assetsDirs(){return["../assets"]}get _elem(){return e(this)}static get watchers(){return{showSeconds:["prepareMask"],value:["onValueChanged"]}}};l.style=":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";export{l as ez_time_input}
@@ -47,6 +47,14 @@ export declare class EzComboBox {
47
47
  * Evento que é disparado ao alterar o valor do componente
48
48
  */
49
49
  ezChange: EventEmitter<Option>;
50
+ /**
51
+ * Remove a opção vazia da lista de opções
52
+ */
53
+ suppressEmptyOption: boolean;
54
+ /**
55
+ * Permite exibir a mensagem de erro.
56
+ */
57
+ canShowError: boolean;
50
58
  private internalUpdate;
51
59
  private getText;
52
60
  private getSelectedOption;
@@ -22,10 +22,15 @@ export interface FieldConfig {
22
22
  name: string;
23
23
  label?: string;
24
24
  group?: string;
25
- tab?: string;
25
+ tab?: string | TabConfig;
26
26
  defaultValue?: any;
27
27
  visible?: boolean;
28
28
  readOnly?: boolean;
29
29
  required?: boolean;
30
30
  cleanOnCopy?: boolean;
31
31
  }
32
+ export interface TabConfig {
33
+ label: string;
34
+ visible?: boolean;
35
+ order?: number;
36
+ }
@@ -1,4 +1,5 @@
1
- export declare const buildComboBox: ({ name, label }: {
1
+ export declare const buildComboBox: ({ name, label, readOnly }: {
2
2
  name: any;
3
3
  label: any;
4
+ readOnly: any;
4
5
  }, properties: any) => HTMLElement;
@@ -1,6 +1,7 @@
1
- export declare const buildDate: ({ name, label }: {
1
+ export declare const buildDate: ({ name, label, readOnly }: {
2
2
  name: any;
3
3
  label: any;
4
+ readOnly: any;
4
5
  }) => HTMLElement;
5
6
  export declare const buildTimeDate: ({ name, label }: {
6
7
  name: any;
@@ -1,4 +1,5 @@
1
- export declare const buildFile: ({ name, label }: {
1
+ export declare const buildFile: ({ name, label, readOnly }: {
2
2
  name: any;
3
3
  label: any;
4
+ readOnly: any;
4
5
  }) => HTMLElement;
@@ -1,8 +1,10 @@
1
- export declare const buildDecimal: ({ name, label }: {
1
+ export declare const buildDecimal: ({ name, label, readOnly }: {
2
2
  name: any;
3
3
  label: any;
4
+ readOnly: any;
4
5
  }, properties: any) => HTMLElement;
5
- export declare const buildInteger: ({ name, label }: {
6
+ export declare const buildInteger: ({ name, label, readOnly }: {
6
7
  name: any;
7
8
  label: any;
9
+ readOnly: any;
8
10
  }) => HTMLElement;
@@ -1,4 +1,5 @@
1
- export declare const buildSearch: ({ name, label }: {
1
+ export declare const buildSearch: ({ name, label, readOnly }: {
2
2
  name: any;
3
3
  label: any;
4
+ readOnly: any;
4
5
  }) => HTMLElement;
@@ -1,4 +1,5 @@
1
- export declare const buildTextArea: ({ name, label }: {
1
+ export declare const buildTextArea: ({ name, label, readOnly }: {
2
2
  name: any;
3
3
  label: any;
4
+ readOnly: any;
4
5
  }) => HTMLElement;
@@ -1,5 +1,7 @@
1
1
  import EzGridController, { EzGridColumn, EzGridColumnMenuItemDef, EzGridOptions } from "../EzGridController";
2
- export default class AgGridController implements EzGridController {
2
+ import { Sort } from "@sankhyalabs/core";
3
+ import { SortingProvider } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
4
+ export default class AgGridController implements EzGridController, SortingProvider {
3
5
  private _grid;
4
6
  private _gridOptions;
5
7
  private _columnStateChangeCallback;
@@ -13,6 +15,7 @@ export default class AgGridController implements EzGridController {
13
15
  private _serverURL;
14
16
  private _dataUnit;
15
17
  constructor(enterprise: boolean);
18
+ getSort(): Array<Sort>;
16
19
  initDatagrid(container: HTMLElement, options: EzGridOptions): void;
17
20
  private setOptionsEvents;
18
21
  private setOptionsPagination;
@@ -1,9 +1,11 @@
1
1
  import { EventEmitter } from '../../../../stencil-public-runtime';
2
2
  export declare class SelectBox {
3
- private _selectElem;
4
3
  ezChange: EventEmitter<string>;
5
- selectedOption: string;
6
- changeSelection(): void;
7
- componentDidRender(): void;
4
+ selectedOption: Option | string;
8
5
  render(): any;
9
6
  }
7
+ interface Option {
8
+ value: string;
9
+ label: string;
10
+ }
11
+ export {};
@@ -22,6 +22,7 @@ export declare class EzList {
22
22
  private _element;
23
23
  private _itemContainer;
24
24
  private _draggingElement;
25
+ private _changeDeboucingTimeout;
25
26
  /**
26
27
  * Define a lista inicial do componente.
27
28
  */
@@ -40,7 +41,7 @@ export declare class EzList {
40
41
  ezSelectable: boolean;
41
42
  /**
42
43
  * Define se é possível selecionar mais de um registro.
43
- */
44
+
44
45
  /**
45
46
  * Função responsável por renderizar um conteúdo dentro do item da lista.
46
47
  */
@@ -67,21 +68,25 @@ export declare class EzList {
67
68
  componentWillLoad(): void;
68
69
  componentWillRender(): void;
69
70
  onDrop(ev: any, dragEndItem: ListItemGroup): void;
71
+ onDropLastIndex(ev: any, groupDropped?: any): void;
70
72
  onDropGroup(groupSelected: any): void;
71
73
  onDragEnd(): void;
72
- addOverClass(ev: any): void;
74
+ addOverClass(element: any): void;
73
75
  addOverGroupClass(ev: any, group: ListGroup): void;
74
- removeOverClass(ev: any): void;
76
+ removeOverClass(): void;
75
77
  removeOverGroupClass(ev: any, group: any): void;
76
- onDragStart(event: any, item: any, group?: any, index?: any): void;
77
- onDrag(event: any): void;
78
+ onDragStart(item: any, group?: any, index?: any): void;
78
79
  selectFirstItem(): void;
79
80
  nextOption(selectedItem: ListItem): void;
80
81
  previousOption(selectedItem: ListItem): void;
81
82
  private keyDownHandler;
82
83
  getItemId(itemLabel: String): string;
83
84
  getDivGroupId(groupName: String): string;
85
+ getGroupOverlayId(groupName: string): string;
84
86
  onDragOverGroup(event: DragEvent, group: ListGroup): void;
85
- onDragOverItem(event: DragEvent, group?: ListGroup): void;
87
+ onDragOverItem(event: DragEvent): void;
88
+ onDragOverLastIndex(ev: any): void;
89
+ showOverlays(groupDragStart: any): void;
90
+ hideOverlays(): void;
86
91
  render(): any;
87
92
  }
@@ -34,6 +34,10 @@ export declare class EzTextInput {
34
34
  * Aplica uma máscara no conteúdo conforme o padrão estabelecido
35
35
  */
36
36
  mask: string;
37
+ /**
38
+ * Permite exibir a mensagem de erro.
39
+ */
40
+ canShowError: boolean;
37
41
  /**
38
42
  * Restringe o que o usuário pode digitar. Cada caractere digitado será testado
39
43
  * e deve estar contido nessa string ou será descartado.
@@ -132,6 +132,10 @@ export namespace Components {
132
132
  "value": boolean;
133
133
  }
134
134
  interface EzComboBox {
135
+ /**
136
+ * Permite exibir a mensagem de erro.
137
+ */
138
+ "canShowError": boolean;
135
139
  /**
136
140
  * Deixa o campo disponível ou não para interação com usuário.
137
141
  */
@@ -161,6 +165,10 @@ export namespace Components {
161
165
  * Ajusta a opção de mostrar o "value" ao selecionar uma opção. Por padrão não mostra.
162
166
  */
163
167
  "showSelectedValue": boolean;
168
+ /**
169
+ * Remove a opção vazia da lista de opções
170
+ */
171
+ "suppressEmptyOption": boolean;
164
172
  /**
165
173
  * Valor selecionado no campo
166
174
  */
@@ -352,7 +360,7 @@ export namespace Components {
352
360
  */
353
361
  "getSelection": () => Promise<any>;
354
362
  /**
355
- * Função responsável por renderizar um conteúdo dentro do item da lista.
363
+ * Define se é possível selecionar mais de um registro. /** Função responsável por renderizar um conteúdo dentro do item da lista.
356
364
  */
357
365
  "itemSlotBuilder": (item: any, group?: any) => HTMLElement;
358
366
  /**
@@ -551,6 +559,10 @@ export namespace Components {
551
559
  "value": string;
552
560
  }
553
561
  interface EzTextInput {
562
+ /**
563
+ * Permite exibir a mensagem de erro.
564
+ */
565
+ "canShowError": boolean;
554
566
  /**
555
567
  * Deixa o campo disponível ou não para digitação.
556
568
  */
@@ -683,7 +695,7 @@ export namespace Components {
683
695
  "selectedTab": string;
684
696
  }
685
697
  interface SelectBox {
686
- "selectedOption": string;
698
+ "selectedOption": Option|string;
687
699
  }
688
700
  interface TestDu {
689
701
  }
@@ -1009,6 +1021,10 @@ declare namespace LocalJSX {
1009
1021
  "value"?: boolean;
1010
1022
  }
1011
1023
  interface EzComboBox {
1024
+ /**
1025
+ * Permite exibir a mensagem de erro.
1026
+ */
1027
+ "canShowError"?: boolean;
1012
1028
  /**
1013
1029
  * Deixa o campo disponível ou não para interação com usuário.
1014
1030
  */
@@ -1042,6 +1058,10 @@ declare namespace LocalJSX {
1042
1058
  * Ajusta a opção de mostrar o "value" ao selecionar uma opção. Por padrão não mostra.
1043
1059
  */
1044
1060
  "showSelectedValue"?: boolean;
1061
+ /**
1062
+ * Remove a opção vazia da lista de opções
1063
+ */
1064
+ "suppressEmptyOption"?: boolean;
1045
1065
  /**
1046
1066
  * Valor selecionado no campo
1047
1067
  */
@@ -1214,7 +1234,7 @@ declare namespace LocalJSX {
1214
1234
  */
1215
1235
  "ezSelectable"?: boolean;
1216
1236
  /**
1217
- * Função responsável por renderizar um conteúdo dentro do item da lista.
1237
+ * Define se é possível selecionar mais de um registro. /** Função responsável por renderizar um conteúdo dentro do item da lista.
1218
1238
  */
1219
1239
  "itemSlotBuilder"?: (item: any, group?: any) => HTMLElement;
1220
1240
  /**
@@ -1425,6 +1445,10 @@ declare namespace LocalJSX {
1425
1445
  "value"?: string;
1426
1446
  }
1427
1447
  interface EzTextInput {
1448
+ /**
1449
+ * Permite exibir a mensagem de erro.
1450
+ */
1451
+ "canShowError"?: boolean;
1428
1452
  /**
1429
1453
  * Deixa o campo disponível ou não para digitação.
1430
1454
  */
@@ -1544,7 +1568,7 @@ declare namespace LocalJSX {
1544
1568
  }
1545
1569
  interface SelectBox {
1546
1570
  "onEzChange"?: (event: CustomEvent<string>) => void;
1547
- "selectedOption"?: string;
1571
+ "selectedOption"?: Option|string;
1548
1572
  }
1549
1573
  interface TestDu {
1550
1574
  }
@@ -0,0 +1,2 @@
1
+ export { default as ApplicationUtils } from './ApplicationUtils';
2
+ export { default as CSSVarsUtils } from './CSSVarsUtils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "1.1.92",
3
+ "version": "1.1.95",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- class ApplicationUtils {
4
- static async showDialog(title, message, icon = null, confirm, critical = false) {
5
- return new Promise(resolve => {
6
- let dialog = document.querySelector("ez-dialog");
7
- if (!dialog) {
8
- dialog = document.createElement("ez-dialog");
9
- window.document.body.appendChild(dialog);
10
- }
11
- dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
12
- });
13
- }
14
- static async alert(title, message, icon = null) {
15
- return ApplicationUtils.showDialog(title, message, icon, false, false);
16
- }
17
- static async error(title, message, icon = null) {
18
- return ApplicationUtils.showDialog(title, message, icon, false, true);
19
- }
20
- static async confirm(title, message, icon = null, critical = false) {
21
- return ApplicationUtils.showDialog(title, message, icon, true, critical);
22
- }
23
- static async info(message) {
24
- let toast = document.querySelector("ez-toast");
25
- if (!toast) {
26
- toast = document.createElement("ez-toast");
27
- window.document.body.appendChild(toast);
28
- }
29
- toast.message = message;
30
- toast.fadeTime = 4000;
31
- toast.show();
32
- }
33
- }
34
-
35
- exports.ApplicationUtils = ApplicationUtils;
@@ -1,224 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-88286449.js');
6
- require('./index-a92e6d04.js');
7
- const FloatingManager = require('./FloatingManager-6cfeb947.js');
8
-
9
- const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__Time--background-color:var(--background--xlight, #FAFAFA);--ez-calendar__body--padding:var(--space--medium, 12px) var(--space--small, 6px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:1px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--ez-calendar__nav-btn--next-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>');--ez-calendar__cell--margin:0px 1.5px;--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:1.5px 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--primary, #E2F4EF);--ez-calendar__cell--over--color:var(--color--primary-300, #008561);--ez-calendar__cell--outset--color:var(--color--disable-primary, #E5EAF0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--primary-300, #E2F4EF);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--small, 6px);margin:0px var(--space--, 12px) var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--extra-large, 700);font-size:var(--title--small, 14px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--extra-small, 10px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color);color:var(--ez-calendar__cell--over--color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--extra-small, 12px);padding:0px;font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}section{display:flex}.calendarTime{margin-left:-10px;display:flex;flex-direction:column;padding:12px 0px 0px 10px;background-color:var(--ez-calendar__Time--background-color);border-top-right-radius:var(--ez-calendar__body--border-radius);border-bottom-right-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__column{height:136px;padding:0px;margin:0px;overflow:auto}.calendar__column::-webkit-scrollbar{width:0px;max-width:0px;min-width:0px}.calendarTime__header{padding-left:var(--space--small, 6px);padding-right:var(--space--small, 6px);display:flex;justify-content:space-between;padding-bottom:var(--space--small, 6px);margin:0px var(--space--, 12px) var(--space--small, 6px) var(--space--, 12px);font-weight:var(--text-weight--extra-large, 700);font-size:var(--title--small, 14px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.separatorTime{color:#A2ABB9;padding:0px 1px;line-height:16px;font-size:17px;font-weight:normal}.endHidden{-webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 48px), transparent 100%)}.calendar__column .calendar__cell{margin:0px;padding:1.5px 1.5px}";
10
-
11
- let EzCalendar = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.ezChange = index.createEvent(this, "ezChange", 7);
15
- this._firstRender = true;
16
- this._todayLabel = "Hoje";
17
- this._weekDayLabels = ["D", "S", "T", "Q", "Q", "S", "S"];
18
- this._monthLabels = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
19
- this._hoursLabel = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"];
20
- this._minutosLabel = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"];
21
- /**
22
- * A data selecionada no calendário
23
- */
24
- this.value = new Date();
25
- /**
26
- * No modo floating o calendário só se tornará visível
27
- * quando o método show() for acionado.
28
- */
29
- this.floating = false;
30
- /**
31
- * Exibe ou não as horas e minutos no calendario
32
- */
33
- this.time = false;
34
- /**
35
- * Exibe ou não os segundos no calendario
36
- */
37
- this.showSeconds = false;
38
- }
39
- /**
40
- * Usado no modo floating. Faz com que o componente seja exibido.
41
- * É possível determinar ajustes de posicionamento através dos parâmetros
42
- * top, left, bottom e right. Esses parâmetros devem ser informados como
43
- * strings no formato css.
44
- */
45
- async show(top, left, bottom, right) {
46
- if (this.floating) {
47
- this._floatingID = FloatingManager.FloatingManager.float(this._box, this._container, { autoClose: true, top, left, bottom, right });
48
- window.requestAnimationFrame(() => {
49
- this._box.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
50
- });
51
- this.scroll();
52
- }
53
- }
54
- /**
55
- * Método necessário para ajustar o posicionamento do calendar acima ou abaixo do ez-date-input conforme a disponibilidade de espaço.
56
- */
57
- async fitVertical(topOffset, bottomOffset) {
58
- const neededHeight = this._container.getBoundingClientRect().bottom + this._calendarHeight;
59
- const availableBottom = (window.innerHeight || document.documentElement.clientHeight) > neededHeight;
60
- if (availableBottom) {
61
- this.show(topOffset + "px", undefined, "unset");
62
- }
63
- else {
64
- this.show("unset", undefined, bottomOffset + "px");
65
- }
66
- }
67
- /**
68
- * Usado no modo floating. Faz com que o componente seja ocultado.
69
- */
70
- async hide() {
71
- if (this._floatingID !== undefined) {
72
- FloatingManager.FloatingManager.close(this._floatingID);
73
- this._floatingID = undefined;
74
- }
75
- }
76
- valueChanged() {
77
- if (this.value) {
78
- this._currentPosition.setTime(this.value.getTime());
79
- this._currentPosition.setDate(1);
80
- }
81
- }
82
- getMonthLabel() {
83
- return this._monthLabels[this._currentPosition.getMonth()] + " " + this._currentPosition.getFullYear();
84
- }
85
- isSelectedDate(d) {
86
- if (this.value) {
87
- return this.value.getDate() == d.getDate() && this.value.getMonth() == d.getMonth() && this.value.getFullYear() == d.getFullYear();
88
- }
89
- return false;
90
- }
91
- changeMonth(offset) {
92
- this._currentPosition.setMonth(this._currentPosition.getMonth() + offset);
93
- index.forceUpdate(this);
94
- }
95
- selectDate(d) {
96
- let newDate = d;
97
- if (this.value && (this.time || this.showSeconds)) {
98
- newDate.setHours(this.value.getHours());
99
- newDate.setMinutes(this.value.getMinutes());
100
- if (this.showSeconds) {
101
- newDate.setSeconds(this.value.getSeconds());
102
- }
103
- else {
104
- newDate.setSeconds(0);
105
- }
106
- }
107
- this.value = newDate;
108
- this.ezChange.emit();
109
- }
110
- selectHours(hour) {
111
- if (!this.value) {
112
- this.value = new Date();
113
- }
114
- this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), hour, this.value.getMinutes(), this.value.getSeconds());
115
- this.ezChange.emit();
116
- }
117
- selectMinutes(minute) {
118
- if (!this.value) {
119
- this.value = new Date();
120
- }
121
- this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), minute, this.value.getSeconds());
122
- this.ezChange.emit();
123
- }
124
- selectSeconds(second) {
125
- if (!this.value) {
126
- this.value = new Date();
127
- }
128
- this.value = new Date(this.value.getFullYear(), this.value.getMonth(), this.value.getDate(), this.value.getHours(), this.value.getMinutes(), second);
129
- this.ezChange.emit();
130
- }
131
- updateScroll(element) {
132
- if (element) {
133
- const { scrollHeight, clientHeight, scrollTop } = element;
134
- const remainingScroll = scrollHeight - clientHeight - Math.ceil(scrollTop);
135
- if (remainingScroll > 0) {
136
- element.classList.add("endHidden");
137
- }
138
- else {
139
- element.classList.remove("endHidden");
140
- }
141
- }
142
- }
143
- componentDidRender() {
144
- if (this.floating && this._firstRender) {
145
- this._calendarHeight = this._box.clientHeight;
146
- this._box.remove();
147
- this._firstRender = false;
148
- }
149
- this.updateScroll(this._hoursScroll);
150
- this.updateScroll(this._minutesScroll);
151
- this.updateScroll(this._secondsScroll);
152
- }
153
- componentDidLoad() {
154
- this.scroll();
155
- }
156
- scroll() {
157
- if (this.time || this.showSeconds) {
158
- this._hoursScroll.scrollTop = this._hoursSelect.offsetTop - 64;
159
- this._minutesScroll.scrollTop = this._minutesSelect.offsetTop - 64;
160
- this.updateScroll(this._hoursScroll);
161
- this.updateScroll(this._minutesScroll);
162
- if (this.showSeconds) {
163
- this._secondsScroll.scrollTop = this._secondsSelect.offsetTop - 64;
164
- this.updateScroll(this._secondsScroll);
165
- }
166
- }
167
- }
168
- render() {
169
- if (this._currentPosition == null) {
170
- this._currentPosition = new Date();
171
- if (this.value) {
172
- this._currentPosition.setTime(this.value.getTime());
173
- }
174
- this._currentPosition.setDate(1);
175
- }
176
- const firstDate = new Date();
177
- firstDate.setTime(this._currentPosition.getTime());
178
- firstDate.setDate(1 - firstDate.getDay());
179
- return (index.h("section", { ref: elem => this._container = elem }, index.h("div", { ref: elem => this._box = elem, style: { display: 'flex' } }, index.h("div", { class: "calendar" }, index.h("div", { class: "calendar__header" }, index.h("button", { class: "calendar__btn-previous", onClick: () => this.changeMonth(-1) }), index.h("label", { class: "calendar__lbl-month" }, this.getMonthLabel()), index.h("button", { class: "calendar__btn-next", onClick: () => this.changeMonth(1) })), index.h("div", { class: "calendar__body" }, index.h("div", { class: "calendar__line" }, this._weekDayLabels.map(day => index.h("div", { class: "calendar__cell calendar__cell--unselectable" }, day))), [0, 7, 14, 21, 28, 35].map(offset => index.h("div", { class: "calendar__line" }, [0, 1, 2, 3, 4, 5, 6].map(index$1 => {
180
- const date = new Date();
181
- date.setTime(firstDate.getTime());
182
- date.setDate(date.getDate() + offset + index$1);
183
- let classNames = "calendar__cell";
184
- if (this._currentPosition.getMonth() != date.getMonth()) {
185
- classNames += " calendar__cell--secondary";
186
- }
187
- else if (this.isSelectedDate(date)) {
188
- classNames += " calendar__cell--selected";
189
- }
190
- return index.h("div", { class: classNames, onClick: () => this.selectDate(date) }, date.getDate());
191
- })))), index.h("div", { class: "calendar__footer" }, index.h("button", { class: "calendar__btn-today", onClick: () => this.selectDate(new Date()) }, this._todayLabel))), (this.time || this.showSeconds) &&
192
- index.h("div", { class: "calendarTime" }, index.h("div", { class: "calendarTime__header" }, index.h("div", null, "H"), index.h("div", { class: "separatorTime" }, ":"), index.h("div", null, "M"), this.showSeconds &&
193
- index.h("div", { class: "separatorTime" }, ":"), this.showSeconds &&
194
- index.h("div", null, "S")), index.h("div", { class: "calendar__body ", style: { display: 'flex', paddingLeft: '12px', paddingRight: '12px' } }, index.h("div", { class: "calendar__column", ref: elem => this._hoursScroll = elem, onScroll: () => this.updateScroll(this._hoursScroll) }, this._hoursLabel.map((offset, index$1) => {
195
- if (index$1 === this.value.getHours()) {
196
- return (index.h("div", { style: { display: 'flex' }, ref: elem => this._hoursSelect = elem }, index.h("div", { class: "calendar__cell calendar__cell--selected", onClick: () => this.selectHours(index$1) }, offset), index.h("div", { class: "separatorTime" }, ":")));
197
- }
198
- else {
199
- return (index.h("div", { style: { display: 'flex' } }, index.h("div", { class: "calendar__cell", onClick: () => this.selectHours(index$1) }, offset), index.h("div", { class: "separatorTime" }, ":")));
200
- }
201
- })), index.h("div", { class: "calendar__column", ref: elem => this._minutesScroll = elem, onScroll: () => this.updateScroll(this._minutesScroll) }, this._minutosLabel.map((offset, index$1) => {
202
- if (index$1 === this.value.getMinutes()) {
203
- return (index.h("div", { style: { display: 'flex' }, ref: elem => this._minutesSelect = elem }, index.h("div", { class: "calendar__cell calendar__cell--selected", onClick: () => this.selectMinutes(index$1) }, offset), this.showSeconds && index.h("div", { class: "separatorTime" }, ":")));
204
- }
205
- else {
206
- return (index.h("div", { style: { display: 'flex' } }, index.h("div", { class: "calendar__cell", onClick: () => this.selectMinutes(index$1) }, offset), this.showSeconds && index.h("div", { class: "separatorTime" }, ":")));
207
- }
208
- })), this.showSeconds &&
209
- index.h("div", { class: "calendar__column", ref: elem => this._secondsScroll = elem, onScroll: () => this.updateScroll(this._secondsScroll) }, this._minutosLabel.map((offset, index$1) => {
210
- if (index$1 === this.value.getSeconds()) {
211
- return (index.h("div", { class: "calendar__cell calendar__cell--selected", onClick: () => this.selectSeconds(index$1), ref: elem => this._secondsSelect = elem }, offset));
212
- }
213
- else {
214
- return (index.h("div", { class: "calendar__cell", onClick: () => this.selectSeconds(index$1) }, offset));
215
- }
216
- })))))));
217
- }
218
- static get watchers() { return {
219
- "value": ["valueChanged"]
220
- }; }
221
- };
222
- EzCalendar.style = ezCalendarCss;
223
-
224
- exports.ez_calendar = EzCalendar;