@fluid-topics/ft-wc-utils 1.2.71 → 1.2.73
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.
|
@@ -40,4 +40,4 @@ export declare class InputValidationEvent extends CustomEvent<{
|
|
|
40
40
|
}> {
|
|
41
41
|
constructor(level: string);
|
|
42
42
|
}
|
|
43
|
-
export declare function toFtInput<T extends Constructor<FtLitElement>, V>(ElementClass: T
|
|
43
|
+
export declare function toFtInput<T extends Constructor<FtLitElement>, V>(ElementClass: T): FtInputType<T, V>;
|
|
@@ -22,7 +22,7 @@ export class InputValidationEvent extends CustomEvent {
|
|
|
22
22
|
super("input-validated", { detail: { level: level } });
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export function toFtInput(ElementClass
|
|
25
|
+
export function toFtInput(ElementClass) {
|
|
26
26
|
class FtInput extends ElementClass {
|
|
27
27
|
constructor() {
|
|
28
28
|
super(...arguments);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ValidationRule<V> = (value?: V) => true | string;
|
|
2
2
|
export declare const ValidationRules: {
|
|
3
3
|
required: (message: string) => ValidationRule<string>;
|
|
4
|
-
email: (message: string) => ValidationRule<
|
|
5
|
-
url: (message: string) => ValidationRule<
|
|
4
|
+
email: (message: string) => ValidationRule<string>;
|
|
5
|
+
url: (message: string) => ValidationRule<string>;
|
|
6
6
|
};
|
package/build/globals.min.js
CHANGED
|
@@ -69,7 +69,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
|
|
|
69
69
|
width:auto;
|
|
70
70
|
height:auto;
|
|
71
71
|
}
|
|
72
|
-
`;var j=function(r,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,o,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},We;(function(r){r.blur="blur",r.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",r.input="input"})(We||(We={}));var He;(function(r){r.default="default",r.warning="warning",r.error="error"})(He||(He={}));var an=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}};function Zy(r
|
|
72
|
+
`;var j=function(r,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,o,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},We;(function(r){r.blur="blur",r.blurWithStatusResolutionOnInput="blurWithStatusResolutionOnInput",r.input="input"})(We||(We={}));var He;(function(r){r.default="default",r.warning="warning",r.error="error"})(He||(He={}));var an=class extends CustomEvent{constructor(e){super("input-validated",{detail:{level:e}})}};function Zy(r){class e extends r{constructor(){super(...arguments),this.warningRules=[],this.errorRules=[],this.validateOn=We.input,this.validateAtRender=!1,this.label="",this.hideLabel=!1,this.name="",this.disabled=!1,this.errorMessages=[],this.warningMessages=[],this.status=He.default,this.focused=!1,this.additionalWarningRules=[],this.additionalErrorRules=[]}connectedCallback(){super.connectedCallback(),this.validateAtRender&&this.triggerValidation()}onBlur(){this.focused=!1,(this.validateOn===We.blur||this.validateOn===We.blurWithStatusResolutionOnInput)&&this.triggerValidation()}onFocus(){this.focused=!0}onInput(){(this.status!==He.default&&this.validateOn===We.blurWithStatusResolutionOnInput||this.validateOn===We.input)&&this.triggerValidation()}triggerValidation(){this.errorMessages=this.processRules([...this.errorRules,...this.additionalErrorRules]),this.warningMessages=this.processRules([...this.warningRules,...this.additionalWarningRules]),this.status=this.resolveStatus(),this.dispatchEvent(new an(this.status))}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?He.error:this.warningMessages.length?He.warning:He.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return j([U()],e.prototype,"warningRules",void 0),j([U()],e.prototype,"errorRules",void 0),j([U()],e.prototype,"validateOn",void 0),j([U({type:Boolean})],e.prototype,"validateAtRender",void 0),j([U()],e.prototype,"label",void 0),j([U({type:Boolean})],e.prototype,"hideLabel",void 0),j([U()],e.prototype,"name",void 0),j([U({type:Boolean})],e.prototype,"disabled",void 0),j([U()],e.prototype,"helperText",void 0),j([U()],e.prototype,"forceStatus",void 0),j([U({reflect:!0})],e.prototype,"value",void 0),j([re()],e.prototype,"errorMessages",void 0),j([re()],e.prototype,"warningMessages",void 0),j([re()],e.prototype,"status",void 0),j([re()],e.prototype,"focused",void 0),j([re()],e.prototype,"additionalWarningRules",void 0),j([re()],e.prototype,"additionalErrorRules",void 0),e}var Jl=/^[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/,Xl=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/,Yy={required:function(r){return e=>!!e||r},email:function(r){return e=>!e||Xl.test(e.toString())||r},url:function(r){return e=>!e||Jl.test(e.toString())||r}};var cn,sn,ln,dn,Ql=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((ln=(sn=(cn=window.safari)===null||cn===void 0?void 0:cn.pushNotification)===null||sn===void 0?void 0:sn.toString())!==null&&ln!==void 0?ln:"")==="[object SafariRemoteNotification]",ed="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(dn=window.ftGlobals)!==null&&dn!==void 0?dn:{lit:Er,litDecorators:Cr,litRepeat:wr,litClassMap:Ar,litStyleMap:Rr,litUnsafeHTML:Nr,wcUtils:{...Dr,...Pr,...Br,...en,...Wr,...jr,...Zr,...kr,...so,...nn,...Ji,...Zo,...Kr,...go,...Xo,...po,...Ua,...zr,...mo,...bo,...Xi,...Ba,...vo,...Go,...rn,...lo,...fo,...Yo,isSafari:Ql,isTouchScreen:ed,setVariable:Zt}};})();
|
|
73
73
|
/*! Bundled license information:
|
|
74
74
|
|
|
75
75
|
@webcomponents/scoped-custom-element-registry/src/scoped-custom-element-registry.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-wc-utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.73",
|
|
4
4
|
"description": "Internal web components tools",
|
|
5
5
|
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"mark.js": "8.11.1",
|
|
25
25
|
"moment": "2.29.4"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "4f8924d376dd8e1fc58e1cde50904618bfe6ac1d"
|
|
28
28
|
}
|