@rededor/cura 1.2.0-rc.0 → 1.2.0-rc.2
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/dist/cjs/app-globals-4d07f363.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +32 -3
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +3 -2
- package/dist/collection/components/cura-calendar/cura-calendar.js +90 -6
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +55 -22
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
- package/dist/components/cura-calendar2.js +37 -5
- package/dist/components/cura-calendar2.js.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/p-0b7a7306.js.map +1 -1
- package/dist/cura/{p-563ba0cd.entry.js → p-2956f120.entry.js} +2 -2
- package/dist/cura/p-2956f120.entry.js.map +1 -0
- package/dist/esm/app-globals-6ca7103d.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +32 -3
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +23 -2
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +23 -1
- package/dist/types/components.d.ts +30 -4
- package/package.json +2 -2
- package/dist/cura/p-563ba0cd.entry.js.map +0 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
const renderCuraCalendar =
|
|
1
|
+
const renderCuraCalendar = args => `
|
|
2
2
|
<cura-calendar
|
|
3
3
|
${args.period && `period="${args.period}"`}
|
|
4
4
|
${args.width && `width="${args.width}"`}
|
|
5
|
+
${args.maxWidth && `max-width="${args.maxWidth}"`}
|
|
6
|
+
${args.minWidth && `min-width="${args.minWidth}"`}
|
|
5
7
|
${args.mode && `mode="${args.mode}"`}
|
|
6
8
|
${args.type && `type="${args.type}"`}
|
|
7
9
|
${args.dateFormat && `date-format="${args.dateFormat}"`}
|
|
8
10
|
${args.locale && `locale="${args.locale}"`}
|
|
9
11
|
${`enable="${args.enable.length > 0 ? args.enable : '[]'}"`}
|
|
10
12
|
${`disable="${args.disable.length > 0 ? args.disable : '[]'}"`}
|
|
11
|
-
${`
|
|
13
|
+
${`default-date='${args.defaultDate.length > 0 ? JSON.stringify(args.defaultDate) : '[]'}'`}
|
|
14
|
+
|
|
12
15
|
${args.disablePassDates && `disable-pass-dates="${args.disablePassDates}"`}
|
|
13
16
|
${args.disableFutureDates && `disable-future-dates="${args.disableFutureDates}"`}
|
|
14
17
|
${args.collapsed && `collapsed="${args.collapsed}"`}
|
|
@@ -23,7 +26,7 @@ export default {
|
|
|
23
26
|
parameters: {
|
|
24
27
|
layout: 'centered',
|
|
25
28
|
},
|
|
26
|
-
render:
|
|
29
|
+
render: args => renderCuraCalendar(args),
|
|
27
30
|
argTypes: {
|
|
28
31
|
period: {
|
|
29
32
|
control: 'array',
|
|
@@ -41,12 +44,28 @@ export default {
|
|
|
41
44
|
defaultValue: { summary: '268px' },
|
|
42
45
|
},
|
|
43
46
|
},
|
|
47
|
+
maxWidth: {
|
|
48
|
+
control: 'text',
|
|
49
|
+
description: 'Define a largura máxima do calendário. <b>Largura máxima "400px"</b>.',
|
|
50
|
+
table: {
|
|
51
|
+
category: 'Properties',
|
|
52
|
+
defaultValue: { summary: '400px' },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
minWidth: {
|
|
56
|
+
control: 'text',
|
|
57
|
+
description: 'Define a largura mínima do calendário. <b>Largura mínima "268px"</b>.',
|
|
58
|
+
table: {
|
|
59
|
+
category: 'Properties',
|
|
60
|
+
defaultValue: { summary: '268px' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
44
63
|
mode: {
|
|
45
64
|
control: 'inline-radio',
|
|
46
65
|
options: ['single', 'multiple', 'range'],
|
|
47
66
|
description: 'Define o modo de seleção de datas.',
|
|
48
67
|
table: {
|
|
49
|
-
category:
|
|
68
|
+
category: 'Properties',
|
|
50
69
|
defaultValue: { summary: 'single' },
|
|
51
70
|
},
|
|
52
71
|
},
|
|
@@ -55,7 +74,7 @@ export default {
|
|
|
55
74
|
options: ['static', 'dropdown'],
|
|
56
75
|
description: 'Define o tipo de visualização (mês/ano) do calendário.',
|
|
57
76
|
table: {
|
|
58
|
-
category:
|
|
77
|
+
category: 'Properties',
|
|
59
78
|
defaultValue: { summary: 'static' },
|
|
60
79
|
},
|
|
61
80
|
},
|
|
@@ -63,7 +82,7 @@ export default {
|
|
|
63
82
|
control: 'text',
|
|
64
83
|
description: 'Define o formato das datas exibidas.',
|
|
65
84
|
table: {
|
|
66
|
-
category:
|
|
85
|
+
category: 'Properties',
|
|
67
86
|
defaultValue: { summary: 'yyyy-MM-dd' },
|
|
68
87
|
},
|
|
69
88
|
},
|
|
@@ -72,7 +91,7 @@ export default {
|
|
|
72
91
|
options: ['pt-BR', 'en-US'],
|
|
73
92
|
description: 'Define o idioma/localização do calendário.',
|
|
74
93
|
table: {
|
|
75
|
-
category:
|
|
94
|
+
category: 'Properties',
|
|
76
95
|
defaultValue: { summary: 'pt-BR' },
|
|
77
96
|
},
|
|
78
97
|
},
|
|
@@ -80,7 +99,7 @@ export default {
|
|
|
80
99
|
control: 'array',
|
|
81
100
|
description: 'Define as datas que serão pré-selecionadas no calendário.',
|
|
82
101
|
table: {
|
|
83
|
-
category:
|
|
102
|
+
category: 'Properties',
|
|
84
103
|
defaultValue: { summary: '[]' },
|
|
85
104
|
},
|
|
86
105
|
},
|
|
@@ -88,7 +107,7 @@ export default {
|
|
|
88
107
|
control: 'array',
|
|
89
108
|
description: 'Define as datas que são habilitadas para seleção.',
|
|
90
109
|
table: {
|
|
91
|
-
category:
|
|
110
|
+
category: 'Properties',
|
|
92
111
|
defaultValue: { summary: '[]' },
|
|
93
112
|
},
|
|
94
113
|
},
|
|
@@ -96,7 +115,7 @@ export default {
|
|
|
96
115
|
control: 'array',
|
|
97
116
|
description: 'Define as datas que são desabilitadas para seleção.',
|
|
98
117
|
table: {
|
|
99
|
-
category:
|
|
118
|
+
category: 'Properties',
|
|
100
119
|
defaultValue: { summary: '[]' },
|
|
101
120
|
},
|
|
102
121
|
},
|
|
@@ -104,7 +123,7 @@ export default {
|
|
|
104
123
|
control: 'number',
|
|
105
124
|
description: 'Define o limite de datas selecionáveis no modo de seleção range.',
|
|
106
125
|
table: {
|
|
107
|
-
category:
|
|
126
|
+
category: 'Properties',
|
|
108
127
|
defaultValue: { summary: 'null' },
|
|
109
128
|
},
|
|
110
129
|
},
|
|
@@ -112,7 +131,7 @@ export default {
|
|
|
112
131
|
control: 'boolean',
|
|
113
132
|
description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',
|
|
114
133
|
table: {
|
|
115
|
-
category:
|
|
134
|
+
category: 'Properties',
|
|
116
135
|
defaultValue: { summary: false },
|
|
117
136
|
},
|
|
118
137
|
},
|
|
@@ -120,7 +139,7 @@ export default {
|
|
|
120
139
|
control: 'boolean',
|
|
121
140
|
description: 'Define se as datas futuras a data atual serão consideras como desabilitadas',
|
|
122
141
|
table: {
|
|
123
|
-
category:
|
|
142
|
+
category: 'Properties',
|
|
124
143
|
defaultValue: { summary: false },
|
|
125
144
|
},
|
|
126
145
|
},
|
|
@@ -128,7 +147,7 @@ export default {
|
|
|
128
147
|
control: 'boolean',
|
|
129
148
|
description: 'Define se a exibição do calendário será com recolhida ou expandida ',
|
|
130
149
|
table: {
|
|
131
|
-
category:
|
|
150
|
+
category: 'Properties',
|
|
132
151
|
defaultValue: { summary: null },
|
|
133
152
|
},
|
|
134
153
|
},
|
|
@@ -136,7 +155,7 @@ export default {
|
|
|
136
155
|
control: 'boolean',
|
|
137
156
|
description: 'Define se o componente é flutuante e aplica o sombreamento.',
|
|
138
157
|
table: {
|
|
139
|
-
category:
|
|
158
|
+
category: 'Properties',
|
|
140
159
|
defaultValue: { summary: true },
|
|
141
160
|
},
|
|
142
161
|
},
|
|
@@ -144,25 +163,39 @@ export default {
|
|
|
144
163
|
control: 'boolean',
|
|
145
164
|
description: 'Define se o componente tenha borda, padding e sombra (box) ou não.',
|
|
146
165
|
table: {
|
|
147
|
-
category:
|
|
166
|
+
category: 'Properties',
|
|
148
167
|
defaultValue: { summary: true },
|
|
149
168
|
},
|
|
150
|
-
}
|
|
169
|
+
},
|
|
151
170
|
},
|
|
152
171
|
};
|
|
153
172
|
export const Calendar = {
|
|
154
173
|
args: {
|
|
155
174
|
period: [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
175
|
+
'2024-08-01',
|
|
176
|
+
'2024-08-30',
|
|
177
|
+
'2024-08-02',
|
|
178
|
+
'2024-08-03',
|
|
179
|
+
'2024-08-04',
|
|
180
|
+
'2024-08-29',
|
|
181
|
+
'2024-08-15',
|
|
182
|
+
'2024-08-02',
|
|
183
|
+
'2024-08-30',
|
|
184
|
+
'2024-09-01',
|
|
185
|
+
'2024-09-29',
|
|
186
|
+
'2024-10-15',
|
|
187
|
+
'2024-09-02',
|
|
188
|
+
'2024-09-30',
|
|
189
|
+
'2024-10-01',
|
|
159
190
|
],
|
|
160
191
|
width: '280px',
|
|
192
|
+
maxWidth: '400px',
|
|
193
|
+
minWidth: '268px',
|
|
161
194
|
mode: 'single',
|
|
162
195
|
type: 'static',
|
|
163
196
|
locale: 'pt-BR',
|
|
164
197
|
dateFormat: 'yyyy-MM-dd',
|
|
165
|
-
defaultDate: [],
|
|
198
|
+
defaultDate: ['2024-08-15'],
|
|
166
199
|
enable: [],
|
|
167
200
|
disable: [],
|
|
168
201
|
limitRange: null,
|
|
@@ -170,7 +203,7 @@ export const Calendar = {
|
|
|
170
203
|
disableFutureDates: false,
|
|
171
204
|
collapsed: null,
|
|
172
205
|
floating: true,
|
|
173
|
-
embedded: true
|
|
206
|
+
embedded: true,
|
|
174
207
|
},
|
|
175
208
|
};
|
|
176
209
|
//# sourceMappingURL=cura-calendar.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-calendar.stories.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.stories.tsx"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;;QAE7B,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC,KAAK,GAAG;QACrC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,UAAU,IAAI,gBAAgB,IAAI,CAAC,UAAU,GAAG;QACrD,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG;QACzD,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG;QAC5D,gBAAgB,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG;QACxE,IAAI,CAAC,gBAAgB,IAAI,uBAAuB,IAAI,CAAC,gBAAgB,GAAG;QACxE,IAAI,CAAC,kBAAkB,IAAI,yBAAyB,IAAI,CAAC,kBAAkB,GAAG;QAC9E,IAAI,CAAC,SAA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UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,KAAK;QACzB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACf;CACF,CAAC","sourcesContent":["const renderCuraCalendar = (args) => `\n <cura-calendar\n ${args.period && `period=\"${args.period}\"`}\n ${args.width && `width=\"${args.width}\"`}\n ${args.mode && `mode=\"${args.mode}\"`}\n ${args.type && `type=\"${args.type}\"`}\n ${args.dateFormat && `date-format=\"${args.dateFormat}\"`}\n ${args.locale && `locale=\"${args.locale}\"`}\n ${`enable=\"${args.enable.length > 0 ? args.enable : '[]'}\"`}\n ${`disable=\"${args.disable.length > 0 ? args.disable : '[]'}\"`}\n ${`defaultDate=\"${args.defaultDate.length > 0 ? args.defaultDate : '[]'}\"`}\n ${args.disablePassDates && `disable-pass-dates=\"${args.disablePassDates}\"`}\n ${args.disableFutureDates && `disable-future-dates=\"${args.disableFutureDates}\"`}\n ${args.collapsed && `collapsed=\"${args.collapsed}\"`}\n ${args.floating && `floating=\"${args.floating}\"`}\n ${args.embedded && `embedded=\"${args.embedded}\"`}\n ${args.limitRange !== null ? `limit-range=\"${args.limitRange}\"` : ''}\n ></cura-calendar>\n`;\n\nexport default {\n title: 'Componentes/Calendar/Calendar',\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n render: (args) => renderCuraCalendar(args),\n argTypes: {\n period: {\n control: 'array',\n description: 'Define os períodos disponíveis para o calendário. Quando não informado, considera todas as datas como habilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n width: {\n control: 'text',\n description: 'Define a largura do calendário. <b>Largura minima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n mode: {\n control: 'inline-radio',\n options: ['single', 'multiple', 'range'],\n description: 'Define o modo de seleção de datas.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'single' },\n },\n },\n type: {\n control: 'inline-radio',\n options: ['static', 'dropdown'],\n description: 'Define o tipo de visualização (mês/ano) do calendário.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'static' },\n },\n },\n dateFormat: {\n control: 'text',\n description: 'Define o formato das datas exibidas.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'yyyy-MM-dd' },\n },\n },\n locale: {\n control: 'inline-radio',\n options: ['pt-BR', 'en-US'],\n description: 'Define o idioma/localização do calendário.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'pt-BR' },\n },\n },\n defaultDate: {\n control: 'array',\n description: 'Define as datas que serão pré-selecionadas no calendário.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: '[]' },\n },\n },\n enable: {\n control: 'array',\n description: 'Define as datas que são habilitadas para seleção.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: '[]' },\n },\n },\n disable: {\n control: 'array',\n description: 'Define as datas que são desabilitadas para seleção.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: '[]' },\n },\n },\n limitRange: {\n control: 'number',\n description: 'Define o limite de datas selecionáveis no modo de seleção range.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'null' },\n },\n },\n disablePassDates: {\n control: 'boolean',\n description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',\n table: {\n category: \"Properties\",\n defaultValue: { summary: false },\n },\n },\n disableFutureDates: {\n control: 'boolean',\n description: 'Define se as datas futuras a data atual serão consideras como desabilitadas',\n table: {\n category: \"Properties\",\n defaultValue: { summary: false },\n },\n },\n collapsed: {\n control: 'boolean',\n description: 'Define se a exibição do calendário será com recolhida ou expandida ',\n table: {\n category: \"Properties\",\n defaultValue: { summary: null },\n },\n },\n floating: {\n control: 'boolean',\n description: 'Define se o componente é flutuante e aplica o sombreamento.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: true },\n },\n },\n embedded: {\n control: 'boolean',\n description: 'Define se o componente tenha borda, padding e sombra (box) ou não.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: true },\n },\n }\n },\n};\n\nexport const Calendar = {\n args: {\n period: [\n \"2024-08-01\", \"2024-08-30\", \"2024-08-02\", \"2024-08-03\", \"2024-08-04\",\n \"2024-08-29\", \"2024-08-15\", \"2024-08-02\", \"2024-08-30\", \"2024-09-01\",\n \"2024-09-29\", \"2024-10-15\", \"2024-09-02\", \"2024-09-30\", \"2024-10-01\"\n ],\n width: '280px',\n mode: 'single',\n type: 'static',\n locale: 'pt-BR',\n dateFormat: 'yyyy-MM-dd',\n defaultDate: [],\n enable: [],\n disable: [],\n limitRange: null,\n disablePassDates: false,\n disableFutureDates: false,\n collapsed: null,\n floating: true,\n embedded: true\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"cura-calendar.stories.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.stories.tsx"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,CAAC,EAAE,CAAC;;QAE3B,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC,KAAK,GAAG;QACrC,IAAI,CAAC,QAAQ,IAAI,cAAc,IAAI,CAAC,QAAQ,GAAG;QAC/C,IAAI,CAAC,QAAQ,IAAI,cAAc,IAAI,CAAC,QAAQ,GAAG;QAC/C,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,UAAU,IAAI,gBAAgB,IAAI,CAAC,UAAU,GAAG;QACrD,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG;QACzD,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC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AQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAChC;SACF;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,oEAAoE;YACjF,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAChC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,YAAY;QACxB,WAAW,EAAE,CAAC,YAAY,CAAC;QAC3B,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,KAAK;QACzB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACf;CACF,CAAC","sourcesContent":["const renderCuraCalendar = args => `\n <cura-calendar\n ${args.period && `period=\"${args.period}\"`}\n ${args.width && `width=\"${args.width}\"`}\n ${args.maxWidth && `max-width=\"${args.maxWidth}\"`}\n ${args.minWidth && `min-width=\"${args.minWidth}\"`}\n ${args.mode && `mode=\"${args.mode}\"`}\n ${args.type && `type=\"${args.type}\"`}\n ${args.dateFormat && `date-format=\"${args.dateFormat}\"`}\n ${args.locale && `locale=\"${args.locale}\"`}\n ${`enable=\"${args.enable.length > 0 ? args.enable : '[]'}\"`}\n ${`disable=\"${args.disable.length > 0 ? args.disable : '[]'}\"`}\n ${`default-date='${args.defaultDate.length > 0 ? JSON.stringify(args.defaultDate) : '[]'}'`}\n\n ${args.disablePassDates && `disable-pass-dates=\"${args.disablePassDates}\"`}\n ${args.disableFutureDates && `disable-future-dates=\"${args.disableFutureDates}\"`}\n ${args.collapsed && `collapsed=\"${args.collapsed}\"`}\n ${args.floating && `floating=\"${args.floating}\"`}\n ${args.embedded && `embedded=\"${args.embedded}\"`}\n ${args.limitRange !== null ? `limit-range=\"${args.limitRange}\"` : ''}\n ></cura-calendar>\n`;\n\nexport default {\n title: 'Componentes/Calendar/Calendar',\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n render: args => renderCuraCalendar(args),\n argTypes: {\n period: {\n control: 'array',\n description: 'Define os períodos disponíveis para o calendário. Quando não informado, considera todas as datas como habilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n width: {\n control: 'text',\n description: 'Define a largura do calendário. <b>Largura minima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n maxWidth: {\n control: 'text',\n description: 'Define a largura máxima do calendário. <b>Largura máxima \"400px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '400px' },\n },\n },\n minWidth: {\n control: 'text',\n description: 'Define a largura mínima do calendário. <b>Largura mínima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n mode: {\n control: 'inline-radio',\n options: ['single', 'multiple', 'range'],\n description: 'Define o modo de seleção de datas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'single' },\n },\n },\n type: {\n control: 'inline-radio',\n options: ['static', 'dropdown'],\n description: 'Define o tipo de visualização (mês/ano) do calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'static' },\n },\n },\n dateFormat: {\n control: 'text',\n description: 'Define o formato das datas exibidas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'yyyy-MM-dd' },\n },\n },\n locale: {\n control: 'inline-radio',\n options: ['pt-BR', 'en-US'],\n description: 'Define o idioma/localização do calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'pt-BR' },\n },\n },\n defaultDate: {\n control: 'array',\n description: 'Define as datas que serão pré-selecionadas no calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n enable: {\n control: 'array',\n description: 'Define as datas que são habilitadas para seleção.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n disable: {\n control: 'array',\n description: 'Define as datas que são desabilitadas para seleção.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n limitRange: {\n control: 'number',\n description: 'Define o limite de datas selecionáveis no modo de seleção range.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'null' },\n },\n },\n disablePassDates: {\n control: 'boolean',\n description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n disableFutureDates: {\n control: 'boolean',\n description: 'Define se as datas futuras a data atual serão consideras como desabilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n collapsed: {\n control: 'boolean',\n description: 'Define se a exibição do calendário será com recolhida ou expandida ',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n floating: {\n control: 'boolean',\n description: 'Define se o componente é flutuante e aplica o sombreamento.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n embedded: {\n control: 'boolean',\n description: 'Define se o componente tenha borda, padding e sombra (box) ou não.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n },\n};\n\nexport const Calendar = {\n args: {\n period: [\n '2024-08-01',\n '2024-08-30',\n '2024-08-02',\n '2024-08-03',\n '2024-08-04',\n '2024-08-29',\n '2024-08-15',\n '2024-08-02',\n '2024-08-30',\n '2024-09-01',\n '2024-09-29',\n '2024-10-15',\n '2024-09-02',\n '2024-09-30',\n '2024-10-01',\n ],\n width: '280px',\n maxWidth: '400px',\n minWidth: '268px',\n mode: 'single',\n type: 'static',\n locale: 'pt-BR',\n dateFormat: 'yyyy-MM-dd',\n defaultDate: ['2024-08-15'],\n enable: [],\n disable: [],\n limitRange: null,\n disablePassDates: false,\n disableFutureDates: false,\n collapsed: null,\n floating: true,\n embedded: true,\n },\n};\n"]}
|
|
@@ -545,7 +545,7 @@ export class CuraInputText {
|
|
|
545
545
|
"references": {
|
|
546
546
|
"MaskPreset": {
|
|
547
547
|
"location": "local",
|
|
548
|
-
"path": "/
|
|
548
|
+
"path": "/home/marcuslima/Documents/www/rededor/web/cura/packages/component-lib/src/components/forms/cura-input-text/cura-input-text.tsx",
|
|
549
549
|
"id": "src/components/forms/cura-input-text/cura-input-text.tsx::MaskPreset"
|
|
550
550
|
}
|
|
551
551
|
}
|
|
@@ -3569,7 +3569,7 @@ var locale = {
|
|
|
3569
3569
|
};
|
|
3570
3570
|
const ptBR = locale;
|
|
3571
3571
|
|
|
3572
|
-
const curaCalendarCss = ":host{display:block;width:var(--width);max-width:
|
|
3572
|
+
const curaCalendarCss = ":host{display:block;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);margin:0 auto}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);min-width:var(--min-width);border-radius:4px;overflow:hidden;background:#fff;font-family:var(--font-family)}:host .calendar.embedded{border:2px solid var(--neutral-light);padding:0px 12px 12px 12px}:host .calendar.floating{box-shadow:0 4px 8px var(--neutral-light)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:7px 10px 0px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--accent-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .collapsed-container{text-align:center;position:relative;display:flex;align-items:center;justify-content:center;padding-top:10px}:host .collapsed-container::before{content:\"\";position:absolute;bottom:0;top:0;left:2px;right:2px;border-top:2px dotted var(--neutral-light)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected,:host .date.default-dates{color:var(--neutral-black) !important;background:var(--accent-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date.range.interval{border-radius:0;background-color:var(--accent-light);color:var(--neutral-black)}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date:hover{background:var(--accent-light);border-radius:50%;color:var(--neutral-black)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}.teste{width:100%}";
|
|
3573
3573
|
const CuraCalendarStyle0 = curaCalendarCss;
|
|
3574
3574
|
|
|
3575
3575
|
const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends HTMLElement {
|
|
@@ -3583,6 +3583,8 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3583
3583
|
this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
|
|
3584
3584
|
this.period = null;
|
|
3585
3585
|
this.width = '268px';
|
|
3586
|
+
this.minWidth = '268px';
|
|
3587
|
+
this.maxWidth = '400px';
|
|
3586
3588
|
this.mode = 'single';
|
|
3587
3589
|
this.dateFormat = 'yyyy-MM-dd';
|
|
3588
3590
|
this.locale = 'pt-BR';
|
|
@@ -3607,6 +3609,7 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3607
3609
|
}
|
|
3608
3610
|
connectedCallback() {
|
|
3609
3611
|
this.setFontProperties();
|
|
3612
|
+
this.initializeDefaultDates();
|
|
3610
3613
|
const colors = [
|
|
3611
3614
|
{ name: '--accent-base', theme: 'accent-base' },
|
|
3612
3615
|
{ name: '--accent-light', theme: 'accent-light' },
|
|
@@ -3629,6 +3632,15 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3629
3632
|
* Initialize the selected dates based on defaultDate and mode.
|
|
3630
3633
|
*/
|
|
3631
3634
|
initializeDefaultDates() {
|
|
3635
|
+
if (typeof this.defaultDate === 'string') {
|
|
3636
|
+
const parsedDefaultDate = JSON.parse(this.defaultDate || '[]');
|
|
3637
|
+
if (typeof parsedDefaultDate === 'string') {
|
|
3638
|
+
this.defaultDate = [parsedDefaultDate];
|
|
3639
|
+
}
|
|
3640
|
+
else {
|
|
3641
|
+
this.defaultDate = parsedDefaultDate;
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3632
3644
|
this.defaultDates = this.expandDateRanges(this.defaultDate);
|
|
3633
3645
|
}
|
|
3634
3646
|
/**
|
|
@@ -3758,6 +3770,8 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3758
3770
|
* @returns {Date[]} An array of individual dates.
|
|
3759
3771
|
*/
|
|
3760
3772
|
expandDateRanges(dates) {
|
|
3773
|
+
if (!dates)
|
|
3774
|
+
return [];
|
|
3761
3775
|
return dates.flatMap(date => {
|
|
3762
3776
|
if (typeof date === 'string')
|
|
3763
3777
|
return isValid(parseISO(date)) ? [parseISO(date)] : [];
|
|
@@ -3991,31 +4005,48 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
3991
4005
|
getHostCSSProperties() {
|
|
3992
4006
|
return {
|
|
3993
4007
|
'--width': this.width,
|
|
4008
|
+
'--min-width': this.minWidth,
|
|
4009
|
+
'--max-width': this.maxWidth,
|
|
3994
4010
|
};
|
|
3995
4011
|
}
|
|
3996
4012
|
watchDefaultDatesArray() {
|
|
3997
4013
|
this.selectedDates = this.customDates;
|
|
3998
4014
|
}
|
|
4015
|
+
handleDefaultDateChange(newValue) {
|
|
4016
|
+
if (typeof newValue === 'string') {
|
|
4017
|
+
const parsedDefaultDate = JSON.parse(newValue || '[]');
|
|
4018
|
+
if (typeof parsedDefaultDate === 'string') {
|
|
4019
|
+
newValue = [parsedDefaultDate];
|
|
4020
|
+
}
|
|
4021
|
+
else {
|
|
4022
|
+
newValue = parsedDefaultDate;
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
this.defaultDates = this.expandDateRanges(newValue);
|
|
4026
|
+
}
|
|
3999
4027
|
render() {
|
|
4000
4028
|
const { months } = this.fetchMonthNames();
|
|
4001
|
-
return (h(Host, { key: '
|
|
4029
|
+
return (h(Host, { key: 'fcea88a384ceebadccb6059ef59cea945f875a72', style: this.getHostCSSProperties() }, h("div", { key: '82c5271ba6b073439fb58471920f73b68b8f1320', class: `calendar ${this.floating ? 'floating' : ''} ${this.embedded ? 'embedded' : ''}`, style: this.styles }, h("header", { key: '3921fb57f3d526b9f33c59f998ad422806505bc1', class: "header" }, h("div", { key: '1f852f0f29ff927d3940c670f5b25206837cc331', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, h("cura-icon", { key: '697fda3903f24611628fe24a7f669ab87474aeab', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (h("div", { class: "select" }, h("cura-select", { size: "small", class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: e => this.onMonthDropdownChange(e) }, months.map((month, index) => (h("cura-select-option", { size: "xsmall", key: index, value: month }, month)))), h("cura-select", { size: "small", class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: e => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), h("cura-icon", { key: '6b7f0694e978b0807c4e54629cda68f2fde27c8a', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), h("span", { key: '5a151331c2c9872cf3b50bbaea7c9b92b1476297', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: "bold", key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), h("div", { key: '7eeb57ed5dc104c953343697a205a922a1b2b912', class: "dates" }, !this.collapsed
|
|
4002
4030
|
? this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))
|
|
4003
4031
|
: this.fetchDaysOfWeek().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (h("div", { class: "collapsed-container" }, h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "plusCircle" }, "Veja mais datas"))) : (h("div", { class: "collapsed-container" }, h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: "small", color: "primary", fontColor: "dark", iconName: "minusCircle" }, "Veja menos datas")))) : null)));
|
|
4004
4032
|
}
|
|
4005
4033
|
static get watchers() { return {
|
|
4006
|
-
"customDates": ["watchDefaultDatesArray"]
|
|
4034
|
+
"customDates": ["watchDefaultDatesArray"],
|
|
4035
|
+
"defaultDate": ["handleDefaultDateChange"]
|
|
4007
4036
|
}; }
|
|
4008
4037
|
static get style() { return CuraCalendarStyle0; }
|
|
4009
4038
|
}, [1, "cura-calendar", {
|
|
4010
4039
|
"period": [513],
|
|
4011
4040
|
"width": [513],
|
|
4041
|
+
"minWidth": [513, "min-width"],
|
|
4042
|
+
"maxWidth": [513, "max-width"],
|
|
4012
4043
|
"mode": [513],
|
|
4013
4044
|
"dateFormat": [1537, "date-format"],
|
|
4014
4045
|
"locale": [513],
|
|
4015
4046
|
"type": [513],
|
|
4016
4047
|
"disable": [16],
|
|
4017
4048
|
"enable": [16],
|
|
4018
|
-
"defaultDate": [
|
|
4049
|
+
"defaultDate": [1537, "default-date"],
|
|
4019
4050
|
"customDates": [16],
|
|
4020
4051
|
"limitRange": [514, "limit-range"],
|
|
4021
4052
|
"disablePassDates": [1540, "disable-pass-dates"],
|
|
@@ -4031,7 +4062,8 @@ const CuraCalendar = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends
|
|
|
4031
4062
|
"selectYear": [32],
|
|
4032
4063
|
"styles": [32]
|
|
4033
4064
|
}, undefined, {
|
|
4034
|
-
"customDates": ["watchDefaultDatesArray"]
|
|
4065
|
+
"customDates": ["watchDefaultDatesArray"],
|
|
4066
|
+
"defaultDate": ["handleDefaultDateChange"]
|
|
4035
4067
|
}]);
|
|
4036
4068
|
function defineCustomElement() {
|
|
4037
4069
|
if (typeof customElements === "undefined") {
|