@sankhyalabs/ezui 1.1.4 → 1.1.5

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 (186) hide show
  1. package/README.md +72 -72
  2. package/dist/{ezui/DataUnit-285bec19.js → cjs/DataUnit-6a98d9de.js} +379 -369
  3. package/dist/{ezui/index-919090de.js → cjs/RequestMetadata-2cd01e8a.js} +4 -383
  4. package/dist/cjs/ez-action-chip.cjs.entry.js +52 -0
  5. package/dist/cjs/ez-button_14.cjs.entry.js +3338 -0
  6. package/dist/cjs/ez-label-chip.cjs.entry.js +131 -0
  7. package/dist/cjs/ez-modal.cjs.entry.js +115 -0
  8. package/dist/cjs/ez-number-input.cjs.entry.js +248 -0
  9. package/dist/cjs/ez-time-input.cjs.entry.js +180 -0
  10. package/dist/cjs/ezui.cjs.js +19 -0
  11. package/dist/cjs/form-metadata.cjs.entry.js +74 -0
  12. package/dist/cjs/index-9403fe8f.js +1322 -0
  13. package/dist/cjs/index.cjs.js +2 -0
  14. package/dist/cjs/loader.cjs.js +21 -0
  15. package/dist/collection/collection-manifest.json +31 -0
  16. package/dist/collection/components/ez-action-chip/ez-action-chip.css +82 -0
  17. package/dist/collection/components/ez-action-chip/ez-action-chip.js +109 -0
  18. package/dist/collection/components/ez-button/ez-button.css +94 -0
  19. package/dist/collection/components/ez-button/ez-button.js +125 -0
  20. package/dist/collection/components/ez-calendar/ez-calendar.css +210 -0
  21. package/dist/collection/components/ez-calendar/ez-calendar.js +215 -0
  22. package/dist/collection/components/ez-check/ez-check.css +266 -0
  23. package/dist/collection/components/ez-check/ez-check.js +168 -0
  24. package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +68 -0
  25. package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +108 -0
  26. package/dist/collection/components/ez-combo-box/ez-combo-box-interfaces.js +2 -0
  27. package/dist/collection/components/ez-combo-box/ez-combo-box.css +167 -0
  28. package/dist/collection/components/ez-combo-box/ez-combo-box.js +363 -0
  29. package/dist/collection/components/ez-date-input/ez-date-input.css +39 -0
  30. package/dist/collection/components/ez-date-input/ez-date-input.js +172 -0
  31. package/dist/collection/components/ez-form/ez-form.css +19 -0
  32. package/dist/collection/components/ez-form/ez-form.js +365 -0
  33. package/dist/collection/components/ez-form/store/Form.actions.js +132 -0
  34. package/dist/collection/components/ez-form/store/Form.reducer.js +194 -0
  35. package/dist/collection/components/ez-form/store/Form.selectors.js +44 -0
  36. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +204 -0
  37. package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +16 -0
  38. package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +24 -0
  39. package/dist/collection/components/ez-form/subcomponents/form-metadata.js +173 -0
  40. package/dist/collection/components/ez-form/subcomponents/place-holder.js +14 -0
  41. package/dist/collection/components/ez-form/subcomponents/structure/Field.js +71 -0
  42. package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +27 -0
  43. package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +40 -0
  44. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +27 -0
  45. package/dist/collection/components/ez-icon/ez-icon.css +37 -0
  46. package/dist/collection/components/ez-icon/ez-icon.js +56 -0
  47. package/dist/collection/components/ez-label-chip/ez-label-chip.css +117 -0
  48. package/dist/collection/components/ez-label-chip/ez-label-chip.js +276 -0
  49. package/dist/collection/components/ez-modal/ez-modal.css +87 -0
  50. package/dist/collection/components/ez-modal/ez-modal.js +224 -0
  51. package/dist/collection/components/ez-number-input/ez-number-input.css +144 -0
  52. package/dist/collection/components/ez-number-input/ez-number-input.js +465 -0
  53. package/dist/collection/components/ez-popover/ez-popover.css +39 -0
  54. package/dist/collection/components/ez-popover/ez-popover.js +323 -0
  55. package/dist/collection/components/ez-search/ez-search.css +296 -0
  56. package/dist/{ezui/ez-search.entry.js → collection/components/ez-search/ez-search.js} +527 -334
  57. package/dist/collection/components/ez-tabselector/ez-tabselector.css +126 -0
  58. package/dist/{ezui/ez-tabselector.entry.js → collection/components/ez-tabselector/ez-tabselector.js} +283 -209
  59. package/dist/collection/components/ez-text-area/ez-text-area.css +140 -0
  60. package/dist/collection/components/ez-text-area/ez-text-area.js +267 -0
  61. package/dist/collection/components/ez-text-input/ez-text-input.css +170 -0
  62. package/dist/collection/components/ez-text-input/ez-text-input.js +395 -0
  63. package/dist/collection/components/ez-time-input/ez-time-input.css +155 -0
  64. package/dist/collection/components/ez-time-input/ez-time-input.js +326 -0
  65. package/dist/collection/index.js +1 -0
  66. package/dist/collection/servidor.js +101 -0
  67. package/dist/collection/utils/FloatingManager.js +16 -0
  68. package/dist/collection/utils/utils.js +6 -0
  69. package/dist/custom-elements/index.js +5065 -0
  70. package/dist/esm/DataUnit-ac4cc054.js +375 -0
  71. package/dist/esm/RequestMetadata-c265c9d5.js +527 -0
  72. package/dist/{ezui → esm}/ez-action-chip.entry.js +42 -42
  73. package/dist/esm/ez-button_14.entry.js +3321 -0
  74. package/dist/{ezui → esm}/ez-label-chip.entry.js +121 -121
  75. package/dist/{ezui → esm}/ez-modal.entry.js +105 -96
  76. package/dist/{ezui → esm}/ez-number-input.entry.js +238 -238
  77. package/dist/{ezui → esm}/ez-time-input.entry.js +170 -170
  78. package/dist/esm/ezui.js +17 -0
  79. package/dist/{ezui → esm}/form-metadata.entry.js +66 -66
  80. package/dist/esm/index-95bb3fd9.js +1293 -0
  81. package/dist/esm/index.js +1 -0
  82. package/dist/esm/loader.js +17 -0
  83. package/dist/esm/polyfills/core-js.js +11 -0
  84. package/dist/esm/polyfills/css-shim.js +1 -0
  85. package/dist/esm/polyfills/dom.js +79 -0
  86. package/dist/esm/polyfills/es5-html-element.js +1 -0
  87. package/dist/esm/polyfills/index.js +34 -0
  88. package/dist/esm/polyfills/system.js +6 -0
  89. package/dist/ezui/ezui.esm.js +1 -122
  90. package/dist/ezui/index.esm.js +0 -1
  91. package/dist/ezui/p-185c57f4.js +1 -0
  92. package/dist/ezui/p-22b82efb.entry.js +1 -0
  93. package/dist/ezui/p-346050cf.entry.js +1 -0
  94. package/dist/ezui/p-593c03ba.js +1 -0
  95. package/dist/ezui/p-77fdb4fd.entry.js +1 -0
  96. package/dist/ezui/p-9dfccb16.js +1 -0
  97. package/dist/ezui/p-dd4331b7.entry.js +1 -0
  98. package/dist/ezui/p-f6fd31ab.entry.js +1 -0
  99. package/dist/ezui/p-f95e3c71.entry.js +1 -0
  100. package/dist/ezui/p-fa260f22.entry.js +1 -0
  101. package/dist/index.cjs.js +1 -0
  102. package/dist/index.js +1 -0
  103. package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +16 -16
  104. package/dist/types/components/ez-button/ez-button.d.ts +20 -20
  105. package/dist/types/components/ez-calendar/ez-calendar.d.ts +42 -42
  106. package/dist/types/components/ez-check/ez-check.d.ts +32 -32
  107. package/dist/types/components/ez-collapsable-box/ez-collapsable-box.d.ts +18 -18
  108. package/dist/types/components/ez-combo-box/ez-combo-box-interfaces.d.ts +4 -4
  109. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +68 -68
  110. package/dist/types/components/ez-date-input/ez-date-input.d.ts +31 -31
  111. package/dist/types/components/ez-form/ez-form.d.ts +31 -27
  112. package/dist/types/components/ez-form/store/Form.actions.d.ts +111 -104
  113. package/dist/types/components/ez-form/store/Form.reducer.d.ts +20 -11
  114. package/dist/types/components/ez-form/store/Form.selectors.d.ts +14 -13
  115. package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +55 -48
  116. package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +41 -41
  117. package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +15 -15
  118. package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +3 -3
  119. package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +10 -10
  120. package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +12 -12
  121. package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +13 -13
  122. package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +17 -7
  123. package/dist/types/components/ez-icon/ez-icon.d.ts +5 -5
  124. package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +40 -40
  125. package/dist/types/components/ez-modal/ez-modal.d.ts +32 -26
  126. package/dist/types/components/ez-number-input/ez-number-input.d.ts +73 -73
  127. package/dist/types/components/ez-popover/ez-popover.d.ts +52 -52
  128. package/dist/types/components/ez-search/ez-search.d.ts +95 -95
  129. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +31 -31
  130. package/dist/types/components/ez-text-area/ez-text-area.d.ts +49 -49
  131. package/dist/types/components/ez-text-input/ez-text-input.d.ts +64 -64
  132. package/dist/types/components/ez-time-input/ez-time-input.d.ts +53 -53
  133. package/dist/types/components.d.ts +8 -0
  134. package/dist/types/index.d.ts +1 -1
  135. package/dist/types/utils/utils.d.ts +2 -2
  136. package/loader/cdn.js +3 -0
  137. package/loader/index.cjs.js +3 -0
  138. package/loader/index.d.ts +13 -0
  139. package/loader/index.es2017.js +3 -0
  140. package/loader/index.js +4 -0
  141. package/loader/package.json +10 -0
  142. package/package.json +114 -114
  143. package/react/components.d.ts +22 -0
  144. package/react/components.js +25 -0
  145. package/react/components.js.map +1 -0
  146. package/react/react-component-lib/createComponent.d.ts +10 -0
  147. package/react/react-component-lib/createComponent.js +59 -0
  148. package/react/react-component-lib/createComponent.js.map +1 -0
  149. package/react/react-component-lib/createOverlayComponent.d.ts +20 -0
  150. package/react/react-component-lib/createOverlayComponent.js +89 -0
  151. package/react/react-component-lib/createOverlayComponent.js.map +1 -0
  152. package/react/react-component-lib/index.d.ts +2 -0
  153. package/react/react-component-lib/index.js +3 -0
  154. package/react/react-component-lib/index.js.map +1 -0
  155. package/react/react-component-lib/interfaces.d.ts +29 -0
  156. package/react/react-component-lib/interfaces.js +1 -0
  157. package/react/react-component-lib/interfaces.js.map +1 -0
  158. package/react/react-component-lib/utils/attachProps.d.ts +12 -0
  159. package/react/react-component-lib/utils/attachProps.js +96 -0
  160. package/react/react-component-lib/utils/attachProps.js.map +1 -0
  161. package/react/react-component-lib/utils/case.d.ts +2 -0
  162. package/react/react-component-lib/utils/case.js +7 -0
  163. package/react/react-component-lib/utils/case.js.map +1 -0
  164. package/react/react-component-lib/utils/dev.d.ts +2 -0
  165. package/react/react-component-lib/utils/dev.js +13 -0
  166. package/react/react-component-lib/utils/dev.js.map +1 -0
  167. package/react/react-component-lib/utils/index.d.ts +7 -0
  168. package/react/react-component-lib/utils/index.js +21 -0
  169. package/react/react-component-lib/utils/index.js.map +1 -0
  170. package/dist/ezui/app-globals-0f993ce5.js +0 -3
  171. package/dist/ezui/css-shim-003e9264.js +0 -4
  172. package/dist/ezui/dom-1b195079.js +0 -73
  173. package/dist/ezui/ez-button.entry.js +0 -47
  174. package/dist/ezui/ez-calendar.entry.js +0 -102
  175. package/dist/ezui/ez-check.entry.js +0 -62
  176. package/dist/ezui/ez-collapsable-box.entry.js +0 -32
  177. package/dist/ezui/ez-combo-box.entry.js +0 -181
  178. package/dist/ezui/ez-date-input.entry.js +0 -77
  179. package/dist/ezui/ez-form.entry.js +0 -1907
  180. package/dist/ezui/ez-icon.entry.js +0 -17
  181. package/dist/ezui/ez-popover.entry.js +0 -112
  182. package/dist/ezui/ez-text-area.entry.js +0 -105
  183. package/dist/ezui/ez-text-input.entry.js +0 -202
  184. package/dist/ezui/index-39044be2.js +0 -2832
  185. package/dist/ezui/place-holder.entry.js +0 -15
  186. package/dist/ezui/shadow-css-c1ad5fdc.js +0 -383
@@ -0,0 +1,210 @@
1
+ :host {
2
+ --cal--font-family: var(--font-pattern, Arial);
3
+ --cal--color: var(--title--primary, #626e82);
4
+ --cal--text-shadow: var(--text-shadow, 0 0 0 #353535,0 0 1px transparent);
5
+
6
+ /* cal__body */
7
+ --cal__body--background-color: var(--background--xlight, #FFF);
8
+ --cal__body--padding: var(--space--medium, 12px);
9
+ --cal__body--border-radius: var(--border--radius-medium, 12px);
10
+ --cal__body--shadow: var(--shadow, 0px 0px 16px 0px #000);
11
+
12
+ /* cal__header */
13
+ --cal__header-line--stroke: 2px;
14
+ --cal__header-line--color: var(--color--strokes, #C0C0C0);
15
+
16
+ /* nav buttons */
17
+ --cal__nav-btn--fill: var(--text--primary, #008561);
18
+ --cal__nav-btn--over--fill: var(--color--primary, #350404);
19
+ --cal__nav-btn--width: 10px;
20
+ --cal__nav-btn--height: 16px;
21
+ --cal__nav-btn--previous-path: path("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");
22
+ --cal__nav-btn--next-path: path("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");
23
+
24
+ /* cell */
25
+ --cal__cell--margin: 0px var(--space--small, 12px);
26
+ --cal__cell--width: var(--space--large, 24px);
27
+ --cal__cell--padding: var(--space--extra-small, 3px) 0px;
28
+ --cal__cell--border-radius: var(--border--radius-small, 6px);
29
+ --cal__cell--over--background-color: var(--color--strokes, #C0C0C0);
30
+ --cal__cell--outset--color: var(--color--strokes, #C0C0C0);
31
+ --cal__cell--selected--background-color: var(--color--primary, #008561);
32
+ --cal__cell--selected--color: var(--color--inverted, #FFF);
33
+
34
+ /* btn today */
35
+ --cal__btn-today--color: var(--color--primary);
36
+ --cal__btn-today--hover--background-color: var(--color--strokes, #C0C0C0);
37
+ --cal__btn-today--border-radius: var(--border--radius-small, 6px);
38
+
39
+ /***************
40
+ host style
41
+ ***************/
42
+ /*private*/
43
+ position: relative;
44
+ display: flex;
45
+ user-select: none;
46
+ }
47
+
48
+ .calendar{
49
+ /*private*/
50
+ z-index: var(--more-visible, 2);
51
+ display: flex;
52
+ flex-direction: column;
53
+
54
+ /*public*/
55
+ background-color: var(--cal__body--background-color);
56
+ padding: var(--cal__body--padding);
57
+ border-radius: var(--cal__body--border-radius);
58
+ box-shadow: var(--cal__body--shadow);
59
+ }
60
+
61
+ .calendar__header{
62
+ /*private*/
63
+ display: flex;
64
+ justify-content: space-between;
65
+ padding-bottom: var(--space--medium, 12px);
66
+ margin: var(--space--small, 6px) var(--space--, 12px);
67
+
68
+ /*public*/
69
+ font-family: var(--cal--font-family);
70
+ color: var(--cal--color);
71
+ text-shadow: var(--cal--text-shadow);
72
+ border-bottom: solid var(--cal__header-line--stroke) var(--cal__header-line--color);
73
+ }
74
+
75
+ .calendar__btn-next, .calendar__btn-previous{
76
+ /*private*/
77
+ outline: none;
78
+ border: none;
79
+ background-color: unset;
80
+ cursor: pointer;
81
+ padding: 0px;
82
+ }
83
+
84
+ .calendar__btn-next::after, .calendar__btn-previous::after{
85
+ /*private*/
86
+ content: '';
87
+ display: flex;
88
+
89
+ /*public*/
90
+ background-color: var(--cal__nav-btn--fill);/*parece estranho, mas o bg funciona como fill pq aplicaremos clip-path.*/
91
+ width: var(--cal__nav-btn--width);
92
+ height: var(--cal__nav-btn--height);
93
+ }
94
+
95
+ .calendar__btn-previous::after{
96
+ /*public*/
97
+ clip-path: var(--cal__nav-btn--previous-path);
98
+ }
99
+
100
+ .calendar__btn-next::after{
101
+ /*public*/
102
+ clip-path: var(--cal__nav-btn--next-path);
103
+ }
104
+
105
+ .calendar__btn-next:hover::after, .calendar__btn-previous:hover::after{
106
+ /*public*/
107
+ background-color: var(--cal__nav-btn--over--fill);
108
+ }
109
+
110
+ .calendar__lbl-month{
111
+ /*private*/
112
+ font-weight: var(--text-weight--large, 600);
113
+ font-size: var(--title--medium, 16px);
114
+
115
+ /*public*/
116
+ font-family: var(--cal--font-family);
117
+ color: var(--cal--color);
118
+ text-shadow: var(--cal--text-shadow);
119
+ }
120
+
121
+ .calendar__line{
122
+ /*private*/
123
+ display: flex;
124
+ padding: 0px;
125
+ margin: 0px;
126
+ }
127
+
128
+ .calendar__cell{
129
+ /*private*/
130
+ display: flex;
131
+ justify-content: center;
132
+ align-content: center;
133
+ cursor: pointer;
134
+ font-size: var(--text--small, 12px);
135
+
136
+ /*public*/
137
+ font-family: var(--cal--font-family);
138
+ color: var(--cal--color);
139
+ text-shadow: var(--cal--text-shadow);
140
+ padding: var(--cal__cell--padding);
141
+ margin: var(--cal__cell--margin);
142
+ min-width: var(--cal__cell--width);
143
+ border-radius: var(--cal__cell--border-radius);
144
+ }
145
+
146
+
147
+ .calendar__cell:hover{
148
+ /*public*/
149
+ background-color: var(--cal__cell--over--background-color);
150
+ }
151
+
152
+ .calendar__cell--secondary{
153
+ /*public*/
154
+ color: var(--cal__cell--outset--color);
155
+ }
156
+
157
+ .calendar__cell--unselectable:hover{
158
+ /*private*/
159
+ background-color: unset;
160
+ border-radius: unset;
161
+ cursor: unset;
162
+ }
163
+
164
+ .calendar__cell--unselectable{
165
+ /*private*/
166
+ font-weight: var(--text-weight--large, 600);
167
+
168
+ /*public*/
169
+ font-family: var(--cal--font-family);
170
+ color: var(--cal--color);
171
+ text-shadow: var(--cal--text-shadow);
172
+ }
173
+
174
+ .calendar__cell--selected, .calendar__cell--selected:hover{
175
+ /*public*/
176
+ background-color: var(--cal__cell--selected--background-color);
177
+ color: var(--cal__cell--selected--color);
178
+ }
179
+
180
+ .calendar__body {
181
+ /*private*/
182
+ padding: var(--space--small, 6px) 0px;
183
+ }
184
+
185
+ .calendar__footer{
186
+ /*private*/
187
+ display: flex;
188
+ flex-direction: column;
189
+ }
190
+
191
+ .calendar__btn-today{
192
+ /*private*/
193
+ border: none;
194
+ background-color: unset;
195
+ cursor: pointer;
196
+ font-weight: var(--text-weight--large, 600);
197
+ font-size: var(--title--small);
198
+ padding: var(--space--extra-small, 6px);
199
+
200
+ /*public*/
201
+ font-family: var(--cal--font-family);
202
+ text-shadow: var(--cal--text-shadow);
203
+ color: var(--cal__btn-today--color);
204
+ border-radius: var(--cal__btn-today--border-radius);
205
+ }
206
+
207
+ .calendar__btn-today:hover{
208
+ /*public*/
209
+ background-color: var(--cal__btn-today--hover--background-color);
210
+ }
@@ -0,0 +1,215 @@
1
+ import { FloatingManager } from '@sankhyalabs/core';
2
+ import { Component, forceUpdate, h, Prop, Method, Event, Watch } from '@stencil/core';
3
+ export class EzCalendar {
4
+ constructor() {
5
+ this._firstRender = true;
6
+ this._todayLabel = 'Hoje';
7
+ this._weekDayLabels = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];
8
+ this._monthLabels = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
9
+ /**
10
+ * A data selecionada no calendário
11
+ */
12
+ this.value = new Date();
13
+ /**
14
+ * No modo floating o calendário só se tornará visível
15
+ * quando o método show() for acionado.
16
+ */
17
+ this.floating = false;
18
+ }
19
+ /**
20
+ * Usado no modo floating. Faz com que o componente seja exibido.
21
+ * É possível determinar ajustes de posicionamento através dos parâmetros
22
+ * top, left, bottom e right. Esses parâmetros devem ser informados como
23
+ * strings no formato css.
24
+ */
25
+ async show(top, left, bottom, right) {
26
+ if (this.floating) {
27
+ this._floatingID = FloatingManager.float(this._box, this._container, { autoClose: true, top, left, bottom, right });
28
+ }
29
+ }
30
+ /**
31
+ * Usado no modo floating. Faz com que o componente seja ocultado.
32
+ */
33
+ async hide() {
34
+ if (this._floatingID !== undefined) {
35
+ FloatingManager.close(this._floatingID);
36
+ this._floatingID = undefined;
37
+ }
38
+ }
39
+ valueChanged() {
40
+ if (this.value) {
41
+ this._currentPosition.setTime(this.value.getTime());
42
+ this._currentPosition.setDate(1);
43
+ }
44
+ }
45
+ getMonthLabel() {
46
+ return this._monthLabels[this._currentPosition.getMonth()] + " " + this._currentPosition.getFullYear();
47
+ }
48
+ isSelectedDate(d) {
49
+ if (this.value) {
50
+ return this.value.getDate() == d.getDate() && this.value.getMonth() == d.getMonth() && this.value.getFullYear() == d.getFullYear();
51
+ }
52
+ return false;
53
+ }
54
+ changeMonth(offset) {
55
+ this._currentPosition.setMonth(this._currentPosition.getMonth() + offset);
56
+ forceUpdate(this);
57
+ }
58
+ selectDate(d) {
59
+ this.value = d;
60
+ this.ezChange.emit();
61
+ }
62
+ componentDidRender() {
63
+ if (this.floating && this._firstRender) {
64
+ this._box.remove();
65
+ this._firstRender = false;
66
+ }
67
+ }
68
+ render() {
69
+ if (this._currentPosition == null) {
70
+ this._currentPosition = new Date();
71
+ this._currentPosition.setTime(this.value.getTime());
72
+ this._currentPosition.setDate(1);
73
+ }
74
+ const firstDate = new Date();
75
+ firstDate.setTime(this._currentPosition.getTime());
76
+ firstDate.setDate(1 - firstDate.getDay());
77
+ return (h("section", { ref: elem => this._container = elem },
78
+ h("div", { class: "calendar", ref: elem => this._box = elem },
79
+ h("div", { class: "calendar__header" },
80
+ h("button", { class: "calendar__btn-previous", onClick: () => this.changeMonth(-1) }),
81
+ h("label", { class: "calendar__lbl-month" }, this.getMonthLabel()),
82
+ h("button", { class: "calendar__btn-next", onClick: () => this.changeMonth(1) })),
83
+ h("div", { class: "calendar__body" },
84
+ h("div", { class: "calendar__line" }, this._weekDayLabels.map(day => h("div", { class: "calendar__cell calendar__cell--unselectable" }, day))),
85
+ [0, 7, 14, 21, 28, 35].map(offset => h("div", { class: "calendar__line" }, [0, 1, 2, 3, 4, 5, 6].map(index => {
86
+ const date = new Date();
87
+ date.setTime(firstDate.getTime());
88
+ date.setDate(date.getDate() + offset + index);
89
+ let classNames = "calendar__cell";
90
+ if (this._currentPosition.getMonth() != date.getMonth()) {
91
+ classNames += " calendar__cell--secondary";
92
+ }
93
+ else if (this.isSelectedDate(date)) {
94
+ classNames += " calendar__cell--selected";
95
+ }
96
+ return h("div", { class: classNames, onClick: () => this.selectDate(date) }, date.getDate());
97
+ })))),
98
+ h("div", { class: "calendar__footer" },
99
+ h("button", { class: "calendar__btn-today", onClick: () => this.selectDate(new Date()) }, this._todayLabel)))));
100
+ }
101
+ static get is() { return "ez-calendar"; }
102
+ static get encapsulation() { return "shadow"; }
103
+ static get originalStyleUrls() { return {
104
+ "$": ["ez-calendar.css"]
105
+ }; }
106
+ static get styleUrls() { return {
107
+ "$": ["ez-calendar.css"]
108
+ }; }
109
+ static get properties() { return {
110
+ "value": {
111
+ "type": "unknown",
112
+ "mutable": true,
113
+ "complexType": {
114
+ "original": "Date",
115
+ "resolved": "Date",
116
+ "references": {
117
+ "Date": {
118
+ "location": "global"
119
+ }
120
+ }
121
+ },
122
+ "required": false,
123
+ "optional": false,
124
+ "docs": {
125
+ "tags": [],
126
+ "text": "A data selecionada no calend\u00E1rio"
127
+ },
128
+ "defaultValue": "new Date()"
129
+ },
130
+ "floating": {
131
+ "type": "boolean",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "boolean",
135
+ "resolved": "boolean",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": false,
140
+ "docs": {
141
+ "tags": [],
142
+ "text": "No modo floating o calend\u00E1rio s\u00F3 se tornar\u00E1 vis\u00EDvel\nquando o m\u00E9todo show() for acionado."
143
+ },
144
+ "attribute": "floating",
145
+ "reflect": true,
146
+ "defaultValue": "false"
147
+ }
148
+ }; }
149
+ static get events() { return [{
150
+ "method": "ezChange",
151
+ "name": "ezChange",
152
+ "bubbles": true,
153
+ "cancelable": true,
154
+ "composed": true,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": "Quando o usu\u00E1rio escolhe uma data, esse evento \u00E9 emitido."
158
+ },
159
+ "complexType": {
160
+ "original": "string",
161
+ "resolved": "string",
162
+ "references": {}
163
+ }
164
+ }]; }
165
+ static get methods() { return {
166
+ "show": {
167
+ "complexType": {
168
+ "signature": "(top?: string, left?: string, bottom?: string, right?: string) => Promise<void>",
169
+ "parameters": [{
170
+ "tags": [],
171
+ "text": ""
172
+ }, {
173
+ "tags": [],
174
+ "text": ""
175
+ }, {
176
+ "tags": [],
177
+ "text": ""
178
+ }, {
179
+ "tags": [],
180
+ "text": ""
181
+ }],
182
+ "references": {
183
+ "Promise": {
184
+ "location": "global"
185
+ }
186
+ },
187
+ "return": "Promise<void>"
188
+ },
189
+ "docs": {
190
+ "text": "Usado no modo floating. Faz com que o componente seja exibido.\n\u00C9 poss\u00EDvel determinar ajustes de posicionamento atrav\u00E9s dos par\u00E2metros\ntop, left, bottom e right. Esses par\u00E2metros devem ser informados como\nstrings no formato css.",
191
+ "tags": []
192
+ }
193
+ },
194
+ "hide": {
195
+ "complexType": {
196
+ "signature": "() => Promise<void>",
197
+ "parameters": [],
198
+ "references": {
199
+ "Promise": {
200
+ "location": "global"
201
+ }
202
+ },
203
+ "return": "Promise<void>"
204
+ },
205
+ "docs": {
206
+ "text": "Usado no modo floating. Faz com que o componente seja ocultado.",
207
+ "tags": []
208
+ }
209
+ }
210
+ }; }
211
+ static get watchers() { return [{
212
+ "propName": "value",
213
+ "methodName": "valueChanged"
214
+ }]; }
215
+ }
@@ -0,0 +1,266 @@
1
+ :host {
2
+
3
+ /***************
4
+ Regular mode
5
+ ***************/
6
+ /*dimensions */
7
+ /*@doc Define a largura do box do checkbox */
8
+ --chk--box--width: 18px;
9
+ /*@doc Define a altura do box do checkbox */
10
+ --chk--box--height: 18px;
11
+ --chk--width: calc(var(--chk--box--width) + 14px);
12
+ --chk--height: calc(var(--chk--box--width) + 14px);
13
+
14
+ /*general*/
15
+ --chk--border-radius: var(--border--radius-small);
16
+
17
+ /*box*/
18
+ --chk--checked--background-color: var(--color--primary-200);
19
+ --chk--focus--background-color: var(--color--strokes, #FFFFFF);
20
+ --chk--hover--background-color: var(--background--medium);
21
+ --chk--checked--disabled--background-color: var(--color--disable-secondary);
22
+
23
+ --chk--border: var(--border--medium) var(--title--primary);
24
+ --chk--disabled--border: var(--border--medium) var(--color--strokes);
25
+ --chk--checked--border: var(--border--medium) var(--color--primary);
26
+
27
+
28
+ --chk--checked--hover--background-color: var(--color--primary-200);
29
+ --chk--checked--focus--background-color: var(--color--primary-300, #FFFFFF);
30
+
31
+ /*check*/
32
+ --chk--check--clip-path: polygon(40% 70%, 46% 73%, 51% 71%, 93% 21%, 93% 16%, 83% 8%, 76% 9%, 47% 45%, 43% 44%, 38% 39%, 30% 37%, 22% 47%, 23% 54%, 40% 70%);
33
+ --chk--check--background-color: var(--color--primary);
34
+ --chk--check--disabled--background-color: var(--color--strokes);
35
+
36
+ /***************
37
+ Switch mode
38
+ ***************/
39
+ /*dimensions */
40
+ --swt--slider--width: 34px;
41
+ --swt--slider--height: 14px;
42
+ --swt--pin--width: 20px;
43
+ --swt--pin--height: 20px;
44
+ --swt--focus--width: 32px;
45
+ --swt--focus--height: 32px;
46
+
47
+ /*background*/
48
+ --swt--background-color: var(--color--strokes);
49
+ --swt--disabled--background-color: var(--color--disable-secondary);
50
+ --swt--checked--background-color: var(--color--primary-300);
51
+
52
+ /*pin*/
53
+ --swt--pin--background-color: var(--background--xlight);
54
+ --swt--pin--disabled--background-color: var(--color--disable-secondary);
55
+ --swt--pin--checked--background-color: var(--color--primary);
56
+ --swt--pin--checked--disabled--background-color: #E8F7F4;
57
+ --swt--pin--focus--background-color: var(--text--disable);
58
+ --swt--pin--checked--focus--background-color: var(--color--primary);
59
+
60
+ /***************
61
+ host style
62
+ ***************/
63
+ /*private*/
64
+ width: 100%;
65
+ }
66
+
67
+ /******** REGULAR MODE ********/
68
+ /*---------------------------unchecked------------------------------*/
69
+ input.regularMode {
70
+ /*private*/
71
+ display: flex;
72
+ flex-wrap: wrap;
73
+ align-items: center;
74
+ justify-content: center;
75
+ box-sizing: border-box;
76
+ -webkit-appearance: none;
77
+ cursor: pointer;
78
+ border-radius: 50%;
79
+
80
+ /*public*/
81
+ width: var(--chk--width);
82
+ height: var(--chk--height);
83
+ }
84
+
85
+
86
+ input.regularMode:enabled:hover{
87
+ /*public*/
88
+ background-color: var(--chk--hover--background-color);
89
+ }
90
+
91
+ input.regularMode:enabled:focus{
92
+ /*private*/
93
+ outline: none;
94
+
95
+ /*public*/
96
+ background-color: var(--chk--focus--background-color);
97
+ }
98
+
99
+ input.regularMode:disabled{
100
+ /*private*/
101
+ cursor: auto;
102
+ background: none;
103
+ }
104
+
105
+ input.regularMode::before{
106
+ /*private*/
107
+ box-sizing: border-box;
108
+ content: "";
109
+ display: block;
110
+
111
+ /*public*/
112
+ width: var(--chk--box--width);
113
+ height: var(--chk--box--height);
114
+ border-radius: var(--chk--border-radius);
115
+ border: var(--chk--border);
116
+ }
117
+
118
+ input.regularMode:disabled::before{
119
+ /*public*/
120
+ border: var(--chk--disabled--border);
121
+ }
122
+
123
+ /*-------------------------------checked---------------------------------*/
124
+ input.regularMode:checked:enabled:hover{
125
+ /*public*/
126
+ background-color: var(--chk--checked--hover--background-color);
127
+ }
128
+
129
+ input.regularMode:checked:enabled:focus{
130
+ /*public*/
131
+ background-color: var(--chk--checked--focus--background-color);
132
+ }
133
+
134
+ input.regularMode:checked::before{
135
+ /*public*/
136
+ border: var(--chk--checked--border);
137
+ background-color: var(--chk--checked--background-color);
138
+ }
139
+
140
+ input.regularMode:checked:disabled:before{
141
+ /*public*/
142
+ border: var(--chk--disabled--border);
143
+ background-color: var(--chk--checked--disabled--background-color);
144
+ }
145
+
146
+ input.regularMode:checked::after{
147
+ /*private*/
148
+ display: flex;
149
+ flex-wrap: wrap;
150
+ align-items: center;
151
+ justify-content: center;
152
+ content: "";
153
+ position: absolute;
154
+ margin-top: 3px;
155
+ margin-left: -1px;
156
+ width: 12px;
157
+ height: 12px;
158
+ background-color: var(--chk--check--background-color);
159
+
160
+ /*public*/
161
+ clip-path: var(--chk--check--clip-path);
162
+ }
163
+
164
+ input.regularMode:checked:disabled::after{
165
+ /*public*/
166
+ background-color: var(--chk--check--disabled--background-color);
167
+ }
168
+
169
+ /******** SWITCH MODE ********/
170
+ /*-------------------------------OFF---------------------------------*/
171
+ input.switchMode{
172
+ /*private*/
173
+ appearance: none;
174
+ position: relative;
175
+ outline: none;
176
+ cursor: pointer;
177
+ border-radius: 20px;
178
+ border: none;
179
+ transition: background-color var(--transition);
180
+
181
+ /*public*/
182
+ width: var(--swt--slider--width);
183
+ height: var(--swt--slider--height);
184
+ background-color: var(--swt--background-color);
185
+ }
186
+
187
+ input.switchMode:disabled{
188
+ /*public*/
189
+ background-color:var(--swt--disabled--background-color);
190
+ }
191
+
192
+ input.switchMode::after{
193
+ /*private*/
194
+ content: "";
195
+ display: block;
196
+ position: absolute;
197
+ box-shadow: var(--shadow);
198
+ transition: transform var(--transition);
199
+ transition: background-color var(--transition);
200
+ transform: translateY(-3px);
201
+ border-radius: 50%;
202
+
203
+ /*public*/
204
+ width: var(--swt--pin--width);
205
+ height: var(--swt--pin--height);
206
+ background-color: var(--swt--pin--background-color);
207
+ }
208
+
209
+ input.switchMode:disabled::after{
210
+ /*public*/
211
+ background-color: var(--swt--pin--disabled--background-color);
212
+ }
213
+
214
+ /*-------------------------------ON---------------------------------*/
215
+ input.switchMode:checked{
216
+ /*private*/
217
+ transition: background-color var(--transition);
218
+
219
+ /*public*/
220
+ background-color: var(--swt--checked--background-color);
221
+ }
222
+
223
+ input.switchMode::before{
224
+ /*private*/
225
+ display: block;
226
+ content: "";
227
+ display: block;
228
+ position: absolute;
229
+ border-radius: 50%;
230
+ opacity: 0;
231
+
232
+ /*public*/
233
+ width: var(--swt--focus--width);
234
+ height: var(--swt--focus--height);
235
+ top: calc((var(--swt--slider--height) - var(--swt--focus--height)) / 2);
236
+ left: calc((var(--swt--pin--width) - var(--swt--focus--width))/2);
237
+ background-color: var(--swt--pin--focus--background-color);
238
+ }
239
+
240
+ input.switchMode:focus::before{
241
+ /*private*/
242
+ opacity: 0.24;
243
+ transition: opacity var(--transition);
244
+ }
245
+
246
+ input.switchMode:checked:focus::before{
247
+ /*private*/
248
+ background-color: var(--swt--pin--checked--focus--background-color);
249
+ transform: translateX(calc(var(--swt--slider--width) - var(--swt--pin--width)));
250
+ }
251
+
252
+ input.switchMode:checked::after{
253
+ /*private*/
254
+ transition: transform var(--transition);
255
+ transition: background-color var(--transition);
256
+ transform: translateX(calc(var(--swt--slider--width) - var(--swt--pin--width))) translateY(-3px);
257
+ box-shadow: var(--shadow);
258
+
259
+ /*public*/
260
+ background-color: var(--swt--pin--checked--background-color);
261
+ }
262
+
263
+ input.switchMode:checked:disabled::after{
264
+ /*public*/
265
+ background-color: var(--swt--pin--checked--disabled--background-color);
266
+ }