@italia/upload 1.0.0-alpha.9 → 1.0.0-beta.1
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/README.md +11 -0
- package/custom-elements.json +52 -17
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/it-upload-avatar.d.ts +0 -1
- package/dist/src/it-upload-avatar.d.ts.map +1 -1
- package/dist/src/it-upload-avatar.js +185 -270
- package/dist/src/it-upload-avatar.js.map +1 -1
- package/dist/src/it-upload-drag-drop.d.ts +4 -0
- package/dist/src/it-upload-drag-drop.d.ts.map +1 -1
- package/dist/src/it-upload-drag-drop.js +268 -115
- package/dist/src/it-upload-drag-drop.js.map +1 -1
- package/dist/src/it-upload.d.ts.map +1 -1
- package/dist/src/it-upload.js +261 -141
- package/dist/src/it-upload.js.map +1 -1
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +27 -27
- package/styles/globals.scss +2 -0
- package/LICENSE +0 -11
package/dist/src/it-upload.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerTranslation, t as translation, a as translation$1, _ as __decorate, b as __metadata, F as FormControl, c as FormControlController } from '../en-
|
|
1
|
+
import { r as registerTranslation, t as translation, a as translation$1, _ as __decorate, b as __metadata, F as FormControl, c as FormControlController } from '../en-BVfEYZab.js';
|
|
2
2
|
import { css, html, nothing } from 'lit';
|
|
3
3
|
import { query, queryAssignedElements, property, state, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -7,34 +7,6 @@ import { f as formatSize } from '../utils-xlxkOHqp.js';
|
|
|
7
7
|
import 'lit/directive.js';
|
|
8
8
|
|
|
9
9
|
var styles = css`@charset "UTF-8";
|
|
10
|
-
/***************************** 1 ****************************************/
|
|
11
|
-
/***************************** 2 ****************************************/
|
|
12
|
-
/***************************** 1 ****************************************/
|
|
13
|
-
/***************************** 2 ****************************************/
|
|
14
|
-
/***************************** 1 ****************************************/
|
|
15
|
-
/***************************** 2 ****************************************/
|
|
16
|
-
/***************************** 3 ****************************************/
|
|
17
|
-
/***************************** 1 ****************************************/
|
|
18
|
-
/***************************** 2 ****************************************/
|
|
19
|
-
/***************************** 3 ****************************************/
|
|
20
|
-
/***************************** NEUTRAL 1 ****************************************/
|
|
21
|
-
/***************************** NEUTRAL 2 ****************************************/
|
|
22
|
-
/***************************** NEUTRAL 2 / 3 ****************************************/
|
|
23
|
-
.form-check [type=checkbox]:focus + label,
|
|
24
|
-
.form-check [type=radio]:focus + label {
|
|
25
|
-
border-color: hsl(0, 0%, 0%) !important;
|
|
26
|
-
box-shadow: 0 0 0 2px var(--bsi-color-border-inverse), 0 0 0 5px var(--bsi-color-outline-focus) !important;
|
|
27
|
-
outline: 3px solid transparent !important;
|
|
28
|
-
outline-offset: 3px !important;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.form-check [type=checkbox]:focus[data-focus-mouse=true] + label,
|
|
32
|
-
.form-check [type=radio]:focus[data-focus-mouse=true] + label {
|
|
33
|
-
border-color: inherit !important;
|
|
34
|
-
box-shadow: none !important;
|
|
35
|
-
outline: none !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
10
|
*,
|
|
39
11
|
*::before,
|
|
40
12
|
*::after {
|
|
@@ -788,7 +760,7 @@ input::-webkit-date-and-time-value {
|
|
|
788
760
|
}
|
|
789
761
|
|
|
790
762
|
select {
|
|
791
|
-
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='hsl%280, 0%,
|
|
763
|
+
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='hsl%280, 0%, 32%%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
|
|
792
764
|
background-repeat: no-repeat;
|
|
793
765
|
background-position: right var(--bsi-form-control-spacing) center;
|
|
794
766
|
background-size: 16px 12px;
|
|
@@ -801,7 +773,6 @@ select:focus {
|
|
|
801
773
|
}
|
|
802
774
|
select[multiple], select[size]:not([size="1"]) {
|
|
803
775
|
padding-right: 0.75rem;
|
|
804
|
-
background-image: none;
|
|
805
776
|
}
|
|
806
777
|
select:disabled {
|
|
807
778
|
background-color: hsl(0, 0%, 90%);
|
|
@@ -935,8 +906,8 @@ input::-webkit-datetime-edit {
|
|
|
935
906
|
.form-check [type=checkbox],
|
|
936
907
|
.form-check [type=radio] {
|
|
937
908
|
position: absolute;
|
|
938
|
-
top:
|
|
939
|
-
left:
|
|
909
|
+
top: 0;
|
|
910
|
+
left: 0;
|
|
940
911
|
width: auto;
|
|
941
912
|
margin-top: 0;
|
|
942
913
|
margin-left: 0;
|
|
@@ -958,6 +929,19 @@ input::-webkit-datetime-edit {
|
|
|
958
929
|
font-size: var(--bsi-label-font-size-l);
|
|
959
930
|
}
|
|
960
931
|
}
|
|
932
|
+
.form-check [type=checkbox]:focus + label,
|
|
933
|
+
.form-check [type=radio]:focus + label {
|
|
934
|
+
border-color: hsl(0, 0%, 0%) !important;
|
|
935
|
+
box-shadow: 0 0 0 2px var(--bsi-color-border-inverse), 0 0 0 5px var(--bsi-color-outline-focus) !important;
|
|
936
|
+
outline: 3px solid transparent !important;
|
|
937
|
+
outline-offset: 3px !important;
|
|
938
|
+
}
|
|
939
|
+
.form-check [type=checkbox]:focus[data-focus-mouse=true] + label,
|
|
940
|
+
.form-check [type=radio]:focus[data-focus-mouse=true] + label {
|
|
941
|
+
border-color: inherit !important;
|
|
942
|
+
box-shadow: none !important;
|
|
943
|
+
outline: none !important;
|
|
944
|
+
}
|
|
961
945
|
.form-check input[type=checkbox] + label::after,
|
|
962
946
|
.form-check input[type=checkbox] + label::before {
|
|
963
947
|
position: absolute;
|
|
@@ -1004,6 +988,9 @@ input::-webkit-datetime-edit {
|
|
|
1004
988
|
height: 0;
|
|
1005
989
|
border-color: transparent;
|
|
1006
990
|
}
|
|
991
|
+
.form-check input[type=checkbox] + label:hover::after {
|
|
992
|
+
border-color: var(--bsi-color-border-secondary-hover);
|
|
993
|
+
}
|
|
1007
994
|
.form-check input[type=checkbox]:disabled + label {
|
|
1008
995
|
opacity: 1;
|
|
1009
996
|
cursor: not-allowed;
|
|
@@ -1045,6 +1032,9 @@ input::-webkit-datetime-edit {
|
|
|
1045
1032
|
.form-check input[type=radio]:checked + label::before {
|
|
1046
1033
|
border-color: var(--bsi-form-checked-color);
|
|
1047
1034
|
}
|
|
1035
|
+
.form-check input[type=radio] + label:hover::before {
|
|
1036
|
+
border-color: var(--bsi-color-border-secondary-hover);
|
|
1037
|
+
}
|
|
1048
1038
|
.form-check input[type=radio]:disabled + label {
|
|
1049
1039
|
cursor: not-allowed;
|
|
1050
1040
|
}
|
|
@@ -1131,21 +1121,6 @@ input::-webkit-datetime-edit {
|
|
|
1131
1121
|
transition: none !important;
|
|
1132
1122
|
}
|
|
1133
1123
|
}
|
|
1134
|
-
.form-check [type=checkbox]:focus + label,
|
|
1135
|
-
.form-check [type=radio]:focus + label {
|
|
1136
|
-
border-color: hsl(0, 0%, 0%) !important;
|
|
1137
|
-
box-shadow: 0 0 0 2px var(--bsi-color-border-inverse), 0 0 0 5px var(--bsi-color-outline-focus) !important;
|
|
1138
|
-
outline: 3px solid transparent !important;
|
|
1139
|
-
outline-offset: 3px !important;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
.form-check [type=checkbox]:focus[data-focus-mouse=true] + label,
|
|
1143
|
-
.form-check [type=radio]:focus[data-focus-mouse=true] + label {
|
|
1144
|
-
border-color: inherit !important;
|
|
1145
|
-
box-shadow: none !important;
|
|
1146
|
-
outline: none !important;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
1124
|
.form-control-plaintext {
|
|
1150
1125
|
border: 0;
|
|
1151
1126
|
--bsi-form-control-border-color: transparent;
|
|
@@ -1164,7 +1139,7 @@ input::-webkit-datetime-edit {
|
|
|
1164
1139
|
.form-control {
|
|
1165
1140
|
background-repeat: no-repeat;
|
|
1166
1141
|
background-position: center right;
|
|
1167
|
-
background-size: 45px
|
|
1142
|
+
background-size: 45px 20px;
|
|
1168
1143
|
}
|
|
1169
1144
|
.form-control:disabled {
|
|
1170
1145
|
cursor: not-allowed;
|
|
@@ -1172,20 +1147,6 @@ input::-webkit-datetime-edit {
|
|
|
1172
1147
|
border: 0;
|
|
1173
1148
|
color: var(--bsi-color-text-disabled);
|
|
1174
1149
|
}
|
|
1175
|
-
.was-validated .form-control:valid, .form-control.is-valid {
|
|
1176
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23008055' viewBox='0 0 192 512'%3E%3Cpath d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z'/%3E%3C/svg%3E");
|
|
1177
|
-
}
|
|
1178
|
-
.was-validated .form-control:invalid, .form-control.is-invalid {
|
|
1179
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23cc334d' viewBox='0 0 384 512'%3E%3Cpath d='M231.6 256l130.1-130.1c4.7-4.7 4.7-12.3 0-17l-22.6-22.6c-4.7-4.7-12.3-4.7-17 0L192 216.4 61.9 86.3c-4.7-4.7-12.3-4.7-17 0l-22.6 22.6c-4.7 4.7-4.7 12.3 0 17L152.4 256 22.3 386.1c-4.7 4.7-4.7 12.3 0 17l22.6 22.6c4.7 4.7 12.3 4.7 17 0L192 295.6l130.1 130.1c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17L231.6 256z'/%3E%3C/svg%3E");
|
|
1180
|
-
border-color: var(--bsi-color-border-danger);
|
|
1181
|
-
}
|
|
1182
|
-
.form-control.warning {
|
|
1183
|
-
background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M2%2012C2%206.47715%206.47715%202%2012%202C14.6522%202%2017.1957%203.05357%2019.0711%204.92893C20.9464%206.8043%2022%209.34784%2022%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012ZM3%2012C3%2016.9706%207.02944%2021%2012%2021C16.9706%2021%2021%2016.9706%2021%2012C21%207.02944%2016.9706%203%2012%203C7.02944%203%203%207.02944%203%2012ZM11.5%2014.2V5.7H12.7V14.2H11.5ZM12.6%2018.3V16.5H11.4V18.3H12.6Z%22/%3E%0A%3C/svg%3E") no-repeat;
|
|
1184
|
-
border-color: var(--bsi-color-border-warning);
|
|
1185
|
-
}
|
|
1186
|
-
.form-control.is-valid ~ .warning-feedback {
|
|
1187
|
-
display: block;
|
|
1188
|
-
}
|
|
1189
1150
|
|
|
1190
1151
|
.form-control-sm {
|
|
1191
1152
|
--bsi-form-control-spacing: var(--bsi-spacing-xxs) var(--bsi-spacing-3xs);
|
|
@@ -1433,6 +1394,10 @@ textarea.form-control-lg {
|
|
|
1433
1394
|
overflow: hidden;
|
|
1434
1395
|
}
|
|
1435
1396
|
|
|
1397
|
+
.avatar-upload-wrapper {
|
|
1398
|
+
position: relative;
|
|
1399
|
+
display: inline-block;
|
|
1400
|
+
}
|
|
1436
1401
|
.avatar-upload-wrapper .avatar-upload-icon {
|
|
1437
1402
|
position: absolute;
|
|
1438
1403
|
right: 4px;
|
|
@@ -1440,30 +1405,23 @@ textarea.form-control-lg {
|
|
|
1440
1405
|
display: flex;
|
|
1441
1406
|
align-items: center;
|
|
1442
1407
|
justify-content: center;
|
|
1443
|
-
width:
|
|
1444
|
-
height:
|
|
1408
|
+
width: 32px;
|
|
1409
|
+
height: 32px;
|
|
1445
1410
|
border: 2px solid var(--bsi-color-border-inverse);
|
|
1446
1411
|
border-radius: 50%;
|
|
1447
1412
|
background: hsl(210, 6.2290689886%, 92.535%);
|
|
1448
1413
|
pointer-events: none;
|
|
1449
|
-
|
|
1450
|
-
.avatar-upload-wrapper .avatar-upload-icon > svg {
|
|
1451
|
-
width: 16px;
|
|
1452
|
-
height: 16px;
|
|
1414
|
+
z-index: 1;
|
|
1453
1415
|
}
|
|
1454
1416
|
.avatar-upload-wrapper.size-sm .avatar {
|
|
1455
1417
|
width: 80px;
|
|
1456
1418
|
height: 80px;
|
|
1457
1419
|
}
|
|
1458
1420
|
.avatar-upload-wrapper.size-sm .avatar-upload-icon {
|
|
1459
|
-
right:
|
|
1460
|
-
bottom:
|
|
1461
|
-
width:
|
|
1462
|
-
height:
|
|
1463
|
-
}
|
|
1464
|
-
.avatar-upload-wrapper.size-sm .avatar-upload-icon > svg {
|
|
1465
|
-
width: 12px;
|
|
1466
|
-
height: 12px;
|
|
1421
|
+
right: 6px;
|
|
1422
|
+
bottom: 8px;
|
|
1423
|
+
width: 24px;
|
|
1424
|
+
height: 24px;
|
|
1467
1425
|
}
|
|
1468
1426
|
|
|
1469
1427
|
.upload-dragdrop {
|
|
@@ -1684,9 +1642,6 @@ textarea.form-control-lg {
|
|
|
1684
1642
|
margin-top: 0.25rem;
|
|
1685
1643
|
font-size: 0.75rem;
|
|
1686
1644
|
}
|
|
1687
|
-
.form-feedback.just-validate-error-label {
|
|
1688
|
-
color: var(--bsi-color-text-danger);
|
|
1689
|
-
}
|
|
1690
1645
|
|
|
1691
1646
|
.input-group-text:has(~ [data-focus-mouse=true]:not(.btn)),
|
|
1692
1647
|
[data-focus-mouse=true]:not(.btn) ~ .input-group-text,
|
|
@@ -1708,20 +1663,44 @@ button:has(~ .is-invalid),
|
|
|
1708
1663
|
display: none;
|
|
1709
1664
|
}
|
|
1710
1665
|
|
|
1711
|
-
.
|
|
1712
|
-
|
|
1666
|
+
.is-valid,
|
|
1667
|
+
.is-invalid {
|
|
1713
1668
|
padding-right: calc(1.5em + 0.75rem) !important;
|
|
1714
|
-
|
|
1669
|
+
}
|
|
1670
|
+
.is-valid[type=number],
|
|
1671
|
+
.is-invalid[type=number] {
|
|
1672
|
+
padding-right: calc(1.5em + 0.75rem + var(--bsi-form-control-spacing) + 1rem) !important;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.was-validated &:valid,
|
|
1676
|
+
.is-valid {
|
|
1677
|
+
border-color: var(--bsi-color-border-success) !important;
|
|
1678
|
+
background-image: url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="%23008055" xmlns="http://www.w3.org/2000/svg"><path d="M9.6,16.9L4,11.4l0.8-0.7l4.8,4.8l8.5-8.4l0.7,0.7L9.6,16.9z" /></svg>');
|
|
1679
|
+
}
|
|
1680
|
+
.was-validated &:valid ~ .warning-feedback,
|
|
1681
|
+
.is-valid ~ .warning-feedback {
|
|
1682
|
+
display: block;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
.was-validated &:invalid,
|
|
1686
|
+
.is-invalid {
|
|
1687
|
+
border-color: var(--bsi-color-border-danger) !important;
|
|
1688
|
+
background-image: url('data:image/svg+xml,<svg width="24" fill="%23cc334d" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.7,12l6.7,6.6l-0.8,0.8L12,12.7l-6.6,6.7l-0.8-0.8l6.7-6.6L4.6,5.4l0.8-0.8l6.6,6.7l6.6-6.7l0.8,0.8L12.7,12z" /></svg>');
|
|
1715
1689
|
}
|
|
1716
1690
|
|
|
1717
|
-
.
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1691
|
+
.form-control.warning {
|
|
1692
|
+
border-color: var(--bsi-color-border-warning) !important;
|
|
1693
|
+
background-image: url('data:image/svg+xml,<svg width="24" height="24" fill="%23995c00" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.5,17h-1V2h1V17z M12.5,20h-1v2h1V20z" /></svg>');
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
.input-group-text:has(~ .is-valid),
|
|
1697
|
+
.is-valid ~ .input-group-text,
|
|
1698
|
+
button:has(~ .is-valid),
|
|
1699
|
+
.is-valid + button {
|
|
1721
1700
|
border-color: var(--bsi-color-border-success);
|
|
1722
1701
|
}
|
|
1723
1702
|
|
|
1724
|
-
.
|
|
1703
|
+
.is-valid + .input-group-text.align-buttons,
|
|
1725
1704
|
.is-invalid + .input-group-text.align-buttons {
|
|
1726
1705
|
right: 30px;
|
|
1727
1706
|
}
|
|
@@ -1730,33 +1709,12 @@ button:has(~ .just-validate-success-field),
|
|
|
1730
1709
|
bottom: 22px;
|
|
1731
1710
|
}
|
|
1732
1711
|
|
|
1733
|
-
.autocomplete__wrapper .form-feedback
|
|
1712
|
+
.autocomplete__wrapper .form-feedback {
|
|
1734
1713
|
position: absolute;
|
|
1735
1714
|
}
|
|
1736
1715
|
|
|
1737
1716
|
textarea.form-control {
|
|
1738
|
-
background-position: top 0.
|
|
1739
|
-
background-size: 37px 30% !important;
|
|
1740
|
-
}
|
|
1741
|
-
textarea.is-invalid {
|
|
1742
|
-
border-bottom-style: solid;
|
|
1743
|
-
border-bottom-width: 1px;
|
|
1744
|
-
}
|
|
1745
|
-
textarea.just-validate-success-field {
|
|
1746
|
-
border-bottom-style: solid;
|
|
1747
|
-
border-bottom-width: 1px;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
input[type=checkbox].is-invalid,
|
|
1751
|
-
input[type=radio].is-invalid {
|
|
1752
|
-
--bsi-form-checkbox-border-color: var(--bsi-color-border-danger);
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
select.is-invalid {
|
|
1756
|
-
border: 1px solid var(--bsi-color-border-danger);
|
|
1757
|
-
}
|
|
1758
|
-
select.just-validate-success-field {
|
|
1759
|
-
border: 1px solid var(--bsi-color-border-success);
|
|
1717
|
+
background-position: top 0.5em right !important;
|
|
1760
1718
|
}
|
|
1761
1719
|
|
|
1762
1720
|
body {
|
|
@@ -2072,6 +2030,126 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2072
2030
|
margin: 0 !important;
|
|
2073
2031
|
}
|
|
2074
2032
|
|
|
2033
|
+
.text-primary {
|
|
2034
|
+
--bsi-text-opacity: 1;
|
|
2035
|
+
color: rgba(var(--bsi-primary-rgb), var(--bsi-text-opacity)) !important;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
.text-secondary {
|
|
2039
|
+
--bsi-text-opacity: 1;
|
|
2040
|
+
color: hsl(210, 33%, 28%) !important;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
.text-success {
|
|
2044
|
+
--bsi-text-opacity: 1;
|
|
2045
|
+
color: rgba(var(--bsi-success-rgb), var(--bsi-text-opacity)) !important;
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
.text-info {
|
|
2049
|
+
--bsi-text-opacity: 1;
|
|
2050
|
+
color: rgba(var(--bsi-info-rgb), var(--bsi-text-opacity)) !important;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
.text-warning {
|
|
2054
|
+
--bsi-text-opacity: 1;
|
|
2055
|
+
color: rgba(var(--bsi-warning-rgb), var(--bsi-text-opacity)) !important;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
.text-danger {
|
|
2059
|
+
--bsi-text-opacity: 1;
|
|
2060
|
+
color: rgba(var(--bsi-danger-rgb), var(--bsi-text-opacity)) !important;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
.text-light {
|
|
2064
|
+
--bsi-text-opacity: 1;
|
|
2065
|
+
color: rgba(var(--bsi-light-rgb), var(--bsi-text-opacity)) !important;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
.text-dark {
|
|
2069
|
+
--bsi-text-opacity: 1;
|
|
2070
|
+
color: rgba(var(--bsi-dark-rgb), var(--bsi-text-opacity)) !important;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
.text-black {
|
|
2074
|
+
--bsi-text-opacity: 1;
|
|
2075
|
+
color: rgba(var(--bsi-black-rgb), var(--bsi-text-opacity)) !important;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
.text-white {
|
|
2079
|
+
--bsi-text-opacity: 1;
|
|
2080
|
+
color: rgba(var(--bsi-white-rgb), var(--bsi-text-opacity)) !important;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
.text-100 {
|
|
2084
|
+
--bsi-text-opacity: 1;
|
|
2085
|
+
color: rgba(var(--bsi-100-rgb), var(--bsi-text-opacity)) !important;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
.text-200 {
|
|
2089
|
+
--bsi-text-opacity: 1;
|
|
2090
|
+
color: rgba(var(--bsi-200-rgb), var(--bsi-text-opacity)) !important;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
.text-300 {
|
|
2094
|
+
--bsi-text-opacity: 1;
|
|
2095
|
+
color: rgba(var(--bsi-300-rgb), var(--bsi-text-opacity)) !important;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
.text-400 {
|
|
2099
|
+
--bsi-text-opacity: 1;
|
|
2100
|
+
color: rgba(var(--bsi-400-rgb), var(--bsi-text-opacity)) !important;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
.text-500 {
|
|
2104
|
+
--bsi-text-opacity: 1;
|
|
2105
|
+
color: rgba(var(--bsi-500-rgb), var(--bsi-text-opacity)) !important;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
.text-600 {
|
|
2109
|
+
--bsi-text-opacity: 1;
|
|
2110
|
+
color: rgba(var(--bsi-600-rgb), var(--bsi-text-opacity)) !important;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
.text-700 {
|
|
2114
|
+
--bsi-text-opacity: 1;
|
|
2115
|
+
color: rgba(var(--bsi-700-rgb), var(--bsi-text-opacity)) !important;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
.text-800 {
|
|
2119
|
+
--bsi-text-opacity: 1;
|
|
2120
|
+
color: rgba(var(--bsi-800-rgb), var(--bsi-text-opacity)) !important;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
.text-900 {
|
|
2124
|
+
--bsi-text-opacity: 1;
|
|
2125
|
+
color: rgba(var(--bsi-900-rgb), var(--bsi-text-opacity)) !important;
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
.text-body {
|
|
2129
|
+
--bsi-text-opacity: 1;
|
|
2130
|
+
color: rgba(var(--bsi-body-color-rgb), var(--bsi-text-opacity)) !important;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
.text-muted {
|
|
2134
|
+
--bsi-text-opacity: 1;
|
|
2135
|
+
color: hsl(210, 17%, 44%) !important;
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
.text-black-50 {
|
|
2139
|
+
--bsi-text-opacity: 1;
|
|
2140
|
+
color: rgba(0, 0, 0, 0.5) !important;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
.text-white-50 {
|
|
2144
|
+
--bsi-text-opacity: 1;
|
|
2145
|
+
color: rgba(255, 255, 255, 0.5) !important;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
.text-reset {
|
|
2149
|
+
--bsi-text-opacity: 1;
|
|
2150
|
+
color: inherit !important;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2075
2153
|
@media (min-width: 576px) {
|
|
2076
2154
|
.d-sm-none {
|
|
2077
2155
|
display: none !important;
|
|
@@ -2153,14 +2231,32 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2153
2231
|
display: flex !important;
|
|
2154
2232
|
}
|
|
2155
2233
|
}
|
|
2156
|
-
.upload[type=file]
|
|
2234
|
+
label:has(.upload[type=file]) {
|
|
2157
2235
|
display: flex;
|
|
2236
|
+
overflow: hidden;
|
|
2158
2237
|
width: fit-content;
|
|
2159
2238
|
max-width: unset !important;
|
|
2160
2239
|
align-items: center;
|
|
2240
|
+
padding: var(--bsi-spacing-xs) var(--bsi-spacing-m);
|
|
2241
|
+
border-radius: var(--bsi-form-control-border-radius);
|
|
2242
|
+
margin-bottom: 0;
|
|
2243
|
+
background-color: var(--bsi-color-background-primary);
|
|
2244
|
+
color: var(--bsi-color-text-inverse);
|
|
2245
|
+
cursor: pointer;
|
|
2246
|
+
font-size: 1rem;
|
|
2247
|
+
font-weight: 700;
|
|
2161
2248
|
gap: var(--bsi-spacing-xxs, 8px);
|
|
2249
|
+
transition: background-color var(--bsi-transition-instant);
|
|
2250
|
+
}
|
|
2251
|
+
label:has(.upload[type=file]):hover {
|
|
2252
|
+
background-color: var(--bsi-color-background-primary-hover);
|
|
2162
2253
|
}
|
|
2163
2254
|
|
|
2255
|
+
@media (min-width: 576px) {
|
|
2256
|
+
label:has(.upload[type=file]) {
|
|
2257
|
+
font-size: var(--bsi-label-font-size-s);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2164
2260
|
:host([required]) .upload-required-feedback {
|
|
2165
2261
|
display: block;
|
|
2166
2262
|
}
|
|
@@ -2178,7 +2274,7 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2178
2274
|
}
|
|
2179
2275
|
|
|
2180
2276
|
:focus-visible,
|
|
2181
|
-
.upload:focus-visible
|
|
2277
|
+
label:has(.upload[type=file]:focus-visible),
|
|
2182
2278
|
.upload-dragdrop-input:focus-visible[type=file] + label,
|
|
2183
2279
|
.avatar-upload:focus-within:focus-visible {
|
|
2184
2280
|
border-color: #000 !important;
|
|
@@ -2187,6 +2283,13 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2187
2283
|
outline-offset: 3px !important;
|
|
2188
2284
|
}
|
|
2189
2285
|
|
|
2286
|
+
.upload[type=file]:focus-visible {
|
|
2287
|
+
border-color: initial !important;
|
|
2288
|
+
box-shadow: none !important;
|
|
2289
|
+
outline: none !important;
|
|
2290
|
+
outline-offset: initial !important;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2190
2293
|
.upload-file-actions {
|
|
2191
2294
|
display: flex;
|
|
2192
2295
|
align-items: center;
|
|
@@ -2212,11 +2315,23 @@ blockquote.blockquote-card.dark .blockquote-footer,
|
|
|
2212
2315
|
line-height: 1;
|
|
2213
2316
|
}
|
|
2214
2317
|
|
|
2215
|
-
.upload-pictures-wall .upload[type=file]
|
|
2318
|
+
.upload-pictures-wall label:has(.upload[type=file]) {
|
|
2216
2319
|
display: flex;
|
|
2320
|
+
width: 128px;
|
|
2321
|
+
height: 128px;
|
|
2217
2322
|
flex-direction: column;
|
|
2218
2323
|
align-items: center;
|
|
2219
2324
|
justify-content: center;
|
|
2325
|
+
padding: 0;
|
|
2326
|
+
border: 2px dashed var(--bsi-color-border-primary);
|
|
2327
|
+
border-radius: 0;
|
|
2328
|
+
background-color: var(--bsi-color-border-primary-lighter);
|
|
2329
|
+
color: var(--bsi-color-text-primary);
|
|
2330
|
+
font-weight: 600;
|
|
2331
|
+
transition: border-color var(--bsi-transition-instant);
|
|
2332
|
+
}
|
|
2333
|
+
.upload-pictures-wall label:has(.upload[type=file]):hover {
|
|
2334
|
+
border: 2px dashed var(--bsi-color-border-primary-hover);
|
|
2220
2335
|
}`;
|
|
2221
2336
|
|
|
2222
2337
|
registerTranslation(translation);
|
|
@@ -2305,13 +2420,15 @@ let ItUpload = class ItUpload extends FormControl {
|
|
|
2305
2420
|
this._validateFiles();
|
|
2306
2421
|
}
|
|
2307
2422
|
_validateFiles() {
|
|
2308
|
-
if (this.
|
|
2309
|
-
this.
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2423
|
+
if (!this.customValidation) {
|
|
2424
|
+
if (this.required && this._files.length === 0) {
|
|
2425
|
+
this.inputElement?.setCustomValidity(this.$t('validityRequired'));
|
|
2426
|
+
this.validationMessage = this.$t('validityRequired');
|
|
2427
|
+
}
|
|
2428
|
+
else {
|
|
2429
|
+
this.inputElement?.setCustomValidity('');
|
|
2430
|
+
this.validationMessage = '';
|
|
2431
|
+
}
|
|
2315
2432
|
}
|
|
2316
2433
|
this.formControlController.updateValidity();
|
|
2317
2434
|
}
|
|
@@ -2515,23 +2632,17 @@ let ItUpload = class ItUpload extends FormControl {
|
|
|
2515
2632
|
_renderUploadInput() {
|
|
2516
2633
|
const inputId = this._id;
|
|
2517
2634
|
const labelText = this.variant === 'gallery' ? this.$t('upload_gallery_label') : this.$t('upload_label');
|
|
2518
|
-
const showValidation = this.formControlController.submittedOnce;
|
|
2635
|
+
const showValidation = this.formControlController.submittedOnce || this.customValidation;
|
|
2519
2636
|
const isInvalid = showValidation && this.validationMessage.length > 0;
|
|
2520
2637
|
return html `
|
|
2521
2638
|
<div class="form-group">
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
?disabled="${this.disabled}"
|
|
2530
|
-
?required="${this.required && this._files.length === 0}"
|
|
2531
|
-
aria-invalid="${isInvalid ? 'true' : 'false'}"
|
|
2532
|
-
aria-describedby="${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}"
|
|
2533
|
-
@change="${this._handleFileChange}"
|
|
2534
|
-
/>
|
|
2639
|
+
<!-- Wrapping pattern per Scott O'Hara "Styled File Uploads":
|
|
2640
|
+
https://scottaohara.github.io/a11y_styled_form_controls/src/file-upload/
|
|
2641
|
+
Input inside label instead of BSI's sibling pattern (0.1px ghost input +
|
|
2642
|
+
styled adjacent label). BSI's pattern makes VoiceOver visit the ghost as a
|
|
2643
|
+
confusing "small square group" before the real button. With wrapping, both
|
|
2644
|
+
stops are logical: label text → file upload control. No JS needed — click
|
|
2645
|
+
propagation to the file picker is handled natively by the label. -->
|
|
2535
2646
|
<label part="input-label" for="${inputId}">
|
|
2536
2647
|
<slot name="icon">
|
|
2537
2648
|
<it-icon
|
|
@@ -2542,16 +2653,25 @@ let ItUpload = class ItUpload extends FormControl {
|
|
|
2542
2653
|
></it-icon>
|
|
2543
2654
|
</slot>
|
|
2544
2655
|
<slot name="label">${labelText}</slot>
|
|
2656
|
+
<input
|
|
2657
|
+
type="file"
|
|
2658
|
+
class="upload it-form__control"
|
|
2659
|
+
id="${inputId}"
|
|
2660
|
+
name="${this.name}"
|
|
2661
|
+
?multiple="${this.multiple}"
|
|
2662
|
+
accept="${ifDefined(this.accept)}"
|
|
2663
|
+
?disabled="${this.disabled}"
|
|
2664
|
+
?required="${this.required && this._files.length === 0}"
|
|
2665
|
+
?formNoValidate="${this.customValidation}"
|
|
2666
|
+
aria-invalid="${isInvalid ? 'true' : nothing}"
|
|
2667
|
+
aria-describedby="${ifDefined(isInvalid ? `invalid-feedback-${inputId}` : undefined)}"
|
|
2668
|
+
@change="${this._handleFileChange}"
|
|
2669
|
+
/>
|
|
2545
2670
|
</label>
|
|
2546
2671
|
|
|
2547
2672
|
${when(this.supportText, () => html `<small class="form-text">${this.supportText}</small>`)}
|
|
2548
2673
|
|
|
2549
|
-
<div
|
|
2550
|
-
role="alert"
|
|
2551
|
-
id="invalid-feedback-${inputId}"
|
|
2552
|
-
class="invalid-feedback form-feedback form-text just-validate-error-label"
|
|
2553
|
-
?hidden=${!isInvalid}
|
|
2554
|
-
>
|
|
2674
|
+
<div role="alert" id="invalid-feedback-${inputId}" class="form-feedback text-danger" ?hidden=${!isInvalid}>
|
|
2555
2675
|
${isInvalid ? html `<span class="visually-hidden">${this.label}: </span>${this.validationMessage}` : nothing}
|
|
2556
2676
|
</div>
|
|
2557
2677
|
</div>
|