@revotech-group/revotech-ui-kit 0.0.88 → 0.0.89
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/library.css +22 -0
- package/dist/rtg-ui-kit.js +43 -24
- package/dist/rtg-ui-kit.umd.cjs +15 -16
- package/dist/src/components/ui/input/input.d.ts +2 -1
- package/package.json +1 -1
package/dist/library.css
CHANGED
|
@@ -730,6 +730,9 @@ body {
|
|
|
730
730
|
.rtg-ml-1 {
|
|
731
731
|
margin-left: 0.25rem;
|
|
732
732
|
}
|
|
733
|
+
.rtg-ml-2 {
|
|
734
|
+
margin-left: 0.5rem;
|
|
735
|
+
}
|
|
733
736
|
.rtg-ml-auto {
|
|
734
737
|
margin-left: auto;
|
|
735
738
|
}
|
|
@@ -1789,6 +1792,25 @@ body {
|
|
|
1789
1792
|
z-index: 20;
|
|
1790
1793
|
}
|
|
1791
1794
|
|
|
1795
|
+
.focus-within\:rtg-outline-none:focus-within {
|
|
1796
|
+
outline: 2px solid transparent;
|
|
1797
|
+
outline-offset: 2px;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
.focus-within\:rtg-ring-2:focus-within {
|
|
1801
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1802
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1803
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
.focus-within\:rtg-ring-ring:focus-within {
|
|
1807
|
+
--tw-ring-color: hsl(var(--ring));
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
.focus-within\:rtg-ring-offset-2:focus-within {
|
|
1811
|
+
--tw-ring-offset-width: 2px;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1792
1814
|
.hover\:\!rtg-bg-slate-100:hover {
|
|
1793
1815
|
--tw-bg-opacity: 1 !important;
|
|
1794
1816
|
background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1)) !important;
|
package/dist/rtg-ui-kit.js
CHANGED
|
@@ -5911,7 +5911,7 @@ let ie = class extends h {
|
|
|
5911
5911
|
}
|
|
5912
5912
|
handleCountryChange(e) {
|
|
5913
5913
|
const t = e.target, o = _o.find((s) => s.value === t.value);
|
|
5914
|
-
o && (this.country = o.value, this.countryCode = o.code, this.selectedLabel = o.
|
|
5914
|
+
o && (this.country = o.value, this.countryCode = o.code, this.selectedLabel = o.label, this.requestUpdate(), this.dispatchInputAndChangeEvents()), e.stopPropagation();
|
|
5915
5915
|
}
|
|
5916
5916
|
firstUpdated(e) {
|
|
5917
5917
|
this.removeParentAttributes();
|
|
@@ -5920,7 +5920,33 @@ let ie = class extends h {
|
|
|
5920
5920
|
}
|
|
5921
5921
|
handleInputChange(e) {
|
|
5922
5922
|
const t = e.target;
|
|
5923
|
-
t.type === "file" ? this.value = t.files ? t.files[0].name : "" : this.value = t.value;
|
|
5923
|
+
t.type === "file" ? this.value = t.files ? t.files[0].name : "" : this.value = t.value, this.dispatchInputAndChangeEvents();
|
|
5924
|
+
}
|
|
5925
|
+
dispatchInputAndChangeEvents() {
|
|
5926
|
+
const e = this.type === "tel" ? `${this.countryCode}${this.value}` : this.value;
|
|
5927
|
+
this.dispatchEvent(
|
|
5928
|
+
new CustomEvent("input", {
|
|
5929
|
+
bubbles: !0,
|
|
5930
|
+
composed: !0,
|
|
5931
|
+
detail: {
|
|
5932
|
+
value: e,
|
|
5933
|
+
rawValue: this.value,
|
|
5934
|
+
code: this.countryCode,
|
|
5935
|
+
dataKey: this.dataKey
|
|
5936
|
+
}
|
|
5937
|
+
})
|
|
5938
|
+
), this.dispatchEvent(
|
|
5939
|
+
new CustomEvent("change", {
|
|
5940
|
+
bubbles: !0,
|
|
5941
|
+
composed: !0,
|
|
5942
|
+
detail: {
|
|
5943
|
+
value: e,
|
|
5944
|
+
rawValue: this.value,
|
|
5945
|
+
code: this.countryCode,
|
|
5946
|
+
dataKey: this.dataKey
|
|
5947
|
+
}
|
|
5948
|
+
})
|
|
5949
|
+
);
|
|
5924
5950
|
}
|
|
5925
5951
|
handleFocus() {
|
|
5926
5952
|
this.dispatchEvent(
|
|
@@ -5953,38 +5979,30 @@ let ie = class extends h {
|
|
|
5953
5979
|
return this.type === "tel" ? d`
|
|
5954
5980
|
<div
|
|
5955
5981
|
class="${p(
|
|
5956
|
-
"rtg-flex rtg-items-center rtg-border rtg-border-input rtg-rounded-md rtg-px-3 rtg-py-1",
|
|
5957
|
-
this.
|
|
5982
|
+
"rtg-flex rtg-items-center rtg-border rtg-border-input rtg-rounded-md rtg-px-3 rtg-py-1 rtg-bg-background rtg-text-sm rtg-ring-offset-background rtg-transition-colors focus-within:rtg-outline-none focus-within:rtg-ring-2 focus-within:rtg-ring-ring focus-within:rtg-ring-offset-2",
|
|
5983
|
+
this.customClass
|
|
5958
5984
|
)}"
|
|
5959
5985
|
>
|
|
5960
5986
|
<select
|
|
5961
|
-
class="
|
|
5962
|
-
"rtg-w-[40px] rtg-text-sm rtg-outline-none rtg-bg-transparent",
|
|
5963
|
-
this.className
|
|
5964
|
-
)}"
|
|
5987
|
+
class="rtg-w-[40px] rtg-bg-transparent rtg-text-sm rtg-outline-none"
|
|
5965
5988
|
@change=${this.handleCountryChange}
|
|
5966
5989
|
.value=${this.country}
|
|
5967
5990
|
>
|
|
5968
5991
|
${_o.map(
|
|
5969
|
-
(t) => d
|
|
5970
|
-
value=${t.value}
|
|
5971
|
-
|
|
5972
|
-
>
|
|
5973
|
-
${this.country === t.value ? this.selectedLabel : `${t.label} ${t.code}`}
|
|
5974
|
-
</option>`
|
|
5992
|
+
(t) => d`
|
|
5993
|
+
<option value=${t.value}>${t.label} ${t.code}</option>
|
|
5994
|
+
`
|
|
5975
5995
|
)}
|
|
5976
5996
|
</select>
|
|
5977
|
-
<span class="rtg-
|
|
5997
|
+
<span class="rtg-ml-2">${this.countryCode}</span>
|
|
5978
5998
|
<input
|
|
5979
5999
|
part="input"
|
|
5980
6000
|
type="tel"
|
|
5981
|
-
class="
|
|
5982
|
-
"rtg-flex rtg-bg-transparent rtg-text-sm rtg-px-3 rtg-py-[3px] focus-visible:rtg-outline-none disabled:rtg-opacity-50 input-base",
|
|
5983
|
-
this.className
|
|
5984
|
-
)}"
|
|
6001
|
+
class="input-base rtg-flex-1 rtg-bg-transparent rtg-px-3 rtg-py-[3px] rtg-text-sm focus-visible:rtg-outline-none disabled:rtg-opacity-50"
|
|
5985
6002
|
placeholder=${this.placeholder}
|
|
5986
6003
|
.value=${this.value}
|
|
5987
|
-
@
|
|
6004
|
+
@input=${this.handleInputChange}
|
|
6005
|
+
@change=${this.handleInputChange}
|
|
5988
6006
|
@focus=${this.handleFocus}
|
|
5989
6007
|
?disabled=${this.disabled}
|
|
5990
6008
|
${G(e)}
|
|
@@ -5997,8 +6015,9 @@ let ie = class extends h {
|
|
|
5997
6015
|
placeholder="${this.placeholder}"
|
|
5998
6016
|
?disabled=${this.disabled}
|
|
5999
6017
|
.value=${this.type !== "file" ? this.value : ""}
|
|
6000
|
-
@
|
|
6001
|
-
@
|
|
6018
|
+
@input=${this.handleInputChange}
|
|
6019
|
+
@change=${this.handleInputChange}
|
|
6020
|
+
@focus=${this.handleFocus}
|
|
6002
6021
|
${G(e)}
|
|
6003
6022
|
class="${p(Ba, this.customClass)}"
|
|
6004
6023
|
/>
|
|
@@ -14836,13 +14855,13 @@ let Os = class extends h {
|
|
|
14836
14855
|
render() {
|
|
14837
14856
|
return d`
|
|
14838
14857
|
<div class="sb-flex sb-flex-col sb-gap-4">
|
|
14839
|
-
<label class="sb-font-semibold">Custom button style:</label>
|
|
14858
|
+
<!-- <label class="sb-font-semibold">Custom button style:</label>
|
|
14840
14859
|
<textarea
|
|
14841
14860
|
class="sb-border sb-p-2"
|
|
14842
14861
|
.value=${this.btnClass}
|
|
14843
14862
|
@input=${(e) => this.btnClass = e.target.value}
|
|
14844
14863
|
></textarea>
|
|
14845
|
-
<rtg-alert style=${this.btnClass} message=${"hey"}></rtg-alert>
|
|
14864
|
+
<rtg-alert style=${this.btnClass} message=${"hey"}></rtg-alert> -->
|
|
14846
14865
|
</div>
|
|
14847
14866
|
`;
|
|
14848
14867
|
}
|
package/dist/rtg-ui-kit.umd.cjs
CHANGED
|
@@ -2859,30 +2859,28 @@ body {
|
|
|
2859
2859
|
.wrapper {
|
|
2860
2860
|
display: block;
|
|
2861
2861
|
}
|
|
2862
|
-
`;let St=nr;customElements.define("shadow-wrapper",St);class br extends Ln.AsyncDirective{constructor(){super(...arguments),this.prevData={}}render(e){return Mn.nothing}update(e,[r]){var n;this.element!==e.element&&(this.element=e.element),this.host=((n=e.options)===null||n===void 0?void 0:n.host)||this.element,this.apply(r),this.groom(r),this.prevData={...r}}apply(e){if(!e)return;const{prevData:r,element:n}=this;for(const t in e){const i=e[t];i!==r[t]&&(n[t]=i)}}groom(e){const{prevData:r,element:n}=this;if(r)for(const t in r)(!e||!(t in e)&&n[t]===r[t])&&(n[t]=void 0)}}_t.directive(br);class yr extends br{constructor(){super(...arguments),this.eventData={}}apply(e){if(e)for(const r in e){const n=e[r];n!==this.eventData[r]&&this.applyEvent(r,n)}}applyEvent(e,r){const{prevData:n,element:t}=this;this.eventData[e]=r,n[e]&&t.removeEventListener(e,this,r),t.addEventListener(e,this,r)}groom(e){const{prevData:r,element:n}=this;if(r)for(const t in r)(!e||!(t in e)&&n[t]===r[t])&&this.groomEvent(t,r[t])}groomEvent(e,r){const{element:n}=this;delete this.eventData[e],n.removeEventListener(e,this,r)}handleEvent(e){const r=this.eventData[e.type];typeof r=="function"?r.call(this.host,e):r.handleEvent(e)}disconnected(){const{eventData:e,element:r}=this;for(const n in e){const t=n.slice(1),i=e[n];r.removeEventListener(t,this,i)}}reconnected(){const{eventData:e,element:r}=this;for(const n in e){const t=n.slice(1),i=e[n];r.addEventListener(t,this,i)}}}_t.directive(yr);class wo extends yr{apply(e){if(!e)return;const{prevData:r,element:n}=this;for(const t in e){const i=e[t];if(i===r[t])continue;const s=t.slice(1);switch(t[0]){case"@":this.eventData[s]=i,this.applyEvent(s,i);break;case".":n[s]=i;break;case"?":i?n.setAttribute(s,""):n.removeAttribute(s);break;default:i!=null?n.setAttribute(t,String(i)):n.removeAttribute(t);break}}}groom(e){const{prevData:r,element:n}=this;if(r)for(const t in r){const i=t.slice(1);if(!e||!(t in e)&&n[i]===r[t])switch(t[0]){case"@":this.groomEvent(i,r[t]);break;case".":n[i]=void 0;break;case"?":n.removeAttribute(i);break;default:n.removeAttribute(t);break}}}}const V=_t.directive(wo),wr=[{label:"AF",value:"AF",code:"+93"},{label:"AL",value:"AL",code:"+355"},{label:"DZ",value:"DZ",code:"+213"},{label:"AS",value:"AS",code:"+1684"},{label:"AD",value:"AD",code:"+376"},{label:"AO",value:"AO",code:"+244"},{label:"AI",value:"AI",code:"+1264"},{label:"AG",value:"AG",code:"+1268"},{label:"AR",value:"AR",code:"+54"},{label:"AM",value:"AM",code:"+374"},{label:"AW",value:"AW",code:"+297"},{label:"AU",value:"AU",code:"+61"},{label:"AT",value:"AT",code:"+43"},{label:"AZ",value:"AZ",code:"+994"},{label:"BS",value:"BS",code:"+1242"},{label:"BH",value:"BH",code:"+973"},{label:"BD",value:"BD",code:"+880"},{label:"BB",value:"BB",code:"+1246"},{label:"BY",value:"BY",code:"+375"},{label:"BE",value:"BE",code:"+32"},{label:"BZ",value:"BZ",code:"+501"},{label:"BJ",value:"BJ",code:"+229"},{label:"BM",value:"BM",code:"+1441"},{label:"BT",value:"BT",code:"+975"},{label:"BO",value:"BO",code:"+591"},{label:"BA",value:"BA",code:"+387"},{label:"BW",value:"BW",code:"+267"},{label:"BR",value:"BR",code:"+55"},{label:"IO",value:"IO",code:"+246"},{label:"VG",value:"VG",code:"+1284"},{label:"BN",value:"BN",code:"+673"},{label:"BG",value:"BG",code:"+359"},{label:"BF",value:"BF",code:"+226"},{label:"BI",value:"BI",code:"+257"},{label:"KH",value:"KH",code:"+855"},{label:"CM",value:"CM",code:"+237"},{label:"CA",value:"CA",code:"+1"},{label:"CV",value:"CV",code:"+238"},{label:"KY",value:"KY",code:"+1345"},{label:"CF",value:"CF",code:"+236"},{label:"TD",value:"TD",code:"+235"},{label:"CL",value:"CL",code:"+56"},{label:"CN",value:"CN",code:"+86"},{label:"CX",value:"CX",code:"+61"},{label:"CC",value:"CC",code:"+61"},{label:"CO",value:"CO",code:"+57"},{label:"KM",value:"KM",code:"+269"},{label:"CK",value:"CK",code:"+682"},{label:"CR",value:"CR",code:"+506"},{label:"HR",value:"HR",code:"+385"},{label:"CU",value:"CU",code:"+53"},{label:"CW",value:"CW",code:"+599"},{label:"CY",value:"CY",code:"+357"},{label:"CZ",value:"CZ",code:"+420"},{label:"CD",value:"CD",code:"+243"},{label:"DK",value:"DK",code:"+45"},{label:"DJ",value:"DJ",code:"+253"},{label:"DM",value:"DM",code:"+1767"},{label:"DO",value:"DO",code:"+1809"},{label:"DO",value:"DO",code:"+1829"},{label:"DO",value:"DO",code:"+1849"},{label:"TL",value:"TL",code:"+670"},{label:"EC",value:"EC",code:"+593"},{label:"EG",value:"EG",code:"+20"},{label:"SV",value:"SV",code:"+503"},{label:"GQ",value:"GQ",code:"+240"},{label:"ER",value:"ER",code:"+291"},{label:"EE",value:"EE",code:"+372"},{label:"ET",value:"ET",code:"+251"},{label:"FK",value:"FK",code:"+500"},{label:"FO",value:"FO",code:"+298"},{label:"FJ",value:"FJ",code:"+679"},{label:"FI",value:"FI",code:"+358"},{label:"FR",value:"FR",code:"+33"},{label:"PF",value:"PF",code:"+689"},{label:"GA",value:"GA",code:"+241"},{label:"GM",value:"GM",code:"+220"},{label:"GE",value:"GE",code:"+995"},{label:"DE",value:"DE",code:"+49"},{label:"GH",value:"GH",code:"+233"},{label:"GI",value:"GI",code:"+350"},{label:"GR",value:"GR",code:"+30"},{label:"GL",value:"GL",code:"+299"},{label:"GD",value:"GD",code:"+1473"},{label:"GU",value:"GU",code:"+1671"},{label:"GT",value:"GT",code:"+502"},{label:"GG",value:"GG",code:"+441481"},{label:"GN",value:"GN",code:"+224"},{label:"GW",value:"GW",code:"+245"},{label:"GY",value:"GY",code:"+592"},{label:"HT",value:"HT",code:"+509"},{label:"HN",value:"HN",code:"+504"},{label:"HK",value:"HK",code:"+852"},{label:"HU",value:"HU",code:"+36"},{label:"IS",value:"IS",code:"+354"},{label:"IN",value:"IN",code:"+91"},{label:"ID",value:"ID",code:"+62"},{label:"IR",value:"IR",code:"+98"},{label:"IQ",value:"IQ",code:"+964"},{label:"IE",value:"IE",code:"+353"},{label:"IM",value:"IM",code:"+441624"},{label:"IL",value:"IL",code:"+972"},{label:"IT",value:"IT",code:"+39"},{label:"CI",value:"CI",code:"+225"},{label:"JM",value:"JM",code:"+1876"},{label:"JP",value:"JP",code:"+81"},{label:"JE",value:"JE",code:"+441534"},{label:"JO",value:"JO",code:"+962"},{label:"KZ",value:"KZ",code:"+7"},{label:"KE",value:"KE",code:"+254"},{label:"KI",value:"KI",code:"+686"},{label:"XK",value:"XK",code:"+383"},{label:"KW",value:"KW",code:"+965"},{label:"KG",value:"KG",code:"+996"},{label:"LA",value:"LA",code:"+856"},{label:"LV",value:"LV",code:"+371"},{label:"LB",value:"LB",code:"+961"},{label:"LS",value:"LS",code:"+266"},{label:"LR",value:"LR",code:"+231"},{label:"LY",value:"LY",code:"+218"},{label:"LI",value:"LI",code:"+423"},{label:"LT",value:"LT",code:"+370"},{label:"LU",value:"LU",code:"+352"},{label:"MO",value:"MO",code:"+853"},{label:"MK",value:"MK",code:"+389"},{label:"MG",value:"MG",code:"+261"},{label:"MW",value:"MW",code:"+265"},{label:"MY",value:"MY",code:"+60"},{label:"MV",value:"MV",code:"+960"},{label:"ML",value:"ML",code:"+223"},{label:"MT",value:"MT",code:"+356"},{label:"MH",value:"MH",code:"+692"},{label:"MR",value:"MR",code:"+222"},{label:"MU",value:"MU",code:"+230"},{label:"YT",value:"YT",code:"+262"},{label:"MX",value:"MX",code:"+52"},{label:"FM",value:"FM",code:"+691"},{label:"MD",value:"MD",code:"+373"},{label:"MC",value:"MC",code:"+377"},{label:"MN",value:"MN",code:"+976"},{label:"ME",value:"ME",code:"+382"},{label:"MS",value:"MS",code:"+1664"},{label:"MA",value:"MA",code:"+212"},{label:"MZ",value:"MZ",code:"+258"},{label:"MM",value:"MM",code:"+95"},{label:"NA",value:"NA",code:"+264"},{label:"NR",value:"NR",code:"+674"},{label:"NP",value:"NP",code:"+977"},{label:"NL",value:"NL",code:"+31"},{label:"AN",value:"AN",code:"+599"},{label:"NC",value:"NC",code:"+687"},{label:"NZ",value:"NZ",code:"+64"},{label:"NI",value:"NI",code:"+505"},{label:"NE",value:"NE",code:"+227"},{label:"NG",value:"NG",code:"+234"},{label:"NU",value:"NU",code:"+683"},{label:"KP",value:"KP",code:"+850"},{label:"MP",value:"MP",code:"+1670"},{label:"NO",value:"NO",code:"+47"},{label:"OM",value:"OM",code:"+968"},{label:"PK",value:"PK",code:"+92"},{label:"PW",value:"PW",code:"+680"},{label:"PS",value:"PS",code:"+970"},{label:"PA",value:"PA",code:"+507"},{label:"PG",value:"PG",code:"+675"},{label:"PY",value:"PY",code:"+595"},{label:"PE",value:"PE",code:"+51"},{label:"PH",value:"PH",code:"+63"},{label:"PN",value:"PN",code:"+64"},{label:"PL",value:"PL",code:"+48"},{label:"PT",value:"PT",code:"+351"},{label:"PR",value:"PR",code:"+1787"},{label:"PR",value:"PR",code:"+1939"},{label:"QA",value:"QA",code:"+974"},{label:"CG",value:"CG",code:"+242"},{label:"RE",value:"RE",code:"+262"},{label:"RO",value:"RO",code:"+40"},{label:"RU",value:"RU",code:"+7"},{label:"RW",value:"RW",code:"+250"},{label:"BL",value:"BL",code:"+590"},{label:"SH",value:"SH",code:"+290"},{label:"KN",value:"KN",code:"+1869"},{label:"LC",value:"LC",code:"+1758"},{label:"MF",value:"MF",code:"+590"},{label:"PM",value:"PM",code:"+508"},{label:"VC",value:"VC",code:"+1784"},{label:"WS",value:"WS",code:"+685"},{label:"SM",value:"SM",code:"+378"},{label:"ST",value:"ST",code:"+239"},{label:"SA",value:"SA",code:"+966"},{label:"SN",value:"SN",code:"+221"},{label:"RS",value:"RS",code:"+381"},{label:"SC",value:"SC",code:"+248"},{label:"SL",value:"SL",code:"+232"},{label:"SG",value:"SG",code:"+65"},{label:"SX",value:"SX",code:"+1721"},{label:"SK",value:"SK",code:"+421"},{label:"SI",value:"SI",code:"+386"},{label:"SB",value:"SB",code:"+677"},{label:"SO",value:"SO",code:"+252"},{label:"ZA",value:"ZA",code:"+27"},{label:"KR",value:"KR",code:"+82"},{label:"SS",value:"SS",code:"+211"},{label:"ES",value:"ES",code:"+34"},{label:"LK",value:"LK",code:"+94"},{label:"SD",value:"SD",code:"+249"},{label:"SR",value:"SR",code:"+597"},{label:"SJ",value:"SJ",code:"+47"},{label:"SZ",value:"SZ",code:"+268"},{label:"SE",value:"SE",code:"+46"},{label:"CH",value:"CH",code:"+41"},{label:"SY",value:"SY",code:"+963"},{label:"TW",value:"TW",code:"+886"},{label:"TJ",value:"TJ",code:"+992"},{label:"TZ",value:"TZ",code:"+255"},{label:"TH",value:"TH",code:"+66"},{label:"TG",value:"TG",code:"+228"},{label:"TK",value:"TK",code:"+690"},{label:"TO",value:"TO",code:"+676"},{label:"TT",value:"TT",code:"+1868"},{label:"TN",value:"TN",code:"+216"},{label:"TR",value:"TR",code:"+90"},{label:"TM",value:"TM",code:"+993"},{label:"TC",value:"TC",code:"+1649"},{label:"TV",value:"TV",code:"+688"},{label:"VI",value:"VI",code:"+1340"},{label:"UG",value:"UG",code:"+256"},{label:"UA",value:"UA",code:"+380"},{label:"AE",value:"AE",code:"+971"},{label:"GB",value:"GB",code:"+44"},{label:"US",value:"US",code:"+1"},{label:"UY",value:"UY",code:"+598"},{label:"UZ",value:"UZ",code:"+998"},{label:"VU",value:"VU",code:"+678"},{label:"VA",value:"VA",code:"+379"},{label:"VE",value:"VE",code:"+58"},{label:"VN",value:"VN",code:"+84"},{label:"WF",value:"WF",code:"+681"},{label:"EH",value:"EH",code:"+212"},{label:"YE",value:"YE",code:"+967"},{label:"ZM",value:"ZM",code:"+260"},{label:"ZW",value:"ZW",code:"+263"}];var Co=Object.defineProperty,_o=Object.getOwnPropertyDescriptor,oe=(a,e,r,n)=>{for(var t=n>1?void 0:n?_o(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&Co(e,r,t),t};o.RtgInput=class extends h{constructor(){super(),this.disabled=!1,this.type="text",this.placeholder="",this.defaultValue="",this.value="",this.dataKey="",this.country="US",this.countryCode="+1",this.selectedLabel="US",this.value=this.value||this.defaultValue}handleCountryChange(e){const r=e.target,n=wr.find(t=>t.value===r.value);n&&(this.country=n.value,this.countryCode=n.code,this.selectedLabel=n.value,this.requestUpdate()),e.stopPropagation()}firstUpdated(e){this.removeParentAttributes();const r=["--input-border-radius","--input-padding"];this.applyCustomClass(r,"input","input-base"),this.type!=="file"&&this.defaultValue&&(this.value=this.defaultValue),this.observeStyleAndClassSync(this.inputElement)}handleInputChange(e){const r=e.target;r.type==="file"?this.value=r.files?r.files[0].name:"":this.value=r.value}handleFocus(){this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0,detail:{dataKey:this.dataKey}}))}getAttributesToExclude(){return["disabled","type","placeholder","value","data-testid","custom-class","data-key"]}getAttributesToRemoveFromParent(){return["class","style"]}createRenderRoot(){return this}render(){const e=this.getFilteredAttributes();return this.type==="tel"?d.html`
|
|
2862
|
+
`;let St=nr;customElements.define("shadow-wrapper",St);class br extends Ln.AsyncDirective{constructor(){super(...arguments),this.prevData={}}render(e){return Mn.nothing}update(e,[r]){var n;this.element!==e.element&&(this.element=e.element),this.host=((n=e.options)===null||n===void 0?void 0:n.host)||this.element,this.apply(r),this.groom(r),this.prevData={...r}}apply(e){if(!e)return;const{prevData:r,element:n}=this;for(const t in e){const i=e[t];i!==r[t]&&(n[t]=i)}}groom(e){const{prevData:r,element:n}=this;if(r)for(const t in r)(!e||!(t in e)&&n[t]===r[t])&&(n[t]=void 0)}}_t.directive(br);class yr extends br{constructor(){super(...arguments),this.eventData={}}apply(e){if(e)for(const r in e){const n=e[r];n!==this.eventData[r]&&this.applyEvent(r,n)}}applyEvent(e,r){const{prevData:n,element:t}=this;this.eventData[e]=r,n[e]&&t.removeEventListener(e,this,r),t.addEventListener(e,this,r)}groom(e){const{prevData:r,element:n}=this;if(r)for(const t in r)(!e||!(t in e)&&n[t]===r[t])&&this.groomEvent(t,r[t])}groomEvent(e,r){const{element:n}=this;delete this.eventData[e],n.removeEventListener(e,this,r)}handleEvent(e){const r=this.eventData[e.type];typeof r=="function"?r.call(this.host,e):r.handleEvent(e)}disconnected(){const{eventData:e,element:r}=this;for(const n in e){const t=n.slice(1),i=e[n];r.removeEventListener(t,this,i)}}reconnected(){const{eventData:e,element:r}=this;for(const n in e){const t=n.slice(1),i=e[n];r.addEventListener(t,this,i)}}}_t.directive(yr);class wo extends yr{apply(e){if(!e)return;const{prevData:r,element:n}=this;for(const t in e){const i=e[t];if(i===r[t])continue;const s=t.slice(1);switch(t[0]){case"@":this.eventData[s]=i,this.applyEvent(s,i);break;case".":n[s]=i;break;case"?":i?n.setAttribute(s,""):n.removeAttribute(s);break;default:i!=null?n.setAttribute(t,String(i)):n.removeAttribute(t);break}}}groom(e){const{prevData:r,element:n}=this;if(r)for(const t in r){const i=t.slice(1);if(!e||!(t in e)&&n[i]===r[t])switch(t[0]){case"@":this.groomEvent(i,r[t]);break;case".":n[i]=void 0;break;case"?":n.removeAttribute(i);break;default:n.removeAttribute(t);break}}}}const V=_t.directive(wo),wr=[{label:"AF",value:"AF",code:"+93"},{label:"AL",value:"AL",code:"+355"},{label:"DZ",value:"DZ",code:"+213"},{label:"AS",value:"AS",code:"+1684"},{label:"AD",value:"AD",code:"+376"},{label:"AO",value:"AO",code:"+244"},{label:"AI",value:"AI",code:"+1264"},{label:"AG",value:"AG",code:"+1268"},{label:"AR",value:"AR",code:"+54"},{label:"AM",value:"AM",code:"+374"},{label:"AW",value:"AW",code:"+297"},{label:"AU",value:"AU",code:"+61"},{label:"AT",value:"AT",code:"+43"},{label:"AZ",value:"AZ",code:"+994"},{label:"BS",value:"BS",code:"+1242"},{label:"BH",value:"BH",code:"+973"},{label:"BD",value:"BD",code:"+880"},{label:"BB",value:"BB",code:"+1246"},{label:"BY",value:"BY",code:"+375"},{label:"BE",value:"BE",code:"+32"},{label:"BZ",value:"BZ",code:"+501"},{label:"BJ",value:"BJ",code:"+229"},{label:"BM",value:"BM",code:"+1441"},{label:"BT",value:"BT",code:"+975"},{label:"BO",value:"BO",code:"+591"},{label:"BA",value:"BA",code:"+387"},{label:"BW",value:"BW",code:"+267"},{label:"BR",value:"BR",code:"+55"},{label:"IO",value:"IO",code:"+246"},{label:"VG",value:"VG",code:"+1284"},{label:"BN",value:"BN",code:"+673"},{label:"BG",value:"BG",code:"+359"},{label:"BF",value:"BF",code:"+226"},{label:"BI",value:"BI",code:"+257"},{label:"KH",value:"KH",code:"+855"},{label:"CM",value:"CM",code:"+237"},{label:"CA",value:"CA",code:"+1"},{label:"CV",value:"CV",code:"+238"},{label:"KY",value:"KY",code:"+1345"},{label:"CF",value:"CF",code:"+236"},{label:"TD",value:"TD",code:"+235"},{label:"CL",value:"CL",code:"+56"},{label:"CN",value:"CN",code:"+86"},{label:"CX",value:"CX",code:"+61"},{label:"CC",value:"CC",code:"+61"},{label:"CO",value:"CO",code:"+57"},{label:"KM",value:"KM",code:"+269"},{label:"CK",value:"CK",code:"+682"},{label:"CR",value:"CR",code:"+506"},{label:"HR",value:"HR",code:"+385"},{label:"CU",value:"CU",code:"+53"},{label:"CW",value:"CW",code:"+599"},{label:"CY",value:"CY",code:"+357"},{label:"CZ",value:"CZ",code:"+420"},{label:"CD",value:"CD",code:"+243"},{label:"DK",value:"DK",code:"+45"},{label:"DJ",value:"DJ",code:"+253"},{label:"DM",value:"DM",code:"+1767"},{label:"DO",value:"DO",code:"+1809"},{label:"DO",value:"DO",code:"+1829"},{label:"DO",value:"DO",code:"+1849"},{label:"TL",value:"TL",code:"+670"},{label:"EC",value:"EC",code:"+593"},{label:"EG",value:"EG",code:"+20"},{label:"SV",value:"SV",code:"+503"},{label:"GQ",value:"GQ",code:"+240"},{label:"ER",value:"ER",code:"+291"},{label:"EE",value:"EE",code:"+372"},{label:"ET",value:"ET",code:"+251"},{label:"FK",value:"FK",code:"+500"},{label:"FO",value:"FO",code:"+298"},{label:"FJ",value:"FJ",code:"+679"},{label:"FI",value:"FI",code:"+358"},{label:"FR",value:"FR",code:"+33"},{label:"PF",value:"PF",code:"+689"},{label:"GA",value:"GA",code:"+241"},{label:"GM",value:"GM",code:"+220"},{label:"GE",value:"GE",code:"+995"},{label:"DE",value:"DE",code:"+49"},{label:"GH",value:"GH",code:"+233"},{label:"GI",value:"GI",code:"+350"},{label:"GR",value:"GR",code:"+30"},{label:"GL",value:"GL",code:"+299"},{label:"GD",value:"GD",code:"+1473"},{label:"GU",value:"GU",code:"+1671"},{label:"GT",value:"GT",code:"+502"},{label:"GG",value:"GG",code:"+441481"},{label:"GN",value:"GN",code:"+224"},{label:"GW",value:"GW",code:"+245"},{label:"GY",value:"GY",code:"+592"},{label:"HT",value:"HT",code:"+509"},{label:"HN",value:"HN",code:"+504"},{label:"HK",value:"HK",code:"+852"},{label:"HU",value:"HU",code:"+36"},{label:"IS",value:"IS",code:"+354"},{label:"IN",value:"IN",code:"+91"},{label:"ID",value:"ID",code:"+62"},{label:"IR",value:"IR",code:"+98"},{label:"IQ",value:"IQ",code:"+964"},{label:"IE",value:"IE",code:"+353"},{label:"IM",value:"IM",code:"+441624"},{label:"IL",value:"IL",code:"+972"},{label:"IT",value:"IT",code:"+39"},{label:"CI",value:"CI",code:"+225"},{label:"JM",value:"JM",code:"+1876"},{label:"JP",value:"JP",code:"+81"},{label:"JE",value:"JE",code:"+441534"},{label:"JO",value:"JO",code:"+962"},{label:"KZ",value:"KZ",code:"+7"},{label:"KE",value:"KE",code:"+254"},{label:"KI",value:"KI",code:"+686"},{label:"XK",value:"XK",code:"+383"},{label:"KW",value:"KW",code:"+965"},{label:"KG",value:"KG",code:"+996"},{label:"LA",value:"LA",code:"+856"},{label:"LV",value:"LV",code:"+371"},{label:"LB",value:"LB",code:"+961"},{label:"LS",value:"LS",code:"+266"},{label:"LR",value:"LR",code:"+231"},{label:"LY",value:"LY",code:"+218"},{label:"LI",value:"LI",code:"+423"},{label:"LT",value:"LT",code:"+370"},{label:"LU",value:"LU",code:"+352"},{label:"MO",value:"MO",code:"+853"},{label:"MK",value:"MK",code:"+389"},{label:"MG",value:"MG",code:"+261"},{label:"MW",value:"MW",code:"+265"},{label:"MY",value:"MY",code:"+60"},{label:"MV",value:"MV",code:"+960"},{label:"ML",value:"ML",code:"+223"},{label:"MT",value:"MT",code:"+356"},{label:"MH",value:"MH",code:"+692"},{label:"MR",value:"MR",code:"+222"},{label:"MU",value:"MU",code:"+230"},{label:"YT",value:"YT",code:"+262"},{label:"MX",value:"MX",code:"+52"},{label:"FM",value:"FM",code:"+691"},{label:"MD",value:"MD",code:"+373"},{label:"MC",value:"MC",code:"+377"},{label:"MN",value:"MN",code:"+976"},{label:"ME",value:"ME",code:"+382"},{label:"MS",value:"MS",code:"+1664"},{label:"MA",value:"MA",code:"+212"},{label:"MZ",value:"MZ",code:"+258"},{label:"MM",value:"MM",code:"+95"},{label:"NA",value:"NA",code:"+264"},{label:"NR",value:"NR",code:"+674"},{label:"NP",value:"NP",code:"+977"},{label:"NL",value:"NL",code:"+31"},{label:"AN",value:"AN",code:"+599"},{label:"NC",value:"NC",code:"+687"},{label:"NZ",value:"NZ",code:"+64"},{label:"NI",value:"NI",code:"+505"},{label:"NE",value:"NE",code:"+227"},{label:"NG",value:"NG",code:"+234"},{label:"NU",value:"NU",code:"+683"},{label:"KP",value:"KP",code:"+850"},{label:"MP",value:"MP",code:"+1670"},{label:"NO",value:"NO",code:"+47"},{label:"OM",value:"OM",code:"+968"},{label:"PK",value:"PK",code:"+92"},{label:"PW",value:"PW",code:"+680"},{label:"PS",value:"PS",code:"+970"},{label:"PA",value:"PA",code:"+507"},{label:"PG",value:"PG",code:"+675"},{label:"PY",value:"PY",code:"+595"},{label:"PE",value:"PE",code:"+51"},{label:"PH",value:"PH",code:"+63"},{label:"PN",value:"PN",code:"+64"},{label:"PL",value:"PL",code:"+48"},{label:"PT",value:"PT",code:"+351"},{label:"PR",value:"PR",code:"+1787"},{label:"PR",value:"PR",code:"+1939"},{label:"QA",value:"QA",code:"+974"},{label:"CG",value:"CG",code:"+242"},{label:"RE",value:"RE",code:"+262"},{label:"RO",value:"RO",code:"+40"},{label:"RU",value:"RU",code:"+7"},{label:"RW",value:"RW",code:"+250"},{label:"BL",value:"BL",code:"+590"},{label:"SH",value:"SH",code:"+290"},{label:"KN",value:"KN",code:"+1869"},{label:"LC",value:"LC",code:"+1758"},{label:"MF",value:"MF",code:"+590"},{label:"PM",value:"PM",code:"+508"},{label:"VC",value:"VC",code:"+1784"},{label:"WS",value:"WS",code:"+685"},{label:"SM",value:"SM",code:"+378"},{label:"ST",value:"ST",code:"+239"},{label:"SA",value:"SA",code:"+966"},{label:"SN",value:"SN",code:"+221"},{label:"RS",value:"RS",code:"+381"},{label:"SC",value:"SC",code:"+248"},{label:"SL",value:"SL",code:"+232"},{label:"SG",value:"SG",code:"+65"},{label:"SX",value:"SX",code:"+1721"},{label:"SK",value:"SK",code:"+421"},{label:"SI",value:"SI",code:"+386"},{label:"SB",value:"SB",code:"+677"},{label:"SO",value:"SO",code:"+252"},{label:"ZA",value:"ZA",code:"+27"},{label:"KR",value:"KR",code:"+82"},{label:"SS",value:"SS",code:"+211"},{label:"ES",value:"ES",code:"+34"},{label:"LK",value:"LK",code:"+94"},{label:"SD",value:"SD",code:"+249"},{label:"SR",value:"SR",code:"+597"},{label:"SJ",value:"SJ",code:"+47"},{label:"SZ",value:"SZ",code:"+268"},{label:"SE",value:"SE",code:"+46"},{label:"CH",value:"CH",code:"+41"},{label:"SY",value:"SY",code:"+963"},{label:"TW",value:"TW",code:"+886"},{label:"TJ",value:"TJ",code:"+992"},{label:"TZ",value:"TZ",code:"+255"},{label:"TH",value:"TH",code:"+66"},{label:"TG",value:"TG",code:"+228"},{label:"TK",value:"TK",code:"+690"},{label:"TO",value:"TO",code:"+676"},{label:"TT",value:"TT",code:"+1868"},{label:"TN",value:"TN",code:"+216"},{label:"TR",value:"TR",code:"+90"},{label:"TM",value:"TM",code:"+993"},{label:"TC",value:"TC",code:"+1649"},{label:"TV",value:"TV",code:"+688"},{label:"VI",value:"VI",code:"+1340"},{label:"UG",value:"UG",code:"+256"},{label:"UA",value:"UA",code:"+380"},{label:"AE",value:"AE",code:"+971"},{label:"GB",value:"GB",code:"+44"},{label:"US",value:"US",code:"+1"},{label:"UY",value:"UY",code:"+598"},{label:"UZ",value:"UZ",code:"+998"},{label:"VU",value:"VU",code:"+678"},{label:"VA",value:"VA",code:"+379"},{label:"VE",value:"VE",code:"+58"},{label:"VN",value:"VN",code:"+84"},{label:"WF",value:"WF",code:"+681"},{label:"EH",value:"EH",code:"+212"},{label:"YE",value:"YE",code:"+967"},{label:"ZM",value:"ZM",code:"+260"},{label:"ZW",value:"ZW",code:"+263"}];var Co=Object.defineProperty,_o=Object.getOwnPropertyDescriptor,oe=(a,e,r,n)=>{for(var t=n>1?void 0:n?_o(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&Co(e,r,t),t};o.RtgInput=class extends h{constructor(){super(),this.disabled=!1,this.type="text",this.placeholder="",this.defaultValue="",this.value="",this.dataKey="",this.country="US",this.countryCode="+1",this.selectedLabel="US",this.value=this.value||this.defaultValue}handleCountryChange(e){const r=e.target,n=wr.find(t=>t.value===r.value);n&&(this.country=n.value,this.countryCode=n.code,this.selectedLabel=n.label,this.requestUpdate(),this.dispatchInputAndChangeEvents()),e.stopPropagation()}firstUpdated(e){this.removeParentAttributes();const r=["--input-border-radius","--input-padding"];this.applyCustomClass(r,"input","input-base"),this.type!=="file"&&this.defaultValue&&(this.value=this.defaultValue),this.observeStyleAndClassSync(this.inputElement)}handleInputChange(e){const r=e.target;r.type==="file"?this.value=r.files?r.files[0].name:"":this.value=r.value,this.dispatchInputAndChangeEvents()}dispatchInputAndChangeEvents(){const e=this.type==="tel"?`${this.countryCode}${this.value}`:this.value;this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:e,rawValue:this.value,code:this.countryCode,dataKey:this.dataKey}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:e,rawValue:this.value,code:this.countryCode,dataKey:this.dataKey}}))}handleFocus(){this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0,detail:{dataKey:this.dataKey}}))}getAttributesToExclude(){return["disabled","type","placeholder","value","data-testid","custom-class","data-key"]}getAttributesToRemoveFromParent(){return["class","style"]}createRenderRoot(){return this}render(){const e=this.getFilteredAttributes();return this.type==="tel"?d.html`
|
|
2863
2863
|
<div
|
|
2864
|
-
class="${p("rtg-flex rtg-items-center rtg-border rtg-border-input rtg-rounded-md rtg-px-3 rtg-py-1",this.
|
|
2864
|
+
class="${p("rtg-flex rtg-items-center rtg-border rtg-border-input rtg-rounded-md rtg-px-3 rtg-py-1 rtg-bg-background rtg-text-sm rtg-ring-offset-background rtg-transition-colors focus-within:rtg-outline-none focus-within:rtg-ring-2 focus-within:rtg-ring-ring focus-within:rtg-ring-offset-2",this.customClass)}"
|
|
2865
2865
|
>
|
|
2866
2866
|
<select
|
|
2867
|
-
class="
|
|
2867
|
+
class="rtg-w-[40px] rtg-bg-transparent rtg-text-sm rtg-outline-none"
|
|
2868
2868
|
@change=${this.handleCountryChange}
|
|
2869
2869
|
.value=${this.country}
|
|
2870
2870
|
>
|
|
2871
|
-
${wr.map(r=>d.html
|
|
2872
|
-
value=${r.value}
|
|
2873
|
-
|
|
2874
|
-
>
|
|
2875
|
-
${this.country===r.value?this.selectedLabel:`${r.label} ${r.code}`}
|
|
2876
|
-
</option>`)}
|
|
2871
|
+
${wr.map(r=>d.html`
|
|
2872
|
+
<option value=${r.value}>${r.label} ${r.code}</option>
|
|
2873
|
+
`)}
|
|
2877
2874
|
</select>
|
|
2878
|
-
<span class="rtg-
|
|
2875
|
+
<span class="rtg-ml-2">${this.countryCode}</span>
|
|
2879
2876
|
<input
|
|
2880
2877
|
part="input"
|
|
2881
2878
|
type="tel"
|
|
2882
|
-
class="
|
|
2879
|
+
class="input-base rtg-flex-1 rtg-bg-transparent rtg-px-3 rtg-py-[3px] rtg-text-sm focus-visible:rtg-outline-none disabled:rtg-opacity-50"
|
|
2883
2880
|
placeholder=${this.placeholder}
|
|
2884
2881
|
.value=${this.value}
|
|
2885
|
-
@
|
|
2882
|
+
@input=${this.handleInputChange}
|
|
2883
|
+
@change=${this.handleInputChange}
|
|
2886
2884
|
@focus=${this.handleFocus}
|
|
2887
2885
|
?disabled=${this.disabled}
|
|
2888
2886
|
${V(e)}
|
|
@@ -2895,8 +2893,9 @@ body {
|
|
|
2895
2893
|
placeholder="${this.placeholder}"
|
|
2896
2894
|
?disabled=${this.disabled}
|
|
2897
2895
|
.value=${this.type!=="file"?this.value:""}
|
|
2898
|
-
@
|
|
2899
|
-
@
|
|
2896
|
+
@input=${this.handleInputChange}
|
|
2897
|
+
@change=${this.handleInputChange}
|
|
2898
|
+
@focus=${this.handleFocus}
|
|
2900
2899
|
${V(e)}
|
|
2901
2900
|
class="${p(qn,this.customClass)}"
|
|
2902
2901
|
/>
|
|
@@ -4906,13 +4905,13 @@ body {
|
|
|
4906
4905
|
</div>
|
|
4907
4906
|
`}},pn([l.query("[data-radix-scroll-area-viewport]")],o.RtgScrollArea.prototype,"viewportEl",2),o.RtgScrollArea=pn([l.customElement("rtg-scroll-area")],o.RtgScrollArea);var sg=Object.defineProperty,lg=Object.getOwnPropertyDescriptor,hn=(a,e,r,n)=>{for(var t=n>1?void 0:n?lg(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&sg(e,r,t),t};o.LightSampleDemo=class extends h{constructor(){super(),this.btnClass="border: 1px solid #DC2626;"}getAttributesToExclude(){return["disabled","type","placeholder","value","data-testid"]}createRenderRoot(){return this}render(){return d.html`
|
|
4908
4907
|
<div class="sb-flex sb-flex-col sb-gap-4">
|
|
4909
|
-
<label class="sb-font-semibold">Custom button style:</label>
|
|
4908
|
+
<!-- <label class="sb-font-semibold">Custom button style:</label>
|
|
4910
4909
|
<textarea
|
|
4911
4910
|
class="sb-border sb-p-2"
|
|
4912
4911
|
.value=${this.btnClass}
|
|
4913
4912
|
@input=${e=>this.btnClass=e.target.value}
|
|
4914
4913
|
></textarea>
|
|
4915
|
-
<rtg-alert style=${this.btnClass} message=${"hey"}></rtg-alert>
|
|
4914
|
+
<rtg-alert style=${this.btnClass} message=${"hey"}></rtg-alert> -->
|
|
4916
4915
|
</div>
|
|
4917
4916
|
`}},hn([l.state()],o.LightSampleDemo.prototype,"btnClass",2),o.LightSampleDemo=hn([l.customElement("light-sample-demo")],o.LightSampleDemo);/**
|
|
4918
4917
|
* @license
|
|
@@ -16,7 +16,8 @@ export declare class RtgInput extends BaseElement {
|
|
|
16
16
|
selectedLabel: string;
|
|
17
17
|
private handleCountryChange;
|
|
18
18
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
19
|
-
handleInputChange
|
|
19
|
+
private handleInputChange;
|
|
20
|
+
private dispatchInputAndChangeEvents;
|
|
20
21
|
handleFocus(): void;
|
|
21
22
|
protected getAttributesToExclude(): string[];
|
|
22
23
|
protected getAttributesToRemoveFromParent(): string[];
|
package/package.json
CHANGED