@ncino/web-components 13.2.0 → 13.3.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.
- package/dist/components/input/gator/input-phone/input-phone.gator.js +3 -3
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js +1 -0
- package/dist/types/components/input/gator/input-phone/input-phone.gator.d.ts +6 -0
- package/package.json +3 -3
- package/web-types.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as
|
|
1
|
+
import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as l}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as m}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as c}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as f}from"../../../../utils/decorators/custom-element-decorator.js";import{createRef as p,ref as d}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import b from"../../../../packages/web-components/src/components/input/gator/input-phone/input-phone.gator.scss.js";import{NgcInputBase as v}from"../../base/input-base.gator.js";import"../dropdown/input-dropdown.gator.js";import"../input-text/input-text.gator.js";import"../input-label/input-label.gator.js";import{isValidPhoneNumber as y}from"../../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js";import{parsePhoneNumber as h}from"../../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js";import{unsafeCSS as g}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var C=Object.defineProperty,$=Object.getOwnPropertyDescriptor,V=Object.getPrototypeOf,P=Reflect.get,a=(e,t,n,i)=>{for(var o=i>1?void 0:i?$(t,n):t,u=e.length-1,s;u>=0;u--)(s=e[u])&&(o=(i?s(t,n,o):s(o))||o);return i&&o&&C(t,n,o),o},N=(e,t,n)=>P(V(e),n,t);let r=class extends v{constructor(){super(...arguments),this.inputContainer=p(),this.dropdownContainer=p()}get phoneRegionIso(){if(this.countryCodeValue!=null&&this.countryCodeValue!=="")return this.countryCodeValue;if(this.countryCodeValue===null||this.countryCodeValue==="")return;const e=this.defaultCountry?.trim();return e?e.toUpperCase():void 0}render(){return l`
|
|
2
2
|
<div class="gator-form-element">
|
|
3
3
|
${this.label?this.labelMarkup:null}
|
|
4
4
|
<div class="gator-phone-input-container" ${d(this.inputContainer)}>
|
|
@@ -33,7 +33,7 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
|
|
|
33
33
|
</div>
|
|
34
34
|
${this.bottomText}
|
|
35
35
|
</div>
|
|
36
|
-
`}updated(){this.dropdownContainer.value&&this.inputContainer.value&&(this.dropdownContainer.value.listWidth=this.inputContainer.value?.offsetWidth.toString())}handleSelected(e){const t=e.detail.value;if(t===""||t===null||t===void 0){this.countryCodeValue=null;return}this.countryCodeValue=typeof t=="string"?t.toUpperCase():String(t)}handlePhoneInput(e){e.preventDefault(),e.stopPropagation();const t=
|
|
36
|
+
`}updated(){this.dropdownContainer.value&&this.inputContainer.value&&(this.dropdownContainer.value.listWidth=this.inputContainer.value?.offsetWidth.toString())}handleSelected(e){const t=e.detail.value;if(t===""||t===null||t===void 0){this.countryCodeValue=null;return}this.countryCodeValue=typeof t=="string"?t.toUpperCase():String(t)}isValidPhoneNumberForCurrentContext(e){if(e==="")return!0;const t=this.phoneRegionIso;if(t)return y(e,t);const n=h(e);return n?n.isValid():!0}handlePhoneInput(e){e.preventDefault(),e.stopPropagation();const t=e.detail.value,n=String(t??"").trim(),i=this.isValidPhoneNumberForCurrentContext(n),o=h(t,this.phoneRegionIso);if(o){o.country&&(this.countryCodeValue=o.country),this.phoneNumberValue=o.nationalNumber,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:t,countryCode:o.countryCallingCode,country:o.country,phoneNumber:o.nationalNumber,formattedPhoneNumber:o.formatInternational(),isValidPhoneNumber:i}}));return}this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:t,isValidPhoneNumber:i}}))}get slotLabelMarkup(){return l`
|
|
37
37
|
<ngc-input-label
|
|
38
38
|
slot="label"
|
|
39
39
|
hide-label
|
|
@@ -41,4 +41,4 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
|
|
|
41
41
|
.required="${this.required}"
|
|
42
42
|
>
|
|
43
43
|
${this.label}
|
|
44
|
-
</ngc-input-label>`}};
|
|
44
|
+
</ngc-input-label>`}};r.styles=[...N(r,r,"styles"),g(b)];a([c()],r.prototype,"countryCodeValue",2);a([c()],r.prototype,"phoneNumberValue",2);a([m({type:String,attribute:"default-country"})],r.prototype,"defaultCountry",2);r=a([f("ngc-input-phone")],r);export{r as NgcInputPhone};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c from"./normalizeArguments.js";import f from"./parsePhoneNumber_.js";function o(e){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(n){p(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function p(e,t,r){return(t=b(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e){var t=m(e,"string");return o(t)=="symbol"?t:t+""}function m(e,t){if(o(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function l(){var e=c(arguments),t=e.text,r=e.options,n=e.metadata;r=a(a({},r),{},{extract:!1});var i=f(t,r,n);return i&&i.isValid()||!1}export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"./withMetadataArgument.js";import t from"../../es6/isValidPhoneNumber.js";function m(){return r(t,arguments)}export{m as isValidPhoneNumber};
|
|
@@ -23,6 +23,12 @@ export declare class NgcInputPhone extends NgcInputBase {
|
|
|
23
23
|
render(): import('lit').TemplateResult<1>;
|
|
24
24
|
updated(): void;
|
|
25
25
|
handleSelected(e: CustomEvent): void;
|
|
26
|
+
/**
|
|
27
|
+
* Validity for the selected/default region when known; otherwise only when the library
|
|
28
|
+
* can parse an international number. National-format input without a region cannot be
|
|
29
|
+
* validated and is treated as valid (`true`).
|
|
30
|
+
*/
|
|
31
|
+
private isValidPhoneNumberForCurrentContext;
|
|
26
32
|
handlePhoneInput(e: CustomEvent): void;
|
|
27
33
|
get slotLabelMarkup(): import('lit').TemplateResult<1>;
|
|
28
34
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncino/web-components",
|
|
3
3
|
"author": "nCino",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.3.0",
|
|
5
5
|
"license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"vite-plugin-static-copy": "^3.3.0",
|
|
101
101
|
"vitest": "^4.1.0",
|
|
102
102
|
"yaml-eslint-parser": "^2.0.0",
|
|
103
|
-
"@ncino/styles": "13.
|
|
103
|
+
"@ncino/styles": "13.3.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@ncino/styles": "13.
|
|
106
|
+
"@ncino/styles": "13.3.0"
|
|
107
107
|
},
|
|
108
108
|
"bugs": {
|
|
109
109
|
"url": "https://github.com/ncino/force-sdk-web-components/issues"
|
package/web-types.json
CHANGED