@sula-tech/webcomponents 0.7.2 → 0.7.3

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);
@@ -21786,12 +21826,12 @@ const SulaTextfield = class {
21786
21826
  }
21787
21827
  render() {
21788
21828
  return h$1(Host, {
21789
- key: "3805ff5fefc6ccc3b903384ac54bcf01ebd9527a",
21829
+ key: "46cd224f63ed98167fd261dc930014a0293ea614",
21790
21830
  ref: e => this.node = e
21791
21831
  }, h$1("div", {
21792
- key: "e90a85b46e51d9c0c989bc4e0ff53b5996cc6c49"
21832
+ key: "feb3a3f5fccc779ecab04aae9fb6bf4f86cc6a6a"
21793
21833
  }, h$1("div", {
21794
- key: "258fa53c0386cc3cc231a53d5d0e8da483cc51ce",
21834
+ key: "7afb904201e65f95b1b13f97f6989c8d921afbe3",
21795
21835
  id: "button-container",
21796
21836
  class: {
21797
21837
  "flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary": true,
@@ -21805,26 +21845,26 @@ const SulaTextfield = class {
21805
21845
  onFocus: this.handleFocus,
21806
21846
  onClick: this.handleInputClick
21807
21847
  }, !this.disabled && h$1("div", {
21808
- key: "0e16b2a5f2bd115b65a6d8e572bde900606fb97c",
21848
+ key: "02dc46c38c09147f966017f3e70df530b7ad175c",
21809
21849
  class: {
21810
21850
  "hidden flex-col w-full": true,
21811
21851
  "pr-12": !!this.icon
21812
21852
  },
21813
21853
  ref: e => this.inputContainer = e
21814
21854
  }, h$1("label", {
21815
- key: "1a487915bfd317c1f1b3c04917096f402e7cb7ba",
21855
+ key: "1ecfe54e70ede77ad085d408b71e1d0f3ee53133",
21816
21856
  class: "font-bold text-sm text-text-primary from-down"
21817
21857
  }, this.label), h$1("input", {
21818
- key: "b2cd0285ef6cdaa4956ac1e7dc7a9d2fb850ffed",
21858
+ key: "e08732fbd8fb08a03dfd3eadc7884ad632b8c809",
21819
21859
  type: this.type,
21820
21860
  ref: e => this.inputElement = e,
21821
21861
  placeholder: this.placeholder,
21822
21862
  class: "outline-none text-base text-text-primary bg-transparent",
21823
21863
  onInput: this.handleInputChanges,
21824
21864
  onFocus: this.handleInputFocus,
21825
- value: this.value
21865
+ value: this.textValue
21826
21866
  })), h$1("div", {
21827
- key: "c26f72728243abca768732d758f7a9992c32d146",
21867
+ key: "e1c37bffee8df5505c2757610b8f5798aded0d59",
21828
21868
  id: "textfield-label",
21829
21869
  class: {
21830
21870
  "text-base flex items-center": true,
@@ -21833,25 +21873,25 @@ const SulaTextfield = class {
21833
21873
  },
21834
21874
  ref: e => this.labelElement = e
21835
21875
  }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && h$1("div", {
21836
- key: "b1f375f8291a67455ae0e252321e4a0fa577bb64",
21876
+ key: "05a531ae49ea6ab7301ac792f7f8c50dcd366df7",
21837
21877
  class: "flex items-center justify-center",
21838
21878
  onClick: this.handleIconClick
21839
21879
  }, h$1("sula-icon", {
21840
- key: "a780572571be2d1b4e754ccb149b768bb9195800",
21880
+ key: "b23ce605c3e496b5bac81b04d4a4d7d08f87c70b",
21841
21881
  icon: this.getInputIcon(),
21842
21882
  customClass: `text-2xl ${this.disabled ? "text-icon-disabled" : "text-icon-primary"}`
21843
21883
  }))), (this.helpText || this.maxLength) && !this.disabled && h$1("div", {
21844
- key: "6ac0ac18b014923a1b6a432e181beaea2f557dca",
21884
+ key: "d3a0d8f6de88b5e18da0e7667ec644a3473e29c3",
21845
21885
  class: "flex justify-between items-center px-16 mt-4 text-sm"
21846
21886
  }, this.helpText && h$1("div", {
21847
- key: "f8aa196b22755380105da258fa8e218ceb3894c0",
21887
+ key: "0e1027cf8e761bbbc5830242f0cb733c152e5fb6",
21848
21888
  id: "textfield-help-text",
21849
21889
  class: {
21850
21890
  "text-text-primary": this.status === SulaTextfieldStatus.Default,
21851
21891
  "text-feedback-error": this.status === SulaTextfieldStatus.Error
21852
21892
  }
21853
21893
  }, this.helpText), this.maxLength && h$1("div", {
21854
- key: "9a9359a270f5f84175829e2e8347e992c89a2639",
21894
+ key: "8c271af5206a0b44748125bed4456dcb6b357117",
21855
21895
  id: "max-length-container",
21856
21896
  class: {
21857
21897
  "text-text-primary": this.status === SulaTextfieldStatus.Default,
@@ -21859,6 +21899,11 @@ const SulaTextfield = class {
21859
21899
  }
21860
21900
  }, this.textValue ? this.textValue.length : 0, "/", this.maxLength))));
21861
21901
  }
21902
+ static get watchers() {
21903
+ return {
21904
+ value: [ "watchValueHandler" ]
21905
+ };
21906
+ }
21862
21907
  };
21863
21908
 
21864
21909
  SulaTextfield.style = sulaTextfieldCss;
@@ -22135,4 +22180,4 @@ SulaTimelineList.style = sulaTimelineListCss;
22135
22180
 
22136
22181
  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
22182
  //# 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
22183
+ //# sourceMappingURL=p-43b2dde5.entry.js.map