@sula-tech/webcomponents 0.11.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["sula-avatar_21",[[1,"sula-modal",{"opened":[1028],"blockBodyScroll":[1028,"block-body-scroll"],"closeOnClickOutside":[1028,"close-on-click-outside"],"type":[1],"headerIcon":[1,"header-icon"],"modalTitle":[1,"modal-title"],"promoImage":[1,"promo-image"],"subTitle":[1,"sub-title"],"primaryButtonText":[1,"primary-button-text"],"secondaryButtonText":[1,"secondary-button-text"],"slotOverflow":[1,"slot-overflow"],"isAnimating":[32],"shouldRender":[32]},null,{"opened":["handleOpenedChange"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"selected":[1028],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"searchable":[516],"menuMaxHeight":[2,"menu-max-height"],"selectedItem":[32],"showItems":[32],"isFocused":[32],"searchTerm":[32],"filteredItems":[32],"openUpward":[32]},[[4,"click","handleDocumentClick"],[9,"resize","handleWindowResize"]],{"value":["handleValueChange"],"showItems":["handleShowItemsChange"]}],[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-breadcrumb",{"items":[1040]}],[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-segmented-control",{"items":[1040],"type":[1025],"size":[1025],"color":[1025]}],[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],"maskPattern":[1,"mask-pattern"],"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"],"responsive":[4],"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],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[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-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"],"maxHeight":[2,"max-height"],"selectedValue":[16,"selected-value"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
19
+ return bootstrapLazy([["sula-avatar_21",[[1,"sula-modal",{"opened":[1028],"blockBodyScroll":[1028,"block-body-scroll"],"closeOnClickOutside":[1028,"close-on-click-outside"],"type":[1],"headerIcon":[1,"header-icon"],"modalTitle":[1,"modal-title"],"promoImage":[1,"promo-image"],"subTitle":[1,"sub-title"],"primaryButtonText":[1,"primary-button-text"],"secondaryButtonText":[1,"secondary-button-text"],"slotOverflow":[1,"slot-overflow"],"isAnimating":[32],"shouldRender":[32]},null,{"opened":["handleOpenedChange"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"selected":[1028],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"searchable":[516],"menuMaxHeight":[2,"menu-max-height"],"selectedItem":[32],"showItems":[32],"isFocused":[32],"searchTerm":[32],"filteredItems":[32],"openUpward":[32]},[[4,"click","handleDocumentClick"],[9,"resize","handleWindowResize"]],{"value":["handleValueChange"],"showItems":["handleShowItemsChange"]}],[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-breadcrumb",{"items":[1040]}],[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-segmented-control",{"items":[1040],"type":[1025],"size":[1025],"color":[1025]}],[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],"maskPattern":[1,"mask-pattern"],"maskPatternSwitchMaxLength":[2,"mask-pattern-switch-max-length"],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"],"maskPattern":["watchMaskPatternHandler"],"maskPatternSwitchMaxLength":["watchMaskPatternSwitchMaxLengthHandler"]}],[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"],"responsive":[4],"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],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[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-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"],"maxHeight":[2,"max-height"],"selectedValue":[16,"selected-value"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
20
20
  });
21
21
  //# sourceMappingURL=webcomponents.js.map
22
22
 
@@ -41,12 +41,20 @@ export declare class SulaTextfield {
41
41
  * Event emitted when input value changes.
42
42
  */
43
43
  valueChanged: EventEmitter<string>;
44
+ /**
45
+ * Event emitted when input value changes without mask pattern applied.
46
+ */
47
+ valueChangedWithoutMask: EventEmitter<string>;
44
48
  /**
45
49
  * The textfield mask pattern
46
50
  * The mask pattern should follow the VMasker pattern format
47
51
  * More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern
48
52
  */
49
- maskPattern?: string;
53
+ maskPattern?: string | string[];
54
+ /**
55
+ * Max input length used to switch between the first and second mask pattern.
56
+ */
57
+ maskPatternSwitchMaxLength: number;
50
58
  /**
51
59
  * Event emitted when input is focused.
52
60
  */
@@ -60,6 +68,8 @@ export declare class SulaTextfield {
60
68
  showPassword: boolean;
61
69
  inputIsFocused: boolean;
62
70
  watchValueHandler(newValue: string): void;
71
+ watchMaskPatternHandler(): void;
72
+ watchMaskPatternSwitchMaxLengthHandler(): void;
63
73
  inputContainer: HTMLDivElement;
64
74
  inputElement: HTMLInputElement;
65
75
  labelElement: HTMLDivElement;
@@ -75,7 +85,11 @@ export declare class SulaTextfield {
75
85
  handleBlur: () => void;
76
86
  handleInputFocus: () => void;
77
87
  handleIconClick: (event: MouseEvent) => void;
78
- handleInputMask(): void;
88
+ handleInputMask(inputValue?: string): void;
89
+ private syncMaskState;
90
+ private hasMaskPatternConfigured;
91
+ private getMaskPatterns;
92
+ private getMaskPatternByValueLength;
79
93
  handlePasswordIconClicked(): void;
80
94
  getInputIcon(): string;
81
95
  render(): any;
@@ -49,6 +49,14 @@ declare const _default: {
49
49
  required: boolean;
50
50
  };
51
51
  };
52
+ maskPatternSwitchMaxLength: {
53
+ control: string;
54
+ defaultValue: number;
55
+ description: string;
56
+ type: {
57
+ required: boolean;
58
+ };
59
+ };
52
60
  placeholder: {
53
61
  control: string;
54
62
  defaultValue: string;
@@ -93,6 +101,10 @@ declare const _default: {
93
101
  action: string;
94
102
  description: string;
95
103
  };
104
+ valueChangedWithoutMask: {
105
+ action: string;
106
+ description: string;
107
+ };
96
108
  focusedOn: {
97
109
  action: string;
98
110
  description: string;
@@ -113,6 +125,7 @@ declare const _default: {
113
125
  export default _default;
114
126
  export declare const Default: any;
115
127
  export declare const WithMask: any;
128
+ export declare const WithCpfCnpjMask: any;
116
129
  export declare const WithValue: any;
117
130
  export declare const WithHelpText: any;
118
131
  export declare const WithMaxLength: any;
@@ -536,7 +536,12 @@ export namespace Components {
536
536
  /**
537
537
  * The textfield mask pattern The mask pattern should follow the VMasker pattern format More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern
538
538
  */
539
- "maskPattern"?: string;
539
+ "maskPattern"?: string | string[];
540
+ /**
541
+ * Max input length used to switch between the first and second mask pattern.
542
+ * @default 14
543
+ */
544
+ "maskPatternSwitchMaxLength": number;
540
545
  /**
541
546
  * The textfield max length
542
547
  */
@@ -927,6 +932,7 @@ declare global {
927
932
  };
928
933
  interface HTMLSulaTextfieldElementEventMap {
929
934
  "valueChanged": string;
935
+ "valueChangedWithoutMask": string;
930
936
  "focusedOn": void;
931
937
  "focusedOut": void;
932
938
  }
@@ -1620,7 +1626,12 @@ declare namespace LocalJSX {
1620
1626
  /**
1621
1627
  * The textfield mask pattern The mask pattern should follow the VMasker pattern format More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern
1622
1628
  */
1623
- "maskPattern"?: string;
1629
+ "maskPattern"?: string | string[];
1630
+ /**
1631
+ * Max input length used to switch between the first and second mask pattern.
1632
+ * @default 14
1633
+ */
1634
+ "maskPatternSwitchMaxLength"?: number;
1624
1635
  /**
1625
1636
  * The textfield max length
1626
1637
  */
@@ -1637,6 +1648,10 @@ declare namespace LocalJSX {
1637
1648
  * Event emitted when input value changes.
1638
1649
  */
1639
1650
  "onValueChanged"?: (event: SulaTextfieldCustomEvent<string>) => void;
1651
+ /**
1652
+ * Event emitted when input value changes without mask pattern applied.
1653
+ */
1654
+ "onValueChangedWithoutMask"?: (event: SulaTextfieldCustomEvent<string>) => void;
1640
1655
  /**
1641
1656
  * The textfield placeholder
1642
1657
  */
@@ -22485,12 +22485,13 @@ var vanillaMaskerExports = requireVanillaMasker();
22485
22485
 
22486
22486
  var VMasker = getDefaultExportFromCjs(vanillaMaskerExports);
22487
22487
 
22488
- const sulaTextfieldCss = '*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.outline{outline-style:solid}:host{display:block}.button-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.button-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.from-down{animation:from-down .2s ease-in-out}.from-up{animation:from-up .2s ease-in-out}@keyframes from-down{0%{opacity:0;transform:translateY(75%)}to{opacity:1;transform:translateY(0)}}@keyframes from-up{0%{opacity:0;transform:translateY(-75%)}to{opacity:1;transform:translateY(0)}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.static{position:static}.mt-4{margin-top:.25rem}.flex{display:flex}.hidden{display:none}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.pr-12{padding-right:.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}';
22488
+ const sulaTextfieldCss = '*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.outline{outline-style:solid}:host{display:block}.button-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.button-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.from-down{animation:from-down .2s ease-in-out}.from-up{animation:from-up .2s ease-in-out}@keyframes from-down{0%{opacity:0;transform:translateY(75%)}to{opacity:1;transform:translateY(0)}}@keyframes from-up{0%{opacity:0;transform:translateY(-75%)}to{opacity:1;transform:translateY(0)}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#012b15;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#330d00;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#402705;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#401204;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#402301;--color-gray-50:#fff;--color-gray-100:#f3f4f4;--color-gray-200:#e5e6e6;--color-gray-300:#bfc0c0;--color-gray-400:#acaeae;--color-gray-500:#949595;--color-gray-600:#737575;--color-gray-700:#6c6e6e;--color-gray-800:#313333;--color-gray-900:#272929;--color-gray-950:#191d1d;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#071e40;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:rgba(25,29,29,.02);--color-black-opacity-100:rgba(25,29,29,.05);--color-black-opacity-200:rgba(25,29,29,.11);--color-black-opacity-300:rgba(25,29,29,.28);--color-black-opacity-400:rgba(25,29,29,.36);--color-black-opacity-500:rgba(25,29,29,.44);--color-black-opacity-600:rgba(25,29,29,.62);--color-black-opacity-700:rgba(25,29,29,.64);--color-black-opacity-800:rgba(25,29,29,.72);--color-black-opacity-900:rgba(25,29,29,.8);--color-black-opacity-950:rgba(25,29,29,.96);--color-shadow-opacity-50:rgba(0,0,0,.04);--color-shadow-opacity-100:rgba(0,0,0,.06);--color-shadow-opacity-200:rgba(0,0,0,.12);--color-shadow-opacity-300:rgba(0,0,0,.2);--color-shadow-opacity-400:rgba(0,0,0,.32);--color-shadow-opacity-500:rgba(0,0,0,.5);--color-shadow-opacity-600:rgba(0,0,0,.55);--color-shadow-opacity-700:rgba(0,0,0,.64);--color-shadow-opacity-800:rgba(0,0,0,.73);--color-shadow-opacity-900:rgba(0,0,0,.8);--color-shadow-opacity-950:rgba(0,0,0,.91);--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f3f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#313333;--color-text-secondary:#6c6e6e;--color-text-disabled:#949595;--color-text-link:#1355b4;--color-states-empty-bg-hover:rgba(25,29,29,.05);--color-states-empty-bg-pressed:rgba(25,29,29,.11);--color-states-bg-disabled:rgba(25,29,29,.02);--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e5e6e6;--color-states-negative-pressed:#bfc0c0;--color-icon-primary:#6c6e6e;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#acaeae;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f3f4f4;--color-neutral-neutral-3:#acaeae;--color-neutral-neutral-4:#949595;--color-neutral-neutral-5:#737575;--color-neutral-neutral-6:#6c6e6e;--color-neutral-neutral-7:#313333;--color-neutral-neutral-8:#272929;--color-negative-negative-1:#fff;--color-negative-negative-2:#313333;--color-opacity-body:#fffc;--color-opacity-on-body:rgba(25,29,29,.02);--color-opacity-overlay:rgba(25,29,29,.62);--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949595;--color-line-general-strong:#bfc0c0;--color-line-general:#e5e6e6;--color-line-hair:rgba(25,29,29,.05);--color-box-shadow-body:#fff;--color-box-shadow-shadow-color-1:rgba(0,0,0,.04);--color-box-shadow-shadow-color-2:rgba(0,0,0,.06)}.static{position:static}.mt-4{margin-top:.25rem}.flex{display:flex}.hidden{display:none}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.pr-12{padding-right:.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}';
22489
22489
 
22490
22490
  const SulaTextfield = class {
22491
22491
  constructor(e) {
22492
22492
  registerInstance(this, e);
22493
22493
  this.valueChanged = createEvent(this, "valueChanged");
22494
+ this.valueChangedWithoutMask = createEvent(this, "valueChangedWithoutMask");
22494
22495
  this.focusedOn = createEvent(this, "focusedOn");
22495
22496
  this.focusedOut = createEvent(this, "focusedOut");
22496
22497
  /**
@@ -22499,6 +22500,9 @@ const SulaTextfield = class {
22499
22500
  /**
22500
22501
  * The textfield status
22501
22502
  */ this.status = SulaTextfieldStatus.Default;
22503
+ /**
22504
+ * Max input length used to switch between the first and second mask pattern.
22505
+ */ this.maskPatternSwitchMaxLength = 14;
22502
22506
  this.inputIsOpen = false;
22503
22507
  this.textValue = "";
22504
22508
  this.showPassword = false;
@@ -22507,13 +22511,16 @@ const SulaTextfield = class {
22507
22511
  this.toggleOptions(true);
22508
22512
  };
22509
22513
  this.handleInputChanges = e => {
22510
- if (this.maskPattern && this.inputElement) {
22511
- this.handleInputMask();
22512
- }
22513
22514
  const t = e.target.value;
22514
- this.textValue = t;
22515
- this.value = t;
22516
- this.valueChanged.emit(t);
22515
+ let o = t;
22516
+ if (this.hasMaskPatternConfigured() && this.inputElement) {
22517
+ this.handleInputMask(t);
22518
+ o = this.inputElement.value;
22519
+ }
22520
+ this.valueChangedWithoutMask.emit(o.replace(/\D/g, ""));
22521
+ this.textValue = o;
22522
+ this.value = o;
22523
+ this.valueChanged.emit(o);
22517
22524
  };
22518
22525
  this.handleFocus = () => {
22519
22526
  if (this.disabled) return;
@@ -22537,16 +22544,21 @@ const SulaTextfield = class {
22537
22544
  };
22538
22545
  }
22539
22546
  watchValueHandler(e) {
22540
- this.textValue = e;
22541
- if (this.inputElement && this.inputElement.value !== e) {
22542
- const t = this.inputElement.selectionStart;
22543
- this.inputElement.value = e || "";
22544
- if (this.inputIsFocused && t !== null) {
22545
- const o = Math.min(t, (e || "").length);
22546
- this.inputElement.setSelectionRange(o, o);
22547
+ const t = e || "";
22548
+ this.textValue = t;
22549
+ if (this.inputElement && this.inputElement.value !== t) {
22550
+ const e = this.inputElement.selectionStart;
22551
+ this.inputElement.value = t;
22552
+ if (this.hasMaskPatternConfigured()) {
22553
+ this.handleInputMask(t);
22554
+ this.textValue = this.inputElement.value;
22555
+ }
22556
+ if (this.inputIsFocused && e !== null) {
22557
+ const t = Math.min(e, this.inputElement.value.length);
22558
+ this.inputElement.setSelectionRange(t, t);
22547
22559
  }
22548
22560
  }
22549
- if (e && e.trim().length > 0) {
22561
+ if (this.textValue && this.textValue.trim().length > 0) {
22550
22562
  this.inputIsOpen = true;
22551
22563
  this.changeElementsStyle();
22552
22564
  } else if (!this.inputIsFocused) {
@@ -22554,6 +22566,12 @@ const SulaTextfield = class {
22554
22566
  this.changeElementsStyle();
22555
22567
  }
22556
22568
  }
22569
+ watchMaskPatternHandler() {
22570
+ this.syncMaskState();
22571
+ }
22572
+ watchMaskPatternSwitchMaxLengthHandler() {
22573
+ this.syncMaskState();
22574
+ }
22557
22575
  handleClick(e) {
22558
22576
  if (!this.node || !this.inputIsFocused) return;
22559
22577
  const t = this.node.contains(e.target);
@@ -22577,8 +22595,10 @@ const SulaTextfield = class {
22577
22595
  if (this.textValue && this.textValue.trim().length > 0) {
22578
22596
  this.changeElementsStyle();
22579
22597
  }
22580
- if (this.maskPattern && this.inputElement) {
22598
+ if (this.hasMaskPatternConfigured() && this.inputElement) {
22581
22599
  this.handleInputMask();
22600
+ this.textValue = this.inputElement.value;
22601
+ this.value = this.inputElement.value;
22582
22602
  }
22583
22603
  }
22584
22604
  toggleOptions(e) {
@@ -22595,8 +22615,46 @@ const SulaTextfield = class {
22595
22615
  this.labelElement.classList.add("from-up");
22596
22616
  }
22597
22617
  }
22598
- handleInputMask() {
22599
- VMasker(this.inputElement).maskPattern(this.maskPattern);
22618
+ handleInputMask(e) {
22619
+ var t;
22620
+ if (!this.inputElement) return;
22621
+ const o = this.getMaskPatternByValueLength(e);
22622
+ if (!o) return;
22623
+ const r = ((t = e !== null && e !== void 0 ? e : this.inputElement.value) !== null && t !== void 0 ? t : "").replace(/[^a-zA-Z0-9]/g, "");
22624
+ VMasker(this.inputElement).unMask();
22625
+ this.inputElement.value = VMasker.toPattern(r, o);
22626
+ }
22627
+ syncMaskState() {
22628
+ if (!this.inputElement) return;
22629
+ if (!this.hasMaskPatternConfigured()) {
22630
+ VMasker(this.inputElement).unMask();
22631
+ return;
22632
+ }
22633
+ this.handleInputMask();
22634
+ this.textValue = this.inputElement.value;
22635
+ this.value = this.inputElement.value;
22636
+ }
22637
+ hasMaskPatternConfigured() {
22638
+ return this.getMaskPatterns().length > 0;
22639
+ }
22640
+ getMaskPatterns() {
22641
+ if (Array.isArray(this.maskPattern)) {
22642
+ return this.maskPattern.map((e => e === null || e === void 0 ? void 0 : e.trim())).filter(Boolean);
22643
+ }
22644
+ if (typeof this.maskPattern === "string" && this.maskPattern.trim().length > 0) {
22645
+ return [ this.maskPattern.trim() ];
22646
+ }
22647
+ return [];
22648
+ }
22649
+ getMaskPatternByValueLength(e) {
22650
+ var t, o, r;
22651
+ const n = this.getMaskPatterns();
22652
+ if (n.length === 0) return undefined;
22653
+ if (n.length === 1) return n[0];
22654
+ const a = ((o = e !== null && e !== void 0 ? e : (t = this.inputElement) === null || t === void 0 ? void 0 : t.value) !== null && o !== void 0 ? o : "").length;
22655
+ const i = (r = this.maskPatternSwitchMaxLength) !== null && r !== void 0 ? r : 14;
22656
+ const c = a > i ? 1 : 0;
22657
+ return n[Math.min(c, n.length - 1)];
22600
22658
  }
22601
22659
  handlePasswordIconClicked() {
22602
22660
  const e = this.inputElement.selectionStart;
@@ -22617,12 +22675,12 @@ const SulaTextfield = class {
22617
22675
  }
22618
22676
  render() {
22619
22677
  return h$1(Host, {
22620
- key: "b06e08483a4e05c4c0458991eee33683493e906a",
22678
+ key: "b857d08cc9d53c1cfaa87a573d52026b9b72d088",
22621
22679
  ref: e => this.node = e
22622
22680
  }, h$1("div", {
22623
- key: "16fa77d77f98e1dc9b4884f4d55eaae54fe1ecf6"
22681
+ key: "d173e497fbe8c78b899a1e66784d411981008abb"
22624
22682
  }, h$1("div", {
22625
- key: "194098398ef8219420a48cabb0b1b36b44d5d727",
22683
+ key: "bc1682f30d7ffb0eb890baba6d126d3cdbaf3a20",
22626
22684
  id: "button-container",
22627
22685
  class: {
22628
22686
  "flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary": true,
@@ -22636,17 +22694,17 @@ const SulaTextfield = class {
22636
22694
  onFocus: this.handleFocus,
22637
22695
  onClick: this.handleInputClick
22638
22696
  }, !this.disabled && h$1("div", {
22639
- key: "9795339bc40d505837b673b1350bd863829e4daa",
22697
+ key: "7e78f2a5b2d0bd3111ddfec6a592d907ac1aa078",
22640
22698
  class: {
22641
22699
  "hidden flex-col w-full": true,
22642
22700
  "pr-12": !!this.icon
22643
22701
  },
22644
22702
  ref: e => this.inputContainer = e
22645
22703
  }, h$1("label", {
22646
- key: "289548d1e1da0ef6a18106155c732307f2fedf67",
22704
+ key: "d0419a71fb3372d34b07625acd95bae71b1133a0",
22647
22705
  class: "font-bold text-sm text-text-primary from-down"
22648
22706
  }, this.label), h$1("input", {
22649
- key: "e737484f921f93ca54f249b6e575e8c22a5e6660",
22707
+ key: "11926def24206e02e0fcd0e4ba7b94664f1ca21a",
22650
22708
  type: this.type,
22651
22709
  ref: e => this.inputElement = e,
22652
22710
  placeholder: this.placeholder,
@@ -22655,7 +22713,7 @@ const SulaTextfield = class {
22655
22713
  onFocus: this.handleInputFocus,
22656
22714
  value: this.textValue
22657
22715
  })), h$1("div", {
22658
- key: "44213cd6c32eb17d918f7087c58551c75a18206a",
22716
+ key: "93118f3270d2f325dd474805ed6870cb1cddb2bd",
22659
22717
  id: "textfield-label",
22660
22718
  class: {
22661
22719
  "text-base flex items-center": true,
@@ -22664,25 +22722,25 @@ const SulaTextfield = class {
22664
22722
  },
22665
22723
  ref: e => this.labelElement = e
22666
22724
  }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && h$1("div", {
22667
- key: "6ab542e64b6c48163ae8fc5d873258237ca253b2",
22725
+ key: "bc78873f12cd069f1987dddbfd9eea29f5c07c8e",
22668
22726
  class: "flex items-center justify-center",
22669
22727
  onClick: this.handleIconClick
22670
22728
  }, h$1("sula-icon", {
22671
- key: "915aeca122f4ee3a28742b441c0f2067f4a8ce8a",
22729
+ key: "f8a30c1ea8f73e748ce43b4f0029a83435e88d2b",
22672
22730
  icon: this.getInputIcon(),
22673
22731
  customClass: `text-2xl ${this.disabled ? "text-icon-disabled" : "text-icon-primary"}`
22674
22732
  }))), (this.helpText || this.maxLength) && !this.disabled && h$1("div", {
22675
- key: "81edcd13a69c02c31f913cd36768540417095e77",
22733
+ key: "e6cc2bed4087a75fe8ed2541af38e44778144485",
22676
22734
  class: "flex justify-between items-center px-16 mt-4 text-sm"
22677
22735
  }, this.helpText && h$1("div", {
22678
- key: "ff99921f928181450f106413cca5ba8ead39c897",
22736
+ key: "ed826977d2f85c23c4e41c51bab2a35a093d4207",
22679
22737
  id: "textfield-help-text",
22680
22738
  class: {
22681
22739
  "text-text-primary": this.status === SulaTextfieldStatus.Default,
22682
22740
  "text-feedback-error": this.status === SulaTextfieldStatus.Error
22683
22741
  }
22684
22742
  }, this.helpText), this.maxLength && h$1("div", {
22685
- key: "29c954591b2426eb5cf3bdeedd7ae78161573647",
22743
+ key: "595dd29e865d45bcc1df11dc024eb1c9db77e990",
22686
22744
  id: "max-length-container",
22687
22745
  class: {
22688
22746
  "text-text-primary": this.status === SulaTextfieldStatus.Default,
@@ -22692,7 +22750,9 @@ const SulaTextfield = class {
22692
22750
  }
22693
22751
  static get watchers() {
22694
22752
  return {
22695
- value: [ "watchValueHandler" ]
22753
+ value: [ "watchValueHandler" ],
22754
+ maskPattern: [ "watchMaskPatternHandler" ],
22755
+ maskPatternSwitchMaxLength: [ "watchMaskPatternSwitchMaxLengthHandler" ]
22696
22756
  };
22697
22757
  }
22698
22758
  };
@@ -22971,4 +23031,4 @@ SulaTimelineList.style = sulaTimelineListCss;
22971
23031
 
22972
23032
  export { SulaAvatar as sula_avatar, SulaBadge as sula_badge, SulaBreadcrumb as sula_breadcrumb, 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, SulaModal as sula_modal, SulaProgressBar as sula_progress_bar, SulaRadioButton as sula_radio_button, SulaSearchBar as sula_search_bar, SulaSegmentedControl as sula_segmented_control, 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 };
22973
23033
  //# sourceMappingURL=sula-avatar.sula-badge.sula-breadcrumb.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-modal.sula-progress-bar.sula-radio-button.sula-search-bar.sula-segmented-control.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.esm.js.map
22974
- //# sourceMappingURL=p-0749814d.entry.js.map
23034
+ //# sourceMappingURL=p-3c319b71.entry.js.map