@phila/phila-ui-checkbox 0.0.5 → 0.0.8
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/Checkbox.vue.d.ts +8 -55
- package/dist/checkbox.js +34 -34
- package/dist/checkbox.umd.cjs +1 -1
- package/package.json +5 -5
package/dist/Checkbox.vue.d.ts
CHANGED
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
import { InputProps } from "@phila/phila-ui-core";
|
|
2
2
|
import { CheckboxProps } from "./types";
|
|
3
|
-
declare const _default:
|
|
4
|
-
id: any;
|
|
5
|
-
errors(): never[];
|
|
6
|
-
label: string;
|
|
7
|
-
desc: string;
|
|
8
|
-
modelValue: () => never[];
|
|
9
|
-
valueKey: string;
|
|
10
|
-
textKey: string;
|
|
11
|
-
numOfColumns: number;
|
|
12
|
-
small: boolean;
|
|
13
|
-
options: () => {
|
|
14
|
-
"option-1": string;
|
|
15
|
-
"option-2": string;
|
|
16
|
-
"option-3": string;
|
|
17
|
-
};
|
|
18
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputProps & CheckboxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
4
|
"update:modelValue": (...args: any[]) => void;
|
|
20
5
|
change: (...args: any[]) => void;
|
|
21
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
22
|
-
id: any;
|
|
23
|
-
errors(): never[];
|
|
24
|
-
label: string;
|
|
25
|
-
desc: string;
|
|
26
|
-
modelValue: () => never[];
|
|
27
|
-
valueKey: string;
|
|
28
|
-
textKey: string;
|
|
29
|
-
numOfColumns: number;
|
|
30
|
-
small: boolean;
|
|
31
|
-
options: () => {
|
|
32
|
-
"option-1": string;
|
|
33
|
-
"option-2": string;
|
|
34
|
-
"option-3": string;
|
|
35
|
-
};
|
|
36
|
-
}>>> & {
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<InputProps & CheckboxProps> & Readonly<{
|
|
37
7
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
38
8
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
39
|
-
}
|
|
9
|
+
}>, {
|
|
40
10
|
id: string;
|
|
41
11
|
errors: import("@phila/phila-ui-core").InputErrors;
|
|
42
12
|
options: (import("@phila/phila-ui-core").HTMLInputValue[] | import("@phila/phila-ui-core").InputOptions | import("@phila/phila-ui-core").InputOptions[] | import("@phila/phila-ui-core").InputOptionsGroup | import("@phila/phila-ui-core").InputOptionObject[] | undefined) & (import("@phila/phila-ui-core").InputOptions | import("@phila/phila-ui-core").InputOptions[]);
|
|
@@ -44,32 +14,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
44
14
|
valueKey: string;
|
|
45
15
|
label: string;
|
|
46
16
|
desc: string;
|
|
47
|
-
modelValue:
|
|
17
|
+
modelValue: Array<string | number | boolean>;
|
|
48
18
|
numOfColumns: string | number;
|
|
49
19
|
small: boolean;
|
|
50
|
-
}, {}>, {
|
|
51
|
-
label
|
|
52
|
-
desc
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
21
|
+
label?: ((props: {}) => any) | undefined;
|
|
22
|
+
desc?: ((props: {}) => any) | undefined;
|
|
53
23
|
}>;
|
|
54
24
|
export default _default;
|
|
55
|
-
type
|
|
56
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
57
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
58
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
59
|
-
} : {
|
|
60
|
-
type: import('vue').PropType<T[K]>;
|
|
61
|
-
required: true;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
type __VLS_WithDefaults<P, D> = {
|
|
65
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
66
|
-
default: D[K];
|
|
67
|
-
}> : P[K];
|
|
68
|
-
};
|
|
69
|
-
type __VLS_Prettify<T> = {
|
|
70
|
-
[K in keyof T]: T[K];
|
|
71
|
-
} & {};
|
|
72
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
73
26
|
new (): {
|
|
74
27
|
$slots: S;
|
|
75
28
|
};
|
package/dist/checkbox.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, getCurrentInstance as I, ref as w, watch as D, createElementBlock as o, openBlock as l, normalizeClass as N, unref as a, createElementVNode as s, createCommentVNode as h, renderSlot as b, Fragment as c, createTextVNode as P, toDisplayString as n, normalizeStyle as S, renderList as _, withDirectives as z, mergeProps as E, vModelCheckbox as K } from "vue";
|
|
2
2
|
import T from "@phila/phila-ui-core";
|
|
3
3
|
const U = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "input-error-msg"
|
|
6
|
-
}, q =
|
|
7
|
-
/* @__PURE__ */ s("i", { class: "fas fa-exclamation-circle" })
|
|
8
|
-
], -1), A = {
|
|
6
|
+
}, q = {
|
|
9
7
|
key: 1,
|
|
10
8
|
class: "is-field-info"
|
|
11
|
-
},
|
|
9
|
+
}, A = {
|
|
12
10
|
key: 0,
|
|
13
11
|
class: "is-field-info"
|
|
14
|
-
},
|
|
12
|
+
}, F = ["id"], H = ["id", "name", "aria-checked", "value"], L = ["for"], { formHelpers: v } = T, { randomID: M } = v, j = {
|
|
15
13
|
inheritAttrs: !1
|
|
16
|
-
},
|
|
17
|
-
...
|
|
14
|
+
}, Q = /* @__PURE__ */ B({
|
|
15
|
+
...j,
|
|
18
16
|
__name: "Checkbox",
|
|
19
17
|
props: {
|
|
20
|
-
id: { default:
|
|
18
|
+
id: { default: M() },
|
|
21
19
|
errors: { default() {
|
|
22
20
|
return [];
|
|
23
21
|
} },
|
|
@@ -40,66 +38,68 @@ const U = {
|
|
|
40
38
|
},
|
|
41
39
|
emits: ["update:modelValue", "change"],
|
|
42
40
|
setup(k, { emit: $ }) {
|
|
43
|
-
const i = k,
|
|
44
|
-
|
|
41
|
+
const i = k, p = $, V = I(), { error: m, classes: g, optionText: y, optionValue: f } = v.useInput.useInputComposable(V, i), r = w(i.modelValue);
|
|
42
|
+
D(
|
|
45
43
|
() => i.modelValue,
|
|
46
44
|
(e) => {
|
|
47
45
|
r.value = e;
|
|
48
46
|
}
|
|
49
47
|
);
|
|
50
48
|
const C = (e) => {
|
|
51
|
-
|
|
49
|
+
p("change", e), p("update:modelValue", r.value);
|
|
52
50
|
};
|
|
53
|
-
return (e,
|
|
54
|
-
class:
|
|
51
|
+
return (e, d) => (l(), o("div", {
|
|
52
|
+
class: N(["input-wrap input-checkbox", [a(g), i.small && "small-checkradio"]])
|
|
55
53
|
}, [
|
|
56
54
|
s("fieldset", null, [
|
|
57
55
|
s("legend", null, [
|
|
58
|
-
e.label ? (
|
|
59
|
-
|
|
60
|
-
], 64)) :
|
|
56
|
+
e.label ? (l(), o(c, { key: 0 }, [
|
|
57
|
+
P(n(e.label) + " " + n(e.$attrs.required !== void 0 ? "*" : ""), 1)
|
|
58
|
+
], 64)) : b(e.$slots, "label", { key: 1 })
|
|
61
59
|
]),
|
|
62
|
-
a(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
a(m) ? (l(), o("div", U, [
|
|
61
|
+
d[1] || (d[1] = s("span", { class: "icon" }, [
|
|
62
|
+
s("i", { class: "fas fa-exclamation-circle" })
|
|
63
|
+
], -1)),
|
|
64
|
+
s("span", null, n(a(m)), 1)
|
|
65
|
+
])) : h("", !0),
|
|
66
|
+
e.desc ? (l(), o("div", q, n(e.desc), 1)) : (l(), o(c, { key: 2 }, [
|
|
67
|
+
e.$slots.desc ? (l(), o("div", A, [
|
|
68
|
+
b(e.$slots, "desc")
|
|
69
|
+
])) : h("", !0)
|
|
70
70
|
], 64)),
|
|
71
71
|
s("div", {
|
|
72
72
|
id: `cb-group-${e.id}`,
|
|
73
|
-
style:
|
|
73
|
+
style: S(`columns: ${e.numOfColumns} auto`)
|
|
74
74
|
}, [
|
|
75
|
-
(
|
|
75
|
+
(l(!0), o(c, null, _(e.options, (u, t) => (l(), o("div", {
|
|
76
76
|
key: `k-${t}`,
|
|
77
77
|
class: "control"
|
|
78
78
|
}, [
|
|
79
79
|
z(s("input", E({
|
|
80
80
|
id: `cb-${t}-${e.id}`,
|
|
81
|
-
"onUpdate:modelValue":
|
|
81
|
+
"onUpdate:modelValue": d[0] || (d[0] = (O) => r.value = O),
|
|
82
82
|
name: `cb-${t}-${e.id}`,
|
|
83
83
|
type: "checkbox",
|
|
84
|
-
"aria-checked": e.modelValue.includes(a(
|
|
84
|
+
"aria-checked": e.modelValue.includes(a(f)(u, t)),
|
|
85
85
|
class: "is-checkradio",
|
|
86
86
|
role: "checkbox",
|
|
87
87
|
ref_for: !0
|
|
88
88
|
}, e.$attrs, {
|
|
89
|
-
value: a(
|
|
89
|
+
value: a(f)(u, t),
|
|
90
90
|
onChange: C
|
|
91
|
-
}), null, 16,
|
|
91
|
+
}), null, 16, H), [
|
|
92
92
|
[K, r.value]
|
|
93
93
|
]),
|
|
94
94
|
s("label", {
|
|
95
95
|
for: `cb-${t}-${e.id}`
|
|
96
|
-
}, n(a(y)(
|
|
96
|
+
}, n(a(y)(u)), 9, L)
|
|
97
97
|
]))), 128))
|
|
98
|
-
], 12,
|
|
98
|
+
], 12, F)
|
|
99
99
|
])
|
|
100
100
|
], 2));
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
export {
|
|
104
|
-
|
|
104
|
+
Q as default
|
|
105
105
|
};
|
package/dist/checkbox.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue"),require("@phila/phila-ui-core")):typeof define=="function"&&define.amd?define(["vue","@phila/phila-ui-core"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.Checkbox=l(e.Vue,e.PhilaUICore))})(this,function(e,l){"use strict";const m={key:0,class:"input-error-msg"},f=
|
|
1
|
+
(function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue"),require("@phila/phila-ui-core")):typeof define=="function"&&define.amd?define(["vue","@phila/phila-ui-core"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.Checkbox=l(e.Vue,e.PhilaUICore))})(this,function(e,l){"use strict";const m={key:0,class:"input-error-msg"},f={key:1,class:"is-field-info"},u={key:0,class:"is-field-info"},k=["id"],h=["id","name","aria-checked","value"],V=["for"],{formHelpers:i}=l,{randomID:B}=i,b={inheritAttrs:!1};return e.defineComponent({...b,__name:"Checkbox",props:{id:{default:B()},errors:{default(){return[]}},optgroup:{type:Boolean},disableableOptions:{type:Boolean},options:{default:()=>({"option-1":"Option 1","option-2":"Option 2","option-3":"Option 3"})},name:{},textKey:{default:""},valueKey:{default:""},imaskProps:{},label:{default:""},desc:{default:""},modelValue:{default:()=>[]},numOfColumns:{default:1},small:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(y,{emit:E}){const n=y,c=E,g=e.getCurrentInstance(),{error:d,classes:$,optionText:C,optionValue:p}=i.useInput.useInputComposable(g,n),a=e.ref(n.modelValue);e.watch(()=>n.modelValue,o=>{a.value=o});const N=o=>{c("change",o),c("update:modelValue",a.value)};return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap input-checkbox",[e.unref($),n.small&&"small-checkradio"]])},[e.createElementVNode("fieldset",null,[e.createElementVNode("legend",null,[o.label?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(o.label)+" "+e.toDisplayString(o.$attrs.required!==void 0?"*":""),1)],64)):e.renderSlot(o.$slots,"label",{key:1})]),e.unref(d)?(e.openBlock(),e.createElementBlock("div",m,[s[1]||(s[1]=e.createElementVNode("span",{class:"icon"},[e.createElementVNode("i",{class:"fas fa-exclamation-circle"})],-1)),e.createElementVNode("span",null,e.toDisplayString(e.unref(d)),1)])):e.createCommentVNode("",!0),o.desc?(e.openBlock(),e.createElementBlock("div",f,e.toDisplayString(o.desc),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[o.$slots.desc?(e.openBlock(),e.createElementBlock("div",u,[e.renderSlot(o.$slots,"desc")])):e.createCommentVNode("",!0)],64)),e.createElementVNode("div",{id:`cb-group-${o.id}`,style:e.normalizeStyle(`columns: ${o.numOfColumns} auto`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.options,(r,t)=>(e.openBlock(),e.createElementBlock("div",{key:`k-${t}`,class:"control"},[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:`cb-${t}-${o.id}`,"onUpdate:modelValue":s[0]||(s[0]=S=>a.value=S),name:`cb-${t}-${o.id}`,type:"checkbox","aria-checked":o.modelValue.includes(e.unref(p)(r,t)),class:"is-checkradio",role:"checkbox",ref_for:!0},o.$attrs,{value:e.unref(p)(r,t),onChange:N}),null,16,h),[[e.vModelCheckbox,a.value]]),e.createElementVNode("label",{for:`cb-${t}-${o.id}`},e.toDisplayString(e.unref(C)(r)),9,V)]))),128))],12,k)])],2))}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/phila-ui-checkbox",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"preview": "vite preview"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@phila/phila-ui-core": "^1.0.
|
|
28
|
+
"@phila/phila-ui-core": "^1.0.24",
|
|
29
29
|
"bulma": "^0.9.4",
|
|
30
30
|
"vue": "^3.3.8"
|
|
31
31
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@types/node": "^20.10.3",
|
|
34
34
|
"@vitejs/plugin-vue": "^4.5.0",
|
|
35
35
|
"sass": "^1.69.5",
|
|
36
|
-
"typescript": "^5.
|
|
36
|
+
"typescript": "^5.8.2",
|
|
37
37
|
"vite": "^5.0.0",
|
|
38
38
|
"vite-plugin-dts": "^3.6.4",
|
|
39
39
|
"vite-plugin-lib-inject-css": "^1.3.0",
|
|
40
|
-
"vue-tsc": "^
|
|
40
|
+
"vue-tsc": "^2.2.8"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"registry": "https://registry.npmjs.com/",
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "09f2b67c1d3db773c813231e21b62b37e34aefbd"
|
|
47
47
|
}
|