@phila/phila-ui-filter-panel 1.0.0-beta.4 → 1.0.0-beta.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/FilterPanel.vue.d.ts +2 -1
- package/dist/FilterPanel.vue.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +115 -109
- package/package.json +3 -3
|
@@ -14,6 +14,7 @@ declare const _default: import('vue').DefineComponent<FilterPanelProps, {}, {},
|
|
|
14
14
|
showActions: boolean;
|
|
15
15
|
applyText: string;
|
|
16
16
|
resetText: string;
|
|
17
|
-
|
|
17
|
+
fullScreen: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
19
|
export default _default;
|
|
19
20
|
//# sourceMappingURL=FilterPanel.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterPanel.vue.d.ts","sourceRoot":"","sources":["../src/FilterPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterPanel.vue.d.ts","sourceRoot":"","sources":["../src/FilterPanel.vue"],"names":[],"mappings":"AA2MA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;AAiThD,wBASG"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.phila-filter-panel__section[data-v-54c0ee8c]{border-bottom:1px solid var(--Schemes-Border, #ccc);padding:.75rem 0}.phila-filter-panel__section-toggle[data-v-54c0ee8c]{display:flex;width:100%;align-items:center;justify-content:space-between;background:none;border:none;cursor:pointer;font-size:inherit;font-weight:700}.phila-filter-panel__section-toggle .is-collapsed[data-v-54c0ee8c]{transform:rotate(-90deg)}.phila-filter-panel__section-body[data-v-54c0ee8c]{padding-top:.75rem}.phila-filter-panel__section-body[data-v-54c0ee8c] .labels-container{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.phila-filter-panel[data-v-
|
|
1
|
+
.phila-filter-panel__section[data-v-54c0ee8c]{border-bottom:1px solid var(--Schemes-Border, #ccc);padding:.75rem 0}.phila-filter-panel__section-toggle[data-v-54c0ee8c]{display:flex;width:100%;align-items:center;justify-content:space-between;background:none;border:none;cursor:pointer;font-size:inherit;font-weight:700}.phila-filter-panel__section-toggle .is-collapsed[data-v-54c0ee8c]{transform:rotate(-90deg)}.phila-filter-panel__section-body[data-v-54c0ee8c]{padding-top:.75rem}.phila-filter-panel__section-body[data-v-54c0ee8c] .labels-container{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.phila-filter-panel[data-v-052723b8]{display:flex;flex-direction:column;height:100%;background:#fff;overflow:hidden;box-sizing:border-box}.phila-filter-panel--full-screen[data-v-052723b8]{position:fixed;inset:0;z-index:10001}.phila-filter-panel__header[data-v-052723b8]{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:1.5rem 1.5rem .75rem}.phila-filter-panel__body[data-v-052723b8]{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:1rem;padding:0 1.5rem 1.5rem}.phila-filter-panel__title[data-v-052723b8]{margin:0;font-size:1.25rem;font-weight:700}.phila-filter-panel__close[data-v-052723b8]{background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1}.phila-filter-panel__sections[data-v-052723b8]{display:flex;flex-direction:column}.phila-filter-panel__footer[data-v-052723b8]{display:flex;gap:.75rem;flex-shrink:0;padding:.75rem 1.5rem 1.5rem;border-top:1px solid var(--Schemes-Border, #e5e7eb)}.phila-filter-panel__footer[data-v-052723b8]>*{flex:1}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,5 +17,8 @@ export interface FilterPanelProps extends BaseProps {
|
|
|
17
17
|
applyText?: string;
|
|
18
18
|
/** Reset button label. */
|
|
19
19
|
resetText?: string;
|
|
20
|
+
/** Render as a full-screen takeover (teleported to <body>, above app chrome).
|
|
21
|
+
* Off (default) renders inline; the consumer positions it. */
|
|
22
|
+
fullScreen?: boolean;
|
|
20
23
|
}
|
|
21
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,wFAAwF;IACxF,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,uFAAuF;IACvF,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sFAAsF;IACtF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,wFAAwF;IACxF,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,uFAAuF;IACvF,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sFAAsF;IACtF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;mEAC+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),h=require("@phila/phila-ui-core"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),h=require("@phila/phila-ui-core"),_=require("@phila/phila-ui-search"),V=require("@phila/phila-ui-button"),k=require("@phila/phila-ui-core/icons"),w=require("@phila/phila-ui-checkbox"),E=require("@phila/phila-ui-radio"),A={class:"phila-filter-panel__section"},P={class:"phila-filter-panel__section-body"},T=e.defineComponent({__name:"FilterPanelSection",props:{filter:{},collapsed:{type:Boolean},modelValue:{type:[Boolean,Object]}},emits:["toggle","update:modelValue"],setup(t,{emit:p}){const n=t,c=p,r=e.computed(()=>n.filter.choices??[]),d=e.computed(()=>n.modelValue&&typeof n.modelValue=="object"?n.modelValue:{});return(m,i)=>(e.openBlock(),e.createElementBlock("section",A,[e.createElementVNode("button",{type:"button",class:"phila-filter-panel__section-toggle",onClick:i[0]||(i[0]=s=>c("toggle"))},[e.createElementVNode("span",null,e.toDisplayString(t.filter.label),1),e.createVNode(e.unref(h.Icon),{icon:e.unref(k.IconChevronDown),size:"xxsmall",inline:"",decorative:"",class:e.normalizeClass({"is-collapsed":t.collapsed})},null,8,["icon","class"])]),e.withDirectives(e.createElementVNode("div",P,[t.filter.multiple?(e.openBlock(),e.createBlock(e.unref(w.CheckboxGroup),{key:0,"group-label":t.filter.label,choices:r.value,"model-value":d.value,"onUpdate:modelValue":i[1]||(i[1]=s=>c("update:modelValue",s))},null,8,["group-label","choices","model-value"])):(e.openBlock(),e.createBlock(e.unref(E.RadioGroup),{key:1,"group-label":t.filter.label,choices:r.value,"model-value":d.value,"onUpdate:modelValue":i[2]||(i[2]=s=>c("update:modelValue",s))},null,8,["group-label","choices","model-value"]))],512),[[e.vShow,!t.collapsed]])]))}}),b=(t,p)=>{const n=t.__vccOpts||t;for(const[c,r]of p)n[c]=r;return n},U=b(T,[["__scopeId","data-v-54c0ee8c"]]),q={class:"phila-filter-panel__header"},D={class:"phila-filter-panel__title"},F={class:"phila-filter-panel__body"},$={class:"phila-filter-panel__sections"},j={key:0,class:"phila-filter-panel__footer"},I=e.defineComponent({__name:"FilterPanel",props:{filters:{},modelValue:{default:()=>({})},title:{default:"All Filters"},searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search"},showActions:{type:Boolean,default:!1},applyText:{default:"Apply"},resetText:{default:"Reset"},fullScreen:{type:Boolean,default:!1},className:{}},emits:["update:modelValue","close"],setup(t,{emit:p}){const n=t,c=p,r=e.ref({}),d=e.ref(""),m=e.ref({});function i(o){const a={};for(const l of n.filters){const u=o[l.key];if(Array.isArray(l.choices)&&l.choices.length>0){const x=u&&typeof u=="object"?u:{};a[l.key]=Object.fromEntries(l.choices.map(y=>[y.value,!!x[y.value]]))}else a[l.key]=u===!0}return a}const s=e.computed(()=>n.showActions?r.value:n.modelValue);e.onMounted(()=>{const o=i(n.modelValue);r.value=o,c("update:modelValue",o)});const v=e.computed(()=>n.filters.filter(o=>Array.isArray(o.choices)&&o.choices.length>0)),g=e.computed(()=>{const o=d.value.trim().toLowerCase();return o?v.value.filter(a=>a.label.toLowerCase().includes(o)||(a.choices??[]).some(l=>l.text.toLowerCase().includes(o))):v.value}),f=e.computed(()=>v.value.reduce((o,a)=>{if(a.excludeFromCount)return o;const l=s.value[a.key];return o+(l&&typeof l=="object"?Object.values(l).filter(Boolean).length:l?1:0)},0));function B(o,a){const l=i({...s.value,[o]:a});n.showActions?r.value=l:c("update:modelValue",l)}function C(o){m.value={...m.value,[o]:!m.value[o]}}function N(){r.value=i({})}function S(){c("update:modelValue",i(r.value)),c("close")}return(o,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!t.fullScreen},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(h.cn)("phila-filter-panel",t.fullScreen&&"phila-filter-panel--full-screen",n.className))},[e.createElementVNode("header",q,[e.createElementVNode("h2",D,e.toDisplayString(t.title)+e.toDisplayString(f.value?` (${f.value})`:""),1),e.createElementVNode("button",{type:"button",class:"phila-filter-panel__close","aria-label":"Close filters",onClick:a[0]||(a[0]=l=>c("close"))},[e.createVNode(e.unref(h.Icon),{icon:e.unref(k.IconClose),size:"small",inline:"",decorative:""},null,8,["icon"])])]),e.createElementVNode("div",F,[t.searchable?(e.openBlock(),e.createBlock(e.unref(_.Search),{key:0,modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=l=>d.value=l),placeholder:t.searchPlaceholder},null,8,["modelValue","placeholder"])):e.createCommentVNode("",!0),e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createBlock(U,{key:l.key,filter:l,collapsed:!!m.value[l.key],"model-value":s.value[l.key],onToggle:u=>C(l.key),"onUpdate:modelValue":u=>B(l.key,u)},null,8,["filter","collapsed","model-value","onToggle","onUpdate:modelValue"]))),128))])]),t.showActions?(e.openBlock(),e.createElementBlock("footer",j,[e.createVNode(e.unref(V.PhilaButton),{variant:"secondary",onClick:N},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.resetText),1)]),_:1}),e.createVNode(e.unref(V.PhilaButton),{variant:"primary",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.applyText)+e.toDisplayString(f.value?` (${f.value})`:""),1)]),_:1})])):e.createCommentVNode("",!0)],2)],8,["disabled"]))}}),z=b(I,[["__scopeId","data-v-052723b8"]]);exports.FilterPanel=z;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Search as
|
|
4
|
-
import { PhilaButton as
|
|
5
|
-
import { IconChevronDown as
|
|
6
|
-
import { CheckboxGroup as
|
|
7
|
-
import { RadioGroup as
|
|
8
|
-
import './index.css';const
|
|
1
|
+
import { defineComponent as T, computed as v, createElementBlock as x, openBlock as d, createElementVNode as r, withDirectives as O, createVNode as g, toDisplayString as f, unref as c, normalizeClass as $, createBlock as b, vShow as D, ref as C, onMounted as E, Teleport as G, createCommentVNode as w, Fragment as R, renderList as q, withCtx as S, createTextVNode as A } from "vue";
|
|
2
|
+
import { Icon as F, cn as M } from "@phila/phila-ui-core";
|
|
3
|
+
import { Search as H } from "@phila/phila-ui-search";
|
|
4
|
+
import { PhilaButton as B } from "@phila/phila-ui-button";
|
|
5
|
+
import { IconChevronDown as J, IconClose as K } from "@phila/phila-ui-core/icons";
|
|
6
|
+
import { CheckboxGroup as Q } from "@phila/phila-ui-checkbox";
|
|
7
|
+
import { RadioGroup as W } from "@phila/phila-ui-radio";
|
|
8
|
+
import './index.css';const X = { class: "phila-filter-panel__section" }, Y = { class: "phila-filter-panel__section-body" }, Z = /* @__PURE__ */ T({
|
|
9
9
|
__name: "FilterPanelSection",
|
|
10
10
|
props: {
|
|
11
11
|
filter: {},
|
|
@@ -13,53 +13,53 @@ import './index.css';const W = { class: "phila-filter-panel__section" }, X = { c
|
|
|
13
13
|
modelValue: { type: [Boolean, Object] }
|
|
14
14
|
},
|
|
15
15
|
emits: ["toggle", "update:modelValue"],
|
|
16
|
-
setup(
|
|
17
|
-
const a =
|
|
16
|
+
setup(l, { emit: h }) {
|
|
17
|
+
const a = l, n = h, i = v(() => a.filter.choices ?? []), p = v(
|
|
18
18
|
() => a.modelValue && typeof a.modelValue == "object" ? a.modelValue : {}
|
|
19
19
|
);
|
|
20
|
-
return (y, s) => (
|
|
21
|
-
|
|
20
|
+
return (y, s) => (d(), x("section", X, [
|
|
21
|
+
r("button", {
|
|
22
22
|
type: "button",
|
|
23
23
|
class: "phila-filter-panel__section-toggle",
|
|
24
|
-
onClick: s[0] || (s[0] = (
|
|
24
|
+
onClick: s[0] || (s[0] = (u) => n("toggle"))
|
|
25
25
|
}, [
|
|
26
|
-
|
|
27
|
-
g(c(
|
|
28
|
-
icon: c(
|
|
26
|
+
r("span", null, f(l.filter.label), 1),
|
|
27
|
+
g(c(F), {
|
|
28
|
+
icon: c(J),
|
|
29
29
|
size: "xxsmall",
|
|
30
30
|
inline: "",
|
|
31
31
|
decorative: "",
|
|
32
|
-
class:
|
|
32
|
+
class: $({ "is-collapsed": l.collapsed })
|
|
33
33
|
}, null, 8, ["icon", "class"])
|
|
34
34
|
]),
|
|
35
|
-
O(
|
|
36
|
-
|
|
35
|
+
O(r("div", Y, [
|
|
36
|
+
l.filter.multiple ? (d(), b(c(Q), {
|
|
37
37
|
key: 0,
|
|
38
|
-
"group-label":
|
|
38
|
+
"group-label": l.filter.label,
|
|
39
39
|
choices: i.value,
|
|
40
40
|
"model-value": p.value,
|
|
41
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
42
|
-
}, null, 8, ["group-label", "choices", "model-value"])) : (
|
|
41
|
+
"onUpdate:modelValue": s[1] || (s[1] = (u) => n("update:modelValue", u))
|
|
42
|
+
}, null, 8, ["group-label", "choices", "model-value"])) : (d(), b(c(W), {
|
|
43
43
|
key: 1,
|
|
44
|
-
"group-label":
|
|
44
|
+
"group-label": l.filter.label,
|
|
45
45
|
choices: i.value,
|
|
46
46
|
"model-value": p.value,
|
|
47
|
-
"onUpdate:modelValue": s[2] || (s[2] = (
|
|
47
|
+
"onUpdate:modelValue": s[2] || (s[2] = (u) => n("update:modelValue", u))
|
|
48
48
|
}, null, 8, ["group-label", "choices", "model-value"]))
|
|
49
49
|
], 512), [
|
|
50
|
-
[D, !
|
|
50
|
+
[D, !l.collapsed]
|
|
51
51
|
])
|
|
52
52
|
]));
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
55
|
-
const a =
|
|
54
|
+
}), P = (l, h) => {
|
|
55
|
+
const a = l.__vccOpts || l;
|
|
56
56
|
for (const [n, i] of h)
|
|
57
57
|
a[n] = i;
|
|
58
58
|
return a;
|
|
59
|
-
},
|
|
59
|
+
}, ee = /* @__PURE__ */ P(Z, [["__scopeId", "data-v-54c0ee8c"]]), le = { class: "phila-filter-panel__header" }, te = { class: "phila-filter-panel__title" }, oe = { class: "phila-filter-panel__body" }, ae = { class: "phila-filter-panel__sections" }, ne = {
|
|
60
60
|
key: 0,
|
|
61
61
|
class: "phila-filter-panel__footer"
|
|
62
|
-
},
|
|
62
|
+
}, se = /* @__PURE__ */ T({
|
|
63
63
|
__name: "FilterPanel",
|
|
64
64
|
props: {
|
|
65
65
|
filters: {},
|
|
@@ -70,46 +70,47 @@ import './index.css';const W = { class: "phila-filter-panel__section" }, X = { c
|
|
|
70
70
|
showActions: { type: Boolean, default: !1 },
|
|
71
71
|
applyText: { default: "Apply" },
|
|
72
72
|
resetText: { default: "Reset" },
|
|
73
|
+
fullScreen: { type: Boolean, default: !1 },
|
|
73
74
|
className: {}
|
|
74
75
|
},
|
|
75
76
|
emits: ["update:modelValue", "close"],
|
|
76
|
-
setup(
|
|
77
|
-
const a =
|
|
78
|
-
function s(
|
|
77
|
+
setup(l, { emit: h }) {
|
|
78
|
+
const a = l, n = h, i = C({}), p = C(""), y = C({});
|
|
79
|
+
function s(t) {
|
|
79
80
|
const o = {};
|
|
80
81
|
for (const e of a.filters) {
|
|
81
|
-
const m =
|
|
82
|
+
const m = t[e.key];
|
|
82
83
|
if (Array.isArray(e.choices) && e.choices.length > 0) {
|
|
83
84
|
const L = m && typeof m == "object" ? m : {};
|
|
84
|
-
o[e.key] = Object.fromEntries(e.choices.map((
|
|
85
|
+
o[e.key] = Object.fromEntries(e.choices.map((_) => [_.value, !!L[_.value]]));
|
|
85
86
|
} else
|
|
86
87
|
o[e.key] = m === !0;
|
|
87
88
|
}
|
|
88
89
|
return o;
|
|
89
90
|
}
|
|
90
|
-
const
|
|
91
|
+
const u = v(() => a.showActions ? i.value : a.modelValue);
|
|
91
92
|
E(() => {
|
|
92
|
-
const
|
|
93
|
-
i.value =
|
|
93
|
+
const t = s(a.modelValue);
|
|
94
|
+
i.value = t, n("update:modelValue", t);
|
|
94
95
|
});
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
(o) => o.label.toLowerCase().includes(
|
|
99
|
-
) :
|
|
96
|
+
const k = v(() => a.filters.filter((t) => Array.isArray(t.choices) && t.choices.length > 0)), j = v(() => {
|
|
97
|
+
const t = p.value.trim().toLowerCase();
|
|
98
|
+
return t ? k.value.filter(
|
|
99
|
+
(o) => o.label.toLowerCase().includes(t) || (o.choices ?? []).some((e) => e.text.toLowerCase().includes(t))
|
|
100
|
+
) : k.value;
|
|
100
101
|
}), V = v(
|
|
101
|
-
() =>
|
|
102
|
-
if (o.excludeFromCount) return
|
|
103
|
-
const e =
|
|
104
|
-
return
|
|
102
|
+
() => k.value.reduce((t, o) => {
|
|
103
|
+
if (o.excludeFromCount) return t;
|
|
104
|
+
const e = u.value[o.key];
|
|
105
|
+
return t + (e && typeof e == "object" ? Object.values(e).filter(Boolean).length : e ? 1 : 0);
|
|
105
106
|
}, 0)
|
|
106
107
|
);
|
|
107
|
-
function N(
|
|
108
|
-
const e = s({ ...
|
|
108
|
+
function N(t, o) {
|
|
109
|
+
const e = s({ ...u.value, [t]: o });
|
|
109
110
|
a.showActions ? i.value = e : n("update:modelValue", e);
|
|
110
111
|
}
|
|
111
|
-
function I(
|
|
112
|
-
y.value = { ...y.value, [
|
|
112
|
+
function I(t) {
|
|
113
|
+
y.value = { ...y.value, [t]: !y.value[t] };
|
|
113
114
|
}
|
|
114
115
|
function U() {
|
|
115
116
|
i.value = s({});
|
|
@@ -117,66 +118,71 @@ import './index.css';const W = { class: "phila-filter-panel__section" }, X = { c
|
|
|
117
118
|
function z() {
|
|
118
119
|
n("update:modelValue", s(i.value)), n("close");
|
|
119
120
|
}
|
|
120
|
-
return (
|
|
121
|
-
|
|
121
|
+
return (t, o) => (d(), b(G, {
|
|
122
|
+
to: "body",
|
|
123
|
+
disabled: !l.fullScreen
|
|
122
124
|
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
125
|
+
r("div", {
|
|
126
|
+
class: $(c(M)("phila-filter-panel", l.fullScreen && "phila-filter-panel--full-screen", a.className))
|
|
127
|
+
}, [
|
|
128
|
+
r("header", le, [
|
|
129
|
+
r("h2", te, f(l.title) + f(V.value ? ` (${V.value})` : ""), 1),
|
|
130
|
+
r("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
class: "phila-filter-panel__close",
|
|
133
|
+
"aria-label": "Close filters",
|
|
134
|
+
onClick: o[0] || (o[0] = (e) => n("close"))
|
|
135
|
+
}, [
|
|
136
|
+
g(c(F), {
|
|
137
|
+
icon: c(K),
|
|
138
|
+
size: "small",
|
|
139
|
+
inline: "",
|
|
140
|
+
decorative: ""
|
|
141
|
+
}, null, 8, ["icon"])
|
|
142
|
+
])
|
|
143
|
+
]),
|
|
144
|
+
r("div", oe, [
|
|
145
|
+
l.searchable ? (d(), b(c(H), {
|
|
146
|
+
key: 0,
|
|
147
|
+
modelValue: p.value,
|
|
148
|
+
"onUpdate:modelValue": o[1] || (o[1] = (e) => p.value = e),
|
|
149
|
+
placeholder: l.searchPlaceholder
|
|
150
|
+
}, null, 8, ["modelValue", "placeholder"])) : w("", !0),
|
|
151
|
+
r("div", ae, [
|
|
152
|
+
(d(!0), x(R, null, q(j.value, (e) => (d(), b(ee, {
|
|
153
|
+
key: e.key,
|
|
154
|
+
filter: e,
|
|
155
|
+
collapsed: !!y.value[e.key],
|
|
156
|
+
"model-value": u.value[e.key],
|
|
157
|
+
onToggle: (m) => I(e.key),
|
|
158
|
+
"onUpdate:modelValue": (m) => N(e.key, m)
|
|
159
|
+
}, null, 8, ["filter", "collapsed", "model-value", "onToggle", "onUpdate:modelValue"]))), 128))
|
|
160
|
+
])
|
|
161
|
+
]),
|
|
162
|
+
l.showActions ? (d(), x("footer", ne, [
|
|
163
|
+
g(c(B), {
|
|
164
|
+
variant: "secondary",
|
|
165
|
+
onClick: U
|
|
166
|
+
}, {
|
|
167
|
+
default: S(() => [
|
|
168
|
+
A(f(l.resetText), 1)
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
}),
|
|
172
|
+
g(c(B), {
|
|
173
|
+
variant: "primary",
|
|
174
|
+
onClick: z
|
|
175
|
+
}, {
|
|
176
|
+
default: S(() => [
|
|
177
|
+
A(f(l.applyText) + f(V.value ? ` (${V.value})` : ""), 1)
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
})
|
|
181
|
+
])) : w("", !0)
|
|
182
|
+
], 2)
|
|
183
|
+
], 8, ["disabled"]));
|
|
178
184
|
}
|
|
179
|
-
}),
|
|
185
|
+
}), fe = /* @__PURE__ */ P(se, [["__scopeId", "data-v-052723b8"]]);
|
|
180
186
|
export {
|
|
181
|
-
|
|
187
|
+
fe as FilterPanel
|
|
182
188
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/phila-ui-filter-panel",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Filter panel for faceted filtering",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@phila/phila-ui-core": "3.0.0-beta.9",
|
|
32
32
|
"@phila/phila-ui-search": "1.2.0-beta.12",
|
|
33
|
-
"@phila/phila-ui-radio": "1.0.0-beta.
|
|
34
|
-
"@phila/phila-ui-checkbox": "1.0.0-beta.
|
|
33
|
+
"@phila/phila-ui-radio": "1.0.0-beta.11",
|
|
34
|
+
"@phila/phila-ui-checkbox": "1.0.0-beta.11",
|
|
35
35
|
"@phila/phila-ui-button": "2.3.0-beta.10"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|