@sula-tech/webcomponents 0.7.2 → 0.7.4

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.
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["sula-avatar_18",[[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"selectedItem":[32],"showItems":[32],"isFocused":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]]],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32]},[[4,"click","handleClick"]]],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
19
+ return bootstrapLazy([["sula-avatar_18",[[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"selectedItem":[32],"showItems":[32],"isFocused":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
20
20
  });
21
21
  //# sourceMappingURL=webcomponents.js.map
22
22
 
@@ -48,6 +48,7 @@ export declare class SulaTextarea {
48
48
  isActive: boolean;
49
49
  textValue: string;
50
50
  textareaIsFocused: boolean;
51
+ watchValueHandler(newValue: string): void;
51
52
  textareaElement: HTMLTextAreaElement;
52
53
  node?: HTMLElement;
53
54
  activeLabelElement: HTMLLabelElement;
@@ -53,6 +53,7 @@ export declare class SulaTextfield {
53
53
  textValue: string;
54
54
  showPassword: boolean;
55
55
  inputIsFocused: boolean;
56
+ watchValueHandler(newValue: string): void;
56
57
  inputContainer: HTMLDivElement;
57
58
  inputElement: HTMLInputElement;
58
59
  labelElement: HTMLDivElement;
@@ -21544,6 +21544,22 @@ const SulaTextarea = class {
21544
21544
  this.setLabelUp();
21545
21545
  };
21546
21546
  }
21547
+ watchValueHandler(e) {
21548
+ this.textValue = e;
21549
+ if (this.textareaElement && this.textareaElement.value !== e) {
21550
+ const t = this.textareaElement.selectionStart;
21551
+ this.textareaElement.value = e || "";
21552
+ if (this.textareaIsFocused && t !== null) {
21553
+ const o = Math.min(t, (e || "").length);
21554
+ this.textareaElement.setSelectionRange(o, o);
21555
+ }
21556
+ }
21557
+ if (e && e.trim().length > 0) {
21558
+ this.setLabelUp();
21559
+ } else if (!this.textareaIsFocused) {
21560
+ this.setLabelDown();
21561
+ }
21562
+ }
21547
21563
  handleClick(e) {
21548
21564
  if (!this.node || !this.textareaIsFocused) return;
21549
21565
  const t = this.node.contains(e.target);
@@ -21591,12 +21607,12 @@ const SulaTextarea = class {
21591
21607
  render() {
21592
21608
  const e = this.rows * 24 + 48;
21593
21609
  return h$1(Host, {
21594
- key: "ed754651792554736de45340f7a2eca30303517e",
21610
+ key: "71e17dbbb92c7a05d8988820c0599b39a0f841a2",
21595
21611
  ref: e => this.node = e
21596
21612
  }, h$1("div", {
21597
- key: "7c8422829a17136e4f98792da018fa4a4c531de4"
21613
+ key: "9be717191ecd92216c42830dfda5ea14a3c5c939"
21598
21614
  }, h$1("div", {
21599
- key: "16f16305b5b1a059e8d1e0b956eb78d2443bd9e0",
21615
+ key: "3765ff81f012dce9438d9c00d694fb61864acf79",
21600
21616
  id: "textarea-container",
21601
21617
  class: {
21602
21618
  "relative border rounded-sm px-16 py-12 outline-none caret-brand-primary": true,
@@ -21612,7 +21628,7 @@ const SulaTextarea = class {
21612
21628
  onFocus: this.handleFocus,
21613
21629
  onClick: this.handleTextareaClick
21614
21630
  }, h$1("label", {
21615
- key: "ca41cf5b404b52684d6597a6976b86a596bb613f",
21631
+ key: "252bc2b94a3a39a478a6c919bc181514eeb13891",
21616
21632
  class: {
21617
21633
  "text-base top-16 left-12 absolute transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]": true,
21618
21634
  "text-text-primary": !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
@@ -21621,7 +21637,7 @@ const SulaTextarea = class {
21621
21637
  },
21622
21638
  ref: e => this.labelElement = e
21623
21639
  }, this.label), h$1("label", {
21624
- key: "cfcb85fadb260a530be91f347c55e6f98ae3168b",
21640
+ key: "71505a321c84a6c33668cb0f8e67877943225c99",
21625
21641
  class: {
21626
21642
  "absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 active-label hidden from-down": true,
21627
21643
  "text-sm top-12 left-16": this.isActive,
@@ -21631,7 +21647,7 @@ const SulaTextarea = class {
21631
21647
  },
21632
21648
  ref: e => this.activeLabelElement = e
21633
21649
  }, this.label), h$1("textarea", {
21634
- key: "b020d47c6e676defc7af5703142bf28b27235b68",
21650
+ key: "55fdbfcf690c8198c62299d884cd85bba5f08346",
21635
21651
  ref: e => this.textareaElement = e,
21636
21652
  placeholder: this.isActive ? this.placeholder : "",
21637
21653
  rows: this.rows,
@@ -21649,10 +21665,10 @@ const SulaTextarea = class {
21649
21665
  onBlur: this.handleBlur,
21650
21666
  value: this.textValue
21651
21667
  })), (this.helpText || this.maxLength) && h$1("div", {
21652
- key: "5772c4879f4a2e680423a025ddf371b0682fdbfc",
21668
+ key: "a4d90c39f337137a50ac71ffdd1f0b0714761de9",
21653
21669
  class: "flex justify-between items-center px-16 mt-4 text-sm"
21654
21670
  }, this.helpText && h$1("div", {
21655
- key: "f85f4b9195cf845d110a8f3a9b4a34e8cd522783",
21671
+ key: "a1368830518a465f2d3bec91eec42966a5eee1c0",
21656
21672
  id: "textarea-help-text",
21657
21673
  class: {
21658
21674
  "text-text-primary": this.status === SulaTextareaStatus.Default && !this.disabled,
@@ -21660,7 +21676,7 @@ const SulaTextarea = class {
21660
21676
  "text-text-disabled": this.disabled
21661
21677
  }
21662
21678
  }, this.helpText), this.maxLength && h$1("div", {
21663
- key: "dffd4ae72ce81a460589f6cbb58f7615529547ea",
21679
+ key: "a53bdb59f7dfab7c276a9fd34921026f25bccf12",
21664
21680
  id: "max-length-container",
21665
21681
  class: {
21666
21682
  "text-text-primary": this.status === SulaTextareaStatus.Default && !this.disabled,
@@ -21669,6 +21685,11 @@ const SulaTextarea = class {
21669
21685
  }
21670
21686
  }, this.textValue ? this.textValue.length : 0, "/", this.maxLength))));
21671
21687
  }
21688
+ static get watchers() {
21689
+ return {
21690
+ value: [ "watchValueHandler" ]
21691
+ };
21692
+ }
21672
21693
  };
21673
21694
 
21674
21695
  SulaTextarea.style = sulaTextareaCss;
@@ -21711,6 +21732,7 @@ const SulaTextfield = class {
21711
21732
  this.handleInputChanges = e => {
21712
21733
  const t = e.target.value;
21713
21734
  this.textValue = t;
21735
+ this.value = t;
21714
21736
  this.valueChanged.emit(t);
21715
21737
  };
21716
21738
  this.handleFocus = () => {
@@ -21734,6 +21756,24 @@ const SulaTextfield = class {
21734
21756
  }
21735
21757
  };
21736
21758
  }
21759
+ watchValueHandler(e) {
21760
+ this.textValue = e;
21761
+ if (this.inputElement && this.inputElement.value !== e) {
21762
+ const t = this.inputElement.selectionStart;
21763
+ this.inputElement.value = e || "";
21764
+ if (this.inputIsFocused && t !== null) {
21765
+ const o = Math.min(t, (e || "").length);
21766
+ this.inputElement.setSelectionRange(o, o);
21767
+ }
21768
+ }
21769
+ if (e && e.trim().length > 0) {
21770
+ this.inputIsOpen = true;
21771
+ this.changeElementsStyle();
21772
+ } else if (!this.inputIsFocused) {
21773
+ this.inputIsOpen = false;
21774
+ this.changeElementsStyle();
21775
+ }
21776
+ }
21737
21777
  handleClick(e) {
21738
21778
  if (!this.node || !this.inputIsFocused) return;
21739
21779
  const t = this.node.contains(e.target);
@@ -21761,6 +21801,7 @@ const SulaTextfield = class {
21761
21801
  this.inputElement.focus();
21762
21802
  }
21763
21803
  changeElementsStyle() {
21804
+ if (!this.inputContainer || !this.labelElement) return;
21764
21805
  this.inputContainer.style.display = this.inputIsOpen ? "flex" : "none";
21765
21806
  this.labelElement.style.display = this.inputIsOpen ? "none" : "block";
21766
21807
  if (!this.inputIsOpen) {
@@ -21786,12 +21827,12 @@ const SulaTextfield = class {
21786
21827
  }
21787
21828
  render() {
21788
21829
  return h$1(Host, {
21789
- key: "3805ff5fefc6ccc3b903384ac54bcf01ebd9527a",
21830
+ key: "db19982329c8a6aa8989b3a68ef61a7453ee4a99",
21790
21831
  ref: e => this.node = e
21791
21832
  }, h$1("div", {
21792
- key: "e90a85b46e51d9c0c989bc4e0ff53b5996cc6c49"
21833
+ key: "daf060b490b07b535cb414b11c3c75f307f127aa"
21793
21834
  }, h$1("div", {
21794
- key: "258fa53c0386cc3cc231a53d5d0e8da483cc51ce",
21835
+ key: "1d84aec41f352537a124311c076eceec3271832a",
21795
21836
  id: "button-container",
21796
21837
  class: {
21797
21838
  "flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary": true,
@@ -21805,26 +21846,26 @@ const SulaTextfield = class {
21805
21846
  onFocus: this.handleFocus,
21806
21847
  onClick: this.handleInputClick
21807
21848
  }, !this.disabled && h$1("div", {
21808
- key: "0e16b2a5f2bd115b65a6d8e572bde900606fb97c",
21849
+ key: "6ec4a250e1bcd8f053b2dba7e6e6fe6842c1b9bf",
21809
21850
  class: {
21810
21851
  "hidden flex-col w-full": true,
21811
21852
  "pr-12": !!this.icon
21812
21853
  },
21813
21854
  ref: e => this.inputContainer = e
21814
21855
  }, h$1("label", {
21815
- key: "1a487915bfd317c1f1b3c04917096f402e7cb7ba",
21856
+ key: "001ef2edc750497dc82a65341f98289fd8d28c6d",
21816
21857
  class: "font-bold text-sm text-text-primary from-down"
21817
21858
  }, this.label), h$1("input", {
21818
- key: "b2cd0285ef6cdaa4956ac1e7dc7a9d2fb850ffed",
21859
+ key: "96c0725c63ed92ddbc164f8efcdc003707eb0115",
21819
21860
  type: this.type,
21820
21861
  ref: e => this.inputElement = e,
21821
21862
  placeholder: this.placeholder,
21822
21863
  class: "outline-none text-base text-text-primary bg-transparent",
21823
21864
  onInput: this.handleInputChanges,
21824
21865
  onFocus: this.handleInputFocus,
21825
- value: this.value
21866
+ value: this.textValue
21826
21867
  })), h$1("div", {
21827
- key: "c26f72728243abca768732d758f7a9992c32d146",
21868
+ key: "f65cd97f9ddcadcc07789d8d3dc9421e82e31d78",
21828
21869
  id: "textfield-label",
21829
21870
  class: {
21830
21871
  "text-base flex items-center": true,
@@ -21833,25 +21874,25 @@ const SulaTextfield = class {
21833
21874
  },
21834
21875
  ref: e => this.labelElement = e
21835
21876
  }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && h$1("div", {
21836
- key: "b1f375f8291a67455ae0e252321e4a0fa577bb64",
21877
+ key: "27596e159d5bcdd52f587350fa7ed619d5a6346e",
21837
21878
  class: "flex items-center justify-center",
21838
21879
  onClick: this.handleIconClick
21839
21880
  }, h$1("sula-icon", {
21840
- key: "a780572571be2d1b4e754ccb149b768bb9195800",
21881
+ key: "2fb87a5df61f3ed9f50f404ca8ff2988c71d10a7",
21841
21882
  icon: this.getInputIcon(),
21842
21883
  customClass: `text-2xl ${this.disabled ? "text-icon-disabled" : "text-icon-primary"}`
21843
21884
  }))), (this.helpText || this.maxLength) && !this.disabled && h$1("div", {
21844
- key: "6ac0ac18b014923a1b6a432e181beaea2f557dca",
21885
+ key: "d54b53d64879e9a454a72c7e6726c8b0f5905baa",
21845
21886
  class: "flex justify-between items-center px-16 mt-4 text-sm"
21846
21887
  }, this.helpText && h$1("div", {
21847
- key: "f8aa196b22755380105da258fa8e218ceb3894c0",
21888
+ key: "7ded73f462e82f41b8766e4654cd47fabf3b3a40",
21848
21889
  id: "textfield-help-text",
21849
21890
  class: {
21850
21891
  "text-text-primary": this.status === SulaTextfieldStatus.Default,
21851
21892
  "text-feedback-error": this.status === SulaTextfieldStatus.Error
21852
21893
  }
21853
21894
  }, this.helpText), this.maxLength && h$1("div", {
21854
- key: "9a9359a270f5f84175829e2e8347e992c89a2639",
21895
+ key: "c62b62d8b8c99a775a31092479f1e4d8f581908c",
21855
21896
  id: "max-length-container",
21856
21897
  class: {
21857
21898
  "text-text-primary": this.status === SulaTextfieldStatus.Default,
@@ -21859,6 +21900,11 @@ const SulaTextfield = class {
21859
21900
  }
21860
21901
  }, this.textValue ? this.textValue.length : 0, "/", this.maxLength))));
21861
21902
  }
21903
+ static get watchers() {
21904
+ return {
21905
+ value: [ "watchValueHandler" ]
21906
+ };
21907
+ }
21862
21908
  };
21863
21909
 
21864
21910
  SulaTextfield.style = sulaTextfieldCss;
@@ -22135,4 +22181,4 @@ SulaTimelineList.style = sulaTimelineListCss;
22135
22181
 
22136
22182
  export { SulaAvatar as sula_avatar, SulaBadge as sula_badge, SulaButton as sula_button, SulaCheckbox as sula_checkbox, SulaChip as sula_chip, SulaDropdown as sula_dropdown, SulaIcon as sula_icon, SulaLoader as sula_loader, SulaMenuSelectList as sula_menu_select_list, SulaProgressBar as sula_progress_bar, SulaRadioButton as sula_radio_button, SulaSearchBar as sula_search_bar, SulaSwitch as sula_switch, SulaTag as sula_tag, SulaTextarea as sula_textarea, SulaTextfield as sula_textfield, SulaTiles as sula_tiles, SulaTimelineList as sula_timeline_list };
22137
22183
  //# sourceMappingURL=sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-progress-bar.sula-radio-button.sula-search-bar.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.esm.js.map
22138
- //# sourceMappingURL=p-226f8631.entry.js.map
22184
+ //# sourceMappingURL=p-0cad4d30.entry.js.map