@cloudscape-design/components 3.0.532 → 3.0.534
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/date-range-picker/index.d.ts.map +1 -1
- package/date-range-picker/index.js +21 -5
- package/date-range-picker/index.js.map +1 -1
- package/date-range-picker/interfaces.d.ts +16 -0
- package/date-range-picker/interfaces.d.ts.map +1 -1
- package/date-range-picker/interfaces.js.map +1 -1
- package/date-range-picker/styles.css.js +39 -38
- package/date-range-picker/styles.scoped.css +51 -46
- package/date-range-picker/styles.selectors.js +39 -38
- package/date-range-picker/time-offset.js +3 -3
- package/date-range-picker/time-offset.js.map +1 -1
- package/internal/context/single-tab-stop-navigation-context.js +1 -1
- package/internal/context/single-tab-stop-navigation-context.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/date-time/format-date-iso.d.ts +7 -0
- package/internal/utils/date-time/format-date-iso.d.ts.map +1 -0
- package/internal/utils/date-time/format-date-iso.js +8 -0
- package/internal/utils/date-time/format-date-iso.js.map +1 -0
- package/internal/utils/date-time/format-date-localized.d.ts +8 -0
- package/internal/utils/date-time/format-date-localized.d.ts.map +1 -0
- package/internal/utils/date-time/format-date-localized.js +32 -0
- package/internal/utils/date-time/format-date-localized.js.map +1 -0
- package/internal/utils/date-time/format-date-range.d.ts +11 -3
- package/internal/utils/date-time/format-date-range.d.ts.map +1 -1
- package/internal/utils/date-time/format-date-range.js +30 -5
- package/internal/utils/date-time/format-date-range.js.map +1 -1
- package/internal/utils/date-time/format-time-offset.d.ts +3 -0
- package/internal/utils/date-time/format-time-offset.d.ts.map +1 -0
- package/internal/utils/date-time/format-time-offset.js +31 -0
- package/internal/utils/date-time/format-time-offset.js.map +1 -0
- package/internal/utils/date-time/index.d.ts +1 -1
- package/internal/utils/date-time/index.d.ts.map +1 -1
- package/internal/utils/date-time/index.js +1 -1
- package/internal/utils/date-time/index.js.map +1 -1
- package/internal/utils/scrollable-containers.d.ts +1 -1
- package/internal/utils/scrollable-containers.js +1 -1
- package/internal/utils/scrollable-containers.js.map +1 -1
- package/package.json +1 -1
- package/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
- package/table/body-cell/disabled-inline-editor.js +3 -1
- package/table/body-cell/disabled-inline-editor.js.map +1 -1
- package/table/body-cell/index.d.ts.map +1 -1
- package/table/body-cell/index.js +3 -1
- package/table/body-cell/index.js.map +1 -1
- package/table/body-cell/styles.css.js +30 -30
- package/table/body-cell/styles.scoped.css +101 -77
- package/table/body-cell/styles.selectors.js +30 -30
- package/table/body-cell/td-element.d.ts.map +1 -1
- package/table/body-cell/td-element.js +6 -3
- package/table/body-cell/td-element.js.map +1 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +7 -4
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/styles.css.js +24 -24
- package/table/header-cell/styles.scoped.css +80 -38
- package/table/header-cell/styles.selectors.js +24 -24
- package/table/header-cell/th-element.d.ts +2 -1
- package/table/header-cell/th-element.d.ts.map +1 -1
- package/table/header-cell/th-element.js +9 -5
- package/table/header-cell/th-element.js.map +1 -1
- package/table/interfaces.d.ts +5 -0
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +53 -45
- package/table/internal.js.map +1 -1
- package/table/no-data-cell.js +1 -1
- package/table/no-data-cell.js.map +1 -1
- package/table/resizer/index.d.ts.map +1 -1
- package/table/resizer/index.js +4 -2
- package/table/resizer/index.js.map +1 -1
- package/table/selection/selection-control.d.ts +3 -1
- package/table/selection/selection-control.d.ts.map +1 -1
- package/table/selection/selection-control.js +2 -2
- package/table/selection/selection-control.js.map +1 -1
- package/table/table-role/grid-navigation.d.ts.map +1 -1
- package/table/table-role/grid-navigation.js +38 -24
- package/table/table-role/grid-navigation.js.map +1 -1
- package/table/table-role/table-role-helper.d.ts.map +1 -1
- package/table/table-role/table-role-helper.js +0 -2
- package/table/table-role/table-role-helper.js.map +1 -1
- package/table/table-role/utils.d.ts +1 -0
- package/table/table-role/utils.d.ts.map +1 -1
- package/table/table-role/utils.js +7 -2
- package/table/table-role/utils.js.map +1 -1
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +2 -2
- package/table/thead.js.map +1 -1
- package/table/use-table-focus-navigation.d.ts +9 -1
- package/table/use-table-focus-navigation.d.ts.map +1 -1
- package/table/use-table-focus-navigation.js +3 -3
- package/table/use-table-focus-navigation.js.map +1 -1
- package/internal/utils/date-time/format-timezone-offset.d.ts +0 -2
- package/internal/utils/date-time/format-timezone-offset.d.ts.map +0 -1
- package/internal/utils/date-time/format-timezone-offset.js +0 -12
- package/internal/utils/date-time/format-timezone-offset.js.map +0 -1
|
@@ -90,11 +90,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
94
|
-
animation: awsui_awsui-motion-fade-in-
|
|
93
|
+
.awsui_calendar_mgja0_15dh9_93:not(#\9) {
|
|
94
|
+
animation: awsui_awsui-motion-fade-in-0_mgja0_15dh9_1 var(--motion-duration-show-quick-aq3ump, 135ms) var(--motion-easing-show-quick-vc5zgd, ease-out);
|
|
95
95
|
animation-fill-mode: both;
|
|
96
96
|
}
|
|
97
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
97
|
+
@keyframes awsui_awsui-motion-fade-in-0_mgja0_15dh9_1 {
|
|
98
98
|
from {
|
|
99
99
|
opacity: 0;
|
|
100
100
|
}
|
|
@@ -103,12 +103,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
@media (prefers-reduced-motion: reduce) {
|
|
106
|
-
.
|
|
106
|
+
.awsui_calendar_mgja0_15dh9_93:not(#\9) {
|
|
107
107
|
animation: none;
|
|
108
108
|
transition: none;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
.awsui-motion-disabled .
|
|
111
|
+
.awsui-motion-disabled .awsui_calendar_mgja0_15dh9_93:not(#\9), .awsui-mode-entering .awsui_calendar_mgja0_15dh9_93:not(#\9) {
|
|
112
112
|
animation: none;
|
|
113
113
|
transition: none;
|
|
114
114
|
}
|
|
@@ -117,7 +117,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
117
117
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
118
118
|
SPDX-License-Identifier: Apache-2.0
|
|
119
119
|
*/
|
|
120
|
-
.
|
|
120
|
+
.awsui_root_mgja0_15dh9_120:not(#\9) {
|
|
121
121
|
border-collapse: separate;
|
|
122
122
|
border-spacing: 0;
|
|
123
123
|
box-sizing: border-box;
|
|
@@ -151,35 +151,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
151
151
|
font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
152
152
|
-webkit-font-smoothing: auto;
|
|
153
153
|
-moz-osx-font-smoothing: auto;
|
|
154
|
+
}
|
|
155
|
+
.awsui_root_mgja0_15dh9_120:not(#\9):not(.awsui_wide_mgja0_15dh9_154) {
|
|
154
156
|
max-inline-size: 32em;
|
|
155
157
|
}
|
|
158
|
+
.awsui_root_mgja0_15dh9_120.awsui_wide_mgja0_15dh9_154:not(#\9) {
|
|
159
|
+
max-inline-size: 39em;
|
|
160
|
+
}
|
|
156
161
|
|
|
157
|
-
.awsui_focus-
|
|
162
|
+
.awsui_focus-lock_mgja0_15dh9_161:not(#\9) {
|
|
158
163
|
display: contents;
|
|
159
164
|
}
|
|
160
165
|
|
|
161
|
-
.awsui_trigger-
|
|
166
|
+
.awsui_trigger-wrapper_mgja0_15dh9_165:not(#\9) {
|
|
162
167
|
min-inline-size: calc(var(--size-calendar-grid-width-lrunz7, 238px) + 2 * var(--space-l-t419sm, 20px));
|
|
163
168
|
}
|
|
164
169
|
|
|
165
|
-
.awsui_trigger-
|
|
170
|
+
.awsui_trigger-flexbox_mgja0_15dh9_169:not(#\9) {
|
|
166
171
|
display: flex;
|
|
167
172
|
}
|
|
168
173
|
|
|
169
|
-
.awsui_calendar-
|
|
174
|
+
.awsui_calendar-container_mgja0_15dh9_173:not(#\9) {
|
|
170
175
|
inline-size: calc(2 * var(--size-calendar-grid-width-lrunz7, 238px) + var(--space-xs-zb16t3, 8px));
|
|
171
176
|
}
|
|
172
|
-
.awsui_calendar-
|
|
177
|
+
.awsui_calendar-container_mgja0_15dh9_173.awsui_one-grid_mgja0_15dh9_176:not(#\9) {
|
|
173
178
|
inline-size: var(--size-calendar-grid-width-lrunz7, 238px);
|
|
174
179
|
}
|
|
175
180
|
|
|
176
|
-
.awsui_calendar-
|
|
181
|
+
.awsui_calendar-header_mgja0_15dh9_180:not(#\9) {
|
|
177
182
|
display: flex;
|
|
178
183
|
justify-content: space-between;
|
|
179
184
|
align-items: center;
|
|
180
185
|
position: relative;
|
|
181
186
|
}
|
|
182
|
-
.awsui_calendar-header-months-
|
|
187
|
+
.awsui_calendar-header-months-wrapper_mgja0_15dh9_186:not(#\9) {
|
|
183
188
|
position: absolute;
|
|
184
189
|
inset: 0;
|
|
185
190
|
margin-block: 0;
|
|
@@ -190,7 +195,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
190
195
|
flex: 1;
|
|
191
196
|
pointer-events: none;
|
|
192
197
|
}
|
|
193
|
-
.awsui_calendar-header-
|
|
198
|
+
.awsui_calendar-header-month_mgja0_15dh9_186:not(#\9) {
|
|
194
199
|
font-size: var(--font-size-body-m-x4okxb, 14px);
|
|
195
200
|
line-height: var(--line-height-body-m-30ar75, 20px);
|
|
196
201
|
font-weight: 700;
|
|
@@ -198,32 +203,32 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
198
203
|
display: flex;
|
|
199
204
|
pointer-events: auto;
|
|
200
205
|
}
|
|
201
|
-
.awsui_calendar-next-month-
|
|
206
|
+
.awsui_calendar-next-month-btn_mgja0_15dh9_205:not(#\9) {
|
|
202
207
|
/* used for identifying element */
|
|
203
208
|
}
|
|
204
|
-
.awsui_calendar-prev-month-
|
|
209
|
+
.awsui_calendar-prev-month-btn_mgja0_15dh9_208:not(#\9) {
|
|
205
210
|
/* used for identifying element */
|
|
206
211
|
}
|
|
207
212
|
|
|
208
|
-
.awsui_first-
|
|
209
|
-
.awsui_second-
|
|
213
|
+
.awsui_first-grid_mgja0_15dh9_212:not(#\9),
|
|
214
|
+
.awsui_second-grid_mgja0_15dh9_213:not(#\9) {
|
|
210
215
|
/* used in test-utils */
|
|
211
216
|
}
|
|
212
217
|
|
|
213
|
-
.awsui_date-and-time-
|
|
218
|
+
.awsui_date-and-time-container_mgja0_15dh9_217:not(#\9) {
|
|
214
219
|
display: grid;
|
|
215
220
|
grid-template-columns: repeat(auto-fit, minmax(var(--size-calendar-grid-width-lrunz7, 238px), 1fr));
|
|
216
221
|
gap: var(--space-xs-zb16t3, 8px);
|
|
217
222
|
}
|
|
218
223
|
|
|
219
|
-
.awsui_date-and-time-
|
|
224
|
+
.awsui_date-and-time-wrapper_mgja0_15dh9_223:not(#\9) {
|
|
220
225
|
inline-size: var(--size-calendar-grid-width-lrunz7, 238px);
|
|
221
226
|
display: grid;
|
|
222
227
|
gap: var(--space-xs-zb16t3, 8px);
|
|
223
228
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
224
229
|
}
|
|
225
230
|
|
|
226
|
-
.
|
|
231
|
+
.awsui_footer_mgja0_15dh9_230:not(#\9) {
|
|
227
232
|
display: flex;
|
|
228
233
|
flex-wrap: wrap;
|
|
229
234
|
justify-content: flex-end;
|
|
@@ -232,51 +237,51 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
232
237
|
padding-block-end: var(--space-s-34lx8l, 12px);
|
|
233
238
|
padding-inline: var(--space-l-t419sm, 20px);
|
|
234
239
|
}
|
|
235
|
-
.
|
|
240
|
+
.awsui_footer_mgja0_15dh9_230.awsui_has-clear-button_mgja0_15dh9_239:not(#\9) {
|
|
236
241
|
justify-content: space-between;
|
|
237
242
|
}
|
|
238
|
-
.
|
|
243
|
+
.awsui_footer_mgja0_15dh9_230.awsui_one-grid_mgja0_15dh9_176:not(#\9) {
|
|
239
244
|
padding-block-start: 0;
|
|
240
245
|
padding-block-end: var(--space-s-34lx8l, 12px);
|
|
241
246
|
padding-inline: var(--space-xs-zb16t3, 8px);
|
|
242
247
|
}
|
|
243
248
|
|
|
244
|
-
.awsui_footer-button-
|
|
249
|
+
.awsui_footer-button-wrapper_mgja0_15dh9_248:not(#\9) {
|
|
245
250
|
padding-block-start: var(--space-s-34lx8l, 12px);
|
|
246
251
|
}
|
|
247
|
-
.awsui_footer-button-
|
|
252
|
+
.awsui_footer-button-wrapper_mgja0_15dh9_248:not(#\9):last-child {
|
|
248
253
|
margin-inline-start: auto;
|
|
249
254
|
}
|
|
250
255
|
|
|
251
|
-
.awsui_icon-
|
|
256
|
+
.awsui_icon-wrapper_mgja0_15dh9_255:not(#\9) {
|
|
252
257
|
color: var(--color-text-interactive-default-lnx6lk, #414d5c);
|
|
253
258
|
margin-inline-end: var(--space-xs-zb16t3, 8px);
|
|
254
259
|
}
|
|
255
260
|
|
|
256
|
-
.
|
|
261
|
+
.awsui_label_mgja0_15dh9_260:not(#\9) {
|
|
257
262
|
-webkit-user-select: text;
|
|
258
263
|
user-select: text;
|
|
259
264
|
cursor: default;
|
|
260
265
|
}
|
|
261
266
|
|
|
262
|
-
.
|
|
267
|
+
.awsui_label_mgja0_15dh9_260.awsui_label-enabled_mgja0_15dh9_265:not(#\9):hover > .awsui_trigger-flexbox_mgja0_15dh9_169 > .awsui_icon-wrapper_mgja0_15dh9_255 {
|
|
263
268
|
color: var(--color-text-interactive-hover-mj8add, #000716);
|
|
264
269
|
}
|
|
265
270
|
|
|
266
|
-
.awsui_label-
|
|
271
|
+
.awsui_label-text_mgja0_15dh9_269:not(#\9) {
|
|
267
272
|
color: var(--color-text-input-placeholder-mx1ygd, #5f6b7a);
|
|
268
273
|
font-style: italic;
|
|
269
274
|
}
|
|
270
275
|
|
|
271
|
-
.awsui_label-token-
|
|
276
|
+
.awsui_label-token-nowrap_mgja0_15dh9_274:not(#\9) {
|
|
272
277
|
white-space: nowrap;
|
|
273
278
|
}
|
|
274
279
|
|
|
275
|
-
.awsui_mode-
|
|
280
|
+
.awsui_mode-switch_mgja0_15dh9_278:not(#\9) {
|
|
276
281
|
/* used in test-utils */
|
|
277
282
|
}
|
|
278
283
|
|
|
279
|
-
.
|
|
284
|
+
.awsui_dropdown_mgja0_15dh9_282:not(#\9) {
|
|
280
285
|
overflow: auto;
|
|
281
286
|
border-block-start: 1px solid var(--color-border-container-top-736buh, transparent);
|
|
282
287
|
border-block-end: 1px solid var(--color-border-container-top-736buh, transparent);
|
|
@@ -285,10 +290,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
285
290
|
border-end-start-radius: var(--border-radius-dropdown-0dhh79, 8px);
|
|
286
291
|
border-end-end-radius: var(--border-radius-dropdown-0dhh79, 8px);
|
|
287
292
|
}
|
|
288
|
-
.
|
|
293
|
+
.awsui_dropdown_mgja0_15dh9_282:not(#\9):focus {
|
|
289
294
|
outline: none;
|
|
290
295
|
}
|
|
291
|
-
body[data-awsui-focus-visible=true] .
|
|
296
|
+
body[data-awsui-focus-visible=true] .awsui_dropdown_mgja0_15dh9_282:not(#\9):focus {
|
|
292
297
|
outline: 2px dotted transparent;
|
|
293
298
|
outline-offset: 2px;
|
|
294
299
|
border-start-start-radius: var(--border-radius-dropdown-0dhh79, 8px);
|
|
@@ -298,43 +303,43 @@ body[data-awsui-focus-visible=true] .awsui_dropdown_mgja0_1nkdu_277:not(#\9):foc
|
|
|
298
303
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
299
304
|
}
|
|
300
305
|
|
|
301
|
-
.awsui_dropdown-
|
|
306
|
+
.awsui_dropdown-content_mgja0_15dh9_304:not(#\9) {
|
|
302
307
|
-webkit-user-select: text;
|
|
303
308
|
user-select: text;
|
|
304
309
|
background-color: var(--color-background-container-content-4un1ap, #ffffff);
|
|
305
310
|
inline-size: calc(2 * var(--size-calendar-grid-width-lrunz7, 238px) + var(--space-xs-zb16t3, 8px) + 2 * var(--space-l-t419sm, 20px));
|
|
306
311
|
}
|
|
307
|
-
.awsui_dropdown-
|
|
312
|
+
.awsui_dropdown-content_mgja0_15dh9_304.awsui_one-grid_mgja0_15dh9_176:not(#\9) {
|
|
308
313
|
inline-size: calc(var(--size-calendar-grid-width-lrunz7, 238px) + 2 * var(--space-l-t419sm, 20px));
|
|
309
314
|
}
|
|
310
315
|
|
|
311
|
-
.awsui_start-date-
|
|
312
|
-
.awsui_start-time-
|
|
313
|
-
.awsui_end-date-
|
|
314
|
-
.awsui_end-time-
|
|
316
|
+
.awsui_start-date-input_mgja0_15dh9_313:not(#\9),
|
|
317
|
+
.awsui_start-time-input_mgja0_15dh9_314:not(#\9),
|
|
318
|
+
.awsui_end-date-input_mgja0_15dh9_315:not(#\9),
|
|
319
|
+
.awsui_end-time-input_mgja0_15dh9_316:not(#\9) {
|
|
315
320
|
/* used in test-utils */
|
|
316
321
|
}
|
|
317
322
|
|
|
318
|
-
.awsui_validation-
|
|
323
|
+
.awsui_validation-section_mgja0_15dh9_320:not(#\9) {
|
|
319
324
|
/* used in test-utils */
|
|
320
325
|
}
|
|
321
326
|
|
|
322
|
-
.awsui_validation-
|
|
327
|
+
.awsui_validation-error_mgja0_15dh9_324:not(#\9) {
|
|
323
328
|
/* used in test-utils */
|
|
324
329
|
}
|
|
325
330
|
|
|
326
|
-
.awsui_clear-
|
|
331
|
+
.awsui_clear-button_mgja0_15dh9_328:not(#\9) {
|
|
327
332
|
/* used in test-utils */
|
|
328
333
|
}
|
|
329
334
|
|
|
330
|
-
.awsui_apply-
|
|
335
|
+
.awsui_apply-button_mgja0_15dh9_332:not(#\9) {
|
|
331
336
|
/* used in test-utils */
|
|
332
337
|
}
|
|
333
338
|
|
|
334
|
-
.awsui_cancel-
|
|
339
|
+
.awsui_cancel-button_mgja0_15dh9_336:not(#\9) {
|
|
335
340
|
/* used in test-utils */
|
|
336
341
|
}
|
|
337
342
|
|
|
338
|
-
.awsui_calendar-aria-
|
|
343
|
+
.awsui_calendar-aria-live_mgja0_15dh9_340:not(#\9) {
|
|
339
344
|
/* used in test-utils */
|
|
340
345
|
}
|
|
@@ -2,43 +2,44 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"calendar": "
|
|
6
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
7
|
-
"root": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"trigger-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"calendar-header
|
|
15
|
-
"calendar-header-
|
|
16
|
-
"calendar-
|
|
17
|
-
"calendar-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"date-and-time-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"label
|
|
28
|
-
"label-
|
|
29
|
-
"label-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"dropdown
|
|
33
|
-
"
|
|
34
|
-
"start-
|
|
35
|
-
"
|
|
36
|
-
"end-
|
|
37
|
-
"
|
|
38
|
-
"validation-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
5
|
+
"calendar": "awsui_calendar_mgja0_15dh9_93",
|
|
6
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_mgja0_15dh9_1",
|
|
7
|
+
"root": "awsui_root_mgja0_15dh9_120",
|
|
8
|
+
"wide": "awsui_wide_mgja0_15dh9_154",
|
|
9
|
+
"focus-lock": "awsui_focus-lock_mgja0_15dh9_161",
|
|
10
|
+
"trigger-wrapper": "awsui_trigger-wrapper_mgja0_15dh9_165",
|
|
11
|
+
"trigger-flexbox": "awsui_trigger-flexbox_mgja0_15dh9_169",
|
|
12
|
+
"calendar-container": "awsui_calendar-container_mgja0_15dh9_173",
|
|
13
|
+
"one-grid": "awsui_one-grid_mgja0_15dh9_176",
|
|
14
|
+
"calendar-header": "awsui_calendar-header_mgja0_15dh9_180",
|
|
15
|
+
"calendar-header-months-wrapper": "awsui_calendar-header-months-wrapper_mgja0_15dh9_186",
|
|
16
|
+
"calendar-header-month": "awsui_calendar-header-month_mgja0_15dh9_186",
|
|
17
|
+
"calendar-next-month-btn": "awsui_calendar-next-month-btn_mgja0_15dh9_205",
|
|
18
|
+
"calendar-prev-month-btn": "awsui_calendar-prev-month-btn_mgja0_15dh9_208",
|
|
19
|
+
"first-grid": "awsui_first-grid_mgja0_15dh9_212",
|
|
20
|
+
"second-grid": "awsui_second-grid_mgja0_15dh9_213",
|
|
21
|
+
"date-and-time-container": "awsui_date-and-time-container_mgja0_15dh9_217",
|
|
22
|
+
"date-and-time-wrapper": "awsui_date-and-time-wrapper_mgja0_15dh9_223",
|
|
23
|
+
"footer": "awsui_footer_mgja0_15dh9_230",
|
|
24
|
+
"has-clear-button": "awsui_has-clear-button_mgja0_15dh9_239",
|
|
25
|
+
"footer-button-wrapper": "awsui_footer-button-wrapper_mgja0_15dh9_248",
|
|
26
|
+
"icon-wrapper": "awsui_icon-wrapper_mgja0_15dh9_255",
|
|
27
|
+
"label": "awsui_label_mgja0_15dh9_260",
|
|
28
|
+
"label-enabled": "awsui_label-enabled_mgja0_15dh9_265",
|
|
29
|
+
"label-text": "awsui_label-text_mgja0_15dh9_269",
|
|
30
|
+
"label-token-nowrap": "awsui_label-token-nowrap_mgja0_15dh9_274",
|
|
31
|
+
"mode-switch": "awsui_mode-switch_mgja0_15dh9_278",
|
|
32
|
+
"dropdown": "awsui_dropdown_mgja0_15dh9_282",
|
|
33
|
+
"dropdown-content": "awsui_dropdown-content_mgja0_15dh9_304",
|
|
34
|
+
"start-date-input": "awsui_start-date-input_mgja0_15dh9_313",
|
|
35
|
+
"start-time-input": "awsui_start-time-input_mgja0_15dh9_314",
|
|
36
|
+
"end-date-input": "awsui_end-date-input_mgja0_15dh9_315",
|
|
37
|
+
"end-time-input": "awsui_end-time-input_mgja0_15dh9_316",
|
|
38
|
+
"validation-section": "awsui_validation-section_mgja0_15dh9_320",
|
|
39
|
+
"validation-error": "awsui_validation-error_mgja0_15dh9_324",
|
|
40
|
+
"clear-button": "awsui_clear-button_mgja0_15dh9_328",
|
|
41
|
+
"apply-button": "awsui_apply-button_mgja0_15dh9_332",
|
|
42
|
+
"cancel-button": "awsui_cancel-button_mgja0_15dh9_336",
|
|
43
|
+
"calendar-aria-live": "awsui_calendar-aria-live_mgja0_15dh9_340"
|
|
43
44
|
};
|
|
44
45
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
2
|
-
import {
|
|
2
|
+
import { formatTimeOffsetISO, parseTimezoneOffset, shiftTimezoneOffset } from '../internal/utils/date-time';
|
|
3
3
|
import { addMinutes } from 'date-fns';
|
|
4
4
|
/**
|
|
5
5
|
* Appends a time zone offset to an offset-less date string.
|
|
@@ -10,8 +10,8 @@ export function setTimeOffset(value, timeOffset) {
|
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
12
12
|
type: 'absolute',
|
|
13
|
-
startDate: value.startDate +
|
|
14
|
-
endDate: value.endDate +
|
|
13
|
+
startDate: value.startDate + formatTimeOffsetISO(value.startDate, timeOffset.startDate),
|
|
14
|
+
endDate: value.endDate + formatTimeOffsetISO(value.endDate, timeOffset.endDate),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-offset.js","sourceRoot":"lib/default/","sources":["date-range-picker/time-offset.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"time-offset.js","sourceRoot":"lib/default/","sources":["date-range-picker/time-offset.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAwC,EACxC,UAAoD;IAEpD,IAAI,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,UAAU,CAAC,EAAE;QACjC,OAAO,KAAK,CAAC;KACd;IACD,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC;QACvF,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;KAChF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAwC,EACxC,UAAoD;IAEpD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;QACvC,OAAO,KAAK,CAAC;KACd;IAED;;;;;MAKE;IACF,MAAM,aAAa,GAAG,iFAAiF,CAAC;IAExG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QAC9E,QAAQ,CACN,iBAAiB,EACjB,sGAAsG;YACpG,uEAAuE,CAC1E,CAAC;QACF,OAAO,IAAI,CAAC;KACb;IAED,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC;QACrE,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAAwC,EACxC,aAA0D,EAC1D,UAAmB;IAEnB,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;QACtC,IAAI,aAAa,EAAE;YACjB,OAAO;gBACL,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBACvD,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aACpD,CAAC;SACH;aAAM,IAAI,UAAU,KAAK,SAAS,EAAE;YACnC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;SACvD;KACF;IACD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;;;EAeE;AACF,SAAS,YAAY,CAAC,aAAqB;IACzC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;IACrC,OAAO,UAAU,CAAC,IAAI,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps } from './interfaces';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { formatTimeOffsetISO, parseTimezoneOffset, shiftTimezoneOffset } from '../internal/utils/date-time';\nimport { addMinutes } from 'date-fns';\n\n/**\n * Appends a time zone offset to an offset-less date string.\n */\nexport function setTimeOffset(\n value: DateRangePickerProps.Value | null,\n timeOffset: { startDate?: number; endDate?: number }\n): DateRangePickerProps.Value | null {\n if (!(value?.type === 'absolute')) {\n return value;\n }\n return {\n type: 'absolute',\n startDate: value.startDate + formatTimeOffsetISO(value.startDate, timeOffset.startDate),\n endDate: value.endDate + formatTimeOffsetISO(value.endDate, timeOffset.endDate),\n };\n}\n\n/**\n * Re-formats an absolute date range so that it is expressed using the\n * target time offset. The returned value still represents the same range\n * in time, but contains no visible offset.\n */\nexport function shiftTimeOffset(\n value: null | DateRangePickerProps.Value,\n timeOffset: { startDate?: number; endDate?: number }\n): DateRangePickerProps.Value | null {\n if (!value || value.type !== 'absolute') {\n return value;\n }\n\n /*\n This regex matches an ISO date-time with\n - optional seconds;\n - optional milliseconds;\n - optional time offset or 'Z'.\n */\n const dateTimeRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d{1,3})?(((\\+|-)\\d{2}(:\\d{2})?)|Z)?$/;\n\n if (!dateTimeRegex.test(value.startDate) || !dateTimeRegex.test(value.endDate)) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided a misformatted start or end date. The component will fall back to an empty value. ' +\n 'Dates have to be ISO8601-formatted with an optional time zone offset.'\n );\n return null;\n }\n\n return {\n type: 'absolute',\n startDate: shiftTimezoneOffset(value.startDate, timeOffset.startDate),\n endDate: shiftTimezoneOffset(value.endDate, timeOffset.endDate),\n };\n}\n\nexport function normalizeTimeOffset(\n value: null | DateRangePickerProps.Value,\n getTimeOffset?: DateRangePickerProps.GetTimeOffsetFunction,\n timeOffset?: number\n) {\n if (value && value.type === 'absolute') {\n if (getTimeOffset) {\n return {\n startDate: getTimeOffset(parseDateUTC(value.startDate)),\n endDate: getTimeOffset(parseDateUTC(value.endDate)),\n };\n } else if (timeOffset !== undefined) {\n return { startDate: timeOffset, endDate: timeOffset };\n }\n }\n return { startDate: undefined, endDate: undefined };\n}\n\n/*\n Before the getTimeOffset function is used there is no information on the preferred time offset.\n \n Besides, the ISO date string might or might not contain the offset:\n - 2021-02-03T01:02:03\n - 2021-02-03T01:02:03Z\n - 2021-02-03T01:02:03+01:00\n \n For every value above the date is converted to UTC and the following is true:\n date.getUTCFullYear() === 2021\n date.getUTCMonth() === 1\n date.getUTCDate() === 3\n date.getUTCHours() === 1\n date.getUTCMinutes() === 2\n date.getUTCSeconds() === 3\n*/\nfunction parseDateUTC(isoDateString: string): Date {\n const date = new Date(isoDateString);\n return addMinutes(date, parseTimezoneOffset(isoDateString));\n}\n"]}
|
|
@@ -17,7 +17,7 @@ export function useSingleTabStopNavigation(focusable, options) {
|
|
|
17
17
|
const navigationDisabled = (options === null || options === void 0 ? void 0 : options.tabIndex) && (options === null || options === void 0 ? void 0 : options.tabIndex) < 0;
|
|
18
18
|
const navigationActive = contextNavigationActive && !navigationDisabled;
|
|
19
19
|
useEffect(() => {
|
|
20
|
-
if (
|
|
20
|
+
if (navigationActive && focusable && focusable.current) {
|
|
21
21
|
const unregister = registerFocusable(focusable.current, isFocusable => setFocusTargetActive(isFocusable));
|
|
22
22
|
return () => unregister();
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-tab-stop-navigation-context.js","sourceRoot":"lib/default/","sources":["internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQvE,MAAM,CAAC,MAAM,YAAY,GAGrB;IACF,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CACxC,SAA0C,EAC1C,OAA+B;;IAE/B,MAAM,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,8BAA8B,CAAC,CAAC;IACpH,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,kBAAkB,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,IAAG,CAAC,CAAC;IACtE,MAAM,gBAAgB,GAAG,uBAAuB,IAAI,CAAC,kBAAkB,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,
|
|
1
|
+
{"version":3,"file":"single-tab-stop-navigation-context.js","sourceRoot":"lib/default/","sources":["internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQvE,MAAM,CAAC,MAAM,YAAY,GAGrB;IACF,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CACxC,SAA0C,EAC1C,OAA+B;;IAE/B,MAAM,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,8BAA8B,CAAC,CAAC;IACpH,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,kBAAkB,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,IAAG,CAAC,CAAC;IACtE,MAAM,gBAAgB,GAAG,uBAAuB,IAAI,CAAC,kBAAkB,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,IAAI,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE;YACtD,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC;YAC1G,OAAO,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC;SAC3B;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC;IACjC,IAAI,gBAAgB,EAAE;QACpB,QAAQ,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,CAAC,CAAC;KAC7D;IAED,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC;AACxC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nexport type FocusableChangeHandler = (isFocusable: boolean) => void;\n\nexport interface SingleTabStopNavigationOptions {\n tabIndex?: number;\n}\n\nexport const defaultValue: {\n navigationActive: boolean;\n registerFocusable(focusable: Element, handler: FocusableChangeHandler): () => void;\n} = {\n navigationActive: false,\n registerFocusable: () => () => {},\n};\n\n/**\n * Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.\n * It instructs interactive elements to override tab indices for just a single one to remain user-focusable.\n */\nexport const SingleTabStopNavigationContext = createContext(defaultValue);\n\nexport function useSingleTabStopNavigation(\n focusable: null | React.RefObject<Element>,\n options?: { tabIndex?: number }\n) {\n const { navigationActive: contextNavigationActive, registerFocusable } = useContext(SingleTabStopNavigationContext);\n const [focusTargetActive, setFocusTargetActive] = useState(false);\n const navigationDisabled = options?.tabIndex && options?.tabIndex < 0;\n const navigationActive = contextNavigationActive && !navigationDisabled;\n\n useEffect(() => {\n if (navigationActive && focusable && focusable.current) {\n const unregister = registerFocusable(focusable.current, isFocusable => setFocusTargetActive(isFocusable));\n return () => unregister();\n }\n });\n\n let tabIndex = options?.tabIndex;\n if (navigationActive) {\n tabIndex = !focusTargetActive ? -1 : options?.tabIndex ?? 0;\n }\n\n return { navigationActive, tabIndex };\n}\n"]}
|
package/internal/environment.js
CHANGED
package/internal/manifest.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date-iso.d.ts","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-iso.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,WAAW,EACvB,IAAI,EAAE,OAAO,EACb,cAAc,EACd,UAAU,EACV,UAAU,GACX,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,UAGA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { formatTimeOffsetISO } from './format-time-offset';
|
|
4
|
+
export default function ({ date: isoDate, hideTimeOffset, isDateOnly, timeOffset, }) {
|
|
5
|
+
const formattedOffset = hideTimeOffset || isDateOnly ? '' : formatTimeOffsetISO(isoDate, timeOffset);
|
|
6
|
+
return isoDate + formattedOffset;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=format-date-iso.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date-iso.js","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-iso.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,CAAC,OAAO,WAAW,EACvB,IAAI,EAAE,OAAO,EACb,cAAc,EACd,UAAU,EACV,UAAU,GAMX;IACC,MAAM,eAAe,GAAG,cAAc,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrG,OAAO,OAAO,GAAG,eAAe,CAAC;AACnC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { formatTimeOffsetISO } from './format-time-offset';\n\nexport default function ({\n date: isoDate,\n hideTimeOffset,\n isDateOnly,\n timeOffset,\n}: {\n date: string;\n hideTimeOffset?: boolean;\n isDateOnly: boolean;\n timeOffset?: number;\n}) {\n const formattedOffset = hideTimeOffset || isDateOnly ? '' : formatTimeOffsetISO(isoDate, timeOffset);\n return isoDate + formattedOffset;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default function formatDateLocalized({ date: isoDate, hideTimeOffset, isDateOnly, timeOffset, locale, }: {
|
|
2
|
+
date: string;
|
|
3
|
+
hideTimeOffset?: boolean;
|
|
4
|
+
isDateOnly: boolean;
|
|
5
|
+
timeOffset?: number;
|
|
6
|
+
locale?: string;
|
|
7
|
+
}): string;
|
|
8
|
+
//# sourceMappingURL=format-date-localized.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date-localized.d.ts","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-localized.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,IAAI,EAAE,OAAO,EACb,cAAc,EACd,UAAU,EACV,UAAU,EACV,MAAM,GACP,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,UA4BA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { formatTimeOffsetLocalized } from './format-time-offset';
|
|
4
|
+
export default function formatDateLocalized({ date: isoDate, hideTimeOffset, isDateOnly, timeOffset, locale, }) {
|
|
5
|
+
const date = new Date(isoDate);
|
|
6
|
+
const formattedDate = new Intl.DateTimeFormat(locale, {
|
|
7
|
+
day: 'numeric',
|
|
8
|
+
month: 'long',
|
|
9
|
+
year: 'numeric',
|
|
10
|
+
}).format(date);
|
|
11
|
+
if (isDateOnly) {
|
|
12
|
+
return formattedDate;
|
|
13
|
+
}
|
|
14
|
+
const formattedTime = new Intl.DateTimeFormat(locale, {
|
|
15
|
+
hour: '2-digit',
|
|
16
|
+
hourCycle: 'h23',
|
|
17
|
+
minute: '2-digit',
|
|
18
|
+
second: '2-digit',
|
|
19
|
+
}).format(date);
|
|
20
|
+
const formattedDateTime = formattedDate + getDateTimeSeparator(locale) + formattedTime;
|
|
21
|
+
if (hideTimeOffset) {
|
|
22
|
+
return formattedDateTime;
|
|
23
|
+
}
|
|
24
|
+
const formattedTimeOffset = formatTimeOffsetLocalized(isoDate, timeOffset);
|
|
25
|
+
return formattedDateTime + ' ' + formattedTimeOffset;
|
|
26
|
+
}
|
|
27
|
+
// Languages in which date and time are separated just with a space, without comma
|
|
28
|
+
const languagesWithoutDateTimeSeparator = ['ja', 'zh-CN', 'zh-TW'];
|
|
29
|
+
function getDateTimeSeparator(locale) {
|
|
30
|
+
return locale && languagesWithoutDateTimeSeparator.includes(locale) ? ' ' : ', ';
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=format-date-localized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-date-localized.js","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-localized.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,IAAI,EAAE,OAAO,EACb,cAAc,EACd,UAAU,EACV,UAAU,EACV,MAAM,GAOP;IACC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QACpD,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhB,IAAI,UAAU,EAAE;QACd,OAAO,aAAa,CAAC;KACtB;IAED,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QACpD,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhB,MAAM,iBAAiB,GAAG,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;IAEvF,IAAI,cAAc,EAAE;QAClB,OAAO,iBAAiB,CAAC;KAC1B;IAED,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3E,OAAO,iBAAiB,GAAG,GAAG,GAAG,mBAAmB,CAAC;AACvD,CAAC;AAED,kFAAkF;AAClF,MAAM,iCAAiC,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEnE,SAAS,oBAAoB,CAAC,MAAe;IAC3C,OAAO,MAAM,IAAI,iCAAiC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACnF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { formatTimeOffsetLocalized } from './format-time-offset';\n\nexport default function formatDateLocalized({\n date: isoDate,\n hideTimeOffset,\n isDateOnly,\n timeOffset,\n locale,\n}: {\n date: string;\n hideTimeOffset?: boolean;\n isDateOnly: boolean;\n timeOffset?: number;\n locale?: string;\n}) {\n const date = new Date(isoDate);\n\n const formattedDate = new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n }).format(date);\n\n if (isDateOnly) {\n return formattedDate;\n }\n\n const formattedTime = new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n hourCycle: 'h23',\n minute: '2-digit',\n second: '2-digit',\n }).format(date);\n\n const formattedDateTime = formattedDate + getDateTimeSeparator(locale) + formattedTime;\n\n if (hideTimeOffset) {\n return formattedDateTime;\n }\n\n const formattedTimeOffset = formatTimeOffsetLocalized(isoDate, timeOffset);\n return formattedDateTime + ' ' + formattedTimeOffset;\n}\n\n// Languages in which date and time are separated just with a space, without comma\nconst languagesWithoutDateTimeSeparator = ['ja', 'zh-CN', 'zh-TW'];\n\nfunction getDateTimeSeparator(locale?: string) {\n return locale && languagesWithoutDateTimeSeparator.includes(locale) ? ' ' : ', ';\n}\n"]}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { DateRangePickerProps } from '../../../date-range-picker/interfaces';
|
|
2
|
+
export declare function formatDateRange({ startDate, endDate, timeOffset, hideTimeOffset, format, locale, }: {
|
|
3
|
+
startDate: string;
|
|
4
|
+
endDate: string;
|
|
5
|
+
hideTimeOffset?: boolean;
|
|
6
|
+
timeOffset: {
|
|
7
|
+
startDate?: number;
|
|
8
|
+
endDate?: number;
|
|
9
|
+
};
|
|
10
|
+
format: DateRangePickerProps.AbsoluteFormat;
|
|
11
|
+
locale?: string;
|
|
4
12
|
}): string;
|
|
5
13
|
//# sourceMappingURL=format-date-range.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-date-range.d.ts","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-range.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"format-date-range.d.ts","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-range.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,MAAM,EAAE,oBAAoB,CAAC,cAAc,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAqBT"}
|
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { formatTimezoneOffset } from './format-timezone-offset';
|
|
4
3
|
import { isIsoDateOnly } from './is-iso-date-only';
|
|
5
|
-
|
|
4
|
+
import formatDateIso from './format-date-iso';
|
|
5
|
+
import formatDateLocalized from './format-date-localized';
|
|
6
|
+
export function formatDateRange({ startDate, endDate, timeOffset, hideTimeOffset, format, locale, }) {
|
|
6
7
|
const isDateOnly = isIsoDateOnly(startDate) && isIsoDateOnly(endDate);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
return (formatDate({
|
|
9
|
+
date: startDate,
|
|
10
|
+
format,
|
|
11
|
+
hideTimeOffset,
|
|
12
|
+
isDateOnly,
|
|
13
|
+
timeOffset: timeOffset.startDate,
|
|
14
|
+
locale,
|
|
15
|
+
}) +
|
|
16
|
+
' — ' +
|
|
17
|
+
formatDate({
|
|
18
|
+
date: endDate,
|
|
19
|
+
format,
|
|
20
|
+
hideTimeOffset,
|
|
21
|
+
isDateOnly,
|
|
22
|
+
timeOffset: timeOffset.endDate,
|
|
23
|
+
locale,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
function formatDate({ date, format, hideTimeOffset, isDateOnly, timeOffset, locale, }) {
|
|
27
|
+
switch (format) {
|
|
28
|
+
case 'long-localized': {
|
|
29
|
+
return formatDateLocalized({ date, hideTimeOffset, isDateOnly, locale, timeOffset });
|
|
30
|
+
}
|
|
31
|
+
default: {
|
|
32
|
+
return formatDateIso({ date, hideTimeOffset, isDateOnly, timeOffset });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
10
35
|
}
|
|
11
36
|
//# sourceMappingURL=format-date-range.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-date-range.js","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-range.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"format-date-range.js","sourceRoot":"lib/default/","sources":["internal/utils/date-time/format-date-range.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAG1D,MAAM,UAAU,eAAe,CAAC,EAC9B,SAAS,EACT,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,MAAM,GAQP;IACC,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACtE,OAAO,CACL,UAAU,CAAC;QACT,IAAI,EAAE,SAAS;QACf,MAAM;QACN,cAAc;QACd,UAAU;QACV,UAAU,EAAE,UAAU,CAAC,SAAS;QAChC,MAAM;KACP,CAAC;QACF,KAAK;QACL,UAAU,CAAC;YACT,IAAI,EAAE,OAAO;YACb,MAAM;YACN,cAAc;YACd,UAAU;YACV,UAAU,EAAE,UAAU,CAAC,OAAO;YAC9B,MAAM;SACP,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAClB,IAAI,EACJ,MAAM,EACN,cAAc,EACd,UAAU,EACV,UAAU,EACV,MAAM,GAQP;IACC,QAAQ,MAAM,EAAE;QACd,KAAK,gBAAgB,CAAC,CAAC;YACrB,OAAO,mBAAmB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;SACtF;QACD,OAAO,CAAC,CAAC;YACP,OAAO,aAAa,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;SACxE;KACF;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isIsoDateOnly } from './is-iso-date-only';\nimport formatDateIso from './format-date-iso';\nimport formatDateLocalized from './format-date-localized';\nimport { DateRangePickerProps } from '../../../date-range-picker/interfaces';\n\nexport function formatDateRange({\n startDate,\n endDate,\n timeOffset,\n hideTimeOffset,\n format,\n locale,\n}: {\n startDate: string;\n endDate: string;\n hideTimeOffset?: boolean;\n timeOffset: { startDate?: number; endDate?: number };\n format: DateRangePickerProps.AbsoluteFormat;\n locale?: string;\n}): string {\n const isDateOnly = isIsoDateOnly(startDate) && isIsoDateOnly(endDate);\n return (\n formatDate({\n date: startDate,\n format,\n hideTimeOffset,\n isDateOnly,\n timeOffset: timeOffset.startDate,\n locale,\n }) +\n ' — ' +\n formatDate({\n date: endDate,\n format,\n hideTimeOffset,\n isDateOnly,\n timeOffset: timeOffset.endDate,\n locale,\n })\n );\n}\n\nfunction formatDate({\n date,\n format,\n hideTimeOffset,\n isDateOnly,\n timeOffset,\n locale,\n}: {\n date: string;\n format: DateRangePickerProps.AbsoluteFormat;\n hideTimeOffset?: boolean;\n isDateOnly: boolean;\n timeOffset?: number;\n locale?: string;\n}) {\n switch (format) {\n case 'long-localized': {\n return formatDateLocalized({ date, hideTimeOffset, isDateOnly, locale, timeOffset });\n }\n default: {\n return formatDateIso({ date, hideTimeOffset, isDateOnly, timeOffset });\n }\n }\n}\n"]}
|