@descope/web-components-ui 1.0.54 → 1.0.55

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/index.esm.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import '@vaadin/button';
2
+ import '@vaadin/checkbox';
2
3
  import '@vaadin/text-field';
3
- import '@vaadin/number-field';
4
+ import '@vaadin/date-picker';
4
5
  import '@vaadin/email-field';
6
+ import '@vaadin/number-field';
5
7
  import '@vaadin/password-field';
6
8
  import '@vaadin/text-area';
7
- import '@vaadin/date-picker';
8
- import '@vaadin/checkbox';
9
9
  import merge from 'lodash.merge';
10
10
  import set from 'lodash.set';
11
11
  import Color from 'color';
@@ -623,6 +623,34 @@ const loadingIndicatorStyles = `
623
623
 
624
624
  customElements.define(componentName$g, Button);
625
625
 
626
+ const componentName$f = getComponentName('checkbox');
627
+
628
+ const Checkbox = compose(
629
+ createStyleMixin({
630
+ mappings: {
631
+ width: matchHostStyle(),
632
+ cursor: [{}, { selector: '> label' }]
633
+ }
634
+ }),
635
+ draggableMixin,
636
+ inputMixin,
637
+ componentNameValidationMixin
638
+ )(
639
+ createProxy({
640
+ slots: [],
641
+ wrappedEleName: 'vaadin-checkbox',
642
+ style: `
643
+ :host {
644
+ display: inline-block;
645
+ }
646
+ `,
647
+ excludeAttrsSync: ['tabindex'],
648
+ componentName: componentName$f
649
+ })
650
+ );
651
+
652
+ customElements.define(componentName$f, Checkbox);
653
+
626
654
  const selectors$3 = {
627
655
  label: '::part(label)',
628
656
  input: '::part(input-field)',
@@ -658,7 +686,7 @@ var textFieldMappings = {
658
686
  placeholderColor: { selector: selectors$3.placeholder, property: 'color' }
659
687
  };
660
688
 
661
- const componentName$f = getComponentName('text-field');
689
+ const componentName$e = getComponentName('text-field');
662
690
 
663
691
  let overrides$6 = ``;
664
692
 
@@ -675,7 +703,7 @@ const TextField = compose(
675
703
  wrappedEleName: 'vaadin-text-field',
676
704
  style: () => overrides$6,
677
705
  excludeAttrsSync: ['tabindex'],
678
- componentName: componentName$f
706
+ componentName: componentName$e
679
707
  })
680
708
  );
681
709
 
@@ -720,11 +748,11 @@ overrides$6 = `
720
748
  }
721
749
  `;
722
750
 
723
- customElements.define(componentName$f, TextField);
751
+ customElements.define(componentName$e, TextField);
724
752
 
725
753
  const template = document.createElement('template');
726
754
 
727
- const componentName$e = getComponentName('combo');
755
+ const componentName$d = getComponentName('combo');
728
756
 
729
757
  template.innerHTML = `
730
758
  <descope-button></descope-button>
@@ -741,402 +769,95 @@ class Combo extends DescopeBaseClass {
741
769
  }
742
770
  }
743
771
 
744
- customElements.define(componentName$e, Combo);
772
+ customElements.define(componentName$d, Combo);
745
773
 
746
- const componentName$d = getComponentName('number-field');
774
+ const componentName$c = getComponentName('container');
747
775
 
748
- let overrides$5 = ``;
776
+ class RawContainer extends DescopeBaseClass {
777
+ static get componentName() {
778
+ return componentName$c;
779
+ }
780
+ constructor() {
781
+ super();
782
+ const template = document.createElement('template');
783
+ template.innerHTML = `
784
+ <style>
785
+ :host > slot {
786
+ box-sizing: border-box;
787
+ }
788
+ </style>
789
+ <slot></slot>
790
+ `;
749
791
 
750
- const NumberField = compose(
792
+ this.attachShadow({ mode: 'open' });
793
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
794
+
795
+ this.baseSelector = ':host > slot';
796
+ }
797
+ }
798
+
799
+ const Container = compose(
751
800
  createStyleMixin({
752
801
  mappings: {
753
- ...textFieldMappings
754
- }
755
- }),
756
- draggableMixin,
757
- inputMixin,
758
- componentNameValidationMixin
759
- )(
760
- createProxy({
761
- slots: ['prefix', 'suffix'],
762
- wrappedEleName: 'vaadin-number-field',
763
- style: () => overrides$5,
764
- excludeAttrsSync: ['tabindex'],
765
- componentName: componentName$d
766
- })
767
- );
802
+ height: matchHostStyle(),
803
+ width: matchHostStyle(),
768
804
 
769
- overrides$5 = `
770
- :host {
771
- display: inline-block;
772
- }
773
- vaadin-number-field {
774
- margin: 0;
775
- padding: 0;
776
- }
777
- vaadin-number-field::part(input-field) {
778
- overflow: hidden;
779
- }
780
- vaadin-number-field[readonly] > input:placeholder-shown {
781
- opacity: 1;
782
- }
783
- vaadin-number-field input:-webkit-autofill,
784
- vaadin-number-field input:-webkit-autofill::first-line,
785
- vaadin-number-field input:-webkit-autofill:hover,
786
- vaadin-number-field input:-webkit-autofill:active,
787
- vaadin-number-field input:-webkit-autofill:focus {
788
- -webkit-text-fill-color: var(${NumberField.cssVarList.color});
789
- box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
790
- }
791
- vaadin-number-field > label,
792
- vaadin-number-field::part(input-field) {
793
- cursor: pointer;
794
- color: var(${NumberField.cssVarList.color});
795
- }
796
- vaadin-number-field::part(input-field):focus {
797
- cursor: text;
798
- }
799
- vaadin-number-field[required]::part(required-indicator)::after {
800
- font-size: "12px";
801
- content: "*";
802
- color: var(${NumberField.cssVarList.color});
803
- }
804
- vaadin-number-field[readonly]::part(input-field)::after {
805
- border: 0 solid;
806
- }
807
- `;
805
+ verticalPadding: [
806
+ { property: 'padding-top' },
807
+ { property: 'padding-bottom' }
808
+ ],
809
+ horizontalPadding: [
810
+ { property: 'padding-left' },
811
+ { property: 'padding-right' }
812
+ ],
808
813
 
809
- customElements.define(componentName$d, NumberField);
814
+ display: {}, // maybe this should be hardcoded to flex
815
+ flexDirection: {},
816
+ justifyContent: {},
817
+ alignItems: {},
818
+ gap: {},
810
819
 
811
- const componentName$c = getComponentName('email-field');
820
+ backgroundColor: {},
821
+ borderRadius: {},
812
822
 
813
- let overrides$4 = ``;
823
+ borderColor: {},
824
+ borderStyle: {},
825
+ borderWidth: {},
814
826
 
815
- const EmailField = compose(
816
- createStyleMixin({
817
- mappings: {
818
- ...textFieldMappings
827
+ boxShadow: {}
819
828
  }
820
829
  }),
821
830
  draggableMixin,
822
- inputMixin,
823
831
  componentNameValidationMixin
824
- )(
825
- createProxy({
826
- slots: ['suffix'],
827
- wrappedEleName: 'vaadin-email-field',
828
- style: () => overrides$4,
829
- excludeAttrsSync: ['tabindex'],
830
- componentName: componentName$c
831
- })
832
- );
833
-
834
- overrides$4 = `
835
- :host {
836
- display: inline-block;
837
- }
838
- vaadin-email-field {
839
- margin: 0;
840
- padding: 0;
841
- }
842
- vaadin-email-field::part(input-field) {
843
- overflow: hidden;
844
- }
845
- vaadin-email-field[readonly] > input:placeholder-shown {
846
- opacity: 1;
847
- }
848
- vaadin-email-field input:-webkit-autofill,
849
- vaadin-email-field input:-webkit-autofill::first-line,
850
- vaadin-email-field input:-webkit-autofill:hover,
851
- vaadin-email-field input:-webkit-autofill:active,
852
- vaadin-email-field input:-webkit-autofill:focus {
853
- -webkit-text-fill-color: var(${EmailField.cssVarList.color});
854
- box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
855
- }
856
- vaadin-email-field > label,
857
- vaadin-email-field::part(input-field) {
858
- cursor: pointer;
859
- color: var(${EmailField.cssVarList.color});
860
- }
861
- vaadin-email-field::part(input-field):focus {
862
- cursor: text;
863
- }
864
- vaadin-email-field[required]::part(required-indicator)::after {
865
- font-size: "12px";
866
- content: "*";
867
- color: var(${EmailField.cssVarList.color});
868
- }
869
- vaadin-email-field[readonly]::part(input-field)::after {
870
- border: 0 solid;
871
- }
872
- `;
873
-
874
- customElements.define(componentName$c, EmailField);
832
+ )(RawContainer);
875
833
 
876
- const componentName$b = getComponentName('password-field');
834
+ customElements.define(componentName$c, Container);
877
835
 
878
- let overrides$3 = ``;
836
+ const componentName$b = getComponentName('date-picker');
879
837
 
880
- const PasswordField = compose(
881
- createStyleMixin({
882
- mappings: {
883
- ...textFieldMappings,
884
- revealCursor: [
885
- {
886
- selector: '::part(reveal-button)::before',
887
- property: 'cursor'
888
- }
889
- ]
890
- }
891
- }),
838
+ const DatePicker = compose(
892
839
  draggableMixin,
893
- inputMixin,
894
840
  componentNameValidationMixin
895
841
  )(
896
842
  createProxy({
897
- slots: ['suffix'],
898
- wrappedEleName: 'vaadin-password-field',
899
- style: () => overrides$3,
900
- excludeAttrsSync: ['tabindex'],
901
- componentName: componentName$b
843
+ componentName: componentName$b,
844
+ slots: ['prefix', 'suffix'],
845
+ wrappedEleName: 'vaadin-date-picker',
846
+ style: ``
902
847
  })
903
848
  );
904
849
 
905
- overrides$3 = `
906
- :host {
907
- display: inline-block;
908
- }
909
- vaadin-password-field {
910
- margin: 0;
911
- padding: 0;
912
- }
913
- vaadin-password-field::part(input-field) {
914
- overflow: hidden;
915
- }
916
- vaadin-password-field[readonly] > input:placeholder-shown {
917
- opacity: 1;
918
- }
919
- vaadin-password-field input:-webkit-autofill,
920
- vaadin-password-field input:-webkit-autofill::first-line,
921
- vaadin-password-field input:-webkit-autofill:hover,
922
- vaadin-password-field input:-webkit-autofill:active,
923
- vaadin-password-field input:-webkit-autofill:focus {
924
- -webkit-text-fill-color: var(${PasswordField.cssVarList.color});
925
- box-shadow: 0 0 0 var(${PasswordField.cssVarList.height}) var(${PasswordField.cssVarList.backgroundColor}) inset;
926
- }
927
- vaadin-password-field > label,
928
- vaadin-password-field::part(input-field) {
929
- cursor: pointer;
930
- color: var(${PasswordField.cssVarList.color});
931
- }
932
- vaadin-password-field::part(input-field):focus {
933
- cursor: text;
934
- }
935
- vaadin-password-field[required]::part(required-indicator)::after {
936
- font-size: "12px";
937
- content: "*";
938
- color: var(${PasswordField.cssVarList.color});
939
- }
940
- vaadin-password-field[readonly]::part(input-field)::after {
941
- border: 0 solid;
942
- }
943
- `;
944
-
945
- customElements.define(componentName$b, PasswordField);
850
+ customElements.define(componentName$b, DatePicker);
946
851
 
947
- const componentName$a = getComponentName('text-area');
948
-
949
- const selectors$2 = {
950
- label: '::part(label)',
951
- input: '::part(input-field)',
952
- required: '::part(required-indicator)::after'
953
- };
954
-
955
- let overrides$2 = ``;
956
-
957
- const TextArea = compose(
958
- createStyleMixin({
959
- mappings: {
960
- resize: { selector: '> textarea' },
961
- color: { selector: selectors$2.label },
962
- cursor: {},
963
- width: matchHostStyle(),
964
- backgroundColor: { selector: selectors$2.input },
965
- borderWidth: { selector: selectors$2.input },
966
- borderStyle: { selector: selectors$2.input },
967
- borderColor: { selector: selectors$2.input },
968
- borderRadius: { selector: selectors$2.input },
969
- outline: { selector: selectors$2.input },
970
- outlineOffset: { selector: selectors$2.input }
971
- }
972
- }),
973
- draggableMixin,
974
- inputMixin,
975
- componentNameValidationMixin
976
- )(
977
- createProxy({
978
- slots: [],
979
- wrappedEleName: 'vaadin-text-area',
980
- style: () => overrides$2,
981
- excludeAttrsSync: ['tabindex'],
982
- componentName: componentName$a
983
- })
984
- );
985
-
986
- overrides$2 = `
987
- :host {
988
- display: inline-block;
989
- }
990
-
991
- vaadin-text-area {
992
- margin: 0;
993
- }
994
- vaadin-text-area > label,
995
- vaadin-text-area::part(input-field) {
996
- cursor: pointer;
997
- }
998
- vaadin-text-area[focused]::part(input-field) {
999
- cursor: text;
1000
- }
1001
- vaadin-text-area::part(required-indicator)::after {
1002
- font-size: "12px";
1003
- content: "*";
1004
- }
1005
- `;
1006
-
1007
- customElements.define(componentName$a, TextArea);
1008
-
1009
- const componentName$9 = getComponentName('date-picker');
1010
-
1011
- const DatePicker = compose(
1012
- draggableMixin,
1013
- componentNameValidationMixin
1014
- )(
1015
- createProxy({
1016
- componentName: componentName$9,
1017
- slots: ['prefix', 'suffix'],
1018
- wrappedEleName: 'vaadin-date-picker',
1019
- style: ``
1020
- })
1021
- );
1022
-
1023
- customElements.define(componentName$9, DatePicker);
1024
-
1025
- const componentName$8 = getComponentName('container');
1026
-
1027
- class RawContainer extends DescopeBaseClass {
1028
- static get componentName() {
1029
- return componentName$8;
1030
- }
1031
- constructor() {
1032
- super();
1033
- const template = document.createElement('template');
1034
- template.innerHTML = `
1035
- <style>
1036
- :host > slot {
1037
- box-sizing: border-box;
1038
- }
1039
- </style>
1040
- <slot></slot>
1041
- `;
1042
-
1043
- this.attachShadow({ mode: 'open' });
1044
- this.shadowRoot.appendChild(template.content.cloneNode(true));
1045
-
1046
- this.baseSelector = ':host > slot';
1047
- }
1048
- }
1049
-
1050
- const Container = compose(
1051
- createStyleMixin({
1052
- mappings: {
1053
- height: matchHostStyle(),
1054
- width: matchHostStyle(),
1055
-
1056
- verticalPadding: [
1057
- { property: 'padding-top' },
1058
- { property: 'padding-bottom' }
1059
- ],
1060
- horizontalPadding: [
1061
- { property: 'padding-left' },
1062
- { property: 'padding-right' }
1063
- ],
1064
-
1065
- display: {}, // maybe this should be hardcoded to flex
1066
- flexDirection: {},
1067
- justifyContent: {},
1068
- alignItems: {},
1069
- gap: {},
1070
-
1071
- backgroundColor: {},
1072
- borderRadius: {},
1073
-
1074
- borderColor: {},
1075
- borderStyle: {},
1076
- borderWidth: {},
1077
-
1078
- boxShadow: {}
1079
- }
1080
- }),
1081
- draggableMixin,
1082
- componentNameValidationMixin
1083
- )(RawContainer);
1084
-
1085
- customElements.define(componentName$8, Container);
1086
-
1087
- const componentName$7 = getComponentName('text');
1088
-
1089
- class RawText extends DescopeBaseClass {
1090
- static get componentName() {
1091
- return componentName$7;
1092
- }
1093
- constructor() {
1094
- super();
1095
- const template = document.createElement('template');
1096
- template.innerHTML = `<slot></slot>`;
1097
-
1098
- this.attachShadow({ mode: 'open' });
1099
- this.shadowRoot.appendChild(template.content.cloneNode(true));
1100
-
1101
- this.baseSelector = ':host > slot';
1102
- }
1103
- }
1104
-
1105
- const Text = compose(
1106
- createStyleMixin({
1107
- mappings: {
1108
- fontFamily: {},
1109
- lineHeight: {},
1110
- fontStyle: {},
1111
- fontSize: {},
1112
- fontWeight: {},
1113
- width: {},
1114
- color: {},
1115
- letterSpacing: {},
1116
- textShadow: {},
1117
- borderWidth: {},
1118
- borderStyle: {},
1119
- borderColor: {},
1120
- textTransform: {},
1121
- textAlign: matchHostStyle(),
1122
- display: matchHostStyle()
1123
- }
1124
- }),
1125
- draggableMixin,
1126
- componentNameValidationMixin
1127
- )(RawText);
1128
-
1129
- customElements.define(componentName$7, Text);
1130
-
1131
- const getChildObserver = (callback) => {
1132
- return new MutationObserver((mutationsList) => {
1133
- for (const mutation of mutationsList) {
1134
- if (mutation.type === 'childList') {
1135
- callback(mutation);
1136
- }
1137
- }
1138
- });
1139
- };
852
+ const getChildObserver = (callback) => {
853
+ return new MutationObserver((mutationsList) => {
854
+ for (const mutation of mutationsList) {
855
+ if (mutation.type === 'childList') {
856
+ callback(mutation);
857
+ }
858
+ }
859
+ });
860
+ };
1140
861
 
1141
862
  const insertNestingLevel = (srcEle, nestingEle) => {
1142
863
  nestingEle.append(...srcEle.childNodes);
@@ -1222,87 +943,10 @@ const enforceNestingElementsStylesMixin =
1222
943
  };
1223
944
  };
1224
945
 
1225
- const componentName$6 = getComponentName('link');
1226
- class RawLink extends DescopeBaseClass {
1227
- static get componentName() {
1228
- return componentName$6;
1229
- }
1230
- constructor() {
1231
- super();
1232
- const template = document.createElement('template');
1233
-
1234
- template.innerHTML = `
1235
- <style>
1236
- :host {
1237
- display: inline-block;
1238
- }
1239
- :host a {
1240
- display: inline-block;
1241
- }
1242
- </style>
1243
- <div>
1244
- <a>
1245
- <slot name="text"></slot>
1246
- </a>
1247
- </div>
1248
- `;
1249
-
1250
- this.attachShadow({ mode: 'open' });
1251
- this.shadowRoot.appendChild(template.content.cloneNode(true));
1252
-
1253
- forwardAttrs(this.shadowRoot.host, this.shadowRoot.querySelector('a'), {
1254
- includeAttrs: ['href', 'target', 'tooltip'],
1255
- mapAttrs: {
1256
- tooltip: 'title'
1257
- }
1258
- });
1259
-
1260
- this.baseSelector = ':host > div';
1261
- }
1262
- }
1263
-
1264
- const selectors$1 = {
1265
- anchor: { selector: '> a' }
1266
- };
1267
-
1268
- const { anchor } = selectors$1;
1269
-
1270
- const Link = compose(
1271
- enforceNestingElementsStylesMixin({
1272
- nestingElementTagName: 'descope-text',
1273
- nestingElementDestSlotName: 'text',
1274
- forwardAttrOptions: {
1275
- includeAttrs: ['variant', 'italic', 'uppercase', 'lowercase']
1276
- }
1277
- }),
1278
- createStyleMixin({
1279
- mappings: {
1280
- width: matchHostStyle(),
1281
- textAlign: {},
1282
- color: anchor,
1283
- cursor: anchor,
1284
- borderBottomWidth: anchor,
1285
- borderBottomStyle: anchor,
1286
- borderBottomColor: anchor
1287
- },
1288
- nestedMappings: {
1289
- color: {
1290
- selector: ` ${Text.componentName}`,
1291
- property: Text.cssVarList.color
1292
- }
1293
- }
1294
- }),
1295
- hoverableMixin(anchor.selector),
1296
- draggableMixin,
1297
- componentNameValidationMixin
1298
- )(RawLink);
1299
-
1300
- customElements.define(componentName$6, Link);
1301
-
1302
- const componentName$5 = getComponentName('divider');
946
+ const componentName$a = getComponentName('divider');
1303
947
  class RawDivider extends DescopeBaseClass {
1304
948
  static get componentName() {
1305
- return componentName$5;
949
+ return componentName$a;
1306
950
  }
1307
951
  constructor() {
1308
952
  super();
@@ -1336,14 +980,14 @@ class RawDivider extends DescopeBaseClass {
1336
980
  }
1337
981
  }
1338
982
 
1339
- const selectors = {
983
+ const selectors$2 = {
1340
984
  root: { selector: '' },
1341
985
  before: { selector: '::before' },
1342
986
  after: { selector: '::after' },
1343
987
  slotted: { selector: () => '::slotted(*)' }
1344
988
  };
1345
989
 
1346
- const { root, before, after, slotted } = selectors;
990
+ const { root, before, after, slotted } = selectors$2;
1347
991
 
1348
992
  const Divider = compose(
1349
993
  enforceNestingElementsStylesMixin({
@@ -1372,16 +1016,202 @@ const Divider = compose(
1372
1016
  componentNameValidationMixin
1373
1017
  )(RawDivider);
1374
1018
 
1375
- customElements.define(componentName$5, Divider);
1376
-
1377
- const componentName$4 = getComponentName('logo');
1378
-
1379
- let style;
1380
- const getStyle = () => style;
1019
+ const componentName$9 = getComponentName('text');
1381
1020
 
1382
- class RawLogo extends DescopeBaseClass {
1021
+ class RawText extends DescopeBaseClass {
1383
1022
  static get componentName() {
1384
- return componentName$4;
1023
+ return componentName$9;
1024
+ }
1025
+ constructor() {
1026
+ super();
1027
+ const template = document.createElement('template');
1028
+ template.innerHTML = `<slot></slot>`;
1029
+
1030
+ this.attachShadow({ mode: 'open' });
1031
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
1032
+
1033
+ this.baseSelector = ':host > slot';
1034
+ }
1035
+ }
1036
+
1037
+ const Text = compose(
1038
+ createStyleMixin({
1039
+ mappings: {
1040
+ fontFamily: {},
1041
+ lineHeight: {},
1042
+ fontStyle: {},
1043
+ fontSize: {},
1044
+ fontWeight: {},
1045
+ width: {},
1046
+ color: {},
1047
+ letterSpacing: {},
1048
+ textShadow: {},
1049
+ borderWidth: {},
1050
+ borderStyle: {},
1051
+ borderColor: {},
1052
+ textTransform: {},
1053
+ textAlign: matchHostStyle(),
1054
+ display: matchHostStyle()
1055
+ }
1056
+ }),
1057
+ draggableMixin,
1058
+ componentNameValidationMixin
1059
+ )(RawText);
1060
+
1061
+ customElements.define(componentName$9, Text);
1062
+
1063
+ customElements.define(componentName$a, Divider);
1064
+
1065
+ const componentName$8 = getComponentName('email-field');
1066
+
1067
+ let overrides$5 = ``;
1068
+
1069
+ const EmailField = compose(
1070
+ createStyleMixin({
1071
+ mappings: {
1072
+ ...textFieldMappings
1073
+ }
1074
+ }),
1075
+ draggableMixin,
1076
+ inputMixin,
1077
+ componentNameValidationMixin
1078
+ )(
1079
+ createProxy({
1080
+ slots: ['suffix'],
1081
+ wrappedEleName: 'vaadin-email-field',
1082
+ style: () => overrides$5,
1083
+ excludeAttrsSync: ['tabindex'],
1084
+ componentName: componentName$8
1085
+ })
1086
+ );
1087
+
1088
+ overrides$5 = `
1089
+ :host {
1090
+ display: inline-block;
1091
+ }
1092
+ vaadin-email-field {
1093
+ margin: 0;
1094
+ padding: 0;
1095
+ }
1096
+ vaadin-email-field::part(input-field) {
1097
+ overflow: hidden;
1098
+ }
1099
+ vaadin-email-field[readonly] > input:placeholder-shown {
1100
+ opacity: 1;
1101
+ }
1102
+ vaadin-email-field input:-webkit-autofill,
1103
+ vaadin-email-field input:-webkit-autofill::first-line,
1104
+ vaadin-email-field input:-webkit-autofill:hover,
1105
+ vaadin-email-field input:-webkit-autofill:active,
1106
+ vaadin-email-field input:-webkit-autofill:focus {
1107
+ -webkit-text-fill-color: var(${EmailField.cssVarList.color});
1108
+ box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
1109
+ }
1110
+ vaadin-email-field > label,
1111
+ vaadin-email-field::part(input-field) {
1112
+ cursor: pointer;
1113
+ color: var(${EmailField.cssVarList.color});
1114
+ }
1115
+ vaadin-email-field::part(input-field):focus {
1116
+ cursor: text;
1117
+ }
1118
+ vaadin-email-field[required]::part(required-indicator)::after {
1119
+ font-size: "12px";
1120
+ content: "*";
1121
+ color: var(${EmailField.cssVarList.color});
1122
+ }
1123
+ vaadin-email-field[readonly]::part(input-field)::after {
1124
+ border: 0 solid;
1125
+ }
1126
+ `;
1127
+
1128
+ customElements.define(componentName$8, EmailField);
1129
+
1130
+ const componentName$7 = getComponentName('link');
1131
+ class RawLink extends DescopeBaseClass {
1132
+ static get componentName() {
1133
+ return componentName$7;
1134
+ }
1135
+ constructor() {
1136
+ super();
1137
+ const template = document.createElement('template');
1138
+
1139
+ template.innerHTML = `
1140
+ <style>
1141
+ :host {
1142
+ display: inline-block;
1143
+ }
1144
+ :host a {
1145
+ display: inline-block;
1146
+ }
1147
+ </style>
1148
+ <div>
1149
+ <a>
1150
+ <slot name="text"></slot>
1151
+ </a>
1152
+ </div>
1153
+ `;
1154
+
1155
+ this.attachShadow({ mode: 'open' });
1156
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
1157
+
1158
+ forwardAttrs(this.shadowRoot.host, this.shadowRoot.querySelector('a'), {
1159
+ includeAttrs: ['href', 'target', 'tooltip'],
1160
+ mapAttrs: {
1161
+ tooltip: 'title'
1162
+ }
1163
+ });
1164
+
1165
+ this.baseSelector = ':host > div';
1166
+ }
1167
+ }
1168
+
1169
+ const selectors$1 = {
1170
+ anchor: { selector: '> a' }
1171
+ };
1172
+
1173
+ const { anchor } = selectors$1;
1174
+
1175
+ const Link = compose(
1176
+ enforceNestingElementsStylesMixin({
1177
+ nestingElementTagName: 'descope-text',
1178
+ nestingElementDestSlotName: 'text',
1179
+ forwardAttrOptions: {
1180
+ includeAttrs: ['variant', 'italic', 'uppercase', 'lowercase']
1181
+ }
1182
+ }),
1183
+ createStyleMixin({
1184
+ mappings: {
1185
+ width: matchHostStyle(),
1186
+ textAlign: {},
1187
+ color: anchor,
1188
+ cursor: anchor,
1189
+ borderBottomWidth: anchor,
1190
+ borderBottomStyle: anchor,
1191
+ borderBottomColor: anchor
1192
+ },
1193
+ nestedMappings: {
1194
+ color: {
1195
+ selector: ` ${Text.componentName}`,
1196
+ property: Text.cssVarList.color
1197
+ }
1198
+ }
1199
+ }),
1200
+ hoverableMixin(anchor.selector),
1201
+ draggableMixin,
1202
+ componentNameValidationMixin
1203
+ )(RawLink);
1204
+
1205
+ customElements.define(componentName$7, Link);
1206
+
1207
+ const componentName$6 = getComponentName('logo');
1208
+
1209
+ let style;
1210
+ const getStyle = () => style;
1211
+
1212
+ class RawLogo extends DescopeBaseClass {
1213
+ static get componentName() {
1214
+ return componentName$6;
1385
1215
  }
1386
1216
  constructor() {
1387
1217
  super();
@@ -1397,40 +1227,622 @@ class RawLogo extends DescopeBaseClass {
1397
1227
 
1398
1228
  this.baseSelector = ':host > div';
1399
1229
  }
1400
- }
1230
+ }
1231
+
1232
+ const Logo = compose(
1233
+ createStyleMixin({
1234
+ mappings: {
1235
+ height: {},
1236
+ width: {},
1237
+ url: {},
1238
+ fallbackUrl: {}
1239
+ }
1240
+ }),
1241
+ draggableMixin,
1242
+ componentNameValidationMixin
1243
+ )(RawLogo);
1244
+
1245
+ style = `
1246
+ :host {
1247
+ display: inline-block;
1248
+ }
1249
+ :host > div {
1250
+ display: inline-block;
1251
+ content: var(${Logo.cssVarList.url}, var(${Logo.cssVarList.fallbackUrl}));
1252
+ }
1253
+ `;
1254
+
1255
+ customElements.define(componentName$6, Logo);
1256
+
1257
+ const componentName$5 = getComponentName('number-field');
1258
+
1259
+ let overrides$4 = ``;
1260
+
1261
+ const NumberField = compose(
1262
+ createStyleMixin({
1263
+ mappings: {
1264
+ ...textFieldMappings
1265
+ }
1266
+ }),
1267
+ draggableMixin,
1268
+ inputMixin,
1269
+ componentNameValidationMixin
1270
+ )(
1271
+ createProxy({
1272
+ slots: ['prefix', 'suffix'],
1273
+ wrappedEleName: 'vaadin-number-field',
1274
+ style: () => overrides$4,
1275
+ excludeAttrsSync: ['tabindex'],
1276
+ componentName: componentName$5
1277
+ })
1278
+ );
1279
+
1280
+ overrides$4 = `
1281
+ :host {
1282
+ display: inline-block;
1283
+ }
1284
+ vaadin-number-field {
1285
+ margin: 0;
1286
+ padding: 0;
1287
+ }
1288
+ vaadin-number-field::part(input-field) {
1289
+ overflow: hidden;
1290
+ }
1291
+ vaadin-number-field[readonly] > input:placeholder-shown {
1292
+ opacity: 1;
1293
+ }
1294
+ vaadin-number-field input:-webkit-autofill,
1295
+ vaadin-number-field input:-webkit-autofill::first-line,
1296
+ vaadin-number-field input:-webkit-autofill:hover,
1297
+ vaadin-number-field input:-webkit-autofill:active,
1298
+ vaadin-number-field input:-webkit-autofill:focus {
1299
+ -webkit-text-fill-color: var(${NumberField.cssVarList.color});
1300
+ box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
1301
+ }
1302
+ vaadin-number-field > label,
1303
+ vaadin-number-field::part(input-field) {
1304
+ cursor: pointer;
1305
+ color: var(${NumberField.cssVarList.color});
1306
+ }
1307
+ vaadin-number-field::part(input-field):focus {
1308
+ cursor: text;
1309
+ }
1310
+ vaadin-number-field[required]::part(required-indicator)::after {
1311
+ font-size: "12px";
1312
+ content: "*";
1313
+ color: var(${NumberField.cssVarList.color});
1314
+ }
1315
+ vaadin-number-field[readonly]::part(input-field)::after {
1316
+ border: 0 solid;
1317
+ }
1318
+ `;
1319
+
1320
+ customElements.define(componentName$5, NumberField);
1321
+
1322
+ const focusElement = (ele) => {
1323
+ ele?.focus();
1324
+ ele?.setSelectionRange(1, 1);
1325
+ };
1326
+
1327
+ const getSanitizedCharacters = (str) => {
1328
+ const pin = str.replace(/\s/g, ''); // sanitize string
1329
+
1330
+ // accept only numbers
1331
+ if (!pin.match(/^\d+$/)) return [];
1332
+
1333
+ return [...pin]; // creating array of chars
1334
+ };
1335
+
1336
+ const componentName$4 = getComponentName('passcode-internal');
1337
+
1338
+ class PasscodeInternal extends HTMLElement {
1339
+ static get observedAttributes() {
1340
+ return [
1341
+ 'disabled',
1342
+ 'bordered',
1343
+ 'size'
1344
+ ];
1345
+ }
1346
+
1347
+ static get componentName() {
1348
+ return componentName$4;
1349
+ }
1350
+
1351
+ static get formAssociated() {
1352
+ return true;
1353
+ }
1354
+
1355
+ #internals
1356
+
1357
+ constructor() {
1358
+ super();
1359
+ const template = document.createElement('template');
1360
+
1361
+ const inputs = [...Array(this.digits).keys()].map((idx) => `
1362
+ <descope-text-field
1363
+ st-width="35px"
1364
+ data-id=${idx}
1365
+ type="tel"
1366
+ autocomplete="none"
1367
+ ></descope-text-field>
1368
+ `);
1369
+
1370
+ template.innerHTML = `
1371
+ <div>
1372
+ ${inputs.join('')}
1373
+ </div>
1374
+ `;
1375
+
1376
+ this.appendChild(template.content.cloneNode(true));
1377
+
1378
+ this.baseSelector = ':host > div';
1379
+
1380
+ this.#internals = this.attachInternals();
1381
+
1382
+ this.inputs = Array.from(this.querySelectorAll('descope-text-field'));
1383
+ }
1384
+
1385
+ checkValidity() {
1386
+ // we need to toggle the has-error-message so the text inside the digits will become red when there is an error
1387
+ if (this.#internals.validity.valid) {
1388
+ this.inputs.forEach(input => input.removeAttribute('has-error-message'));
1389
+ } else {
1390
+ this.inputs.forEach(input => input.setAttribute('has-error-message', 'true'));
1391
+ // we need to call it so the has-error-message with have the correct format (="true")
1392
+ this.oninvalid?.();
1393
+ }
1394
+ return this.#internals.validity.valid
1395
+ }
1396
+
1397
+ get digits() {
1398
+ return Number.parseInt(this.getAttribute('digits')) || 6
1399
+ }
1400
+
1401
+ get value() {
1402
+ return this.inputs.map(({ value }) => value).join('')
1403
+ }
1404
+
1405
+ set value(val) { }
1406
+
1407
+ get isRequired() {
1408
+ return this.hasAttribute('required') && this.getAttribute('required') !== 'false'
1409
+ }
1410
+
1411
+ get pattern() {
1412
+ return `^$|^\\d{${this.digits},}$`
1413
+ }
1414
+
1415
+ get valueMissingErrMsg() {
1416
+ return 'Please fill out this field.'
1417
+ }
1418
+
1419
+ get patternMismatchErrMsg() {
1420
+ return `Must be a ${this.digits} digits number.`
1421
+ }
1422
+
1423
+ get validity() {
1424
+ return this.#internals.validity;
1425
+ }
1426
+
1427
+ get validationMessage() {
1428
+ return this.#internals.validationMessage;
1429
+ }
1430
+
1431
+ reportValidity() {
1432
+ this.#internals.reportValidity();
1433
+ }
1434
+
1435
+ formAssociatedCallback() {
1436
+ this.setValidity?.();
1437
+ }
1438
+
1439
+ setValidity = () => {
1440
+ if (this.isRequired && !this.value) {
1441
+ this.#internals.setValidity({ valueMissing: true }, this.valueMissingErrMsg);
1442
+ }
1443
+ else if (this.pattern && !new RegExp(this.pattern).test(this.value)) {
1444
+ this.#internals.setValidity({ patternMismatch: true }, this.patternMismatchErrMsg);
1445
+ }
1446
+ else {
1447
+ this.#internals.setValidity({});
1448
+ }
1449
+ };
1450
+
1451
+ async connectedCallback() {
1452
+ this.setValidity();
1453
+ this.initInputs();
1454
+
1455
+ this.onfocus = () => {
1456
+ this.inputs[0].focus();
1457
+ };
1458
+ }
1459
+
1460
+ getInputIdx(inputEle) {
1461
+ return Number.parseInt(inputEle.getAttribute('data-id'), 10)
1462
+ }
1463
+
1464
+ getNextInput(currInput) {
1465
+ const currentIdx = this.getInputIdx(currInput);
1466
+ const newIdx = Math.min(currentIdx + 1, this.inputs.length - 1);
1467
+ return this.inputs[newIdx]
1468
+ }
1469
+
1470
+ getPrevInput(currInput) {
1471
+ const currentIdx = this.getInputIdx(currInput);
1472
+ const newIdx = Math.max(currentIdx - 1, 0);
1473
+ return this.inputs[newIdx]
1474
+ }
1475
+
1476
+ fillDigits(charArr, currentInput) {
1477
+ for (let i = 0; i < charArr.length; i += 1) {
1478
+ currentInput.value = charArr[i] ?? '';
1479
+
1480
+ const nextInput = this.getNextInput(currentInput);
1481
+ if (nextInput === currentInput) break;
1482
+ currentInput = nextInput;
1483
+ }
1484
+
1485
+ !currentInput.hasAttribute('focused') && focusElement(currentInput);
1486
+ };
1487
+
1488
+ initInputs() {
1489
+ this.inputs.forEach((input) => {
1490
+
1491
+ // in order to simulate blur on the input
1492
+ // we are checking if focus on one of the digits happened immediately after blur on another digit
1493
+ // if not, the component is no longer focused and we should simulate blur
1494
+ input.addEventListener('blur', () => {
1495
+ const timerId = setTimeout(() => {
1496
+ this.dispatchEvent(new Event('blur'));
1497
+ });
1498
+
1499
+ this.inputs.forEach((ele) =>
1500
+ ele.addEventListener('focus', () => clearTimeout(timerId), { once: true })
1501
+ );
1502
+ });
1503
+
1504
+ input.oninput = (e) => {
1505
+ const charArr = getSanitizedCharacters(input.value);
1506
+
1507
+ if (!charArr.length) input.value = ''; // if we got an invalid value we want to clear the input
1508
+ else this.fillDigits(charArr, input);
1509
+
1510
+ this.setValidity();
1511
+ };
1512
+
1513
+ input.onkeydown = ({ key }) => {
1514
+ if (key === 'Backspace') {
1515
+ input.value = '';
1516
+
1517
+ // if the user deleted the digit we want to focus the previous digit
1518
+ const prevInput = this.getPrevInput(input);
1519
+
1520
+ !prevInput.hasAttribute('focused') && setTimeout(() => {
1521
+ focusElement(prevInput);
1522
+ });
1523
+ } else if (key.match(/^(\d)$/g)) { // if input is a digit
1524
+ input.value = ''; // we are clearing the previous value so we can override it with the new value
1525
+ }
1526
+
1527
+ this.setValidity();
1528
+ };
1529
+ });
1530
+ }
1531
+
1532
+ attributeChangedCallback(
1533
+ attrName,
1534
+ oldValue,
1535
+ newValue
1536
+ ) {
1537
+ if (oldValue !== newValue &&
1538
+ PasscodeInternal.observedAttributes.includes(attrName)) {
1539
+ this.inputs.forEach((input) => input.setAttribute(attrName, newValue));
1540
+ }
1541
+ }
1542
+ }
1543
+
1544
+ const componentName$3 = getComponentName('passcode');
1545
+
1546
+ const customMixin = (superclass) =>
1547
+ class DraggableMixinClass extends superclass {
1548
+ constructor() {
1549
+ super();
1550
+ }
1551
+
1552
+ get digits() {
1553
+ return Number.parseInt(this.getAttribute('digits')) || 6
1554
+ }
1555
+
1556
+ connectedCallback() {
1557
+ super.connectedCallback?.();
1558
+ const template = document.createElement('template');
1559
+
1560
+ //forward required & pattern TODO use forwardAttrs
1561
+ template.innerHTML = `
1562
+ <${componentName$4}
1563
+ bordered="true"
1564
+ name="code"
1565
+ tabindex="0"
1566
+ slot="input"
1567
+ required="${this.shadowRoot.host.getAttribute('required')}"
1568
+ pattern="${this.shadowRoot.host.getAttribute('pattern')}"
1569
+ ></${componentName$4}>
1570
+ `;
1571
+
1572
+ // we are adding a slot under vaadin-text-field, it should reflect all descope-passcode children to be under vaadin-text-field, this is why it has a name & slot
1573
+ const slotEle = Object.assign(document.createElement('slot'), { name: 'input', slot: 'input', part: 'input' });
1574
+ this.proxyElement.appendChild(slotEle);
1575
+
1576
+ // we want to control when the element is out of focus
1577
+ // so the validations will be triggered blur event is dispatched from descope-passcode internal (and not every time focusing a digit)
1578
+ this.proxyElement._setFocused = () => { };
1579
+
1580
+ this.shadowRoot.host.appendChild(template.content.cloneNode(true));
1581
+ this.inputElement = this.querySelector(componentName$4);
1582
+
1583
+ // we want to trigger validation only when dispatching a blur event from the descope-passcode-internal
1584
+ this.inputElement.addEventListener('blur', () => {
1585
+ this.proxyElement.validate();
1586
+ });
1587
+ }
1588
+ };
1589
+
1590
+ const { borderStyle, borderWidth, ...restTextFieldMappings } = textFieldMappings;
1591
+
1592
+ const Passcode = compose(
1593
+ createStyleMixin({
1594
+ mappings: {
1595
+ ...restTextFieldMappings,
1596
+ },
1597
+ nestedMappings: {
1598
+ borderColor: {
1599
+ selector: ` ${TextField.componentName}`,
1600
+ property: TextField.cssVarList.borderColor
1601
+ }
1602
+ }
1603
+ }),
1604
+ draggableMixin,
1605
+ inputMixin,
1606
+ componentNameValidationMixin,
1607
+ customMixin
1608
+ )(
1609
+ createProxy({
1610
+ slots: [],
1611
+ wrappedEleName: 'vaadin-text-field',
1612
+ style: () => `
1613
+ :host {
1614
+ --vaadin-field-default-width: auto;
1615
+ }
1616
+
1617
+ ::slotted([slot='input']) {
1618
+ -webkit-mask-image: none;
1619
+ display: flex;
1620
+ gap: 2px;
1621
+ align-items: center;
1622
+ padding: 0;
1623
+ }
1624
+
1625
+ vaadin-text-field::part(input-field) {
1626
+ background-color: transparent;
1627
+ padding: 0;
1628
+ }
1629
+
1630
+ ${overrides$3}
1631
+ `,
1632
+ excludeAttrsSync: ['tabindex'],
1633
+ componentName: componentName$3
1634
+ })
1635
+ );
1636
+
1637
+ const overrides$3 = `
1638
+ :host {
1639
+ display: inline-block;
1640
+ }
1641
+
1642
+ vaadin-text-field {
1643
+ margin: 0;
1644
+ padding: 0;
1645
+ }
1646
+ vaadin-text-field::part(input-field) {
1647
+ overflow: hidden;
1648
+ }
1649
+ vaadin-text-field[readonly] > input:placeholder-shown {
1650
+ opacity: 1;
1651
+ }
1652
+
1653
+ vaadin-text-field > label,
1654
+ vaadin-text-field::part(input-field) {
1655
+ cursor: pointer;
1656
+ color: var(${Passcode.cssVarList.color});
1657
+ }
1658
+ vaadin-text-field::part(input-field):focus {
1659
+ cursor: text;
1660
+ }
1661
+ vaadin-text-field[required]::part(required-indicator)::after {
1662
+ font-size: "12px";
1663
+ content: "*";
1664
+ color: var(${Passcode.cssVarList.color});
1665
+ }
1666
+ vaadin-text-field[readonly]::part(input-field)::after {
1667
+ border: 0 solid;
1668
+ }
1669
+ `;
1670
+
1671
+ customElements.define(componentName$4, PasscodeInternal);
1672
+
1673
+ customElements.define(componentName$3, Passcode);
1674
+
1675
+ const componentName$2 = getComponentName('password-field');
1676
+
1677
+ let overrides$2 = ``;
1678
+
1679
+ const PasswordField = compose(
1680
+ createStyleMixin({
1681
+ mappings: {
1682
+ ...textFieldMappings,
1683
+ revealCursor: [
1684
+ {
1685
+ selector: '::part(reveal-button)::before',
1686
+ property: 'cursor'
1687
+ }
1688
+ ]
1689
+ }
1690
+ }),
1691
+ draggableMixin,
1692
+ inputMixin,
1693
+ componentNameValidationMixin
1694
+ )(
1695
+ createProxy({
1696
+ slots: ['suffix'],
1697
+ wrappedEleName: 'vaadin-password-field',
1698
+ style: () => overrides$2,
1699
+ excludeAttrsSync: ['tabindex'],
1700
+ componentName: componentName$2
1701
+ })
1702
+ );
1703
+
1704
+ overrides$2 = `
1705
+ :host {
1706
+ display: inline-block;
1707
+ }
1708
+ vaadin-password-field {
1709
+ margin: 0;
1710
+ padding: 0;
1711
+ }
1712
+ vaadin-password-field::part(input-field) {
1713
+ overflow: hidden;
1714
+ }
1715
+ vaadin-password-field[readonly] > input:placeholder-shown {
1716
+ opacity: 1;
1717
+ }
1718
+ vaadin-password-field input:-webkit-autofill,
1719
+ vaadin-password-field input:-webkit-autofill::first-line,
1720
+ vaadin-password-field input:-webkit-autofill:hover,
1721
+ vaadin-password-field input:-webkit-autofill:active,
1722
+ vaadin-password-field input:-webkit-autofill:focus {
1723
+ -webkit-text-fill-color: var(${PasswordField.cssVarList.color});
1724
+ box-shadow: 0 0 0 var(${PasswordField.cssVarList.height}) var(${PasswordField.cssVarList.backgroundColor}) inset;
1725
+ }
1726
+ vaadin-password-field > label,
1727
+ vaadin-password-field::part(input-field) {
1728
+ cursor: pointer;
1729
+ color: var(${PasswordField.cssVarList.color});
1730
+ }
1731
+ vaadin-password-field::part(input-field):focus {
1732
+ cursor: text;
1733
+ }
1734
+ vaadin-password-field[required]::part(required-indicator)::after {
1735
+ font-size: "12px";
1736
+ content: "*";
1737
+ color: var(${PasswordField.cssVarList.color});
1738
+ }
1739
+ vaadin-password-field[readonly]::part(input-field)::after {
1740
+ border: 0 solid;
1741
+ }
1742
+ `;
1743
+
1744
+ customElements.define(componentName$2, PasswordField);
1745
+
1746
+ const componentName$1 = getComponentName('switch-toggle');
1747
+
1748
+ let overrides$1 = ``;
1749
+
1750
+ const SwitchToggle = compose(
1751
+ createStyleMixin({
1752
+ mappings: {
1753
+ width: matchHostStyle(),
1754
+ cursor: [{}, { selector: '> label' }]
1755
+ }
1756
+ }),
1757
+ draggableMixin,
1758
+ inputMixin,
1759
+ componentNameValidationMixin
1760
+ )(
1761
+ createProxy({
1762
+ slots: [],
1763
+ wrappedEleName: 'vaadin-checkbox',
1764
+ style: () => overrides$1,
1765
+ excludeAttrsSync: ['tabindex'],
1766
+ componentName: componentName$1
1767
+ })
1768
+ );
1769
+
1770
+ overrides$1 = `
1771
+ :host {
1772
+ display: inline-block;
1773
+ }
1774
+
1775
+ :host {
1776
+ --margin: 7px;
1777
+ --width: var(${SwitchToggle.cssVarList.width});
1778
+ --height: calc(var(--width) / 2);
1779
+ --radius: var(--height);
1780
+ --knobSize: calc(var(--height) - 5px);
1781
+ --bgColor: #fff;
1782
+ --knobBgColor: #000;
1783
+ }
1784
+ vaadin-checkbox>label {
1785
+ cursor: pointer;
1786
+ border: 1px solid;
1787
+ text-indent: -99999px;
1788
+ display: block;
1789
+ position: relative;
1790
+ width: var(--width);
1791
+ height: var(--height);
1792
+ background: var(--bgColor);
1793
+ border-radius: var(--radius);
1794
+ }
1795
+ vaadin-checkbox>label::after {
1796
+ content: '';
1797
+ position: absolute;
1798
+ transition: 0.3s;
1799
+ top: var(--margin);
1800
+ left: var(--margin);
1801
+ width: var(--knobSize);
1802
+ height: var(--knobSize);
1803
+ background: var(--knobBgColor);
1804
+ border-radius: var(--knobSize);
1805
+ }
1806
+ vaadin-checkbox::part(checkbox) {
1807
+ height: 0;
1808
+ width: 0;
1809
+ visibility: hidden;
1810
+ }
1811
+ vaadin-checkbox[checked]>label::after {
1812
+ transform: translateX(-100%);
1813
+ left: calc(100% - var(--margin));
1814
+ }
1815
+ vaadin-checkbox[active]>label::after {
1816
+ width: calc(var(--knobSize) + 15px);
1817
+ }
1818
+ `;
1401
1819
 
1402
- const Logo = compose(
1403
- createStyleMixin({
1404
- mappings: {
1405
- height: {},
1406
- width: {},
1407
- url: {},
1408
- fallbackUrl: {}
1409
- }
1410
- }),
1411
- draggableMixin,
1412
- componentNameValidationMixin
1413
- )(RawLogo);
1820
+ customElements.define(componentName$1, SwitchToggle);
1414
1821
 
1415
- style = `
1416
- :host {
1417
- display: inline-block;
1418
- }
1419
- :host > div {
1420
- display: inline-block;
1421
- content: var(${Logo.cssVarList.url}, var(${Logo.cssVarList.fallbackUrl}));
1422
- }
1423
- `;
1822
+ const componentName = getComponentName('text-area');
1424
1823
 
1425
- customElements.define(componentName$4, Logo);
1824
+ const selectors = {
1825
+ label: '::part(label)',
1826
+ input: '::part(input-field)',
1827
+ required: '::part(required-indicator)::after'
1828
+ };
1426
1829
 
1427
- const componentName$3 = getComponentName('checkbox');
1830
+ let overrides = ``;
1428
1831
 
1429
- const Checkbox = compose(
1832
+ const TextArea = compose(
1430
1833
  createStyleMixin({
1431
1834
  mappings: {
1835
+ resize: { selector: '> textarea' },
1836
+ color: { selector: selectors.label },
1837
+ cursor: {},
1432
1838
  width: matchHostStyle(),
1433
- cursor: [{}, { selector: '> label' }]
1839
+ backgroundColor: { selector: selectors.input },
1840
+ borderWidth: { selector: selectors.input },
1841
+ borderStyle: { selector: selectors.input },
1842
+ borderColor: { selector: selectors.input },
1843
+ borderRadius: { selector: selectors.input },
1844
+ outline: { selector: selectors.input },
1845
+ outlineOffset: { selector: selectors.input }
1434
1846
  }
1435
1847
  }),
1436
1848
  draggableMixin,
@@ -1439,18 +1851,35 @@ const Checkbox = compose(
1439
1851
  )(
1440
1852
  createProxy({
1441
1853
  slots: [],
1442
- wrappedEleName: 'vaadin-checkbox',
1443
- style: `
1444
- :host {
1445
- display: inline-block;
1446
- }
1447
- `,
1854
+ wrappedEleName: 'vaadin-text-area',
1855
+ style: () => overrides,
1448
1856
  excludeAttrsSync: ['tabindex'],
1449
- componentName: componentName$3
1857
+ componentName
1450
1858
  })
1451
1859
  );
1452
1860
 
1453
- customElements.define(componentName$3, Checkbox);
1861
+ overrides = `
1862
+ :host {
1863
+ display: inline-block;
1864
+ }
1865
+
1866
+ vaadin-text-area {
1867
+ margin: 0;
1868
+ }
1869
+ vaadin-text-area > label,
1870
+ vaadin-text-area::part(input-field) {
1871
+ cursor: pointer;
1872
+ }
1873
+ vaadin-text-area[focused]::part(input-field) {
1874
+ cursor: text;
1875
+ }
1876
+ vaadin-text-area::part(required-indicator)::after {
1877
+ font-size: "12px";
1878
+ content: "*";
1879
+ }
1880
+ `;
1881
+
1882
+ customElements.define(componentName, TextArea);
1454
1883
 
1455
1884
  const getVarName = (path) => getCssVarName(DESCOPE_PREFIX, ...path);
1456
1885
 
@@ -1916,80 +2345,6 @@ const checkbox = {
1916
2345
  [vars$6.cursor]: 'pointer'
1917
2346
  };
1918
2347
 
1919
- const componentName$2 = getComponentName('switch-toggle');
1920
-
1921
- let overrides$1 = ``;
1922
-
1923
- const SwitchToggle = compose(
1924
- createStyleMixin({
1925
- mappings: {
1926
- width: matchHostStyle(),
1927
- cursor: [{}, { selector: '> label' }]
1928
- }
1929
- }),
1930
- draggableMixin,
1931
- inputMixin,
1932
- componentNameValidationMixin
1933
- )(
1934
- createProxy({
1935
- slots: [],
1936
- wrappedEleName: 'vaadin-checkbox',
1937
- style: () => overrides$1,
1938
- excludeAttrsSync: ['tabindex'],
1939
- componentName: componentName$2
1940
- })
1941
- );
1942
-
1943
- overrides$1 = `
1944
- :host {
1945
- display: inline-block;
1946
- }
1947
-
1948
- :host {
1949
- --margin: 7px;
1950
- --width: var(${SwitchToggle.cssVarList.width});
1951
- --height: calc(var(--width) / 2);
1952
- --radius: var(--height);
1953
- --knobSize: calc(var(--height) - 5px);
1954
- --bgColor: #fff;
1955
- --knobBgColor: #000;
1956
- }
1957
- vaadin-checkbox>label {
1958
- cursor: pointer;
1959
- border: 1px solid;
1960
- text-indent: -99999px;
1961
- display: block;
1962
- position: relative;
1963
- width: var(--width);
1964
- height: var(--height);
1965
- background: var(--bgColor);
1966
- border-radius: var(--radius);
1967
- }
1968
- vaadin-checkbox>label::after {
1969
- content: '';
1970
- position: absolute;
1971
- transition: 0.3s;
1972
- top: var(--margin);
1973
- left: var(--margin);
1974
- width: var(--knobSize);
1975
- height: var(--knobSize);
1976
- background: var(--knobBgColor);
1977
- border-radius: var(--knobSize);
1978
- }
1979
- vaadin-checkbox::part(checkbox) {
1980
- height: 0;
1981
- width: 0;
1982
- visibility: hidden;
1983
- }
1984
- vaadin-checkbox[checked]>label::after {
1985
- transform: translateX(-100%);
1986
- left: calc(100% - var(--margin));
1987
- }
1988
- vaadin-checkbox[active]>label::after {
1989
- width: calc(var(--knobSize) + 15px);
1990
- }
1991
- `;
1992
-
1993
2348
  const vars$5 = SwitchToggle.cssVarList;
1994
2349
 
1995
2350
  const swtichToggle = {
@@ -2256,135 +2611,6 @@ const divider = {
2256
2611
  }
2257
2612
  };
2258
2613
 
2259
- const componentName$1 = getComponentName('passcode-internal');
2260
-
2261
- const componentName = getComponentName('passcode');
2262
-
2263
- const customMixin = (superclass) =>
2264
- class DraggableMixinClass extends superclass {
2265
- constructor() {
2266
- super();
2267
- }
2268
-
2269
- get digits() {
2270
- return Number.parseInt(this.getAttribute('digits')) || 6
2271
- }
2272
-
2273
- connectedCallback() {
2274
- super.connectedCallback?.();
2275
- const template = document.createElement('template');
2276
-
2277
- //forward required & pattern TODO use forwardAttrs
2278
- template.innerHTML = `
2279
- <${componentName$1}
2280
- bordered="true"
2281
- name="code"
2282
- tabindex="0"
2283
- slot="input"
2284
- required="${this.shadowRoot.host.getAttribute('required')}"
2285
- pattern="${this.shadowRoot.host.getAttribute('pattern')}"
2286
- ></${componentName$1}>
2287
- `;
2288
-
2289
- // we are adding a slot under vaadin-text-field, it should reflect all descope-passcode children to be under vaadin-text-field, this is why it has a name & slot
2290
- const slotEle = Object.assign(document.createElement('slot'), { name: 'input', slot: 'input', part: 'input' });
2291
- this.proxyElement.appendChild(slotEle);
2292
-
2293
- // we want to control when the element is out of focus
2294
- // so the validations will be triggered blur event is dispatched from descope-passcode internal (and not every time focusing a digit)
2295
- this.proxyElement._setFocused = () => { };
2296
-
2297
- this.shadowRoot.host.appendChild(template.content.cloneNode(true));
2298
- this.inputElement = this.querySelector(componentName$1);
2299
-
2300
- // we want to trigger validation only when dispatching a blur event from the descope-passcode-internal
2301
- this.inputElement.addEventListener('blur', () => {
2302
- this.proxyElement.validate();
2303
- });
2304
- }
2305
- };
2306
-
2307
- const { borderStyle, borderWidth, ...restTextFieldMappings } = textFieldMappings;
2308
-
2309
- const Passcode = compose(
2310
- createStyleMixin({
2311
- mappings: {
2312
- ...restTextFieldMappings,
2313
- },
2314
- nestedMappings: {
2315
- borderColor: {
2316
- selector: ` ${TextField.componentName}`,
2317
- property: TextField.cssVarList.borderColor
2318
- }
2319
- }
2320
- }),
2321
- draggableMixin,
2322
- inputMixin,
2323
- componentNameValidationMixin,
2324
- customMixin
2325
- )(
2326
- createProxy({
2327
- slots: [],
2328
- wrappedEleName: 'vaadin-text-field',
2329
- style: () => `
2330
- :host {
2331
- --vaadin-field-default-width: auto;
2332
- }
2333
-
2334
- ::slotted([slot='input']) {
2335
- -webkit-mask-image: none;
2336
- display: flex;
2337
- gap: 2px;
2338
- align-items: center;
2339
- padding: 0;
2340
- }
2341
-
2342
- vaadin-text-field::part(input-field) {
2343
- background-color: transparent;
2344
- padding: 0;
2345
- }
2346
-
2347
- ${overrides}
2348
- `,
2349
- excludeAttrsSync: ['tabindex'],
2350
- componentName
2351
- })
2352
- );
2353
-
2354
- const overrides = `
2355
- :host {
2356
- display: inline-block;
2357
- }
2358
-
2359
- vaadin-text-field {
2360
- margin: 0;
2361
- padding: 0;
2362
- }
2363
- vaadin-text-field::part(input-field) {
2364
- overflow: hidden;
2365
- }
2366
- vaadin-text-field[readonly] > input:placeholder-shown {
2367
- opacity: 1;
2368
- }
2369
-
2370
- vaadin-text-field > label,
2371
- vaadin-text-field::part(input-field) {
2372
- cursor: pointer;
2373
- color: var(${Passcode.cssVarList.color});
2374
- }
2375
- vaadin-text-field::part(input-field):focus {
2376
- cursor: text;
2377
- }
2378
- vaadin-text-field[required]::part(required-indicator)::after {
2379
- font-size: "12px";
2380
- content: "*";
2381
- color: var(${Passcode.cssVarList.color});
2382
- }
2383
- vaadin-text-field[readonly]::part(input-field)::after {
2384
- border: 0 solid;
2385
- }
2386
- `;
2387
-
2388
2614
  const passcode = {
2389
2615
  ...textField(Passcode.cssVarList),
2390
2616
  };