pdap-design-system 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +34 -0
- package/README.md +35 -49
- package/bin/pdap-design-system-cli.js +12 -8
- package/dist/components/Button/PdapButton.vue.d.ts +36 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/FlexContainer/FlexContainer.vue.d.ts +36 -0
- package/dist/components/FlexContainer/index.d.ts +2 -0
- package/dist/components/FlexContainer/types.d.ts +4 -0
- package/dist/components/Footer/PdapFooter.vue.d.ts +29 -0
- package/dist/components/Footer/index.d.ts +2 -0
- package/dist/components/Footer/types.d.ts +9 -0
- package/dist/components/Form/InputsGenerator/FormInputsGenerator.vue.d.ts +37 -0
- package/dist/components/Form/InputsGenerator/index.d.ts +2 -0
- package/dist/components/Form/PdapForm.vue.d.ts +39 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/types.d.ts +35 -0
- package/dist/components/GridContainer/GridContainer.vue.d.ts +39 -0
- package/dist/components/GridContainer/index.d.ts +2 -0
- package/dist/components/GridContainer/types.d.ts +7 -0
- package/dist/components/GridItem/GridItem.vue.d.ts +39 -0
- package/dist/components/GridItem/index.d.ts +2 -0
- package/dist/components/GridItem/types.d.ts +5 -0
- package/dist/components/Header/PdapHeader.vue.d.ts +29 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Header/types.d.ts +4 -0
- package/dist/components/Input/Checkbox/InputCheckbox.vue.d.ts +24 -0
- package/dist/components/Input/Checkbox/index.d.ts +2 -0
- package/dist/components/Input/PdapInput.vue.d.ts +19 -0
- package/dist/components/Input/Text/InputText.vue.d.ts +24 -0
- package/dist/components/Input/Text/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types.d.ts +20 -0
- package/dist/components/Input/utils.d.ts +4 -0
- package/dist/components/Nav/PdapNav.vue.d.ts +12 -0
- package/dist/components/Nav/index.d.ts +2 -0
- package/dist/components/Nav/types.d.ts +12 -0
- package/dist/components/TileIcon/TileIcon.vue.d.ts +12 -0
- package/dist/components/TileIcon/index.d.ts +2 -0
- package/dist/components/TileIcon/types.d.ts +4 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1728 -0
- package/dist/styles.css +1 -0
- package/dist/tools/testing/serializer.d.ts +7 -0
- package/dist/tools/testing/setup.d.ts +1 -0
- package/dist/utils/vuelidate.d.ts +36 -0
- package/package.json +50 -20
- package/dist/css/global-styles.css +0 -2133
- package/system/README.md +0 -1
- package/system/css/global-styles.css +0 -735
- package/system/css/normalize.css +0 -349
- package/system/images/acronym.svg +0 -16
- package/system/images/favicon.png +0 -0
- package/system/images/icons/automation.svg +0 -50
- package/system/images/icons/community.svg +0 -38
- package/system/images/icons/scrapers.svg +0 -64
- package/system/images/icons/sources.svg +0 -43
- package/system/images/icons/standard.svg +0 -38
- package/system/images/lockup.svg +0 -68
- package/system/images/logo.svg +0 -8
- package/system/images/webclip.gif +0 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
import { PdapInputBaseProps } from './types';
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PdapInputBaseProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapInputBaseProps>>>, {}, {}>, {
|
3
|
+
default?(_: {}): any;
|
4
|
+
}>;
|
5
|
+
export default _default;
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
7
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
9
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
10
|
+
} : {
|
11
|
+
type: import('vue').PropType<T[K]>;
|
12
|
+
required: true;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
16
|
+
new (): {
|
17
|
+
$slots: S;
|
18
|
+
};
|
19
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { type PdapInputTextProps } from '../types';
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputTextProps>, {}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
3
|
+
input: (val: string) => void;
|
4
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PdapInputTextProps>, {}>>> & {
|
5
|
+
onInput?: ((val: string) => any) | undefined;
|
6
|
+
}, {}, {}>;
|
7
|
+
export default _default;
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
9
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
12
|
+
} : {
|
13
|
+
type: import('vue').PropType<T[K]>;
|
14
|
+
required: true;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
type __VLS_WithDefaults<P, D> = {
|
18
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
19
|
+
default: D[K];
|
20
|
+
}> : P[K];
|
21
|
+
};
|
22
|
+
type __VLS_Prettify<T> = {
|
23
|
+
[K in keyof T]: T[K];
|
24
|
+
} & {};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export declare enum PdapInputTypes {
|
2
|
+
CHECKBOX = "checkbox",
|
3
|
+
TEXT = "text"
|
4
|
+
}
|
5
|
+
export interface PdapInputBaseProps {
|
6
|
+
id: string;
|
7
|
+
label: string;
|
8
|
+
name: string;
|
9
|
+
error: string;
|
10
|
+
}
|
11
|
+
export interface PdapInputTextProps extends PdapInputBaseProps {
|
12
|
+
placeholder?: string;
|
13
|
+
type: PdapInputTypes.TEXT;
|
14
|
+
value: string;
|
15
|
+
}
|
16
|
+
export interface PdapInputCheckboxProps extends PdapInputBaseProps {
|
17
|
+
defaultChecked: boolean;
|
18
|
+
type: PdapInputTypes.CHECKBOX;
|
19
|
+
value: string;
|
20
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { PdapNavProps } from './types';
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PdapNavProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapNavProps>>>, {}, {}>;
|
3
|
+
export default _default;
|
4
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
5
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
6
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
7
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
8
|
+
} : {
|
9
|
+
type: import('vue').PropType<T[K]>;
|
10
|
+
required: true;
|
11
|
+
};
|
12
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { PdapTileIconProps } from './types';
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<PdapTileIconProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PdapTileIconProps>>>, {}, {}>;
|
3
|
+
export default _default;
|
4
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
5
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
6
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
7
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
8
|
+
} : {
|
9
|
+
type: import('vue').PropType<T[K]>;
|
10
|
+
required: true;
|
11
|
+
};
|
12
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export { Button } from './Button';
|
2
|
+
export { FlexContainer } from './FlexContainer';
|
3
|
+
export { Footer } from './Footer';
|
4
|
+
export { Form } from './Form';
|
5
|
+
export { GridContainer } from './GridContainer';
|
6
|
+
export { GridItem } from './GridItem';
|
7
|
+
export { Input } from './Input';
|
8
|
+
export { InputCheckbox } from './Input/Checkbox';
|
9
|
+
export { InputText } from './Input/Text';
|
10
|
+
export { Header } from './Header';
|
11
|
+
export { Nav } from './Nav';
|
12
|
+
export { TileIcon } from './TileIcon';
|
package/dist/index.cjs
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),ie=require("vue-router"),Ce=t.defineComponent({__name:"PdapButton",props:{intent:{default:"primary"},isLoading:{type:Boolean,default:!1}},setup(e){const n=e,r=t.reactive({"pdap-button":!0,[`pdap-button-${n.intent}`]:!!n.intent,"pdap-button-loading":n.isLoading});return(a,o)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(r)},[t.renderSlot(a.$slots,"default")],2))}});const ce=t.defineComponent({__name:"FlexContainer",props:{alignment:{default:"start"},component:{default:"div"}},setup(e){const n=e,r=t.reactive({"pdap-flex-container":!0,[`pdap-flex-container-${n.alignment}`]:!0});return(a,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.component),{class:t.normalizeClass(r)},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},8,["class"]))}});const ke={class:"pdap-footer"},Re={class:"pdap-footer-social-links"},Oe=["href"],Ve=t.createElementVNode("p",{class:"pdap-footer-copyright"},[t.createTextVNode(" © 2023 Police Data Accessibility Project"),t.createElementVNode("br")],-1),Be=t.createElementVNode("p",{class:"pdap-footer-copyright"},[t.createTextVNode(" PDAP is a non-profit. EIN: 85-4207132. "),t.createElementVNode("a",{href:"https://docs.pdap.io/meta/policy/pdap-privacy-policy",alt:"Privacy Policy"}," Privacy Policy"),t.createTextVNode(". "),t.createElementVNode("a",{href:"mailto:contact@pdap.io"},"contact@pdap.io")],-1),je={class:"pdap-footer-widget-links"},Ie=t.createElementVNode("a",{href:"https://www.guidestar.org/profile/85-4207132",target:"_blank"},[t.createElementVNode("img",{src:"https://widgets.guidestar.org/gximage2?o=9973356&l=v4"})],-1),Ae=["href"],Te=["src"],Ne=["src"],Le=t.defineComponent({__name:"PdapFooter",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/acronym.svg"},logoImageAnchorPath:{default:"/"}},setup(e){const n=e,r=t.inject("footerLinks",[{href:"https://github.com/orgs/Police-Data-Accessibility-Project",text:"Github"},{href:"ttps://discord.gg/wMqex8nKZJ",text:"Discord"},{href:"https://www.linkedin.com/company/pdap",text:"LinkedIn"},{path:"/jobs",text:"Jobs"}]),a=n.logoImageAnchorPath.startsWith("/");return(o,s)=>{const l=t.resolveComponent("router-link");return t.openBlock(),t.createElementBlock("footer",ke,[t.createVNode(ce,{alignment:"center"},{default:t.withCtx(()=>[t.createElementVNode("ul",Re,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(r),c=>(t.openBlock(),t.createElementBlock("li",{key:c.text,class:"pdap-footer-link-container"},[c.href?(t.openBlock(),t.createElementBlock("a",{key:0,class:"pdap-footer-social-link",href:c.href,target:"_blank",referrerpolicy:"no-referrer"},t.toDisplayString(c.text),9,Oe)):t.createCommentVNode("",!0),c.path?(t.openBlock(),t.createBlock(l,{key:1,"active-class":"pdap-footer-social-link-current","exact-active-class":"pdap-footer-social-link-current-exact",class:"pdap-footer-social-link",to:c.path},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c.text),1)]),_:2},1032,["to"])):t.createCommentVNode("",!0)]))),128))]),Ve,Be,t.createElementVNode("div",je,[Ie,t.unref(a)?(t.openBlock(),t.createBlock(l,{key:1,to:o.logoImageAnchorPath,class:"pdap-footer-logo"},{default:t.withCtx(()=>[t.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ne)]),_:1},8,["to"])):(t.openBlock(),t.createElementBlock("a",{key:0,href:o.logoImageAnchorPath,class:"pdap-footer-logo"},[t.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Te)],8,Ae))])]),_:1})])}}});function J(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function P(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?J(Object(r),!0).forEach(function(a){Se(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Se(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Q(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(e).reduce((r,a)=>(n.includes(a)||(r[a]=t.unref(e[a])),r),{})}function N(e){return typeof e=="function"}function De(e){return t.isReactive(e)||t.isReadonly(e)}function le(e,n,r){let a=e;const o=n.split(".");for(let s=0;s<o.length;s++){if(!a[o[s]])return r;a=a[o[s]]}return a}function H(e,n,r){return t.computed(()=>e.some(a=>le(n,a,{[r]:!1})[r]))}function Y(e,n,r){return t.computed(()=>e.reduce((a,o)=>{const s=le(n,o,{[r]:!1})[r]||[];return a.concat(s)},[]))}function ue(e,n,r,a){return e.call(a,t.unref(n),t.unref(r),a)}function de(e){return e.$valid!==void 0?!e.$valid:!e}function ze(e,n,r,a,o,s,l){let{$lazy:c,$rewardEarly:d}=o,u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],p=arguments.length>8?arguments[8]:void 0,f=arguments.length>9?arguments[9]:void 0,g=arguments.length>10?arguments[10]:void 0;const h=t.ref(!!a.value),i=t.ref(0);r.value=!1;const m=t.watch([n,a].concat(u,g),()=>{if(c&&!a.value||d&&!f.value&&!r.value)return;let $;try{$=ue(e,n,p,l)}catch(v){$=Promise.reject(v)}i.value++,r.value=!!i.value,h.value=!1,Promise.resolve($).then(v=>{i.value--,r.value=!!i.value,s.value=v,h.value=de(v)}).catch(v=>{i.value--,r.value=!!i.value,s.value=v,h.value=!0})},{immediate:!0,deep:typeof n=="object"});return{$invalid:h,$unwatch:m}}function Me(e,n,r,a,o,s,l,c){let{$lazy:d,$rewardEarly:u}=a;const p=()=>({}),f=t.computed(()=>{if(d&&!r.value||u&&!c.value)return!1;let g=!0;try{const h=ue(e,n,l,s);o.value=h,g=de(h)}catch(h){o.value=h}return g});return{$unwatch:p,$invalid:f}}function Fe(e,n,r,a,o,s,l,c,d,u,p){const f=t.ref(!1),g=e.$params||{},h=t.ref(null);let i,m;e.$async?{$invalid:i,$unwatch:m}=ze(e.$validator,n,f,r,a,h,o,e.$watchTargets,d,u,p):{$invalid:i,$unwatch:m}=Me(e.$validator,n,r,a,h,o,d,u);const $=e.$message;return{$message:N($)?t.computed(()=>$(Q({$pending:f,$invalid:i,$params:Q(g),$model:n,$response:h,$validator:s,$propertyPath:c,$property:l}))):$||"",$params:g,$pending:f,$invalid:i,$response:h,$unwatch:m}}function qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=t.unref(e),r=Object.keys(n),a={},o={},s={};let l=null;return r.forEach(c=>{const d=n[c];switch(!0){case N(d.$validator):a[c]=d;break;case N(d):a[c]={$validator:d};break;case c==="$validationGroups":l=d;break;case c.startsWith("$"):s[c]=d;break;default:o[c]=d}}),{rules:a,nestedValidators:o,config:s,validationGroups:l}}const He="__root";function Ge(e,n,r,a,o,s,l,c,d){const u=Object.keys(e),p=a.get(o,e),f=t.ref(!1),g=t.ref(!1),h=t.ref(0);if(p){if(!p.$partial)return p;p.$unwatch(),f.value=p.$dirty.value}const i={$dirty:f,$path:o,$touch:()=>{f.value||(f.value=!0)},$reset:()=>{f.value&&(f.value=!1)},$commit:()=>{}};return u.length?(u.forEach(m=>{i[m]=Fe(e[m],n,i.$dirty,s,l,m,r,o,d,g,h)}),i.$externalResults=t.computed(()=>c.value?[].concat(c.value).map((m,$)=>({$propertyPath:o,$property:r,$validator:"$externalResults",$uid:`${o}-externalResult-${$}`,$message:m,$params:{},$response:null,$pending:!1})):[]),i.$invalid=t.computed(()=>{const m=u.some($=>t.unref(i[$].$invalid));return g.value=m,!!i.$externalResults.value.length||m}),i.$pending=t.computed(()=>u.some(m=>t.unref(i[m].$pending))),i.$error=t.computed(()=>i.$dirty.value?i.$pending.value||i.$invalid.value:!1),i.$silentErrors=t.computed(()=>u.filter(m=>t.unref(i[m].$invalid)).map(m=>{const $=i[m];return t.reactive({$propertyPath:o,$property:r,$validator:m,$uid:`${o}-${m}`,$message:$.$message,$params:$.$params,$response:$.$response,$pending:$.$pending})}).concat(i.$externalResults.value)),i.$errors=t.computed(()=>i.$dirty.value?i.$silentErrors.value:[]),i.$unwatch=()=>u.forEach(m=>{i[m].$unwatch()}),i.$commit=()=>{g.value=!0,h.value=Date.now()},a.set(o,e,i),i):(p&&a.set(o,e,i),i)}function Ue(e,n,r,a,o,s,l){const c=Object.keys(e);return c.length?c.reduce((d,u)=>(d[u]=G({validations:e[u],state:n,key:u,parentKey:r,resultsCache:a,globalConfig:o,instance:s,externalResults:l}),d),{}):{}}function We(e,n,r){const a=t.computed(()=>[n,r].filter(i=>i).reduce((i,m)=>i.concat(Object.values(t.unref(m))),[])),o=t.computed({get(){return e.$dirty.value||(a.value.length?a.value.every(i=>i.$dirty):!1)},set(i){e.$dirty.value=i}}),s=t.computed(()=>{const i=t.unref(e.$silentErrors)||[],m=a.value.filter($=>(t.unref($).$silentErrors||[]).length).reduce(($,v)=>$.concat(...v.$silentErrors),[]);return i.concat(m)}),l=t.computed(()=>{const i=t.unref(e.$errors)||[],m=a.value.filter($=>(t.unref($).$errors||[]).length).reduce(($,v)=>$.concat(...v.$errors),[]);return i.concat(m)}),c=t.computed(()=>a.value.some(i=>i.$invalid)||t.unref(e.$invalid)||!1),d=t.computed(()=>a.value.some(i=>t.unref(i.$pending))||t.unref(e.$pending)||!1),u=t.computed(()=>a.value.some(i=>i.$dirty)||a.value.some(i=>i.$anyDirty)||o.value),p=t.computed(()=>o.value?d.value||c.value:!1),f=()=>{e.$touch(),a.value.forEach(i=>{i.$touch()})},g=()=>{e.$commit(),a.value.forEach(i=>{i.$commit()})},h=()=>{e.$reset(),a.value.forEach(i=>{i.$reset()})};return a.value.length&&a.value.every(i=>i.$dirty)&&f(),{$dirty:o,$errors:l,$invalid:c,$anyDirty:u,$error:p,$pending:d,$touch:f,$reset:h,$silentErrors:s,$commit:g}}function G(e){let{validations:n,state:r,key:a,parentKey:o,childResults:s,resultsCache:l,globalConfig:c={},instance:d,externalResults:u}=e;const p=o?`${o}.${a}`:a,{rules:f,nestedValidators:g,config:h,validationGroups:i}=qe(n),m=P(P({},c),h),$=a?t.computed(()=>{const y=t.unref(r);return y?t.unref(y[a]):void 0}):r,v=P({},t.unref(u)||{}),V=t.computed(()=>{const y=t.unref(u);return a?y?t.unref(y[a]):void 0:y}),z=Ge(f,$,a,l,p,m,d,V,r),w=Ue(g,$,p,l,m,d,V),k={};i&&Object.entries(i).forEach(y=>{let[R,x]=y;k[R]={$invalid:H(x,w,"$invalid"),$error:H(x,w,"$error"),$pending:H(x,w,"$pending"),$errors:Y(x,w,"$errors"),$silentErrors:Y(x,w,"$silentErrors")}});const{$dirty:b,$errors:A,$invalid:M,$anyDirty:ve,$error:ye,$pending:F,$touch:q,$reset:_e,$silentErrors:we,$commit:Z}=We(z,w,s),be=a?t.computed({get:()=>t.unref($),set:y=>{b.value=!0;const R=t.unref(r),x=t.unref(u);x&&(x[a]=v[a]),t.isRef(R[a])?R[a].value=y:R[a]=y}}):null;a&&m.$autoDirty&&t.watch($,()=>{b.value||q();const y=t.unref(u);y&&(y[a]=v[a])},{flush:"sync"});async function xe(){return q(),m.$rewardEarly&&(Z(),await t.nextTick()),await t.nextTick(),new Promise(y=>{if(!F.value)return y(!M.value);const R=t.watch(F,()=>{y(!M.value),R()})})}function Pe(y){return(s.value||{})[y]}function Ee(){t.isRef(u)?u.value=v:Object.keys(v).length===0?Object.keys(u).forEach(y=>{delete u[y]}):Object.assign(u,v)}return t.reactive(P(P(P({},z),{},{$model:be,$dirty:b,$error:ye,$errors:A,$invalid:M,$anyDirty:ve,$pending:F,$touch:q,$reset:_e,$path:p||He,$silentErrors:we,$validate:xe,$commit:Z},s&&{$getResultsForChild:Pe,$clearExternalResults:Ee,$validationGroups:k}),w))}class Ke{constructor(){this.storage=new Map}set(n,r,a){this.storage.set(n,{rules:r,result:a})}checkRulesValidity(n,r,a){const o=Object.keys(a),s=Object.keys(r);return s.length!==o.length||!s.every(c=>o.includes(c))?!1:s.every(c=>r[c].$params?Object.keys(r[c].$params).every(d=>t.unref(a[c].$params[d])===t.unref(r[c].$params[d])):!0)}get(n,r){const a=this.storage.get(n);if(!a)return;const{rules:o,result:s}=a,l=this.checkRulesValidity(n,r,o),c=s.$unwatch?s.$unwatch:()=>({});return l?s:{$dirty:s.$dirty,$partial:!0,$unwatch:c}}}const T={COLLECT_ALL:!0,COLLECT_NONE:!1},ee=Symbol("vuelidate#injectChildResults"),te=Symbol("vuelidate#removeChildResults");function Xe(e){let{$scope:n,instance:r}=e;const a={},o=t.ref([]),s=t.computed(()=>o.value.reduce((p,f)=>(p[f]=t.unref(a[f]),p),{}));function l(p,f){let{$registerAs:g,$scope:h,$stopPropagation:i}=f;i||n===T.COLLECT_NONE||h===T.COLLECT_NONE||n!==T.COLLECT_ALL&&n!==h||(a[g]=p,o.value.push(g))}r.__vuelidateInjectInstances=[].concat(r.__vuelidateInjectInstances||[],l);function c(p){o.value=o.value.filter(f=>f!==p),delete a[p]}r.__vuelidateRemoveInstances=[].concat(r.__vuelidateRemoveInstances||[],c);const d=t.inject(ee,[]);t.provide(ee,r.__vuelidateInjectInstances);const u=t.inject(te,[]);return t.provide(te,r.__vuelidateRemoveInstances),{childResults:s,sendValidationResultsToParent:d,removeValidationResultsFromParent:u}}function pe(e){return new Proxy(e,{get(n,r){return typeof n[r]=="object"?pe(n[r]):t.computed(()=>n[r])}})}let ne=0;function Ze(e,n){var r;let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(a=e,e=void 0,n=void 0);let{$registerAs:o,$scope:s=T.COLLECT_ALL,$stopPropagation:l,$externalResults:c,currentVueInstance:d}=a;const u=d||((r=t.getCurrentInstance())===null||r===void 0?void 0:r.proxy),p=u?u.$options:{};o||(ne+=1,o=`_vuelidate_${ne}`);const f=t.ref({}),g=new Ke,{childResults:h,sendValidationResultsToParent:i,removeValidationResultsFromParent:m}=u?Xe({$scope:s,instance:u}):{childResults:t.ref({})};if(!e&&p.validations){const $=p.validations;n=t.ref({}),t.onBeforeMount(()=>{n.value=u,t.watch(()=>N($)?$.call(n.value,new pe(n.value)):$,v=>{f.value=G({validations:v,state:n,childResults:h,resultsCache:g,globalConfig:a,instance:u,externalResults:c||u.vuelidateExternalResults})},{immediate:!0})}),a=p.validationsConfig||a}else{const $=t.isRef(e)||De(e)?e:t.reactive(e||{});t.watch($,v=>{f.value=G({validations:v,state:n,childResults:h,resultsCache:g,globalConfig:a,instance:u??{},externalResults:c})},{immediate:!0})}return u&&(i.forEach($=>$(f,{$registerAs:o,$scope:s,$stopPropagation:l})),t.onBeforeUnmount(()=>m.forEach($=>$(o)))),t.computed(()=>P(P({},t.unref(f.value)),h.value))}const Je=["for"],Qe=["id"],me=t.defineComponent({__name:"PdapInput",props:{id:{},label:{},name:{},error:{}},setup(e){const n=e,r=t.computed(()=>`pdap-${n.name}-input-error`);return t.watchEffect(()=>{console.debug(`Hello from PDAP Input ${n.name} rendered at ${window.location.pathname}`,{props:n})}),(a,o)=>{var s;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass({"pdap-input":!0,"pdap-input-error":((s=a.error)==null?void 0:s.length)>=1})},[t.renderSlot(a.$slots,"default"),t.createElementVNode("label",{class:"pdap-input-label",for:a.id},t.toDisplayString(a.label),9,Je),a.error?(t.openBlock(),t.createElementBlock("div",{key:0,id:r.value,class:"pdap-input-error-message"},t.toDisplayString(a.error),9,Qe)):t.createCommentVNode("",!0)],2)}}});const Ye=["id","name","value","placeholder"],fe=t.defineComponent({__name:"InputText",props:{placeholder:{},type:{},value:{},id:{},label:{},name:{},error:{}},emits:["input"],setup(e,{emit:n}){const r=e,a=n,o=s=>{a("input",s.target.value)};return t.watchEffect(()=>{console.debug(`Hello from PDAP InputText ${r.name} rendered at ${window.location.pathname}`,{props:r})}),(s,l)=>(t.openBlock(),t.createElementBlock("input",{id:s.id,type:"text",name:s.name,value:s.value,placeholder:s.placeholder,onInput:o},null,40,Ye))}}),et=["id","name","checked","value"],$e=t.defineComponent({__name:"InputCheckbox",props:{defaultChecked:{type:Boolean},type:{},value:{},id:{},label:{},name:{},error:{}},emits:["change"],setup(e,{emit:n}){const r=e,a=n,o=s=>{a("change",s.target.checked.toString())};return t.watchEffect(()=>{console.debug(`Hello from PDAP InputCheckbox ${r.name} rendered at ${window.location.pathname}`,{props:r})}),(s,l)=>(t.openBlock(),t.createElementBlock("input",{id:s.id,class:"pdap-input-checkbox",name:s.name,checked:s.defaultChecked,value:s.value,type:"checkbox",onChange:o},null,40,et))}});var L=(e=>(e.CHECKBOX="checkbox",e.TEXT="text",e))(L||{});const tt={[L.CHECKBOX]:"InputCheckbox",[L.TEXT]:"InputText"},nt={name:"InputsGenerator",components:{InputText:fe,InputCheckbox:$e,PdapInput:me},props:{schema:{type:Object},values:{type:Object},v$:{type:Object}},emits:["blur","input"],setup(e,{emit:n}){n("input"),n("blur")},data(){return{formData:this.values||{},INPUT_COMPONENT_MAP:tt,v:this.$props.v$}},methods:{updateForm(e,n){this.formData[e]=n,this.$emit("input",this.formData)},updateValidations(e){var n,r;(r=(n=this.v$)==null?void 0:n.value)==null||r[e].$touch}}},rt=(e,n)=>{const r=e.__vccOpts||e;for(const[a,o]of n)r[a]=o;return r};function at(e,n,r,a,o,s){const l=t.resolveComponent("PdapInput");return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.schema,c=>{var d,u,p,f;return t.openBlock(),t.createBlock(l,{id:c.id,key:c.name,error:(f=(p=(u=(d=o.v)==null?void 0:d[c.name])==null?void 0:u.$errors)==null?void 0:p[0])==null?void 0:f.$message,name:c.name,label:c.label},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.INPUT_COMPONENT_MAP[c.type]),t.mergeProps(c,{value:o.formData[c.name],onBlur:g=>s.updateValidations(c.name),onInput:g=>s.updateForm(c.name,g)}),null,16,["value","onBlur","onInput"]))]),_:2},1032,["id","error","name","label"])}),128)}const ot=rt(nt,[["render",at]]);function re(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function B(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?re(Object(r),!0).forEach(function(a){st(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function st(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function j(e){return typeof e=="function"}function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function D(e){return j(e.$validator)?B({},e):{$validator:e}}function it(e){return S(e)&&j(e.then)}function E(e){return typeof e=="object"?e.$valid:e}function O(e){return e.$validator||e}function U(e,n){if(!S(e))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof e}`);if(!S(n)&&!j(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const r=D(n);return r.$params=B(B({},r.$params||{}),e),r}function I(e,n){if(!j(e)&&typeof t.unref(e)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof e}`);if(!S(n)&&!j(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const r=D(n);return r.$message=e,r}function ct(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=D(e);return B(B({},r),{},{$async:!0,$watchTargets:n})}function lt(e){return{$validator(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return t.unref(n).reduce((s,l,c)=>{const d=Object.entries(l).reduce((u,p)=>{let[f,g]=p;const h=e[f]||{},i=Object.entries(h).reduce((m,$)=>{let[v,V]=$;const w=O(V).call(this,g,l,c,...a),k=E(w);if(m.$data[v]=w,m.$data.$invalid=!k||!!m.$data.$invalid,m.$data.$error=m.$data.$invalid,!k){let b=V.$message||"";const A=V.$params||{};typeof b=="function"&&(b=b({$pending:!1,$invalid:!k,$params:A,$model:g,$response:w})),m.$errors.push({$property:f,$message:b,$params:A,$response:w,$model:g,$pending:!1,$validator:v})}return{$valid:m.$valid&&k,$data:m.$data,$errors:m.$errors}},{$valid:!0,$data:{},$errors:[]});return u.$data[f]=i.$data,u.$errors[f]=i.$errors,{$valid:u.$valid&&i.$valid,$data:u.$data,$errors:u.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:s.$valid&&d.$valid,$data:s.$data.concat(d.$data),$errors:s.$errors.concat(d.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:r}=n;return r?r.$errors.map(a=>Object.values(a).map(o=>o.map(s=>s.$message)).reduce((o,s)=>o.concat(s),[])):[]}}}const _=e=>{if(e=t.unref(e),Array.isArray(e))return!!e.length;if(e==null)return!1;if(e===!1)return!0;if(e instanceof Date)return!isNaN(e.getTime());if(typeof e=="object"){for(let n in e)return!0;return!1}return!!String(e).length},W=e=>(e=t.unref(e),Array.isArray(e)?e.length:typeof e=="object"?Object.keys(e).length:String(e).length);function C(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a=>(a=t.unref(a),!_(a)||n.every(o=>(o.lastIndex=0,o.test(a))))}var K=Object.freeze({__proto__:null,forEach:lt,len:W,normalizeValidatorObject:D,regex:C,req:_,unwrap:t.unref,unwrapNormalizedValidator:O,unwrapValidatorResponse:E,withAsync:ct,withMessage:I,withParams:U}),ut=C(/^[a-zA-Z]*$/),dt={$validator:ut,$message:"The value is not alphabetical",$params:{type:"alpha"}},pt=C(/^[a-zA-Z0-9]*$/),mt={$validator:pt,$message:"The value must be alpha-numeric",$params:{type:"alphaNum"}},ft=C(/^\d*(\.\d+)?$/),$t={$validator:ft,$message:"Value must be numeric",$params:{type:"numeric"}};function gt(e,n){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+t.unref(e)<=+r&&+t.unref(n)>=+r}function ht(e,n){return{$validator:gt(e,n),$message:r=>{let{$params:a}=r;return`The value must be between ${a.min} and ${a.max}`},$params:{min:e,max:n,type:"between"}}}const vt=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;var yt=C(vt),_t={$validator:yt,$message:"Value is not a valid email address",$params:{type:"email"}};function wt(e){if(!_(e))return!0;if(typeof e!="string")return!1;const n=e.split(".");return n.length===4&&n.every(bt)}const bt=e=>{if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return!1;const n=+e|0;return n>=0&&n<=255};var xt={$validator:wt,$message:"The value is not a valid IP address",$params:{type:"ipAddress"}};function Pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return n=>{if(e=t.unref(e),!_(n))return!0;if(typeof n!="string")return!1;const r=typeof e=="string"&&e!==""?n.split(e):n.length===12||n.length===16?n.match(/.{2}/g):null;return r!==null&&(r.length===6||r.length===8)&&r.every(Et)}}const Et=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/);function Ct(e){return{$validator:Pt(e),$message:"The value is not a valid MAC Address",$params:{type:"macAddress"}}}function kt(e){return n=>!_(n)||W(n)<=t.unref(e)}function Rt(e){return{$validator:kt(e),$message:n=>{let{$params:r}=n;return`The maximum length allowed is ${r.max}`},$params:{max:e,type:"maxLength"}}}function Ot(e){return n=>!_(n)||W(n)>=t.unref(e)}function Vt(e){return{$validator:Ot(e),$message:n=>{let{$params:r}=n;return`This field should be at least ${r.min} characters long`},$params:{min:e,type:"minLength"}}}function Bt(e){return typeof e=="string"&&(e=e.trim()),_(e)}var X={$validator:Bt,$message:"Value is required",$params:{type:"required"}};const ae=(e,n)=>e?_(typeof n=="string"?n.trim():n):!0;function jt(e){return function(n,r){if(typeof e!="function")return ae(t.unref(e),n);const a=e.call(this,n,r);return ae(a,n)}}function It(e){return{$validator:jt(e),$message:"The value is required",$params:{type:"requiredIf",prop:e}}}const oe=(e,n)=>e?!0:_(typeof n=="string"?n.trim():n);function At(e){return function(n,r){if(typeof e!="function")return oe(t.unref(e),n);const a=e.call(this,n,r);return oe(a,n)}}function Tt(e){return{$validator:At(e),$message:"The value is required",$params:{type:"requiredUnless",prop:e}}}function Nt(e){return n=>t.unref(n)===t.unref(e)}function Lt(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"other";return{$validator:Nt(e),$message:r=>`The value must be equal to the ${n} value`,$params:{equalTo:e,otherName:n,type:"sameAs"}}}const St=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;var Dt=C(St),zt={$validator:Dt,$message:"The value is not a valid URL address",$params:{type:"url"}};function Mt(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce((o,s)=>E(o)?o:O(s).apply(this,r),!1)}}function Ft(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce(async(o,s)=>{const l=await o;return E(l)?l:O(s).apply(this,r)},Promise.resolve(!1))}}function qt(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const a=n.some(l=>l.$async),o=n.reduce((l,c)=>c.$watchTargets?l.concat(c.$watchTargets):l,[]);let s=()=>!1;return n.length&&(s=a?Ft(n):Mt(n)),{$async:a,$validator:s,$watchTargets:o}}function Ht(){return U({type:"or"},I("The value does not match any of the provided validators",qt(...arguments)))}function Gt(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce((o,s)=>E(o)?O(s).apply(this,r):o,!0)}}function Ut(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce(async(o,s)=>{const l=await o;return E(l)?O(s).apply(this,r):l},Promise.resolve(!0))}}function Wt(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const a=n.some(l=>l.$async),o=n.reduce((l,c)=>c.$watchTargets?l.concat(c.$watchTargets):l,[]);let s=()=>!1;return n.length&&(s=a?Ut(n):Gt(n)),{$async:a,$validator:s,$watchTargets:o}}function Kt(){return U({type:"and"},I("The value does not match all of the provided validators",Wt(...arguments)))}function Xt(e){return function(n,r){if(!_(n))return!0;const a=O(e).call(this,n,r);return it(a)?a.then(o=>!E(o)):!E(a)}}function Zt(e){return{$validator:Xt(e),$message:"The value does not match the provided validator",$params:{type:"not"}}}function Jt(e){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+n>=+t.unref(e)}function Qt(e){return{$validator:Jt(e),$message:n=>{let{$params:r}=n;return`The minimum value allowed is ${r.min}`},$params:{min:e,type:"minValue"}}}function Yt(e){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+n<=+t.unref(e)}var en=e=>({$validator:Yt(e),$message:n=>{let{$params:r}=n;return`The maximum value allowed is ${r.max}`},$params:{max:e,type:"maxValue"}}),tn=C(/(^[0-9]*$)|(^-[0-9]+$)/),nn={$validator:tn,$message:"Value is not an integer",$params:{type:"integer"}},rn=C(/^[-]?\d*(\.\d+)?$/),an={$validator:rn,$message:"Value must be decimal",$params:{type:"decimal"}};function on(e){let{t:n,messagePath:r=o=>{let{$validator:s}=o;return`validations.${s}`},messageParams:a=o=>o}=e;return function(s){let{withArguments:l=!1,messagePath:c=r,messageParams:d=a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function u(p){return n(c(p),d(B({model:p.$model,property:p.$property,pending:p.$pending,invalid:p.$invalid,response:p.$response,validator:p.$validator,propertyPath:p.$propertyPath},p.$params)))}return l&&typeof s=="function"?function(){return I(u,s(...arguments))}:I(u,s)}}const ge=Object.freeze(Object.defineProperty({__proto__:null,alpha:dt,alphaNum:mt,and:Kt,between:ht,createI18nMessage:on,decimal:an,email:_t,helpers:K,integer:nn,ipAddress:xt,macAddress:Ct,maxLength:Rt,maxValue:en,minLength:Vt,minValue:Qt,not:Zt,numeric:$t,or:Ht,required:X,requiredIf:It,requiredUnless:Tt,sameAs:Lt,url:zt},Symbol.toStringTag,{value:"Module"}));function se(e){return["maxLength","minLength"].includes(e)}function sn(e,n){return{[e]:ge[e](n)}}function cn(e,n,r){return{[e]:K.withMessage(r,ge[e](n))}}function ln(){return{required:X}}function un(e){return{required:K.withMessage(e,X)}}function dn(e,n){if(se(e)&&typeof n.message=="string"&&typeof n.value=="number")return cn(e,n.value,n.message);if(se(e)&&typeof n.message>"u"&&typeof n.value=="number")return sn(e,n.value);if(e==="required"&&typeof n.message=="string")return un(n.message);if(e==="required"&&typeof n.message>"u")return ln();throw new Error("No valid rule detected")}const pn={key:0,class:"pdap-form-error-message"},mn=t.defineComponent({__name:"PdapForm",props:{error:{default:null},id:{},name:{},schema:{}},emits:["submit"],setup(e,{emit:n}){const r=e,a=n,o=t.ref(r.schema.reduce((d,u)=>{switch(u.type){case"checkbox":return{...d,[u.name]:u.defaultChecked};case"text":return{...d,[u.name]:u.value};default:return d}},{})),s=r.schema.reduce((d,u)=>{const p=Object.entries(u.validators??{}).reduce((f,[g,h])=>({...f,...dn(g,h)}),{});return{...d,[u.name]:{...p}}},{}),l=Ze(s,o,{$autoDirty:!1,$lazy:!1});t.watchEffect(()=>console.debug(`Hello from PDAP Form ${r.name} rendered at ${window.location.pathname}`,{props:r,values:o,rules:s,vuelidate:l.value}));async function c(d){const u=await l.value.$validate();if(u){const p=d.target,f=new FormData(p),g={};for(const[h,i]of f)Object.assign(g,{[h]:i});console.debug("Hello from Form's onSubmit handler",{values:g,isCorrectSubmission:u,vuelidate:l.value}),a("submit",g),l.value.$reset(),p.reset();return}else{console.error("is invalid form data",{v$:l.value});return}}return(d,u)=>(t.openBlock(),t.createElementBlock("form",{class:"pdap-form",onSubmit:u[0]||(u[0]=t.withModifiers(p=>c(p),["prevent"]))},[typeof d.error=="string"&&d.error.length>0?(t.openBlock(),t.createElementBlock("div",pn,t.toDisplayString(d.error),1)):t.createCommentVNode("",!0),t.createVNode(ot,t.normalizeProps(t.guardReactiveProps({schema:d.schema,values:o.value,...typeof t.unref(l)<"u"?{v$:t.unref(l)}:{}})),null,16),t.renderSlot(d.$slots,"default")],32))}});const fn=t.defineComponent({__name:"GridContainer",props:{columns:{default:"auto"},component:{default:"div"},rows:{default:"auto"},templateColumns:{},templateRows:{}},setup(e){const n=e,r=t.reactive({"pdap-grid-container":!0,[`pdap-grid-container-column-${n.columns}`]:n.columns!=="auto"}),a=n.templateRows||typeof n.rows=="number",o=n.templateRows??`repeat(${n.rows}, minmax(0, 1fr))`,s=t.reactive({...a&&{gridTemplateRows:o},...n.templateColumns&&{gridTemplateColumns:n.templateColumns}});return(l,c)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.component),{class:t.normalizeClass(r),style:t.normalizeStyle(s)},{default:t.withCtx(()=>[t.renderSlot(l.$slots,"default")]),_:3},8,["class","style"]))}});const $n=t.defineComponent({__name:"GridItem",props:{component:{default:"div"},spanColumn:{default:1},spanRow:{default:1}},setup(e){const n=e,r=t.reactive({"pdap-grid-item":!0,[`pdap-grid-item-span-column-${n.spanColumn}`]:n.spanColumn>1}),a=t.reactive({...n.spanRow>1&&{gridRow:`span ${n.spanRow} / span ${n.spanRow}`}});return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.component),{class:t.normalizeClass(r),style:t.normalizeStyle(a)},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});const gn=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},[t.createElementVNode("path",{d:"M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"})],-1),hn=[gn],vn=["aria-expanded"],yn=["href"],he=t.defineComponent({__name:"PdapNav",props:{topPosition:{}},setup(e){let n=t.inject("navLinks");typeof n>"u"&&(n=[],console.error(`Hey, PDAP developer
|
2
|
+
`,"Did you forget to inject some linkData for the Nav component?"));const r=t.reactive({isExpanded:!1,isMobile:!0}),a=t.reactive({"pdap-nav":!0});t.onBeforeMount(()=>{o(),window.addEventListener("resize",o)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",o)});async function o(){window.innerWidth<=1024?r.isMobile=!0:r.isMobile=!1,await t.nextTick()}async function s(){var c,d;const l=document.querySelector("body");!r.isExpanded&&r.isMobile?(r.isExpanded=!0,l!=null&&l.classList.contains("lock-scroll")||(c=document.querySelector("body"))==null||c.classList.add("lock-scroll")):r.isExpanded&&r.isMobile&&(r.isExpanded=!1,(d=document.querySelector("body"))==null||d.classList.remove("lock-scroll")),await t.nextTick()}return(l,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{"aria-controls":"nav",class:"pdap-nav-open-button",role:"button",onClick:s},hn),t.createElementVNode("nav",{id:"nav","aria-expanded":r.isMobile&&r.isExpanded||!r.isMobile,class:t.normalizeClass(a),style:t.normalizeStyle(r.isMobile?{top:`${l.topPosition}px`}:{})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(n),d=>(t.openBlock(),t.createElementBlock("li",{key:d.text,class:"pdap-nav-link-container"},[d.href?(t.openBlock(),t.createElementBlock("a",{key:0,class:"pdap-nav-link",href:d.href,target:"_blank",referrerpolicy:"no-referrer",onClick:s},t.toDisplayString(d.text),9,yn)):t.createCommentVNode("",!0),d.path?(t.openBlock(),t.createBlock(t.unref(ie.RouterLink),{key:1,"active-class":"pdap-nav-link-current","exact-active-class":"pdap-nav-link-current-exact",class:"pdap-nav-link",to:d.path,onClick:s},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.text),1)]),_:2},1032,["to"])):t.createCommentVNode("",!0)]))),128))],14,vn)],64))}});const _n=["href"],wn=["src"],bn=["src"],xn=t.defineComponent({__name:"PdapHeader",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/lockup.svg"},logoImageAnchorPath:{default:"/"}},setup(e){const n=e,r=t.ref(),a=t.ref(null),o=n.logoImageAnchorPath.startsWith("/");t.onMounted(()=>{s(),window.addEventListener("resize",s)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",s)});function s(){a.value&&(r.value=a.value.offsetHeight)}return(l,c)=>(t.openBlock(),t.createElementBlock("header",{ref_key:"el",ref:a,class:"pdap-header"},[t.unref(o)?(t.openBlock(),t.createBlock(t.unref(ie.RouterLink),{key:1,to:l.logoImageAnchorPath,class:"logo"},{default:t.withCtx(()=>[t.createElementVNode("img",{src:l.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,bn)]),_:1},8,["to"])):(t.openBlock(),t.createElementBlock("a",{key:0,href:l.logoImageAnchorPath,class:"logo"},[t.createElementVNode("img",{src:l.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,wn)],8,_n)),t.createVNode(he,{"top-position":r.value},null,8,["top-position"])],512))}});const Pn=["alt","src"],En=t.defineComponent({__name:"TileIcon",props:{imgAltText:{},imgSrc:{}},setup(e){return(n,r)=>(t.openBlock(),t.createElementBlock("img",{class:"pdap-tile-icon",alt:n.imgAltText,src:n.imgSrc},null,8,Pn))}});exports.Button=Ce;exports.FlexContainer=ce;exports.Footer=Le;exports.Form=mn;exports.GridContainer=fn;exports.GridItem=$n;exports.Header=xn;exports.Input=me;exports.InputCheckbox=$e;exports.InputText=fe;exports.Nav=he;exports.PdapInputTypes=L;exports.TileIcon=En;
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
export * from './components';
|
2
|
+
import './styles/styles.css';
|
3
|
+
export * from './components/Button/types';
|
4
|
+
export * from './components/FlexContainer/types';
|
5
|
+
export * from './components/Footer/types';
|
6
|
+
export * from './components/Form/types';
|
7
|
+
export * from './components/GridContainer/types';
|
8
|
+
export * from './components/GridItem/types';
|
9
|
+
export * from './components/Header/types';
|
10
|
+
export * from './components/Input/types';
|
11
|
+
export * from './components/Nav/types';
|
12
|
+
export * from './components/TileIcon/types';
|