@phila/phila-ui-input-form 0.0.3 → 0.0.6

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/InputForm.js CHANGED
@@ -1,24 +1,22 @@
1
1
  import "./InputForm.css";
2
- import { defineComponent as f, computed as h, openBlock as s, createElementBlock as a, mergeProps as v, toDisplayString as d, createCommentVNode as i, renderSlot as c, createElementVNode as u, pushScopeId as y, popScopeId as _ } from "vue";
3
- import g from "@phila/phila-ui-core";
4
- const k = (t) => (y("data-v-906e820c"), t = t(), _(), t), b = ["id"], I = {
2
+ import { defineComponent as f, computed as v, createElementBlock as o, openBlock as s, mergeProps as y, createCommentVNode as i, renderSlot as m, toDisplayString as l, createElementVNode as p } from "vue";
3
+ import h from "@phila/phila-ui-core";
4
+ const g = ["id"], k = {
5
5
  key: 0,
6
6
  class: "form-title form-padding"
7
- }, C = {
7
+ }, _ = {
8
8
  key: 1,
9
9
  class: "form-subtitle form-padding"
10
- }, B = {
10
+ }, b = {
11
11
  key: 2,
12
12
  class: "form-errors has-text-centered has-text-weight-bold has-text-love-park-red-dark"
13
- }, E = /* @__PURE__ */ k(() => /* @__PURE__ */ u("span", { class: "icon" }, [
14
- /* @__PURE__ */ u("i", { class: "fa fa-exclamation-triangle" })
15
- ], -1)), S = {
13
+ }, C = {
16
14
  key: 3,
17
15
  class: "form-submit form-padding"
18
- }, { formHelpers: $ } = g, { randomID: V } = $, O = /* @__PURE__ */ f({
16
+ }, { formHelpers: B } = h, { randomID: E } = B, I = /* @__PURE__ */ f({
19
17
  __name: "InputForm",
20
18
  props: {
21
- id: { default: V() },
19
+ id: { default: E() },
22
20
  errors: { default() {
23
21
  return [];
24
22
  } },
@@ -33,32 +31,34 @@ const k = (t) => (y("data-v-906e820c"), t = t(), _(), t), b = ["id"], I = {
33
31
  desc: { default: "" },
34
32
  hideErrorsCount: { type: Boolean, default: !1 }
35
33
  },
36
- setup(t) {
37
- const o = t, r = h(() => Array.isArray(o.errors) ? o.errors.length : typeof o.errors == "string" || typeof o.errors == "number" ? 1 : l(o.errors)), l = (e) => Object.keys(e).map((n) => e[n]).reduce(
38
- (n, m) => m.length > 0 ? n + 1 : n,
34
+ setup(n) {
35
+ const r = n, t = v(() => Array.isArray(r.errors) ? r.errors.length : typeof r.errors == "string" || typeof r.errors == "number" ? 1 : d(r.errors)), d = (e) => Object.keys(e).map((a) => e[a]).reduce(
36
+ (a, c) => c.length > 0 ? a + 1 : a,
39
37
  0
40
38
  );
41
- return (e, p) => (s(), a("form", v({
39
+ return (e, u) => (s(), o("form", y({
42
40
  id: `form-${e.id}`
43
41
  }, e.$attrs, { novalidate: "" }), [
44
- e.title ? (s(), a("div", I, d(e.title), 1)) : i("", !0),
45
- e.desc ? (s(), a("p", C, d(e.desc), 1)) : i("", !0),
46
- c(e.$slots, "default", {}, void 0, !0),
47
- !e.hideErrorsCount && r.value > 0 ? (s(), a("div", B, [
48
- E,
49
- u("span", null, " This form has " + d(r.value) + " error" + d(r.value > 1 ? "s" : ""), 1)
42
+ e.title ? (s(), o("div", k, l(e.title), 1)) : i("", !0),
43
+ e.desc ? (s(), o("p", _, l(e.desc), 1)) : i("", !0),
44
+ m(e.$slots, "default", {}, void 0, !0),
45
+ !e.hideErrorsCount && t.value > 0 ? (s(), o("div", b, [
46
+ u[0] || (u[0] = p("span", { class: "icon" }, [
47
+ p("i", { class: "fa fa-exclamation-triangle" })
48
+ ], -1)),
49
+ p("span", null, " This form has " + l(t.value) + " error" + l(t.value > 1 ? "s" : ""), 1)
50
50
  ])) : i("", !0),
51
- e.$slots.submit ? (s(), a("div", S, [
52
- c(e.$slots, "submit", {}, void 0, !0)
51
+ e.$slots.submit ? (s(), o("div", C, [
52
+ m(e.$slots, "submit", {}, void 0, !0)
53
53
  ])) : i("", !0)
54
- ], 16, b));
54
+ ], 16, g));
55
55
  }
56
- }), P = (t, o) => {
57
- const r = t.__vccOpts || t;
58
- for (const [l, e] of o)
59
- r[l] = e;
60
- return r;
61
- }, K = /* @__PURE__ */ P(O, [["__scopeId", "data-v-906e820c"]]);
56
+ }), $ = (n, r) => {
57
+ const t = n.__vccOpts || n;
58
+ for (const [d, e] of r)
59
+ t[d] = e;
60
+ return t;
61
+ }, D = /* @__PURE__ */ $(I, [["__scopeId", "data-v-906e820c"]]);
62
62
  export {
63
- K as default
63
+ D as default
64
64
  };
@@ -1,2 +1,2 @@
1
- (function(t,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue"),require("@phila/phila-ui-core")):typeof define=="function"&&define.amd?define(["vue","@phila/phila-ui-core"],a):(t=typeof globalThis<"u"?globalThis:t||self,t.InputForm=a(t.Vue,t.PhilaUICore))})(this,function(t,a){"use strict";var f=document.createElement("style");f.textContent=`@font-face{font-family:Montserrat;src:local("Montserrat Regular"),local("Montserrat-Regular"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Italic"),local("OpenSans-Italic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Italic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Italic.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Open Sans;src:local("Open Sans Bold Italic"),local("OpenSans-BoldItalic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-BoldItalic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-BoldItalic.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Montserrat;src:local("Montserrat Bold"),local("Montserrat-Bold"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Bold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Bold.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Bold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Bold.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans SemiBold Italic"),local("OpenSans-SemiBoldItalic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.woff) format("woff");font-weight:600;font-style:italic}@font-face{font-family:Open Sans;src:local("Open Sans SemiBold"),local("OpenSans-SemiBold"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBold.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Regular"),local("OpenSans-Regular"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Regular.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Regular.woff) format("woff");font-weight:400;font-style:normal}.form-title[data-v-906e820c]{font-family:Montserrat,BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Helvetica,Arial,sans-serif;color:#444;font-weight:600;margin:0 0 .5rem;line-height:2.1875rem;font-size:1.75rem!important}.form-errors[data-v-906e820c]{font-size:.875rem;padding:1rem 1.5rem;background-color:#fee7e7;margin:1rem 0}.form-errors span.icon[data-v-906e820c]{font-size:1rem}
2
- `,document.head.appendChild(f);const i=o=>(t.pushScopeId("data-v-906e820c"),o=o(),t.popScopeId(),o),p=["id"],c={key:0,class:"form-title form-padding"},m={key:1,class:"form-subtitle form-padding"},d={key:2,class:"form-errors has-text-centered has-text-weight-bold has-text-love-park-red-dark"},w=i(()=>t.createElementVNode("span",{class:"icon"},[t.createElementVNode("i",{class:"fa fa-exclamation-triangle"})],-1)),h={key:3,class:"form-submit form-padding"},{formHelpers:u}=a,{randomID:S}=u,g=t.defineComponent({__name:"InputForm",props:{id:{default:S()},errors:{default(){return[]}},optgroup:{type:Boolean},disableableOptions:{type:Boolean},options:{},name:{},textKey:{},valueKey:{},imaskProps:{},title:{default:""},desc:{default:""},hideErrorsCount:{type:Boolean,default:!1}},setup(o){const n=o,s=t.computed(()=>Array.isArray(n.errors)?n.errors.length:typeof n.errors=="string"||typeof n.errors=="number"?1:l(n.errors)),l=e=>Object.keys(e).map(r=>e[r]).reduce((r,y)=>y.length>0?r+1:r,0);return(e,O)=>(t.openBlock(),t.createElementBlock("form",t.mergeProps({id:`form-${e.id}`},e.$attrs,{novalidate:""}),[e.title?(t.openBlock(),t.createElementBlock("div",c,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.desc?(t.openBlock(),t.createElementBlock("p",m,t.toDisplayString(e.desc),1)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",{},void 0,!0),!e.hideErrorsCount&&s.value>0?(t.openBlock(),t.createElementBlock("div",d,[w,t.createElementVNode("span",null," This form has "+t.toDisplayString(s.value)+" error"+t.toDisplayString(s.value>1?"s":""),1)])):t.createCommentVNode("",!0),e.$slots.submit?(t.openBlock(),t.createElementBlock("div",h,[t.renderSlot(e.$slots,"submit",{},void 0,!0)])):t.createCommentVNode("",!0)],16,p))}});return((o,n)=>{const s=o.__vccOpts||o;for(const[l,e]of n)s[l]=e;return s})(g,[["__scopeId","data-v-906e820c"]])});
1
+ (function(t,s){typeof exports=="object"&&typeof module<"u"?module.exports=s(require("vue"),require("@phila/phila-ui-core")):typeof define=="function"&&define.amd?define(["vue","@phila/phila-ui-core"],s):(t=typeof globalThis<"u"?globalThis:t||self,t.InputForm=s(t.Vue,t.PhilaUICore))})(this,function(t,s){"use strict";var i=document.createElement("style");i.textContent=`@font-face{font-family:Montserrat;src:local("Montserrat Regular"),local("Montserrat-Regular"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Italic"),local("OpenSans-Italic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Italic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Italic.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Open Sans;src:local("Open Sans Bold Italic"),local("OpenSans-BoldItalic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-BoldItalic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-BoldItalic.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Montserrat;src:local("Montserrat Bold"),local("Montserrat-Bold"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Bold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Bold.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Bold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Bold.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans SemiBold Italic"),local("OpenSans-SemiBoldItalic"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.woff) format("woff");font-weight:600;font-style:italic}@font-face{font-family:Open Sans;src:local("Open Sans SemiBold"),local("OpenSans-SemiBold"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBold.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-SemiBold.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:Open Sans;src:local("Open Sans Regular"),local("OpenSans-Regular"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Regular.woff2) format("woff2"),url(https://www.phila.gov/assets/fonts/OpenSans/OpenSans-Regular.woff) format("woff");font-weight:400;font-style:normal}.form-title[data-v-906e820c]{font-family:Montserrat,BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Helvetica,Arial,sans-serif;color:#444;font-weight:600;margin:0 0 .5rem;line-height:2.1875rem;font-size:1.75rem!important}.form-errors[data-v-906e820c]{font-size:.875rem;padding:1rem 1.5rem;background-color:#fee7e7;margin:1rem 0}.form-errors span.icon[data-v-906e820c]{font-size:1rem}
2
+ /*$vite$:1*/`,document.head.appendChild(i);const p=["id"],c={key:0,class:"form-title form-padding"},m={key:1,class:"form-subtitle form-padding"},d={key:2,class:"form-errors has-text-centered has-text-weight-bold has-text-love-park-red-dark"},w={key:3,class:"form-submit form-padding"},{formHelpers:h}=s,{randomID:u}=h,S=t.defineComponent({__name:"InputForm",props:{id:{default:u()},errors:{default(){return[]}},optgroup:{type:Boolean},disableableOptions:{type:Boolean},options:{},name:{},textKey:{},valueKey:{},imaskProps:{},title:{default:""},desc:{default:""},hideErrorsCount:{type:Boolean,default:!1}},setup(a){const o=a,n=t.computed(()=>Array.isArray(o.errors)?o.errors.length:typeof o.errors=="string"||typeof o.errors=="number"?1:l(o.errors)),l=e=>Object.keys(e).map(r=>e[r]).reduce((r,g)=>g.length>0?r+1:r,0);return(e,f)=>(t.openBlock(),t.createElementBlock("form",t.mergeProps({id:`form-${e.id}`},e.$attrs,{novalidate:""}),[e.title?(t.openBlock(),t.createElementBlock("div",c,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.desc?(t.openBlock(),t.createElementBlock("p",m,t.toDisplayString(e.desc),1)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",{},void 0,!0),!e.hideErrorsCount&&n.value>0?(t.openBlock(),t.createElementBlock("div",d,[f[0]||(f[0]=t.createElementVNode("span",{class:"icon"},[t.createElementVNode("i",{class:"fa fa-exclamation-triangle"})],-1)),t.createElementVNode("span",null," This form has "+t.toDisplayString(n.value)+" error"+t.toDisplayString(n.value>1?"s":""),1)])):t.createCommentVNode("",!0),e.$slots.submit?(t.openBlock(),t.createElementBlock("div",w,[t.renderSlot(e.$slots,"submit",{},void 0,!0)])):t.createCommentVNode("",!0)],16,p))}});return((a,o)=>{const n=a.__vccOpts||a;for(const[l,e]of o)n[l]=e;return n})(S,[["__scopeId","data-v-906e820c"]])});
@@ -1,27 +1,27 @@
1
1
  import { InputProps } from '@phila/phila-ui-core';
2
2
  import { InputFormProps } from './types';
3
3
 
4
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps & InputFormProps>, {
4
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps & InputFormProps>, {
5
5
  title: string;
6
6
  desc: string;
7
7
  hideErrorsCount: boolean;
8
8
  errorsCount: number;
9
9
  errors(): never[];
10
10
  id: any;
11
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps & InputFormProps>, {
11
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps & InputFormProps>, {
12
12
  title: string;
13
13
  desc: string;
14
14
  hideErrorsCount: boolean;
15
15
  errorsCount: number;
16
16
  errors(): never[];
17
17
  id: any;
18
- }>>>, {
18
+ }>>> & Readonly<{}>, {
19
19
  id: string;
20
20
  errors: import('@phila/phila-ui-core').InputErrors;
21
21
  title: string;
22
22
  desc: string;
23
23
  hideErrorsCount: boolean;
24
- }, {}>, {
24
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
25
25
  default?(_: {}): any;
26
26
  submit?(_: {}): any;
27
27
  }>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-input-form",
3
3
  "private": false,
4
- "version": "0.0.3",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -20,18 +20,18 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@phila/phila-ui-core": "^1.0.21",
23
+ "@phila/phila-ui-core": "^1.0.24",
24
24
  "vue": "^3.3.8"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^20.10.3",
28
28
  "@vitejs/plugin-vue": "^4.5.0",
29
29
  "sass": "^1.69.5",
30
- "typescript": "^5.2.2",
30
+ "typescript": "^5.8.2",
31
31
  "vite": "^5.0.0",
32
32
  "vite-plugin-dts": "^3.6.4",
33
33
  "vite-plugin-lib-inject-css": "^1.3.0",
34
- "vue-tsc": "^1.8.22"
34
+ "vue-tsc": "^2.2.8"
35
35
  },
36
- "gitHead": "62924e3ac0fd1187900911ff3346a09929ec5aa3"
36
+ "gitHead": "09f2b67c1d3db773c813231e21b62b37e34aefbd"
37
37
  }