@haiilo/catalyst 5.4.0 → 6.0.0
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/catalyst/catalyst.css +1071 -0
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.cdn.js +6 -0
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/p-ad5fca6b.entry.js +10 -0
- package/dist/catalyst/p-ad5fca6b.entry.js.map +1 -0
- package/dist/catalyst/p-d7dc291a.js +2 -0
- package/dist/catalyst/p-d7dc291a.js.map +1 -0
- package/dist/catalyst/scss/index.scss +2 -0
- package/dist/catalyst/scss/vendor/_flatpickr.scss +314 -0
- package/dist/cjs/{cat-alert_27.cjs.entry.js → cat-alert_25.cjs.entry.js} +2922 -3480
- package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -0
- package/dist/cjs/{cat-icon-registry-228164a1.js → cat-icon-registry-6161e2ee.js} +14 -2
- package/dist/cjs/cat-icon-registry-6161e2ee.js.map +1 -0
- package/dist/cjs/catalyst.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +12 -14
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/cat-avatar/cat-avatar.js +5 -5
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.js +5 -7
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +39 -42
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +22 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.css +6 -369
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +110 -314
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +51 -0
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -0
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +6 -9
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +4 -5
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -6
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +13 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.css +0 -377
- package/dist/collection/components/cat-input/cat-input.js +14 -40
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/input-type.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +11 -13
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +11 -36
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +37 -11
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +2 -3
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +42 -53
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +21 -25
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +4 -7
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +17 -21
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +38 -41
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +17 -22
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/index.cdn.js +6 -0
- package/dist/collection/scss/index.scss +2 -0
- package/dist/collection/scss/vendor/_flatpickr.scss +314 -0
- package/dist/collection/utils/platform.js +1 -1
- package/dist/collection/utils/platform.js.map +1 -1
- package/dist/components/cat-avatar2.js +5 -5
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-button2.js +6 -8
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +14 -15
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-datepicker.js +2725 -3028
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-dropdown2.js +6 -9
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +4 -5
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +2 -6
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +13 -1
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-input2.js +9 -16
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +15 -9
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +5 -12
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable2.js +2 -3
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +21 -25
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select2.js +42 -53
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-tabs.js +4 -7
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +11 -11
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +14 -15
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +17 -22
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/floating-ui.dom.esm.js +55 -68
- package/dist/components/floating-ui.dom.esm.js.map +1 -1
- package/dist/components/index.js +11 -13
- package/dist/components/index.js.map +1 -1
- package/dist/esm/{cat-alert_27.entry.js → cat-alert_25.entry.js} +2922 -3478
- package/dist/esm/cat-alert_25.entry.js.map +1 -0
- package/dist/esm/{cat-icon-registry-4bd597f4.js → cat-icon-registry-f15b29d9.js} +14 -2
- package/dist/esm/cat-icon-registry-f15b29d9.js.map +1 -0
- package/dist/esm/catalyst.js +1 -1
- package/dist/esm/index.js +13 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/@types/Intl.d.ts +3 -0
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +11 -9
- package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +1 -0
- package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +21 -65
- package/dist/types/components/cat-datepicker/cat-datepicker.locale.d.ts +3 -0
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +3 -0
- package/dist/types/components/cat-input/cat-input.d.ts +2 -6
- package/dist/types/components/cat-input/input-type.d.ts +1 -1
- package/dist/types/components/cat-pagination/cat-pagination.d.ts +1 -1
- package/dist/types/components/cat-radio/cat-radio.d.ts +3 -7
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +6 -1
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +4 -4
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +10 -8
- package/dist/types/components.d.ts +83 -417
- package/package.json +8 -10
- package/dist/catalyst/p-34e0cbba.entry.js +0 -10
- package/dist/catalyst/p-34e0cbba.entry.js.map +0 -1
- package/dist/catalyst/p-cf32399c.js +0 -2
- package/dist/catalyst/p-cf32399c.js.map +0 -1
- package/dist/cjs/cat-alert_27.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-228164a1.js.map +0 -1
- package/dist/collection/components/cat-datepicker/datepicker-type.js +0 -8
- package/dist/collection/components/cat-datepicker/datepicker-type.js.map +0 -1
- package/dist/collection/components/cat-datepicker/dayjs.config.js +0 -8
- package/dist/collection/components/cat-datepicker/dayjs.config.js.map +0 -1
- package/dist/collection/components/cat-datepicker/vanillajs-datepicker.config.js +0 -46
- package/dist/collection/components/cat-datepicker/vanillajs-datepicker.config.js.map +0 -1
- package/dist/collection/components/cat-label/cat-label.css +0 -22
- package/dist/collection/components/cat-label/cat-label.js +0 -134
- package/dist/collection/components/cat-label/cat-label.js.map +0 -1
- package/dist/collection/components/cat-timepicker/cat-timepicker.css +0 -5
- package/dist/collection/components/cat-timepicker/cat-timepicker.js +0 -668
- package/dist/collection/components/cat-timepicker/cat-timepicker.js.map +0 -1
- package/dist/components/cat-label.d.ts +0 -11
- package/dist/components/cat-label.js +0 -73
- package/dist/components/cat-label.js.map +0 -1
- package/dist/components/cat-timepicker.d.ts +0 -11
- package/dist/components/cat-timepicker.js +0 -258
- package/dist/components/cat-timepicker.js.map +0 -1
- package/dist/esm/cat-alert_27.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-4bd597f4.js.map +0 -1
- package/dist/types/components/cat-datepicker/datepicker-type.d.ts +0 -7
- package/dist/types/components/cat-datepicker/datepicker.d.ts +0 -1
- package/dist/types/components/cat-datepicker/dayjs.config.d.ts +0 -3
- package/dist/types/components/cat-datepicker/vanillajs-datepicker.config.d.ts +0 -4
- package/dist/types/components/cat-label/cat-label.d.ts +0 -27
- package/dist/types/components/cat-timepicker/cat-timepicker.d.ts +0 -158
|
@@ -328,383 +328,6 @@
|
|
|
328
328
|
margin-left: 0;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
.datepicker {
|
|
332
|
-
width: min-content;
|
|
333
|
-
}
|
|
334
|
-
.datepicker:not(.active) {
|
|
335
|
-
display: none;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.datepicker-dropdown {
|
|
339
|
-
position: absolute;
|
|
340
|
-
z-index: 20;
|
|
341
|
-
padding-top: 4px;
|
|
342
|
-
}
|
|
343
|
-
.datepicker-dropdown.datepicker-orient-top {
|
|
344
|
-
padding-top: 0;
|
|
345
|
-
padding-bottom: 4px;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.datepicker-picker {
|
|
349
|
-
display: flex;
|
|
350
|
-
flex-direction: column;
|
|
351
|
-
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
352
|
-
background-color: white;
|
|
353
|
-
}
|
|
354
|
-
.datepicker-dropdown .datepicker-picker {
|
|
355
|
-
box-shadow: 0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.datepicker-main {
|
|
359
|
-
flex: auto;
|
|
360
|
-
padding: 2px;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.datepicker-footer {
|
|
364
|
-
box-shadow: none;
|
|
365
|
-
background-color: transparent;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.datepicker-title {
|
|
369
|
-
box-shadow: none;
|
|
370
|
-
background-color: hsl(0, 0%, 96%);
|
|
371
|
-
padding: 0.375rem 0.75rem;
|
|
372
|
-
text-align: center;
|
|
373
|
-
font-weight: 700;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.datepicker-controls {
|
|
377
|
-
display: flex;
|
|
378
|
-
}
|
|
379
|
-
.datepicker-header .datepicker-controls {
|
|
380
|
-
padding: 2px 2px 0;
|
|
381
|
-
}
|
|
382
|
-
.datepicker-controls .button {
|
|
383
|
-
display: inline-flex;
|
|
384
|
-
position: relative;
|
|
385
|
-
align-items: center;
|
|
386
|
-
justify-content: center;
|
|
387
|
-
margin: 0;
|
|
388
|
-
border: 1px solid rgb(var(--cat-border-color, 235, 236, 240));
|
|
389
|
-
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
390
|
-
box-shadow: none;
|
|
391
|
-
background-color: hsl(0, 0%, 100%);
|
|
392
|
-
cursor: pointer;
|
|
393
|
-
padding: calc(0.375em - 1px) 0.75em;
|
|
394
|
-
height: 2.25em;
|
|
395
|
-
vertical-align: top;
|
|
396
|
-
text-align: center;
|
|
397
|
-
line-height: 1.5;
|
|
398
|
-
white-space: nowrap;
|
|
399
|
-
color: hsl(0, 0%, 21%);
|
|
400
|
-
font-size: 0.9375rem;
|
|
401
|
-
}
|
|
402
|
-
.datepicker-controls .button:focus, .datepicker-controls .button:active {
|
|
403
|
-
outline: none;
|
|
404
|
-
}
|
|
405
|
-
.datepicker-controls .button:hover {
|
|
406
|
-
border-color: #b8b8b8;
|
|
407
|
-
color: hsl(0, 0%, 21%);
|
|
408
|
-
}
|
|
409
|
-
.datepicker-controls .button:focus {
|
|
410
|
-
border-color: hsl(217, 71%, 53%);
|
|
411
|
-
color: hsl(0, 0%, 21%);
|
|
412
|
-
}
|
|
413
|
-
.datepicker-controls .button:focus:not(:active) {
|
|
414
|
-
box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
|
|
415
|
-
}
|
|
416
|
-
.datepicker-controls .button:active {
|
|
417
|
-
border-color: #474747;
|
|
418
|
-
color: hsl(0, 0%, 21%);
|
|
419
|
-
}
|
|
420
|
-
.datepicker-controls .button[disabled] {
|
|
421
|
-
cursor: not-allowed;
|
|
422
|
-
}
|
|
423
|
-
.datepicker-header .datepicker-controls .button {
|
|
424
|
-
border-color: transparent;
|
|
425
|
-
font-weight: bold;
|
|
426
|
-
}
|
|
427
|
-
.datepicker-header .datepicker-controls .button:hover {
|
|
428
|
-
background-color: #f2f4f7;
|
|
429
|
-
}
|
|
430
|
-
.datepicker-header .datepicker-controls .button:active {
|
|
431
|
-
background-color: #f2f4f7;
|
|
432
|
-
}
|
|
433
|
-
.datepicker-footer .datepicker-controls .button {
|
|
434
|
-
flex: auto;
|
|
435
|
-
margin: calc(0.375rem - 1px) 0.375rem;
|
|
436
|
-
border-radius: var(--cat-border-radius-s, 0.125rem);
|
|
437
|
-
font-size: 0.875rem;
|
|
438
|
-
}
|
|
439
|
-
.datepicker-controls .view-switch {
|
|
440
|
-
flex: auto;
|
|
441
|
-
}
|
|
442
|
-
.datepicker-controls .prev-button,
|
|
443
|
-
.datepicker-controls .next-button {
|
|
444
|
-
padding-right: 0.375rem;
|
|
445
|
-
padding-left: 0.375rem;
|
|
446
|
-
flex: 0 0 14.2857142857%;
|
|
447
|
-
}
|
|
448
|
-
.datepicker-controls .prev-button.disabled,
|
|
449
|
-
.datepicker-controls .next-button.disabled {
|
|
450
|
-
visibility: hidden;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.datepicker-view,
|
|
454
|
-
.datepicker-grid {
|
|
455
|
-
display: flex;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
.datepicker-view {
|
|
459
|
-
align-items: stretch;
|
|
460
|
-
width: 17.5rem;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.datepicker-grid {
|
|
464
|
-
flex-wrap: wrap;
|
|
465
|
-
flex: auto;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
.datepicker .days {
|
|
469
|
-
display: flex;
|
|
470
|
-
flex-direction: column;
|
|
471
|
-
flex: auto;
|
|
472
|
-
}
|
|
473
|
-
.datepicker .days-of-week {
|
|
474
|
-
display: flex;
|
|
475
|
-
}
|
|
476
|
-
.datepicker .week-numbers {
|
|
477
|
-
display: flex;
|
|
478
|
-
flex-direction: column;
|
|
479
|
-
flex: 0 0 9.6774193548%;
|
|
480
|
-
}
|
|
481
|
-
.datepicker .weeks {
|
|
482
|
-
display: flex;
|
|
483
|
-
flex-direction: column;
|
|
484
|
-
align-items: stretch;
|
|
485
|
-
flex: auto;
|
|
486
|
-
}
|
|
487
|
-
.datepicker span {
|
|
488
|
-
display: flex;
|
|
489
|
-
align-items: center;
|
|
490
|
-
justify-content: center;
|
|
491
|
-
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
492
|
-
cursor: default;
|
|
493
|
-
-webkit-touch-callout: none;
|
|
494
|
-
user-select: none;
|
|
495
|
-
}
|
|
496
|
-
.datepicker .dow {
|
|
497
|
-
height: 2rem;
|
|
498
|
-
font-size: 0.875rem0.9375rem/2;
|
|
499
|
-
font-weight: 700;
|
|
500
|
-
}
|
|
501
|
-
.datepicker .week {
|
|
502
|
-
flex: auto;
|
|
503
|
-
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
504
|
-
font-size: 0.875rem;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
.datepicker-cell, .datepicker .days .dow {
|
|
508
|
-
flex-basis: 14.2857142857%;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.datepicker-cell {
|
|
512
|
-
height: 2.5rem;
|
|
513
|
-
}
|
|
514
|
-
.datepicker-cell:not(.day) {
|
|
515
|
-
flex-basis: 25%;
|
|
516
|
-
height: 5rem;
|
|
517
|
-
}
|
|
518
|
-
.datepicker-cell:not(.disabled):hover {
|
|
519
|
-
background-color: transparent;
|
|
520
|
-
cursor: pointer;
|
|
521
|
-
}
|
|
522
|
-
.datepicker-cell.focused:not(.selected) {
|
|
523
|
-
background-color: #f2f4f7;
|
|
524
|
-
}
|
|
525
|
-
.datepicker-cell.selected, .datepicker-cell.selected:hover {
|
|
526
|
-
background-color: rgb(var(--cat-primary-bg, 0, 129, 148));
|
|
527
|
-
color: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
528
|
-
font-weight: 700;
|
|
529
|
-
}
|
|
530
|
-
.datepicker-cell.disabled {
|
|
531
|
-
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
532
|
-
}
|
|
533
|
-
.datepicker-cell.prev:not(.disabled), .datepicker-cell.next:not(.disabled) {
|
|
534
|
-
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
535
|
-
}
|
|
536
|
-
.datepicker-cell.prev.selected, .datepicker-cell.next.selected {
|
|
537
|
-
color: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
538
|
-
}
|
|
539
|
-
.datepicker-cell.highlighted:not(.selected):not(.range):not(.today) {
|
|
540
|
-
border-radius: 0;
|
|
541
|
-
background-color: #f2f4f7;
|
|
542
|
-
}
|
|
543
|
-
.datepicker-cell.highlighted:not(.selected):not(.range):not(.today):not(.disabled):hover {
|
|
544
|
-
background-color: #f2f4f7;
|
|
545
|
-
}
|
|
546
|
-
.datepicker-cell.highlighted:not(.selected):not(.range):not(.today).focused {
|
|
547
|
-
background-color: #f2f4f7;
|
|
548
|
-
}
|
|
549
|
-
.datepicker-cell.today:not(.selected) {
|
|
550
|
-
background-color: transparent;
|
|
551
|
-
}
|
|
552
|
-
.datepicker-cell.today:not(.selected):not(.disabled) {
|
|
553
|
-
color: rgb(var(--cat-primary-text, 0, 129, 148));
|
|
554
|
-
}
|
|
555
|
-
.datepicker-cell.today.focused:not(.selected) {
|
|
556
|
-
background-color: #f2f4f7;
|
|
557
|
-
}
|
|
558
|
-
.datepicker-cell.range-end:not(.selected), .datepicker-cell.range-start:not(.selected) {
|
|
559
|
-
background-color: #b8b8b8;
|
|
560
|
-
color: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
561
|
-
}
|
|
562
|
-
.datepicker-cell.range-end.focused:not(.selected), .datepicker-cell.range-start.focused:not(.selected) {
|
|
563
|
-
background-color: #b3b3b3;
|
|
564
|
-
}
|
|
565
|
-
.datepicker-cell.range-start:not(.range-end) {
|
|
566
|
-
border-radius: var(--cat-border-radius-m, 0.25rem) 0 0 var(--cat-border-radius-m, 0.25rem);
|
|
567
|
-
}
|
|
568
|
-
.datepicker-cell.range-end:not(.range-start) {
|
|
569
|
-
border-radius: 0 var(--cat-border-radius-m, 0.25rem) var(--cat-border-radius-m, 0.25rem) 0;
|
|
570
|
-
}
|
|
571
|
-
.datepicker-cell.range {
|
|
572
|
-
border-radius: 0;
|
|
573
|
-
background-color: gainsboro;
|
|
574
|
-
}
|
|
575
|
-
.datepicker-cell.range:not(.disabled):not(.focused):not(.today):hover {
|
|
576
|
-
background-color: #d7d7d7;
|
|
577
|
-
}
|
|
578
|
-
.datepicker-cell.range.disabled {
|
|
579
|
-
color: #c6c6c6;
|
|
580
|
-
}
|
|
581
|
-
.datepicker-cell.range.focused {
|
|
582
|
-
background-color: #d1d1d1;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.datepicker-input.in-edit {
|
|
586
|
-
border-color: #276bda;
|
|
587
|
-
}
|
|
588
|
-
.datepicker-input.in-edit:focus, .datepicker-input.in-edit:active {
|
|
589
|
-
box-shadow: none;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
.datepicker-picker {
|
|
593
|
-
border: 1px solid rgb(var(--cat-border-color, 235, 236, 240));
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
.datepicker-main {
|
|
597
|
-
padding: 0.5rem 1rem;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
.datepicker-view:has(.week-numbers) {
|
|
601
|
-
width: 19.375rem;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
.datepicker-view.months,
|
|
605
|
-
.datepicker-view.years {
|
|
606
|
-
width: 20rem;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
.datepicker .dow,
|
|
610
|
-
.datepicker .week {
|
|
611
|
-
font-size: 0.75rem;
|
|
612
|
-
line-height: 1rem;
|
|
613
|
-
font-weight: 700;
|
|
614
|
-
color: rgb(var(--cat-font-color-muted, 81, 92, 108));
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
.datepicker-cell.today:not(.selected) {
|
|
618
|
-
box-shadow: inset 0 0 0 2px rgb(var(--cat-primary-bg, 0, 129, 148));
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
.datepicker-cell.focused:not(.selected),
|
|
622
|
-
.datepicker-cell:not(.selected):not(.disabled):hover {
|
|
623
|
-
background-color: #f2f4f7;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
.datepicker-controls {
|
|
627
|
-
gap: 0.5rem;
|
|
628
|
-
}
|
|
629
|
-
.datepicker-header .datepicker-controls {
|
|
630
|
-
padding: 1rem 1rem 0;
|
|
631
|
-
}
|
|
632
|
-
.datepicker-header .datepicker-controls .button {
|
|
633
|
-
height: 2.5rem;
|
|
634
|
-
}
|
|
635
|
-
.datepicker-header .datepicker-controls .prev-button,
|
|
636
|
-
.datepicker-header .datepicker-controls .next-button {
|
|
637
|
-
flex-basis: 2.5rem;
|
|
638
|
-
font-size: 1.25rem;
|
|
639
|
-
}
|
|
640
|
-
.datepicker-footer .datepicker-controls {
|
|
641
|
-
padding: 0 1rem 1rem;
|
|
642
|
-
}
|
|
643
|
-
.datepicker-footer .datepicker-controls .button {
|
|
644
|
-
margin: 0;
|
|
645
|
-
height: 2.5rem;
|
|
646
|
-
font-size: 0.9375rem;
|
|
647
|
-
}
|
|
648
|
-
.datepicker-footer .datepicker-controls .button:hover, .datepicker-footer .datepicker-controls .button:active {
|
|
649
|
-
border-color: rgb(var(--cat-border-color-dark, 215, 219, 224));
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1)::before {
|
|
653
|
-
content: "";
|
|
654
|
-
width: 700%;
|
|
655
|
-
height: 100%;
|
|
656
|
-
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
657
|
-
position: absolute;
|
|
658
|
-
top: 0;
|
|
659
|
-
left: 0;
|
|
660
|
-
opacity: 0;
|
|
661
|
-
z-index: 1;
|
|
662
|
-
}
|
|
663
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).today:not(.selected)::before {
|
|
664
|
-
box-shadow: inset 0 0 0 1.5px #008194;
|
|
665
|
-
border-radius: var(--cat-border-radius-m, 0.25rem);
|
|
666
|
-
opacity: 1;
|
|
667
|
-
}
|
|
668
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1):not(:hover)::before {
|
|
669
|
-
background: none;
|
|
670
|
-
}
|
|
671
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1):hover::before {
|
|
672
|
-
opacity: 1;
|
|
673
|
-
background-color: transparent;
|
|
674
|
-
}
|
|
675
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected, .datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected.focused {
|
|
676
|
-
color: white;
|
|
677
|
-
}
|
|
678
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected::before, .datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).selected.focused::before {
|
|
679
|
-
opacity: 1;
|
|
680
|
-
background-color: rgb(var(--cat-primary-bg, 0, 129, 148));
|
|
681
|
-
z-index: -1;
|
|
682
|
-
}
|
|
683
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).focused {
|
|
684
|
-
background: none;
|
|
685
|
-
}
|
|
686
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid :nth-child(7n+1).focused::before {
|
|
687
|
-
opacity: 1;
|
|
688
|
-
background-color: #f2f4f7;
|
|
689
|
-
z-index: -1;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell {
|
|
693
|
-
position: relative;
|
|
694
|
-
}
|
|
695
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.selected, .datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.focused {
|
|
696
|
-
z-index: 2;
|
|
697
|
-
}
|
|
698
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.today:not(.selected) {
|
|
699
|
-
box-shadow: none;
|
|
700
|
-
}
|
|
701
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell:not(.disabled):hover {
|
|
702
|
-
background-color: inherit;
|
|
703
|
-
}
|
|
704
|
-
.datepicker.weekly .datepicker-view:not(.months):not(.years) .datepicker-grid .datepicker-cell.focused {
|
|
705
|
-
background: none;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
331
|
:host {
|
|
709
332
|
display: flex;
|
|
710
333
|
font-size: 0.9375rem;
|
|
@@ -77,17 +77,12 @@ export class CatInput {
|
|
|
77
77
|
async doBlur() {
|
|
78
78
|
this.input.blur();
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* Programmatically simulate a click on the input.
|
|
82
|
-
*/
|
|
83
|
-
async doClick() {
|
|
84
|
-
this.input.click();
|
|
85
|
-
}
|
|
86
80
|
/**
|
|
87
81
|
* Clear the input.
|
|
88
82
|
*/
|
|
89
83
|
async clear() {
|
|
90
84
|
this.value = '';
|
|
85
|
+
this.catChange.emit(this.value);
|
|
91
86
|
}
|
|
92
87
|
watchErrorsHandler(value) {
|
|
93
88
|
if (!coerceBoolean(this.errorUpdate)) {
|
|
@@ -95,7 +90,7 @@ export class CatInput {
|
|
|
95
90
|
}
|
|
96
91
|
else {
|
|
97
92
|
this.errorMapSrc = Array.isArray(value)
|
|
98
|
-
? value.reduce((acc, err) => (
|
|
93
|
+
? value.reduce((acc, err) => ({ ...acc, [err]: undefined }), {})
|
|
99
94
|
: value === true
|
|
100
95
|
? {}
|
|
101
96
|
: value || undefined;
|
|
@@ -103,28 +98,27 @@ export class CatInput {
|
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
100
|
render() {
|
|
106
|
-
var _a, _b, _c;
|
|
107
101
|
return (h("div", { class: {
|
|
108
102
|
'input-field': true,
|
|
109
103
|
'input-horizontal': this.horizontal
|
|
110
104
|
} }, h("div", { class: {
|
|
111
105
|
hidden: this.labelHidden,
|
|
112
106
|
'label-container': true
|
|
113
|
-
} }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" },
|
|
107
|
+
} }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { class: "input-container" }, h("div", { class: {
|
|
114
108
|
'input-wrapper': true,
|
|
115
109
|
'input-round': this.round,
|
|
116
110
|
'input-disabled': this.disabled,
|
|
117
111
|
'input-invalid': this.invalid
|
|
118
|
-
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l" }), h("div", { class: "input-inner-wrapper" }, h("input",
|
|
112
|
+
}, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l" }), h("div", { class: "input-inner-wrapper" }, h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, class: {
|
|
119
113
|
'has-clearable': this.clearable && !this.disabled
|
|
120
|
-
}, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby":
|
|
114
|
+
}, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hint?.length ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t('input.clear'), onClick: this.clear.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l" })), this.invalid && h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), (this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
|
|
121
115
|
}
|
|
122
116
|
get invalid() {
|
|
123
117
|
return !!this.errorMap;
|
|
124
118
|
}
|
|
125
|
-
onInput(
|
|
119
|
+
onInput() {
|
|
126
120
|
this.value = this.input.value;
|
|
127
|
-
this.catChange.emit(
|
|
121
|
+
this.catChange.emit(this.value);
|
|
128
122
|
this.showErrorsIfTimeout();
|
|
129
123
|
}
|
|
130
124
|
onFocus(event) {
|
|
@@ -557,7 +551,7 @@ export class CatInput {
|
|
|
557
551
|
"mutable": false,
|
|
558
552
|
"complexType": {
|
|
559
553
|
"original": "InputType",
|
|
560
|
-
"resolved": "\"
|
|
554
|
+
"resolved": "\"color\" | \"email\" | \"file\" | \"number\" | \"password\" | \"range\" | \"search\" | \"tel\" | \"text\" | \"url\"",
|
|
561
555
|
"references": {
|
|
562
556
|
"InputType": {
|
|
563
557
|
"location": "import",
|
|
@@ -576,11 +570,11 @@ export class CatInput {
|
|
|
576
570
|
"defaultValue": "'text'"
|
|
577
571
|
},
|
|
578
572
|
"value": {
|
|
579
|
-
"type": "
|
|
573
|
+
"type": "string",
|
|
580
574
|
"mutable": true,
|
|
581
575
|
"complexType": {
|
|
582
|
-
"original": "string
|
|
583
|
-
"resolved": "
|
|
576
|
+
"original": "string",
|
|
577
|
+
"resolved": "string | undefined",
|
|
584
578
|
"references": {}
|
|
585
579
|
},
|
|
586
580
|
"required": false,
|
|
@@ -668,13 +662,9 @@ export class CatInput {
|
|
|
668
662
|
"text": "Emitted when the value is changed."
|
|
669
663
|
},
|
|
670
664
|
"complexType": {
|
|
671
|
-
"original": "
|
|
672
|
-
"resolved": "
|
|
673
|
-
"references": {
|
|
674
|
-
"InputEvent": {
|
|
675
|
-
"location": "global"
|
|
676
|
-
}
|
|
677
|
-
}
|
|
665
|
+
"original": "string",
|
|
666
|
+
"resolved": "string",
|
|
667
|
+
"references": {}
|
|
678
668
|
}
|
|
679
669
|
}, {
|
|
680
670
|
"method": "catFocus",
|
|
@@ -762,22 +752,6 @@ export class CatInput {
|
|
|
762
752
|
"tags": []
|
|
763
753
|
}
|
|
764
754
|
},
|
|
765
|
-
"doClick": {
|
|
766
|
-
"complexType": {
|
|
767
|
-
"signature": "() => Promise<void>",
|
|
768
|
-
"parameters": [],
|
|
769
|
-
"references": {
|
|
770
|
-
"Promise": {
|
|
771
|
-
"location": "global"
|
|
772
|
-
}
|
|
773
|
-
},
|
|
774
|
-
"return": "Promise<void>"
|
|
775
|
-
},
|
|
776
|
-
"docs": {
|
|
777
|
-
"text": "Programmatically simulate a click on the input.",
|
|
778
|
-
"tags": []
|
|
779
|
-
}
|
|
780
|
-
},
|
|
781
755
|
"clear": {
|
|
782
756
|
"complexType": {
|
|
783
757
|
"signature": "() => Promise<void>",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-input.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGxE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;;GAUG;AAMH,MAAM,OAAO,QAAQ;;IACF,QAAG,GAAG,aAAa,YAAY,EAAE,EAAE,CAAC;2BAU1B,KAAK;0BAEN,KAAK;;0BAOkE,UAAU;sBAKtF,KAAK;;qBAUN,KAAK;oBAKN,KAAK;;;qBAeJ,KAAK;;iBAUT,EAAE;uBAKI,KAAK;;;;;;;;;oBA6CR,KAAK;oBAKL,KAAK;iBAKR,KAAK;gBAKK,MAAM;;;uBAsBQ,CAAC;;;EAtJzC,IAAY,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAA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":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { InputType } from './input-type';\n\nlet nextUniqueId = 0;\n\n/**\n * Inputs are used to allow users to provide text input when the expected input\n * is short. As well as plain text, Input supports various types of text,\n * including passwords and numbers.\n *\n * @slot hint - Optional hint element to be displayed with the input.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n * @part prefix - The text prefix.\n * @part suffix - The text suffix.\n */\n@Component({\n tag: 'cat-input',\n styleUrl: 'cat-input.scss',\n shadow: true\n})\nexport class CatInput {\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for date, time and numeric values.\n */\n @Prop() max?: number | string;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum value for date, time and numeric values.\n */\n @Prop() min?: number | string;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Use round input edges.\n */\n @Prop() round = false;\n\n /**\n * Type of form control.\n */\n @Prop() type: InputType = 'text';\n\n /**\n * The value of the control.\n */\n @Prop({ mutable: true }) value?: string | number;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.watchErrorsHandler(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on input', this);\n }\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the input.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n }\n\n @Watch('errors')\n watchErrorsHandler(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'input-field': true,\n 'input-horizontal': this.horizontal\n }}\n >\n <div\n class={{\n hidden: this.labelHidden,\n 'label-container': true\n }}\n >\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id}>\n <span class=\"label-wrapper\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && this.requiredMarker.startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {this.maxLength && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.value?.toString().length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"input-container\">\n <div\n class={{\n 'input-wrapper': true,\n 'input-round': this.round,\n 'input-disabled': this.disabled,\n 'input-invalid': this.invalid\n }}\n onClick={() => this.input.focus()}\n >\n {this.textPrefix && (\n <span class=\"text-prefix\" part=\"prefix\">\n {this.textPrefix}\n </span>\n )}\n {this.icon && !this.iconRight && <cat-icon icon={this.icon} class=\"icon-prefix\" size=\"l\"></cat-icon>}\n <div class=\"input-inner-wrapper\">\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n class={{\n 'has-clearable': this.clearable && !this.disabled\n }}\n autocomplete={this.autoComplete}\n disabled={this.disabled}\n max={this.max}\n maxlength={this.maxLength}\n min={this.min}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hint?.length ? this.id + '-hint' : undefined}\n ></input>\n {this.clearable && !this.disabled && this.value && (\n <cat-button\n class=\"clearable\"\n icon=\"$cat:input-close\"\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t('input.clear')}\n onClick={this.clear.bind(this)}\n ></cat-button>\n )}\n </div>\n {!this.invalid && this.icon && this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-suffix\" size=\"l\"></cat-icon>\n )}\n {this.invalid && <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>}\n {this.textSuffix && (\n <span class=\"text-suffix\" part=\"suffix\">\n {this.textSuffix}\n </span>\n )}\n </div>\n {(this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n );\n }\n\n private get invalid() {\n return !!this.errorMap;\n }\n\n private onInput(event: InputEvent) {\n this.value = this.input.value;\n this.catChange.emit(event);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cat-input.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGxE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;;GAUG;AAMH,MAAM,OAAO,Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { InputType } from './input-type';\n\nlet nextUniqueId = 0;\n\n/**\n * Inputs are used to allow users to provide text input when the expected input\n * is short. As well as plain text, Input supports various types of text,\n * including passwords and numbers.\n *\n * @slot hint - Optional hint element to be displayed with the input.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n * @part prefix - The text prefix.\n * @part suffix - The text suffix.\n */\n@Component({\n tag: 'cat-input',\n styleUrl: 'cat-input.scss',\n shadow: true\n})\nexport class CatInput {\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for date, time and numeric values.\n */\n @Prop() max?: number | string;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum value for date, time and numeric values.\n */\n @Prop() min?: number | string;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Use round input edges.\n */\n @Prop() round = false;\n\n /**\n * Type of form control.\n */\n @Prop() type: InputType = 'text';\n\n /**\n * The value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.watchErrorsHandler(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on input', this);\n }\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n @Watch('errors')\n watchErrorsHandler(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'input-field': true,\n 'input-horizontal': this.horizontal\n }}\n >\n <div\n class={{\n hidden: this.labelHidden,\n 'label-container': true\n }}\n >\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id}>\n <span class=\"label-wrapper\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && this.requiredMarker.startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {this.maxLength && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.value?.toString().length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"input-container\">\n <div\n class={{\n 'input-wrapper': true,\n 'input-round': this.round,\n 'input-disabled': this.disabled,\n 'input-invalid': this.invalid\n }}\n onClick={() => this.input.focus()}\n >\n {this.textPrefix && (\n <span class=\"text-prefix\" part=\"prefix\">\n {this.textPrefix}\n </span>\n )}\n {this.icon && !this.iconRight && <cat-icon icon={this.icon} class=\"icon-prefix\" size=\"l\"></cat-icon>}\n <div class=\"input-inner-wrapper\">\n <input\n {...this.nativeAttributes}\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n class={{\n 'has-clearable': this.clearable && !this.disabled\n }}\n autocomplete={this.autoComplete}\n disabled={this.disabled}\n max={this.max}\n maxlength={this.maxLength}\n min={this.min}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hint?.length ? this.id + '-hint' : undefined}\n ></input>\n {this.clearable && !this.disabled && this.value && (\n <cat-button\n class=\"clearable\"\n icon=\"$cat:input-close\"\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t('input.clear')}\n onClick={this.clear.bind(this)}\n ></cat-button>\n )}\n </div>\n {!this.invalid && this.icon && this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-suffix\" size=\"l\"></cat-icon>\n )}\n {this.invalid && <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>}\n {this.textSuffix && (\n <span class=\"text-suffix\" part=\"suffix\">\n {this.textSuffix}\n </span>\n )}\n </div>\n {(this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n );\n }\n\n private get invalid() {\n return !!this.errorMap;\n }\n\n private onInput() {\n this.value = this.input.value;\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-type.js","sourceRoot":"","sources":["../../../src/components/cat-input/input-type.ts"],"names":[],"mappings":"","sourcesContent":["export type InputType =\n | '
|
|
1
|
+
{"version":3,"file":"input-type.js","sourceRoot":"","sources":["../../../src/components/cat-input/input-type.ts"],"names":[],"mappings":"","sourcesContent":["export type InputType =\n | 'color'\n | 'email'\n | 'file'\n | 'number'\n | 'password'\n | 'range'\n | 'search'\n | 'tel'\n | 'text'\n | 'url';\n"]}
|