@phila/phila-ui-filter-chip 0.2.0-beta.6 → 1.0.0-beta.7
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/FilterChip.vue.d.ts +4 -3
- package/dist/FilterChip.vue.d.ts.map +1 -1
- package/dist/FilterChipDropdownPanel.vue.d.ts +9 -4
- package/dist/FilterChipDropdownPanel.vue.d.ts.map +1 -1
- package/dist/FilterChipGroup.vue.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +273 -243
- package/package.json +5 -5
package/dist/FilterChip.vue.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FilterChipProps } from './index';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<FilterChipProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
3
|
click: (event: MouseEvent) => any;
|
|
4
|
-
"update:modelValue": (value: string
|
|
4
|
+
"update:modelValue": (value: Record<string, boolean>) => any;
|
|
5
5
|
"update:selected": (value: boolean) => any;
|
|
6
6
|
}, string, import('vue').PublicProps, Readonly<FilterChipProps> & Readonly<{
|
|
7
7
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
8
|
-
"onUpdate:modelValue"?: ((value: string
|
|
8
|
+
"onUpdate:modelValue"?: ((value: Record<string, boolean>) => any) | undefined;
|
|
9
9
|
"onUpdate:selected"?: ((value: boolean) => any) | undefined;
|
|
10
10
|
}>, {
|
|
11
11
|
text: string;
|
|
@@ -17,9 +17,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Fi
|
|
|
17
17
|
label: string;
|
|
18
18
|
choices: import('@phila/phila-ui-core').FilterChoice[];
|
|
19
19
|
multiple: boolean;
|
|
20
|
+
showActions: boolean;
|
|
20
21
|
applyText: string;
|
|
21
22
|
resetText: string;
|
|
22
|
-
modelValue: string
|
|
23
|
+
modelValue: Record<string, boolean>;
|
|
23
24
|
selected: boolean;
|
|
24
25
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
26
|
triggerRef: ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterChip.vue.d.ts","sourceRoot":"","sources":["../src/FilterChip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterChip.vue.d.ts","sourceRoot":"","sources":["../src/FilterChip.vue"],"names":[],"mappings":"AAoMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAgXivO,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA7Ex3O,GAAG;;AA3RjC,wBAoVK;AAaL,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -4,8 +4,10 @@ type __VLS_Props = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
choices: FilterChoice[];
|
|
6
6
|
multiple: boolean;
|
|
7
|
-
/** committed value from the parent */
|
|
8
|
-
value: string
|
|
7
|
+
/** committed value from the parent — a map of choice value → selected */
|
|
8
|
+
value: Record<string, boolean>;
|
|
9
|
+
/** show Reset/Apply (draft + commit); off (default) = live apply */
|
|
10
|
+
showActions?: boolean;
|
|
9
11
|
/** fixed-position coords computed from the trigger rect (desktop popover) */
|
|
10
12
|
top: number;
|
|
11
13
|
left: number;
|
|
@@ -16,13 +18,16 @@ type __VLS_Props = {
|
|
|
16
18
|
};
|
|
17
19
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
20
|
reset: () => any;
|
|
19
|
-
|
|
21
|
+
"update:modelValue": (value: Record<string, boolean>) => any;
|
|
22
|
+
apply: (value: Record<string, boolean>) => any;
|
|
20
23
|
close: () => any;
|
|
21
24
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
25
|
onReset?: (() => any) | undefined;
|
|
23
|
-
|
|
26
|
+
"onUpdate:modelValue"?: ((value: Record<string, boolean>) => any) | undefined;
|
|
27
|
+
onApply?: ((value: Record<string, boolean>) => any) | undefined;
|
|
24
28
|
onClose?: (() => any) | undefined;
|
|
25
29
|
}>, {
|
|
30
|
+
showActions: boolean;
|
|
26
31
|
mobile: boolean;
|
|
27
32
|
applyText: string;
|
|
28
33
|
resetText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterChipDropdownPanel.vue.d.ts","sourceRoot":"","sources":["../src/FilterChipDropdownPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterChipDropdownPanel.vue.d.ts","sourceRoot":"","sources":["../src/FilterChipDropdownPanel.vue"],"names":[],"mappings":"AA2OA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,KAAK,WAAW,GAAG;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,oEAAoE;IACpE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;;;;;;;;;;;;iBARc,OAAO;YAKZ,OAAO;eACJ,MAAM;eACN,MAAM;;AA4QtB,wBASG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterChipGroup.vue.d.ts","sourceRoot":"","sources":["../src/FilterChipGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterChipGroup.vue.d.ts","sourceRoot":"","sources":["../src/FilterChipGroup.vue"],"names":[],"mappings":"AAkRA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,sBAAsB,CAAC;;;;;;;;;;;;;;;;AAuV3E,wBAUG"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.phila-filter-chip[data-v-40c7e692]{display:inline-flex;align-items:center;height:var(--scale-350, 1.75rem);cursor:pointer;border-style:solid;border-radius:var(--border-radius-l);white-space:nowrap;box-sizing:border-box;appearance:none;text-decoration:none;padding:var(--scale-25) var(--scale-75);gap:var(--spacing-xs);border-width:var(--border-width-s)}.phila-filter-chip.is-extra-large[data-v-40c7e692]{height:var(--scale-400, 2rem);padding:var(--scale-75) var(--spacing-xs);gap:var(--spacing-2xs)}.phila-filter-chip.is-large[data-v-40c7e692]{height:var(--scale-400, 2rem);padding:var(--scale-75) var(--spacing-xs)}.phila-filter-chip.is-small[data-v-40c7e692]{height:var(--scale-250, 1.25rem);padding:var(--scale-10) var(--spacing-2xs);gap:var(--spacing-2xs)}.phila-filter-chip.is-icon-only[data-v-40c7e692]{padding-left:var(--spacing-s, .75rem);padding-right:var(--spacing-s, .75rem)}.phila-filter-chip.phila-filter-chip--blue[data-v-40c7e692]{color:var(--Schemes-Inverse-Primary);border-color:var(--Schemes-Inverse-Primary);background:var(--Schemes-Info-Container)}.phila-filter-chip.phila-filter-chip--blue.is-active[data-v-40c7e692]{background:var(--Palettes-Secondary-Secondary-150);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Tertiary-Tertiary-100)}.phila-filter-chip.phila-filter-chip--blue[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Secondary-Secondary-600);color:var(--Palettes-Tertiary-Tertiary-50);border-color:var(--Palettes-Tertiary-Tertiary-100)}.phila-filter-chip.phila-filter-chip--grey[data-v-40c7e692]{color:var(--Palettes-Neutral-Variant-Neutral-Variant-200);border-color:var(--Schemes-Border-low);background:var(--Palettes-Neutral-Neutral-700)}.phila-filter-chip.phila-filter-chip--grey.is-active[data-v-40c7e692]{background:var(--Palettes-Neutral-Neutral-100);color:var(--Schemes-On-Primary);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--grey[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Neutral-Neutral-600);color:var(--Palettes-Neutral-Variant-Neutral-Variant-50);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--green[data-v-40c7e692]{color:var(--Palettes-Success-Success-100);border-color:var(--Palettes-Success-Success-150);background:var(--Palettes-Success-Success-700)}.phila-filter-chip.phila-filter-chip--green.is-active[data-v-40c7e692]{background:var(--Palettes-Success-Success-200);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Success-Success-200)}.phila-filter-chip.phila-filter-chip--green[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Success-Success-600);color:var(--Palettes-Success-Success-100);border-color:var(--Palettes-Success-Success-150)}.phila-filter-chip.phila-filter-chip--red[data-v-40c7e692]{color:var(--Schemes-On-Error-Container);border-color:var(--Schemes-On-Error-Container);background:var(--Schemes-Error-Container)}.phila-filter-chip.phila-filter-chip--red.is-active[data-v-40c7e692]{background:var(--Palettes-Error-Error-250);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Error-Error-150)}.phila-filter-chip.phila-filter-chip--red[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Error-Error-650);color:var(--Palettes-Error-Error-200);border-color:var(--Palettes-Error-Error-150)}.phila-filter-chip.phila-filter-chip--white[data-v-40c7e692]{color:var(--Palettes-Neutral-Variant-Neutral-Variant-200);border-color:var(--Schemes-Border-low);background:var(--Schemes-On-Primary)}.phila-filter-chip.phila-filter-chip--white.is-active[data-v-40c7e692]{background:var(--Palettes-Neutral-Neutral-100);color:var(--Schemes-On-Primary);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--white[data-v-40c7e692]:hover:not(:disabled){background:var(--Schemes-Surface-Container-Lowest);color:var(--Schemes-Inverse-Surface);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--yellow[data-v-40c7e692]{color:var(--Schemes-On-Alert-Container);border-color:var(--Palettes-Alert-Alert-150);background:var(--Palettes-Alert-Alert-700)}.phila-filter-chip.phila-filter-chip--yellow.is-active[data-v-40c7e692]{background:var(--Palettes-Alert-Alert-250);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Alert-Alert-150)}.phila-filter-chip.phila-filter-chip--yellow[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Alert-Alert-550);color:var(--Schemes-On-Alert-Container);border-color:var(--Palettes-Alert-Alert-150)}.phila-filter-chip[data-v-40c7e692]:focus-visible{outline:2px solid currentColor;outline-offset:var(--spacing-2xs)}.phila-filter-chip[data-v-40c7e692] .icon{color:var(--chip-icon-color, currentColor)}.phila-filter-chip[data-v-40c7e692] .icon path{fill:var(--chip-icon-color, currentColor)}.phila-filter-chip-panel{position:fixed;z-index:1000;min-width:12rem;background:var(--Schemes-Background);border:var(--border-width-s) solid var(--Schemes-Border);border-radius:var(--border-radius-s);box-shadow:0 4px 8px #0000001a;padding:var(--spacing-s, .75rem);display:flex;flex-direction:column;gap:var(--spacing-s, .75rem)}.phila-filter-chip-panel__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--spacing-s, .75rem)}.phila-filter-chip-sheet__scrim{position:fixed;inset:0;z-index:1000;background:#0000004d}.phila-filter-chip-sheet{position:fixed;left:0;right:0;bottom:0;z-index:1001;background:var(--Schemes-Background);border-top-left-radius:var(--border-radius-l, 1rem);border-top-right-radius:var(--border-radius-l, 1rem);box-shadow:0 -4px 16px #00000026;padding:var(--spacing-m, 1rem);display:flex;flex-direction:column;gap:var(--spacing-s, .75rem);max-height:80vh;overflow-y:auto}.phila-filter-chip-sheet__header{display:flex;align-items:center;justify-content:space-between}.phila-filter-chip-sheet__title{font-weight:700;font-family:var(--Body-Default-font-body-default-family, "Montserrat", sans-serif)}.phila-filter-chip-sheet__footer{display:flex;gap:var(--spacing-s, .75rem);margin-top:var(--spacing-xs, .5rem)}.phila-filter-chip-sheet__footer>*{flex:1}.phila-filter-chip-sheet__close{background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;padding:0;color:var(--Schemes-On-Surface, inherit)}.phila-filter-chip-sheet .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-chip-panel .phila-filter-chip-panel__reset{background:none;border:none;padding:0;cursor:pointer;color:var(--Schemes-Primary);text-decoration:underline;font-weight:600}.phila-filter-chip-panel .phila-filter-chip-panel__reset:focus-visible{outline:2px solid var(--Schemes-Primary);outline-offset:2px}.phila-filter-chip-group[data-v-
|
|
1
|
+
.phila-filter-chip[data-v-40c7e692]{display:inline-flex;align-items:center;height:var(--scale-350, 1.75rem);cursor:pointer;border-style:solid;border-radius:var(--border-radius-l);white-space:nowrap;box-sizing:border-box;appearance:none;text-decoration:none;padding:var(--scale-25) var(--scale-75);gap:var(--spacing-xs);border-width:var(--border-width-s)}.phila-filter-chip.is-extra-large[data-v-40c7e692]{height:var(--scale-400, 2rem);padding:var(--scale-75) var(--spacing-xs);gap:var(--spacing-2xs)}.phila-filter-chip.is-large[data-v-40c7e692]{height:var(--scale-400, 2rem);padding:var(--scale-75) var(--spacing-xs)}.phila-filter-chip.is-small[data-v-40c7e692]{height:var(--scale-250, 1.25rem);padding:var(--scale-10) var(--spacing-2xs);gap:var(--spacing-2xs)}.phila-filter-chip.is-icon-only[data-v-40c7e692]{padding-left:var(--spacing-s, .75rem);padding-right:var(--spacing-s, .75rem)}.phila-filter-chip.phila-filter-chip--blue[data-v-40c7e692]{color:var(--Schemes-Inverse-Primary);border-color:var(--Schemes-Inverse-Primary);background:var(--Schemes-Info-Container)}.phila-filter-chip.phila-filter-chip--blue.is-active[data-v-40c7e692]{background:var(--Palettes-Secondary-Secondary-150);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Tertiary-Tertiary-100)}.phila-filter-chip.phila-filter-chip--blue[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Secondary-Secondary-600);color:var(--Palettes-Tertiary-Tertiary-50);border-color:var(--Palettes-Tertiary-Tertiary-100)}.phila-filter-chip.phila-filter-chip--grey[data-v-40c7e692]{color:var(--Palettes-Neutral-Variant-Neutral-Variant-200);border-color:var(--Schemes-Border-low);background:var(--Palettes-Neutral-Neutral-700)}.phila-filter-chip.phila-filter-chip--grey.is-active[data-v-40c7e692]{background:var(--Palettes-Neutral-Neutral-100);color:var(--Schemes-On-Primary);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--grey[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Neutral-Neutral-600);color:var(--Palettes-Neutral-Variant-Neutral-Variant-50);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--green[data-v-40c7e692]{color:var(--Palettes-Success-Success-100);border-color:var(--Palettes-Success-Success-150);background:var(--Palettes-Success-Success-700)}.phila-filter-chip.phila-filter-chip--green.is-active[data-v-40c7e692]{background:var(--Palettes-Success-Success-200);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Success-Success-200)}.phila-filter-chip.phila-filter-chip--green[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Success-Success-600);color:var(--Palettes-Success-Success-100);border-color:var(--Palettes-Success-Success-150)}.phila-filter-chip.phila-filter-chip--red[data-v-40c7e692]{color:var(--Schemes-On-Error-Container);border-color:var(--Schemes-On-Error-Container);background:var(--Schemes-Error-Container)}.phila-filter-chip.phila-filter-chip--red.is-active[data-v-40c7e692]{background:var(--Palettes-Error-Error-250);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Error-Error-150)}.phila-filter-chip.phila-filter-chip--red[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Error-Error-650);color:var(--Palettes-Error-Error-200);border-color:var(--Palettes-Error-Error-150)}.phila-filter-chip.phila-filter-chip--white[data-v-40c7e692]{color:var(--Palettes-Neutral-Variant-Neutral-Variant-200);border-color:var(--Schemes-Border-low);background:var(--Schemes-On-Primary)}.phila-filter-chip.phila-filter-chip--white.is-active[data-v-40c7e692]{background:var(--Palettes-Neutral-Neutral-100);color:var(--Schemes-On-Primary);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--white[data-v-40c7e692]:hover:not(:disabled){background:var(--Schemes-Surface-Container-Lowest);color:var(--Schemes-Inverse-Surface);border-color:var(--Schemes-Border-low)}.phila-filter-chip.phila-filter-chip--yellow[data-v-40c7e692]{color:var(--Schemes-On-Alert-Container);border-color:var(--Palettes-Alert-Alert-150);background:var(--Palettes-Alert-Alert-700)}.phila-filter-chip.phila-filter-chip--yellow.is-active[data-v-40c7e692]{background:var(--Palettes-Alert-Alert-250);color:var(--Schemes-On-Primary);border-color:var(--Palettes-Alert-Alert-150)}.phila-filter-chip.phila-filter-chip--yellow[data-v-40c7e692]:hover:not(:disabled){background:var(--Palettes-Alert-Alert-550);color:var(--Schemes-On-Alert-Container);border-color:var(--Palettes-Alert-Alert-150)}.phila-filter-chip[data-v-40c7e692]:focus-visible{outline:2px solid currentColor;outline-offset:var(--spacing-2xs)}.phila-filter-chip[data-v-40c7e692] .icon{color:var(--chip-icon-color, currentColor)}.phila-filter-chip[data-v-40c7e692] .icon path{fill:var(--chip-icon-color, currentColor)}.phila-filter-chip-panel{position:fixed;z-index:1000;min-width:12rem;background:var(--Schemes-Background);border:var(--border-width-s) solid var(--Schemes-Border);border-radius:var(--border-radius-s);box-shadow:0 4px 8px #0000001a;padding:var(--spacing-s, .75rem);display:flex;flex-direction:column;gap:var(--spacing-s, .75rem)}.phila-filter-chip-panel__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--spacing-s, .75rem)}.phila-filter-chip-sheet__scrim{position:fixed;inset:0;z-index:1000;background:#0000004d}.phila-filter-chip-sheet{position:fixed;left:0;right:0;bottom:0;z-index:1001;background:var(--Schemes-Background);border-top-left-radius:var(--border-radius-l, 1rem);border-top-right-radius:var(--border-radius-l, 1rem);box-shadow:0 -4px 16px #00000026;padding:var(--spacing-m, 1rem);display:flex;flex-direction:column;gap:var(--spacing-s, .75rem);max-height:80vh;overflow-y:auto}.phila-filter-chip-sheet__header{display:flex;align-items:center;justify-content:space-between}.phila-filter-chip-sheet__title{font-weight:700;font-family:var(--Body-Default-font-body-default-family, "Montserrat", sans-serif)}.phila-filter-chip-sheet__footer{display:flex;gap:var(--spacing-s, .75rem);margin-top:var(--spacing-xs, .5rem)}.phila-filter-chip-sheet__footer>*{flex:1}.phila-filter-chip-sheet__close{background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;padding:0;color:var(--Schemes-On-Surface, inherit)}.phila-filter-chip-sheet .labels-container,.phila-filter-chip-panel .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-chip-panel .phila-filter-chip-panel__reset{background:none;border:none;padding:0;cursor:pointer;color:var(--Schemes-Primary);text-decoration:underline;font-weight:600}.phila-filter-chip-panel .phila-filter-chip-panel__reset:focus-visible{outline:2px solid var(--Schemes-Primary);outline-offset:2px}.phila-filter-chip-group[data-v-074e8b43]{display:flex;flex-direction:column;gap:var(--spacing-2xs)}.phila-filter-chip-group__viewport[data-v-074e8b43]{position:relative}.phila-filter-chip-group__label[data-v-074e8b43]{padding-inline:var(--spacing-m)}.phila-filter-chip-group__row[data-v-074e8b43]{display:flex;flex-wrap:nowrap;gap:var(--spacing-xs);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;padding-inline:var(--spacing-m)}.phila-filter-chip-group__row[data-v-074e8b43]::-webkit-scrollbar{display:none}.phila-filter-chip-group__arrow[data-v-074e8b43]{position:absolute;top:50%;transform:translateY(-50%);z-index:1;display:none;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border-radius:50%;border:var(--border-width-s) solid var(--Schemes-Border);background:var(--Schemes-Background);color:var(--Schemes-On-Surface);box-shadow:0 6px 8px -2px #00000059;cursor:pointer}.phila-filter-chip-group__arrow--left[data-v-074e8b43]{left:var(--spacing-m)}.phila-filter-chip-group__arrow--right[data-v-074e8b43]{right:var(--spacing-m)}@media(hover:hover)and (pointer:fine){.phila-filter-chip-group__viewport:hover .phila-filter-chip-group__arrow[data-v-074e8b43]{display:flex}}.phila-filter-chip-group.is-elevated[data-v-074e8b43] .phila-filter-chip{box-shadow:0 2px 4px #0003}.phila-filter-chip-group.is-elevated .phila-filter-chip-group__row[data-v-074e8b43]{padding-top:2px;padding-bottom:8px}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,10 @@ export interface FilterChipProps extends BaseProps {
|
|
|
21
21
|
choices?: FilterChoice[];
|
|
22
22
|
/** Dropdown mode: multi (checkbox) vs single (radio). */
|
|
23
23
|
multiple?: boolean;
|
|
24
|
-
/** Dropdown mode: bound value
|
|
25
|
-
modelValue?: string
|
|
24
|
+
/** Dropdown mode: bound value — a map of choice value → selected. */
|
|
25
|
+
modelValue?: Record<string, boolean>;
|
|
26
|
+
/** Dropdown mode: show Reset/Apply buttons (draft + commit). Default false = live apply. */
|
|
27
|
+
showActions?: boolean;
|
|
26
28
|
applyText?: string;
|
|
27
29
|
resetText?: string;
|
|
28
30
|
}
|
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,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErF,uFAAuF;AACvF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErF,uFAAuF;AACvF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,4FAA4F;IAC5F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,+FAA+F;IAC/F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),b=require("@phila/phila-ui-core"),w=require("@phila/phila-ui-core/icons"),F=require("@phila/phila-ui-radio"),L=require("@phila/phila-ui-checkbox"),S=require("@phila/phila-ui-button"),R=["aria-pressed","aria-expanded"],N="xxsmall",O=e.defineComponent({__name:"FilterChipBase",props:{text:{default:void 0},size:{default:"medium"},color:{default:"blue"},icon:{type:[Function,Object],default:void 0},iconColor:{default:void 0},trailingIcon:{type:[Function,Object],default:void 0},iconOnly:{type:Boolean,default:!1},active:{type:Boolean,default:!1},chevron:{type:Boolean,default:!1},ariaPressed:{type:Boolean},ariaExpanded:{type:Boolean}},emits:["click"],setup(l,{expose:u}){const t=l,a=e.ref(null),n=e.computed(()=>b.cn("phila-filter-chip",`phila-filter-chip--${t.color}`,t.size!=="medium"&&`is-${t.size}`,"has-text-body-"+s(t.size),t.active&&"is-active",t.iconOnly&&"is-icon-only"));u({el:a});const s=r=>{switch(r){case"extra-large":return"default";case"large":return"small";default:return"extra-small"}};return(r,h)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:a,type:"button",class:e.normalizeClass(n.value),style:e.normalizeStyle(l.iconColor?{"--chip-icon-color":l.iconColor}:void 0),"aria-pressed":l.ariaPressed,"aria-expanded":l.ariaExpanded,onClick:h[0]||(h[0]=v=>r.$emit("click",v))},[e.createVNode(e.unref(b.ActionContent),{icon:l.icon,size:l.size,inline:"","icon-size":N,"icon-only":l.iconOnly},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.text),1)],!0)]),_:3},8,["icon","size","icon-only"]),l.chevron?(e.openBlock(),e.createBlock(e.unref(b.Icon),{key:0,icon:e.unref(w.IconChevronDown),size:"xxsmall",inline:"",decorative:"",class:"phila-filter-chip__chevron"},null,8,["icon"])):l.trailingIcon?(e.openBlock(),e.createBlock(e.unref(b.Icon),{key:1,icon:l.trailingIcon,size:N,inline:"",decorative:""},null,8,["icon"])):e.createCommentVNode("",!0)],14,R))}}),I=(l,u)=>{const t=l.__vccOpts||l;for(const[a,n]of u)t[a]=n;return t},E=I(O,[["__scopeId","data-v-40c7e692"]]),U=["id","aria-label"],M={key:0,class:"phila-filter-chip-sheet__header"},q={class:"phila-filter-chip-sheet__title"},G={key:3,class:"phila-filter-chip-sheet__footer"},H={key:4,class:"phila-filter-chip-panel__footer"},j=e.defineComponent({__name:"FilterChipDropdownPanel",props:{menuId:{},label:{},choices:{},multiple:{type:Boolean},value:{},top:{},left:{},mobile:{type:Boolean,default:!1},applyText:{default:"Apply"},resetText:{default:"Reset"}},emits:["apply","reset","close"],setup(l,{emit:u}){const t=l,a=u,n=e.ref(typeof t.value=="string"?t.value:""),s=e.ref(Array.isArray(t.value)?[...t.value]:[]);e.watch(()=>t.value,c=>{t.multiple?s.value=Array.isArray(c)?[...c]:[]:n.value=typeof c=="string"?c:""});const r=e.computed(()=>t.choices.map(c=>({text:c.text,value:c.value}))),h=e.computed(()=>t.multiple?s.value.length:n.value?1:0),v=e.computed(()=>h.value>0?`${t.applyText} (${h.value})`:t.applyText),k=()=>{n.value="",s.value=[],a("reset")},d=()=>{a("apply",t.multiple?[...s.value]:n.value)};return(c,m)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.mobile?(e.openBlock(),e.createElementBlock("div",{key:0,class:"phila-filter-chip-sheet__scrim",onClick:m[0]||(m[0]=y=>a("close"))})):e.createCommentVNode("",!0),e.createElementVNode("div",{id:l.menuId,class:e.normalizeClass(l.mobile?"phila-filter-chip-sheet":"phila-filter-chip-panel"),role:"dialog","aria-label":l.label,style:e.normalizeStyle(l.mobile?void 0:{top:l.top+"px",left:l.left+"px"})},[l.mobile?(e.openBlock(),e.createElementBlock("header",M,[e.createElementVNode("span",q,e.toDisplayString(l.label),1),e.createElementVNode("button",{type:"button",class:"phila-filter-chip-sheet__close","aria-label":"Close",onClick:m[1]||(m[1]=y=>a("close"))}," ✕ ")])):e.createCommentVNode("",!0),l.multiple?(e.openBlock(),e.createBlock(e.unref(L.CheckboxGroup),{key:1,"group-label":l.label,choices:r.value,"model-value":s.value,"onUpdate:modelValue":m[2]||(m[2]=y=>s.value=y)},null,8,["group-label","choices","model-value"])):(e.openBlock(),e.createBlock(e.unref(F.RadioGroup),{key:2,"group-label":l.label,choices:r.value,"model-value":n.value,"onUpdate:modelValue":m[3]||(m[3]=y=>n.value=y)},null,8,["group-label","choices","model-value"])),l.mobile?(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(e.unref(S.PhilaButton),{variant:"secondary",text:l.resetText,onClick:k},null,8,["text"]),e.createVNode(e.unref(S.PhilaButton),{variant:"primary",text:v.value,onClick:d},null,8,["text"])])):(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("button",{type:"button",class:"phila-filter-chip-panel__reset has-text-body-small",onClick:k},e.toDisplayString(l.resetText),1),e.createVNode(e.unref(S.PhilaButton),{variant:"primary",size:"small",text:l.applyText,onClick:d},null,8,["text"])]))],14,U)]))}}),$="(max-width: 1064px) and (max-height: 915px)";function W(){const l=e.ref(typeof window<"u"&&window.matchMedia($).matches);let u=null;function t(a){l.value=a.matches}return e.onMounted(()=>{u=window.matchMedia($),l.value=u.matches,u.addEventListener("change",t)}),e.onBeforeUnmount(()=>{u?.removeEventListener("change",t)}),{isMobile:l}}let X=0;const A=e.defineComponent({__name:"FilterChip",props:{label:{default:void 0},text:{default:void 0},size:{default:"medium"},color:{default:"blue"},icon:{type:[Function,Object],default:void 0},iconColor:{default:void 0},trailingIcon:{type:[Function,Object],default:void 0},selected:{type:Boolean,default:!1},choices:{default:void 0},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array,Boolean],default:void 0},applyText:{default:"Apply"},resetText:{default:"Reset"},className:{}},emits:["update:selected","update:modelValue","click"],setup(l,{emit:u}){const t=l,a=u,n=e.computed(()=>Array.isArray(t.choices)),s=e.useSlots(),r=e.computed(()=>!n.value&&!!t.icon&&!t.text&&!t.label&&!s.default);function h(p){a("update:selected",!t.selected),a("click",p)}const v=`phila-filter-chip-${e.useId()}-${++X}`,{isVisible:k,setVisibility:d}=b.useVisibility({id:v,group:"phila-filter-chip",outsideClickHide:!0,escapeKeyHide:!0,showSingle:!0}),c=e.computed(()=>k(v)),{isMobile:m}=W(),y=e.ref(null),B=e.ref(0),x=e.ref(0),z=e.computed(()=>t.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:typeof t.modelValue=="string"?t.modelValue:""),g=e.computed(()=>t.multiple?Array.isArray(t.modelValue)&&t.modelValue.length>0:typeof t.modelValue=="string"&&t.modelValue!==""),i=e.computed(()=>t.multiple&&Array.isArray(t.modelValue)?t.modelValue.length:0),f=e.computed(()=>{const p=t.label??t.text??"";return i.value>0?`${p} (${i.value})`:p});function o(){const p=y.value?.el??null;if(!p)return;const V=p.getBoundingClientRect();B.value=V.bottom+4,x.value=V.left}function C(){c.value&&d(!1)}e.watch(c,p=>{p&&!m.value?window.addEventListener("scroll",C,{capture:!0}):window.removeEventListener("scroll",C,{capture:!0})});function T(){const p=!c.value;p&&!m.value&&o(),d(p)}function P(p){a("update:modelValue",p),d(!1)}function D(){a("update:modelValue",t.multiple?[]:"")}return(p,V)=>n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(E,{ref_key:"triggerRef",ref:y,text:f.value,size:l.size,color:l.color,icon:l.icon,"icon-color":l.iconColor,active:g.value||c.value,chevron:"","aria-expanded":c.value,"data-toggle":`visibility-${v}`,onClick:T},null,8,["text","size","color","icon","icon-color","active","aria-expanded","data-toggle"]),c.value?(e.openBlock(),e.createBlock(j,{key:0,"menu-id":v,label:l.label??l.text??"",choices:l.choices,multiple:l.multiple,value:z.value,top:B.value,left:x.value,mobile:e.unref(m),"apply-text":l.applyText,"reset-text":l.resetText,onApply:P,onReset:D,onClose:V[0]||(V[0]=ee=>e.unref(d)(!1))},null,8,["label","choices","multiple","value","top","left","mobile","apply-text","reset-text"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(E,{key:1,size:l.size,color:l.color,icon:l.icon,"icon-color":l.iconColor,"trailing-icon":l.trailingIcon,"icon-only":r.value,active:l.selected,"aria-pressed":l.selected,onClick:h},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.text),1)])]),_:3},8,["size","color","icon","icon-color","trailing-icon","icon-only","active","aria-pressed"]))}}),K=5;function Q(){const l=e.ref(null),u=e.ref(!1);let t=!1,a=0,n=0,s=!1,r=null;const h=d=>{l.value&&d.pointerType!=="mouse"&&(t=!0,s=!1,a=d.clientX,n=l.value.scrollLeft)},v=d=>{if(!t||!l.value)return;const c=d.clientX-a;!s&&Math.abs(c)>K&&(s=!0,u.value=!0,l.value.setPointerCapture(d.pointerId),r=d.pointerId),s&&(l.value.scrollLeft=n-c)},k=()=>{if(l.value&&r!==null){try{l.value.releasePointerCapture(r)}catch{}r=null}t=!1,s&&setTimeout(()=>u.value=!1,0)};return e.onBeforeUnmount(k),{el:l,suppressClick:u,dragHandlers:{onPointerdown:h,onPointermove:v,onPointerup:k,onPointerleave:k}}}const Y={key:0,class:"phila-filter-chip-group__label has-text-label-default"},J={class:"phila-filter-chip-group__viewport"},Z=e.defineComponent({__name:"FilterChipGroup",props:{filters:{},modelValue:{default:()=>({})},label:{},size:{default:"medium"},color:{default:"blue"},filterButton:{type:Boolean,default:!1},elevated:{type:Boolean,default:!1},className:{}},emits:["update:modelValue","open-filters"],setup(l,{emit:u}){const t=l,a=u,n=e.computed(()=>{let i=0;for(const f of t.filters){if(f.excludeFromCount)continue;const o=t.modelValue[f.key];Array.isArray(o)?i+=o.length:typeof o=="string"?i+=o?1:0:o===!0&&(i+=1)}return i}),s=e.computed(()=>n.value>0?`Filters (${n.value} selected)`:"Filters"),{el:r,suppressClick:h,dragHandlers:v}=Q(),k=e.computed(()=>b.cn("phila-filter-chip-group",t.elevated&&"is-elevated",t.className));function d(i){return Array.isArray(i.choices)}function c(i,f){a("update:modelValue",{...t.modelValue,[i]:f})}function m(i){h.value&&(i.stopPropagation(),i.preventDefault())}const y=e.ref(!1),B=e.ref(!1);function x(){const i=r.value;i&&(y.value=i.scrollLeft>1,B.value=i.scrollLeft+i.clientWidth<i.scrollWidth-1)}function z(i){const f=r.value;f&&f.scrollBy({left:i*f.clientWidth*.8,behavior:"smooth"})}let g=null;return e.onMounted(()=>{e.nextTick(x),r.value&&(g=new ResizeObserver(()=>x()),g.observe(r.value))}),e.onBeforeUnmount(()=>{g?.disconnect(),g=null}),e.watch(()=>t.filters,()=>e.nextTick(x)),(i,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(k.value)},[l.label?(e.openBlock(),e.createElementBlock("span",Y,e.toDisplayString(l.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",J,[y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"phila-filter-chip-group__arrow phila-filter-chip-group__arrow--left","aria-label":"Scroll filters left",onClick:f[0]||(f[0]=o=>z(-1))},[e.createVNode(e.unref(b.Icon),{icon:e.unref(w.IconChevronLeft),size:"xxsmall",inline:"",decorative:""},null,8,["icon"])])):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({ref_key:"el",ref:r,class:"phila-filter-chip-group__row"},e.unref(v),{onClickCapture:m,onScroll:x}),[l.filterButton?(e.openBlock(),e.createBlock(E,{key:0,size:l.size,color:l.color,icon:e.unref(w.IconSliders),text:n.value>0?`(${n.value})`:"","icon-only":n.value===0,active:n.value>0,"aria-label":s.value,onClick:f[1]||(f[1]=o=>a("open-filters"))},null,8,["size","color","icon","text","icon-only","active","aria-label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.filters,o=>(e.openBlock(),e.createBlock(A,{key:o.key,label:o.label,text:o.label,size:l.size,color:l.color,icon:o.icon,"icon-color":o.iconColor,choices:o.choices,multiple:o.multiple,"model-value":d(o)?l.modelValue[o.key]:void 0,selected:!d(o)&&l.modelValue[o.key]===!0,"onUpdate:modelValue":C=>c(o.key,C),"onUpdate:selected":C=>c(o.key,C)},null,8,["label","text","size","color","icon","icon-color","choices","multiple","model-value","selected","onUpdate:modelValue","onUpdate:selected"]))),128))],16),B.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"phila-filter-chip-group__arrow phila-filter-chip-group__arrow--right","aria-label":"Scroll filters right",onClick:f[2]||(f[2]=o=>z(1))},[e.createVNode(e.unref(b.Icon),{icon:e.unref(w.IconChevronRight),size:"xxsmall",inline:"",decorative:""},null,8,["icon"])])):e.createCommentVNode("",!0)])],2))}}),_=I(Z,[["__scopeId","data-v-8e691eda"]]);exports.FilterChip=A;exports.FilterChipGroup=_;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),C=require("@phila/phila-ui-core"),N=require("@phila/phila-ui-core/icons"),U=require("@phila/phila-ui-radio"),L=require("@phila/phila-ui-checkbox"),I=require("@phila/phila-ui-button"),j=["aria-pressed","aria-expanded"],O="xxsmall",R=e.defineComponent({__name:"FilterChipBase",props:{text:{default:void 0},size:{default:"medium"},color:{default:"blue"},icon:{type:[Function,Object],default:void 0},iconColor:{default:void 0},trailingIcon:{type:[Function,Object],default:void 0},iconOnly:{type:Boolean,default:!1},active:{type:Boolean,default:!1},chevron:{type:Boolean,default:!1},ariaPressed:{type:Boolean},ariaExpanded:{type:Boolean}},emits:["click"],setup(t,{expose:s}){const l=t,n=e.ref(null),u=e.computed(()=>C.cn("phila-filter-chip",`phila-filter-chip--${l.color}`,l.size!=="medium"&&`is-${l.size}`,"has-text-body-"+f(l.size),l.active&&"is-active",l.iconOnly&&"is-icon-only"));s({el:n});const f=c=>{switch(c){case"extra-large":return"default";case"large":return"small";default:return"extra-small"}};return(c,y)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:n,type:"button",class:e.normalizeClass(u.value),style:e.normalizeStyle(t.iconColor?{"--chip-icon-color":t.iconColor}:void 0),"aria-pressed":t.ariaPressed,"aria-expanded":t.ariaExpanded,onClick:y[0]||(y[0]=h=>c.$emit("click",h))},[e.createVNode(e.unref(C.ActionContent),{icon:t.icon,size:t.size,inline:"","icon-size":O,"icon-only":t.iconOnly},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)],!0)]),_:3},8,["icon","size","icon-only"]),t.chevron?(e.openBlock(),e.createBlock(e.unref(C.Icon),{key:0,icon:e.unref(N.IconChevronDown),size:"xxsmall",inline:"",decorative:"",class:"phila-filter-chip__chevron"},null,8,["icon"])):t.trailingIcon?(e.openBlock(),e.createBlock(e.unref(C.Icon),{key:1,icon:t.trailingIcon,size:O,inline:"",decorative:""},null,8,["icon"])):e.createCommentVNode("",!0)],14,j))}}),P=(t,s)=>{const l=t.__vccOpts||t;for(const[n,u]of s)l[n]=u;return l},T=P(R,[["__scopeId","data-v-40c7e692"]]),M=["id","aria-label"],q={key:0,class:"phila-filter-chip-sheet__header"},G={class:"phila-filter-chip-sheet__title"},H={key:0,class:"phila-filter-chip-sheet__footer"},W={key:1,class:"phila-filter-chip-panel__footer"},X=e.defineComponent({__name:"FilterChipDropdownPanel",props:{menuId:{},label:{},choices:{},multiple:{type:Boolean},value:{},showActions:{type:Boolean,default:!1},top:{},left:{},mobile:{type:Boolean,default:!1},applyText:{default:"Apply"},resetText:{default:"Reset"}},emits:["update:modelValue","apply","reset","close"],setup(t,{emit:s}){const l=t,n=s;function u(d){return Object.fromEntries(l.choices.map(v=>[v.value,!!d[v.value]]))}const f=e.ref(u(l.value));e.watch(()=>l.value,d=>f.value=u(d));const c=e.computed(()=>l.showActions?f.value:u(l.value)),y=e.computed(()=>Object.values(c.value).filter(Boolean).length),h=e.computed(()=>y.value>0?`${l.applyText} (${y.value})`:l.applyText),k=e.computed(()=>l.choices.map(d=>({text:d.text,value:d.value,tooltip:d.tooltip})));function p(d){l.showActions?f.value=d:n("update:modelValue",d)}const m=()=>{f.value=Object.fromEntries(l.choices.map(d=>[d.value,!1])),n("reset")},x=()=>n("apply",{...f.value});return(d,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.mobile?(e.openBlock(),e.createElementBlock("div",{key:0,class:"phila-filter-chip-sheet__scrim",onClick:v[0]||(v[0]=g=>n("close"))})):e.createCommentVNode("",!0),e.createElementVNode("div",{id:t.menuId,class:e.normalizeClass(t.mobile?"phila-filter-chip-sheet":"phila-filter-chip-panel"),role:"dialog","aria-label":t.label,style:e.normalizeStyle(t.mobile?void 0:{top:t.top+"px",left:t.left+"px"})},[t.mobile?(e.openBlock(),e.createElementBlock("header",q,[e.createElementVNode("span",G,e.toDisplayString(t.label),1),e.createElementVNode("button",{type:"button",class:"phila-filter-chip-sheet__close","aria-label":"Close",onClick:v[1]||(v[1]=g=>n("close"))}," ✕ ")])):e.createCommentVNode("",!0),t.multiple?(e.openBlock(),e.createBlock(e.unref(L.CheckboxGroup),{key:1,"group-label":t.label,choices:k.value,"model-value":c.value,"onUpdate:modelValue":p},null,8,["group-label","choices","model-value"])):(e.openBlock(),e.createBlock(e.unref(U.RadioGroup),{key:2,"group-label":t.label,choices:k.value,"model-value":c.value,"onUpdate:modelValue":p},null,8,["group-label","choices","model-value"])),t.showActions?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.mobile?(e.openBlock(),e.createElementBlock("div",H,[e.createVNode(e.unref(I.PhilaButton),{variant:"secondary",text:t.resetText,onClick:m},null,8,["text"]),e.createVNode(e.unref(I.PhilaButton),{variant:"primary",text:h.value,onClick:x},null,8,["text"])])):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("button",{type:"button",class:"phila-filter-chip-panel__reset has-text-body-small",onClick:m},e.toDisplayString(t.resetText),1),e.createVNode(e.unref(I.PhilaButton),{variant:"primary",size:"small",text:t.applyText,onClick:x},null,8,["text"])]))],64)):e.createCommentVNode("",!0)],14,M)]))}}),F="(max-width: 1064px) and (max-height: 915px)";function K(){const t=e.ref(typeof window<"u"&&window.matchMedia(F).matches);let s=null;function l(n){t.value=n.matches}return e.onMounted(()=>{s=window.matchMedia(F),t.value=s.matches,s.addEventListener("change",l)}),e.onBeforeUnmount(()=>{s?.removeEventListener("change",l)}),{isMobile:t}}let Q=0;const A=e.defineComponent({__name:"FilterChip",props:{label:{default:void 0},text:{default:void 0},size:{default:"medium"},color:{default:"blue"},icon:{type:[Function,Object],default:void 0},iconColor:{default:void 0},trailingIcon:{type:[Function,Object],default:void 0},selected:{type:Boolean,default:!1},choices:{default:void 0},multiple:{type:Boolean,default:!1},modelValue:{default:void 0},showActions:{type:Boolean,default:!1},applyText:{default:"Apply"},resetText:{default:"Reset"},className:{}},emits:["update:selected","update:modelValue","click"],setup(t,{emit:s}){const l=t,n=s,u=e.computed(()=>Array.isArray(l.choices)),f=e.useSlots(),c=e.computed(()=>!u.value&&!!l.icon&&!l.text&&!l.label&&!f.default);function y(i){n("update:selected",!l.selected),n("click",i)}const h=`phila-filter-chip-${e.useId()}-${++Q}`,{isVisible:k,setVisibility:p}=C.useVisibility({id:h,group:"phila-filter-chip",outsideClickHide:!0,escapeKeyHide:!0,showSingle:!0}),m=e.computed(()=>k(h)),{isMobile:x}=K(),d=e.ref(null),v=e.ref(0),g=e.ref(0),B=e.computed(()=>{const i=l.choices??[],V=l.modelValue??{};return Object.fromEntries(i.map($=>[$.value,!!V[$.value]]))}),w=e.computed(()=>Object.values(B.value).filter(Boolean).length),z=e.computed(()=>w.value>0),a=e.computed(()=>{const i=l.label??l.text??"";return w.value>0?`${i} (${w.value})`:i});function r(){const i=d.value?.el??null;if(!i)return;const V=i.getBoundingClientRect();v.value=V.bottom+4,g.value=V.left}function o(){m.value&&p(!1)}e.watch(m,i=>{i&&!x.value?window.addEventListener("scroll",o,{capture:!0}):window.removeEventListener("scroll",o,{capture:!0})});function b(){const i=!m.value;i&&!x.value&&r(),p(i)}function S(i){n("update:modelValue",i)}function E(i){n("update:modelValue",i),p(!1)}function D(){n("update:modelValue",Object.fromEntries((l.choices??[]).map(i=>[i.value,!1])))}return e.onMounted(()=>{u.value&&n("update:modelValue",B.value)}),(i,V)=>u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(T,{ref_key:"triggerRef",ref:d,text:a.value,size:t.size,color:t.color,icon:t.icon,"icon-color":t.iconColor,active:z.value||m.value,chevron:"","aria-expanded":m.value,"data-toggle":`visibility-${h}`,onClick:b},null,8,["text","size","color","icon","icon-color","active","aria-expanded","data-toggle"]),m.value?(e.openBlock(),e.createBlock(X,{key:0,"menu-id":h,label:t.label??t.text??"",choices:t.choices,multiple:t.multiple,value:B.value,"show-actions":t.showActions,top:v.value,left:g.value,mobile:e.unref(x),"apply-text":t.applyText,"reset-text":t.resetText,"onUpdate:modelValue":S,onApply:E,onReset:D,onClose:V[0]||(V[0]=$=>e.unref(p)(!1))},null,8,["label","choices","multiple","value","show-actions","top","left","mobile","apply-text","reset-text"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(T,{key:1,size:t.size,color:t.color,icon:t.icon,"icon-color":t.iconColor,"trailing-icon":t.trailingIcon,"icon-only":c.value,active:t.selected,"aria-pressed":t.selected,onClick:y},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},8,["size","color","icon","icon-color","trailing-icon","icon-only","active","aria-pressed"]))}}),Y=5;function J(){const t=e.ref(null),s=e.ref(!1);let l=!1,n=0,u=0,f=!1,c=null;const y=p=>{t.value&&p.pointerType!=="mouse"&&(l=!0,f=!1,n=p.clientX,u=t.value.scrollLeft)},h=p=>{if(!l||!t.value)return;const m=p.clientX-n;!f&&Math.abs(m)>Y&&(f=!0,s.value=!0,t.value.setPointerCapture(p.pointerId),c=p.pointerId),f&&(t.value.scrollLeft=u-m)},k=()=>{if(t.value&&c!==null){try{t.value.releasePointerCapture(c)}catch{}c=null}l=!1,f&&setTimeout(()=>s.value=!1,0)};return e.onBeforeUnmount(k),{el:t,suppressClick:s,dragHandlers:{onPointerdown:y,onPointermove:h,onPointerup:k,onPointerleave:k}}}const Z={key:0,class:"phila-filter-chip-group__label has-text-label-default"},_={class:"phila-filter-chip-group__viewport"},ee=e.defineComponent({__name:"FilterChipGroup",props:{filters:{},modelValue:{default:()=>({})},label:{},size:{default:"medium"},color:{default:"blue"},filterButton:{type:Boolean,default:!1},elevated:{type:Boolean,default:!1},className:{}},emits:["update:modelValue","open-filters"],setup(t,{emit:s}){const l=t,n=s,u=e.computed(()=>{let a=0;for(const r of l.filters){if(r.excludeFromCount)continue;const o=l.modelValue[r.key];o&&typeof o=="object"?a+=Object.values(o).filter(Boolean).length:o===!0&&(a+=1)}return a}),f=e.computed(()=>u.value>0?`Filters (${u.value} selected)`:"Filters"),{el:c,suppressClick:y,dragHandlers:h}=J(),k=e.computed(()=>C.cn("phila-filter-chip-group",l.elevated&&"is-elevated",l.className));function p(a){return Array.isArray(a.choices)}function m(a){const r={};for(const o of l.filters){const b=a[o.key];if(Array.isArray(o.choices)&&o.choices.length>0){const S=b&&typeof b=="object"?b:{};r[o.key]=Object.fromEntries(o.choices.map(E=>[E.value,!!S[E.value]]))}else r[o.key]=b===!0}return r}function x(a,r){n("update:modelValue",m({...l.modelValue,[a]:r}))}function d(a){y.value&&(a.stopPropagation(),a.preventDefault())}const v=e.ref(!1),g=e.ref(!1);function B(){const a=c.value;a&&(v.value=a.scrollLeft>1,g.value=a.scrollLeft+a.clientWidth<a.scrollWidth-1)}function w(a){const r=c.value;r&&r.scrollBy({left:a*r.clientWidth*.8,behavior:"smooth"})}let z=null;return e.onMounted(()=>{n("update:modelValue",m(l.modelValue)),e.nextTick(B),c.value&&(z=new ResizeObserver(()=>B()),z.observe(c.value))}),e.onBeforeUnmount(()=>{z?.disconnect(),z=null}),e.watch(()=>l.filters,()=>e.nextTick(B)),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(k.value)},[t.label?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_,[v.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"phila-filter-chip-group__arrow phila-filter-chip-group__arrow--left","aria-label":"Scroll filters left",onClick:r[0]||(r[0]=o=>w(-1))},[e.createVNode(e.unref(C.Icon),{icon:e.unref(N.IconChevronLeft),size:"xxsmall",inline:"",decorative:""},null,8,["icon"])])):e.createCommentVNode("",!0),e.createElementVNode("div",e.mergeProps({ref_key:"el",ref:c,class:"phila-filter-chip-group__row"},e.unref(h),{onClickCapture:d,onScroll:B}),[t.filterButton?(e.openBlock(),e.createBlock(T,{key:0,size:t.size,color:t.color,icon:e.unref(N.IconSliders),text:u.value>0?`Filters (${u.value})`:"Filters",active:u.value>0,"aria-label":f.value,onClick:r[1]||(r[1]=o=>n("open-filters"))},null,8,["size","color","icon","text","active","aria-label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.filters,o=>(e.openBlock(),e.createBlock(A,{key:o.key,label:o.label,text:o.label,size:t.size,color:t.color,icon:o.icon,"icon-color":o.iconColor,choices:o.choices,multiple:o.multiple,"show-actions":o.showActions,"model-value":p(o)?t.modelValue[o.key]:void 0,selected:!p(o)&&t.modelValue[o.key]===!0,"onUpdate:modelValue":b=>x(o.key,b),"onUpdate:selected":b=>x(o.key,b)},null,8,["label","text","size","color","icon","icon-color","choices","multiple","show-actions","model-value","selected","onUpdate:modelValue","onUpdate:selected"]))),128))],16),g.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"phila-filter-chip-group__arrow phila-filter-chip-group__arrow--right","aria-label":"Scroll filters right",onClick:r[2]||(r[2]=o=>w(1))},[e.createVNode(e.unref(C.Icon),{icon:e.unref(N.IconChevronRight),size:"xxsmall",inline:"",decorative:""},null,8,["icon"])])):e.createCommentVNode("",!0)])],2))}}),te=P(ee,[["__scopeId","data-v-074e8b43"]]);exports.FilterChip=A;exports.FilterChipGroup=te;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { IconChevronDown as re, IconChevronLeft as
|
|
4
|
-
import { RadioGroup as
|
|
5
|
-
import { CheckboxGroup as
|
|
6
|
-
import { PhilaButton as
|
|
7
|
-
import './index.css';const
|
|
1
|
+
import { defineComponent as j, ref as w, computed as h, createElementBlock as x, openBlock as s, normalizeStyle as Y, normalizeClass as N, createVNode as T, createBlock as B, createCommentVNode as V, unref as p, withCtx as J, renderSlot as Z, createTextVNode as _, toDisplayString as E, watch as G, Teleport as oe, createElementVNode as F, Fragment as H, onMounted as W, onBeforeUnmount as X, useSlots as ie, useId as ae, nextTick as q, mergeProps as ne, renderList as ce } from "vue";
|
|
2
|
+
import { cn as ee, ActionContent as se, Icon as L, useVisibility as ue } from "@phila/phila-ui-core";
|
|
3
|
+
import { IconChevronDown as re, IconChevronLeft as de, IconSliders as fe, IconChevronRight as ve } from "@phila/phila-ui-core/icons";
|
|
4
|
+
import { RadioGroup as pe } from "@phila/phila-ui-radio";
|
|
5
|
+
import { CheckboxGroup as me } from "@phila/phila-ui-checkbox";
|
|
6
|
+
import { PhilaButton as U } from "@phila/phila-ui-button";
|
|
7
|
+
import './index.css';const he = ["aria-pressed", "aria-expanded"], K = "xxsmall", ye = /* @__PURE__ */ j({
|
|
8
8
|
__name: "FilterChipBase",
|
|
9
9
|
props: {
|
|
10
10
|
text: { default: void 0 },
|
|
@@ -20,20 +20,20 @@ import './index.css';const pe = ["aria-pressed", "aria-expanded"], H = "xxsmall"
|
|
|
20
20
|
ariaExpanded: { type: Boolean }
|
|
21
21
|
},
|
|
22
22
|
emits: ["click"],
|
|
23
|
-
setup(e, { expose:
|
|
24
|
-
const l = e,
|
|
25
|
-
() =>
|
|
23
|
+
setup(e, { expose: r }) {
|
|
24
|
+
const l = e, o = w(null), u = h(
|
|
25
|
+
() => ee(
|
|
26
26
|
"phila-filter-chip",
|
|
27
27
|
`phila-filter-chip--${l.color}`,
|
|
28
28
|
l.size !== "medium" && `is-${l.size}`,
|
|
29
|
-
"has-text-body-" +
|
|
29
|
+
"has-text-body-" + f(l.size),
|
|
30
30
|
l.active && "is-active",
|
|
31
31
|
l.iconOnly && "is-icon-only"
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
switch (
|
|
34
|
+
r({ el: o });
|
|
35
|
+
const f = (n) => {
|
|
36
|
+
switch (n) {
|
|
37
37
|
case "extra-large":
|
|
38
38
|
return "default";
|
|
39
39
|
case "large":
|
|
@@ -42,61 +42,61 @@ import './index.css';const pe = ["aria-pressed", "aria-expanded"], H = "xxsmall"
|
|
|
42
42
|
return "extra-small";
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
return (
|
|
45
|
+
return (n, g) => (s(), x("button", {
|
|
46
46
|
ref_key: "rootEl",
|
|
47
|
-
ref:
|
|
47
|
+
ref: o,
|
|
48
48
|
type: "button",
|
|
49
|
-
class:
|
|
50
|
-
style:
|
|
49
|
+
class: N(u.value),
|
|
50
|
+
style: Y(e.iconColor ? { "--chip-icon-color": e.iconColor } : void 0),
|
|
51
51
|
"aria-pressed": e.ariaPressed,
|
|
52
52
|
"aria-expanded": e.ariaExpanded,
|
|
53
|
-
onClick:
|
|
53
|
+
onClick: g[0] || (g[0] = (b) => n.$emit("click", b))
|
|
54
54
|
}, [
|
|
55
|
-
|
|
55
|
+
T(p(se), {
|
|
56
56
|
icon: e.icon,
|
|
57
57
|
size: e.size,
|
|
58
58
|
inline: "",
|
|
59
|
-
"icon-size":
|
|
59
|
+
"icon-size": K,
|
|
60
60
|
"icon-only": e.iconOnly
|
|
61
61
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
default: J(() => [
|
|
63
|
+
Z(n.$slots, "default", {}, () => [
|
|
64
|
+
_(E(e.text), 1)
|
|
65
65
|
], !0)
|
|
66
66
|
]),
|
|
67
67
|
_: 3
|
|
68
68
|
}, 8, ["icon", "size", "icon-only"]),
|
|
69
|
-
e.chevron ? (
|
|
69
|
+
e.chevron ? (s(), B(p(L), {
|
|
70
70
|
key: 0,
|
|
71
|
-
icon:
|
|
71
|
+
icon: p(re),
|
|
72
72
|
size: "xxsmall",
|
|
73
73
|
inline: "",
|
|
74
74
|
decorative: "",
|
|
75
75
|
class: "phila-filter-chip__chevron"
|
|
76
|
-
}, null, 8, ["icon"])) : e.trailingIcon ? (
|
|
76
|
+
}, null, 8, ["icon"])) : e.trailingIcon ? (s(), B(p(L), {
|
|
77
77
|
key: 1,
|
|
78
78
|
icon: e.trailingIcon,
|
|
79
|
-
size:
|
|
79
|
+
size: K,
|
|
80
80
|
inline: "",
|
|
81
81
|
decorative: ""
|
|
82
|
-
}, null, 8, ["icon"])) :
|
|
83
|
-
], 14,
|
|
82
|
+
}, null, 8, ["icon"])) : V("", !0)
|
|
83
|
+
], 14, he));
|
|
84
84
|
}
|
|
85
|
-
}),
|
|
85
|
+
}), le = (e, r) => {
|
|
86
86
|
const l = e.__vccOpts || e;
|
|
87
|
-
for (const [
|
|
88
|
-
l[
|
|
87
|
+
for (const [o, u] of r)
|
|
88
|
+
l[o] = u;
|
|
89
89
|
return l;
|
|
90
|
-
},
|
|
90
|
+
}, M = /* @__PURE__ */ le(ye, [["__scopeId", "data-v-40c7e692"]]), be = ["id", "aria-label"], xe = {
|
|
91
91
|
key: 0,
|
|
92
92
|
class: "phila-filter-chip-sheet__header"
|
|
93
|
-
},
|
|
94
|
-
key:
|
|
93
|
+
}, ge = { class: "phila-filter-chip-sheet__title" }, ke = {
|
|
94
|
+
key: 0,
|
|
95
95
|
class: "phila-filter-chip-sheet__footer"
|
|
96
|
-
},
|
|
97
|
-
key:
|
|
96
|
+
}, Ce = {
|
|
97
|
+
key: 1,
|
|
98
98
|
class: "phila-filter-chip-panel__footer"
|
|
99
|
-
},
|
|
99
|
+
}, we = /* @__PURE__ */ j({
|
|
100
100
|
__name: "FilterChipDropdownPanel",
|
|
101
101
|
props: {
|
|
102
102
|
menuId: {},
|
|
@@ -104,105 +104,112 @@ import './index.css';const pe = ["aria-pressed", "aria-expanded"], H = "xxsmall"
|
|
|
104
104
|
choices: {},
|
|
105
105
|
multiple: { type: Boolean },
|
|
106
106
|
value: {},
|
|
107
|
+
showActions: { type: Boolean, default: !1 },
|
|
107
108
|
top: {},
|
|
108
109
|
left: {},
|
|
109
110
|
mobile: { type: Boolean, default: !1 },
|
|
110
111
|
applyText: { default: "Apply" },
|
|
111
112
|
resetText: { default: "Reset" }
|
|
112
113
|
},
|
|
113
|
-
emits: ["apply", "reset", "close"],
|
|
114
|
-
setup(e, { emit:
|
|
115
|
-
const l = e,
|
|
116
|
-
|
|
114
|
+
emits: ["update:modelValue", "apply", "reset", "close"],
|
|
115
|
+
setup(e, { emit: r }) {
|
|
116
|
+
const l = e, o = r;
|
|
117
|
+
function u(d) {
|
|
118
|
+
return Object.fromEntries(l.choices.map((y) => [y.value, !!d[y.value]]));
|
|
119
|
+
}
|
|
120
|
+
const f = w(u(l.value));
|
|
121
|
+
G(
|
|
117
122
|
() => l.value,
|
|
118
|
-
(
|
|
119
|
-
l.multiple ? s.value = Array.isArray(n) ? [...n] : [] : o.value = typeof n == "string" ? n : "";
|
|
120
|
-
}
|
|
123
|
+
(d) => f.value = u(d)
|
|
121
124
|
);
|
|
122
|
-
const
|
|
123
|
-
() =>
|
|
124
|
-
), k = () => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
const n = h(() => l.showActions ? f.value : u(l.value)), g = h(() => Object.values(n.value).filter(Boolean).length), b = h(
|
|
126
|
+
() => g.value > 0 ? `${l.applyText} (${g.value})` : l.applyText
|
|
127
|
+
), k = h(() => l.choices.map((d) => ({ text: d.text, value: d.value, tooltip: d.tooltip })));
|
|
128
|
+
function v(d) {
|
|
129
|
+
l.showActions ? f.value = d : o("update:modelValue", d);
|
|
130
|
+
}
|
|
131
|
+
const m = () => {
|
|
132
|
+
f.value = Object.fromEntries(l.choices.map((d) => [d.value, !1])), o("reset");
|
|
133
|
+
}, z = () => o("apply", { ...f.value });
|
|
134
|
+
return (d, y) => (s(), B(oe, { to: "body" }, [
|
|
135
|
+
e.mobile ? (s(), x("div", {
|
|
131
136
|
key: 0,
|
|
132
137
|
class: "phila-filter-chip-sheet__scrim",
|
|
133
|
-
onClick:
|
|
134
|
-
})) :
|
|
135
|
-
|
|
138
|
+
onClick: y[0] || (y[0] = (I) => o("close"))
|
|
139
|
+
})) : V("", !0),
|
|
140
|
+
F("div", {
|
|
136
141
|
id: e.menuId,
|
|
137
|
-
class:
|
|
142
|
+
class: N(e.mobile ? "phila-filter-chip-sheet" : "phila-filter-chip-panel"),
|
|
138
143
|
role: "dialog",
|
|
139
144
|
"aria-label": e.label,
|
|
140
|
-
style:
|
|
145
|
+
style: Y(e.mobile ? void 0 : { top: e.top + "px", left: e.left + "px" })
|
|
141
146
|
}, [
|
|
142
|
-
e.mobile ? (
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
e.mobile ? (s(), x("header", xe, [
|
|
148
|
+
F("span", ge, E(e.label), 1),
|
|
149
|
+
F("button", {
|
|
145
150
|
type: "button",
|
|
146
151
|
class: "phila-filter-chip-sheet__close",
|
|
147
152
|
"aria-label": "Close",
|
|
148
|
-
onClick:
|
|
153
|
+
onClick: y[1] || (y[1] = (I) => o("close"))
|
|
149
154
|
}, " ✕ ")
|
|
150
|
-
])) :
|
|
151
|
-
e.multiple ? (
|
|
155
|
+
])) : V("", !0),
|
|
156
|
+
e.multiple ? (s(), B(p(me), {
|
|
152
157
|
key: 1,
|
|
153
158
|
"group-label": e.label,
|
|
154
|
-
choices:
|
|
155
|
-
"model-value":
|
|
156
|
-
"onUpdate:modelValue":
|
|
157
|
-
}, null, 8, ["group-label", "choices", "model-value"])) : (
|
|
159
|
+
choices: k.value,
|
|
160
|
+
"model-value": n.value,
|
|
161
|
+
"onUpdate:modelValue": v
|
|
162
|
+
}, null, 8, ["group-label", "choices", "model-value"])) : (s(), B(p(pe), {
|
|
158
163
|
key: 2,
|
|
159
164
|
"group-label": e.label,
|
|
160
|
-
choices:
|
|
161
|
-
"model-value":
|
|
162
|
-
"onUpdate:modelValue":
|
|
165
|
+
choices: k.value,
|
|
166
|
+
"model-value": n.value,
|
|
167
|
+
"onUpdate:modelValue": v
|
|
163
168
|
}, null, 8, ["group-label", "choices", "model-value"])),
|
|
164
|
-
e.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
169
|
+
e.showActions ? (s(), x(H, { key: 3 }, [
|
|
170
|
+
e.mobile ? (s(), x("div", ke, [
|
|
171
|
+
T(p(U), {
|
|
172
|
+
variant: "secondary",
|
|
173
|
+
text: e.resetText,
|
|
174
|
+
onClick: m
|
|
175
|
+
}, null, 8, ["text"]),
|
|
176
|
+
T(p(U), {
|
|
177
|
+
variant: "primary",
|
|
178
|
+
text: b.value,
|
|
179
|
+
onClick: z
|
|
180
|
+
}, null, 8, ["text"])
|
|
181
|
+
])) : (s(), x("div", Ce, [
|
|
182
|
+
F("button", {
|
|
183
|
+
type: "button",
|
|
184
|
+
class: "phila-filter-chip-panel__reset has-text-body-small",
|
|
185
|
+
onClick: m
|
|
186
|
+
}, E(e.resetText), 1),
|
|
187
|
+
T(p(U), {
|
|
188
|
+
variant: "primary",
|
|
189
|
+
size: "small",
|
|
190
|
+
text: e.applyText,
|
|
191
|
+
onClick: z
|
|
192
|
+
}, null, 8, ["text"])
|
|
193
|
+
]))
|
|
194
|
+
], 64)) : V("", !0)
|
|
195
|
+
], 14, be)
|
|
189
196
|
]));
|
|
190
197
|
}
|
|
191
|
-
}),
|
|
192
|
-
function
|
|
193
|
-
const e =
|
|
194
|
-
let
|
|
195
|
-
function l(
|
|
196
|
-
e.value =
|
|
198
|
+
}), Q = "(max-width: 1064px) and (max-height: 915px)";
|
|
199
|
+
function ze() {
|
|
200
|
+
const e = w(typeof window < "u" && window.matchMedia(Q).matches);
|
|
201
|
+
let r = null;
|
|
202
|
+
function l(o) {
|
|
203
|
+
e.value = o.matches;
|
|
197
204
|
}
|
|
198
|
-
return
|
|
199
|
-
|
|
200
|
-
}),
|
|
201
|
-
|
|
205
|
+
return W(() => {
|
|
206
|
+
r = window.matchMedia(Q), e.value = r.matches, r.addEventListener("change", l);
|
|
207
|
+
}), X(() => {
|
|
208
|
+
r?.removeEventListener("change", l);
|
|
202
209
|
}), { isMobile: e };
|
|
203
210
|
}
|
|
204
211
|
let Ve = 0;
|
|
205
|
-
const
|
|
212
|
+
const Be = /* @__PURE__ */ j({
|
|
206
213
|
__name: "FilterChip",
|
|
207
214
|
props: {
|
|
208
215
|
label: { default: void 0 },
|
|
@@ -215,137 +222,148 @@ const ze = /* @__PURE__ */ D({
|
|
|
215
222
|
selected: { type: Boolean, default: !1 },
|
|
216
223
|
choices: { default: void 0 },
|
|
217
224
|
multiple: { type: Boolean, default: !1 },
|
|
218
|
-
modelValue: {
|
|
225
|
+
modelValue: { default: void 0 },
|
|
226
|
+
showActions: { type: Boolean, default: !1 },
|
|
219
227
|
applyText: { default: "Apply" },
|
|
220
228
|
resetText: { default: "Reset" },
|
|
221
229
|
className: {}
|
|
222
230
|
},
|
|
223
231
|
emits: ["update:selected", "update:modelValue", "click"],
|
|
224
|
-
setup(e, { emit:
|
|
225
|
-
const l = e,
|
|
226
|
-
() => !
|
|
232
|
+
setup(e, { emit: r }) {
|
|
233
|
+
const l = e, o = r, u = h(() => Array.isArray(l.choices)), f = ie(), n = h(
|
|
234
|
+
() => !u.value && !!l.icon && !l.text && !l.label && !f.default
|
|
227
235
|
);
|
|
228
|
-
function
|
|
229
|
-
|
|
236
|
+
function g(a) {
|
|
237
|
+
o("update:selected", !l.selected), o("click", a);
|
|
230
238
|
}
|
|
231
|
-
const
|
|
232
|
-
id:
|
|
239
|
+
const b = `phila-filter-chip-${ae()}-${++Ve}`, { isVisible: k, setVisibility: v } = ue({
|
|
240
|
+
id: b,
|
|
233
241
|
group: "phila-filter-chip",
|
|
234
242
|
outsideClickHide: !0,
|
|
235
243
|
escapeKeyHide: !0,
|
|
236
244
|
showSingle: !0
|
|
237
|
-
}),
|
|
238
|
-
const
|
|
239
|
-
return
|
|
245
|
+
}), m = h(() => k(b)), { isMobile: z } = ze(), d = w(null), y = w(0), I = w(0), $ = h(() => {
|
|
246
|
+
const a = l.choices ?? [], O = l.modelValue ?? {};
|
|
247
|
+
return Object.fromEntries(a.map((R) => [R.value, !!O[R.value]]));
|
|
248
|
+
}), A = h(() => Object.values($.value).filter(Boolean).length), S = h(() => A.value > 0), i = h(() => {
|
|
249
|
+
const a = l.label ?? l.text ?? "";
|
|
250
|
+
return A.value > 0 ? `${a} (${A.value})` : a;
|
|
240
251
|
});
|
|
241
|
-
function
|
|
242
|
-
const
|
|
243
|
-
if (!
|
|
244
|
-
const
|
|
245
|
-
|
|
252
|
+
function c() {
|
|
253
|
+
const a = d.value?.el ?? null;
|
|
254
|
+
if (!a) return;
|
|
255
|
+
const O = a.getBoundingClientRect();
|
|
256
|
+
y.value = O.bottom + 4, I.value = O.left;
|
|
246
257
|
}
|
|
247
|
-
function
|
|
248
|
-
|
|
258
|
+
function t() {
|
|
259
|
+
m.value && v(!1);
|
|
249
260
|
}
|
|
250
|
-
|
|
251
|
-
|
|
261
|
+
G(m, (a) => {
|
|
262
|
+
a && !z.value ? window.addEventListener("scroll", t, { capture: !0 }) : window.removeEventListener("scroll", t, { capture: !0 });
|
|
252
263
|
});
|
|
253
|
-
function
|
|
254
|
-
const
|
|
255
|
-
|
|
264
|
+
function C() {
|
|
265
|
+
const a = !m.value;
|
|
266
|
+
a && !z.value && c(), v(a);
|
|
256
267
|
}
|
|
257
|
-
function
|
|
258
|
-
|
|
268
|
+
function D(a) {
|
|
269
|
+
o("update:modelValue", a);
|
|
259
270
|
}
|
|
260
|
-
function
|
|
261
|
-
|
|
271
|
+
function P(a) {
|
|
272
|
+
o("update:modelValue", a), v(!1);
|
|
262
273
|
}
|
|
263
|
-
|
|
264
|
-
|
|
274
|
+
function te() {
|
|
275
|
+
o("update:modelValue", Object.fromEntries((l.choices ?? []).map((a) => [a.value, !1])));
|
|
276
|
+
}
|
|
277
|
+
return W(() => {
|
|
278
|
+
u.value && o("update:modelValue", $.value);
|
|
279
|
+
}), (a, O) => u.value ? (s(), x(H, { key: 0 }, [
|
|
280
|
+
T(M, {
|
|
265
281
|
ref_key: "triggerRef",
|
|
266
|
-
ref:
|
|
267
|
-
text:
|
|
282
|
+
ref: d,
|
|
283
|
+
text: i.value,
|
|
268
284
|
size: e.size,
|
|
269
285
|
color: e.color,
|
|
270
286
|
icon: e.icon,
|
|
271
287
|
"icon-color": e.iconColor,
|
|
272
|
-
active:
|
|
288
|
+
active: S.value || m.value,
|
|
273
289
|
chevron: "",
|
|
274
|
-
"aria-expanded":
|
|
275
|
-
"data-toggle": `visibility-${
|
|
276
|
-
onClick:
|
|
290
|
+
"aria-expanded": m.value,
|
|
291
|
+
"data-toggle": `visibility-${b}`,
|
|
292
|
+
onClick: C
|
|
277
293
|
}, null, 8, ["text", "size", "color", "icon", "icon-color", "active", "aria-expanded", "data-toggle"]),
|
|
278
|
-
|
|
294
|
+
m.value ? (s(), B(we, {
|
|
279
295
|
key: 0,
|
|
280
|
-
"menu-id":
|
|
296
|
+
"menu-id": b,
|
|
281
297
|
label: e.label ?? e.text ?? "",
|
|
282
298
|
choices: e.choices,
|
|
283
299
|
multiple: e.multiple,
|
|
284
|
-
value:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
300
|
+
value: $.value,
|
|
301
|
+
"show-actions": e.showActions,
|
|
302
|
+
top: y.value,
|
|
303
|
+
left: I.value,
|
|
304
|
+
mobile: p(z),
|
|
288
305
|
"apply-text": e.applyText,
|
|
289
306
|
"reset-text": e.resetText,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
307
|
+
"onUpdate:modelValue": D,
|
|
308
|
+
onApply: P,
|
|
309
|
+
onReset: te,
|
|
310
|
+
onClose: O[0] || (O[0] = (R) => p(v)(!1))
|
|
311
|
+
}, null, 8, ["label", "choices", "multiple", "value", "show-actions", "top", "left", "mobile", "apply-text", "reset-text"])) : V("", !0)
|
|
312
|
+
], 64)) : (s(), B(M, {
|
|
295
313
|
key: 1,
|
|
296
314
|
size: e.size,
|
|
297
315
|
color: e.color,
|
|
298
316
|
icon: e.icon,
|
|
299
317
|
"icon-color": e.iconColor,
|
|
300
318
|
"trailing-icon": e.trailingIcon,
|
|
301
|
-
"icon-only":
|
|
319
|
+
"icon-only": n.value,
|
|
302
320
|
active: e.selected,
|
|
303
321
|
"aria-pressed": e.selected,
|
|
304
|
-
onClick:
|
|
322
|
+
onClick: g
|
|
305
323
|
}, {
|
|
306
|
-
default:
|
|
307
|
-
|
|
308
|
-
|
|
324
|
+
default: J(() => [
|
|
325
|
+
Z(a.$slots, "default", {}, () => [
|
|
326
|
+
_(E(e.text), 1)
|
|
309
327
|
])
|
|
310
328
|
]),
|
|
311
329
|
_: 3
|
|
312
330
|
}, 8, ["size", "color", "icon", "icon-color", "trailing-icon", "icon-only", "active", "aria-pressed"]));
|
|
313
331
|
}
|
|
314
|
-
}),
|
|
315
|
-
function
|
|
316
|
-
const e =
|
|
317
|
-
let l = !1,
|
|
318
|
-
const
|
|
319
|
-
e.value &&
|
|
320
|
-
},
|
|
332
|
+
}), $e = 5;
|
|
333
|
+
function Ie() {
|
|
334
|
+
const e = w(null), r = w(!1);
|
|
335
|
+
let l = !1, o = 0, u = 0, f = !1, n = null;
|
|
336
|
+
const g = (v) => {
|
|
337
|
+
e.value && v.pointerType !== "mouse" && (l = !0, f = !1, o = v.clientX, u = e.value.scrollLeft);
|
|
338
|
+
}, b = (v) => {
|
|
321
339
|
if (!l || !e.value) return;
|
|
322
|
-
const
|
|
323
|
-
!
|
|
340
|
+
const m = v.clientX - o;
|
|
341
|
+
!f && Math.abs(m) > $e && (f = !0, r.value = !0, e.value.setPointerCapture(v.pointerId), n = v.pointerId), f && (e.value.scrollLeft = u - m);
|
|
324
342
|
}, k = () => {
|
|
325
|
-
if (e.value &&
|
|
343
|
+
if (e.value && n !== null) {
|
|
326
344
|
try {
|
|
327
|
-
e.value.releasePointerCapture(
|
|
345
|
+
e.value.releasePointerCapture(n);
|
|
328
346
|
} catch {
|
|
329
347
|
}
|
|
330
|
-
|
|
348
|
+
n = null;
|
|
331
349
|
}
|
|
332
|
-
l = !1,
|
|
350
|
+
l = !1, f && setTimeout(() => r.value = !1, 0);
|
|
333
351
|
};
|
|
334
|
-
return
|
|
352
|
+
return X(k), {
|
|
335
353
|
el: e,
|
|
336
|
-
suppressClick:
|
|
354
|
+
suppressClick: r,
|
|
337
355
|
dragHandlers: {
|
|
338
|
-
onPointerdown:
|
|
339
|
-
onPointermove:
|
|
356
|
+
onPointerdown: g,
|
|
357
|
+
onPointermove: b,
|
|
340
358
|
onPointerup: k,
|
|
341
359
|
onPointerleave: k
|
|
342
360
|
}
|
|
343
361
|
};
|
|
344
362
|
}
|
|
345
|
-
const
|
|
363
|
+
const Oe = {
|
|
346
364
|
key: 0,
|
|
347
365
|
class: "phila-filter-chip-group__label has-text-label-default"
|
|
348
|
-
},
|
|
366
|
+
}, Te = { class: "phila-filter-chip-group__viewport" }, Ae = /* @__PURE__ */ j({
|
|
349
367
|
__name: "FilterChipGroup",
|
|
350
368
|
props: {
|
|
351
369
|
filters: {},
|
|
@@ -358,83 +376,94 @@ const Be = {
|
|
|
358
376
|
className: {}
|
|
359
377
|
},
|
|
360
378
|
emits: ["update:modelValue", "open-filters"],
|
|
361
|
-
setup(e, { emit:
|
|
362
|
-
const l = e,
|
|
379
|
+
setup(e, { emit: r }) {
|
|
380
|
+
const l = e, o = r, u = h(() => {
|
|
363
381
|
let i = 0;
|
|
364
|
-
for (const
|
|
365
|
-
if (
|
|
366
|
-
const t = l.modelValue[
|
|
367
|
-
|
|
382
|
+
for (const c of l.filters) {
|
|
383
|
+
if (c.excludeFromCount) continue;
|
|
384
|
+
const t = l.modelValue[c.key];
|
|
385
|
+
t && typeof t == "object" ? i += Object.values(t).filter(Boolean).length : t === !0 && (i += 1);
|
|
368
386
|
}
|
|
369
387
|
return i;
|
|
370
|
-
}),
|
|
371
|
-
() =>
|
|
372
|
-
), { el:
|
|
373
|
-
function
|
|
388
|
+
}), f = h(
|
|
389
|
+
() => u.value > 0 ? `Filters (${u.value} selected)` : "Filters"
|
|
390
|
+
), { el: n, suppressClick: g, dragHandlers: b } = Ie(), k = h(() => ee("phila-filter-chip-group", l.elevated && "is-elevated", l.className));
|
|
391
|
+
function v(i) {
|
|
374
392
|
return Array.isArray(i.choices);
|
|
375
393
|
}
|
|
376
|
-
function n(i, f) {
|
|
377
|
-
a("update:modelValue", { ...l.modelValue, [i]: f });
|
|
378
|
-
}
|
|
379
394
|
function m(i) {
|
|
380
|
-
|
|
395
|
+
const c = {};
|
|
396
|
+
for (const t of l.filters) {
|
|
397
|
+
const C = i[t.key];
|
|
398
|
+
if (Array.isArray(t.choices) && t.choices.length > 0) {
|
|
399
|
+
const D = C && typeof C == "object" ? C : {};
|
|
400
|
+
c[t.key] = Object.fromEntries(t.choices.map((P) => [P.value, !!D[P.value]]));
|
|
401
|
+
} else
|
|
402
|
+
c[t.key] = C === !0;
|
|
403
|
+
}
|
|
404
|
+
return c;
|
|
405
|
+
}
|
|
406
|
+
function z(i, c) {
|
|
407
|
+
o("update:modelValue", m({ ...l.modelValue, [i]: c }));
|
|
408
|
+
}
|
|
409
|
+
function d(i) {
|
|
410
|
+
g.value && (i.stopPropagation(), i.preventDefault());
|
|
381
411
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
384
|
-
const i =
|
|
385
|
-
i && (
|
|
412
|
+
const y = w(!1), I = w(!1);
|
|
413
|
+
function $() {
|
|
414
|
+
const i = n.value;
|
|
415
|
+
i && (y.value = i.scrollLeft > 1, I.value = i.scrollLeft + i.clientWidth < i.scrollWidth - 1);
|
|
386
416
|
}
|
|
387
|
-
function
|
|
388
|
-
const
|
|
389
|
-
|
|
417
|
+
function A(i) {
|
|
418
|
+
const c = n.value;
|
|
419
|
+
c && c.scrollBy({ left: i * c.clientWidth * 0.8, behavior: "smooth" });
|
|
390
420
|
}
|
|
391
|
-
let
|
|
392
|
-
return
|
|
393
|
-
|
|
394
|
-
}),
|
|
395
|
-
|
|
396
|
-
}),
|
|
421
|
+
let S = null;
|
|
422
|
+
return W(() => {
|
|
423
|
+
o("update:modelValue", m(l.modelValue)), q($), n.value && (S = new ResizeObserver(() => $()), S.observe(n.value));
|
|
424
|
+
}), X(() => {
|
|
425
|
+
S?.disconnect(), S = null;
|
|
426
|
+
}), G(
|
|
397
427
|
() => l.filters,
|
|
398
|
-
() =>
|
|
399
|
-
), (i,
|
|
400
|
-
class:
|
|
428
|
+
() => q($)
|
|
429
|
+
), (i, c) => (s(), x("div", {
|
|
430
|
+
class: N(k.value)
|
|
401
431
|
}, [
|
|
402
|
-
e.label ? (
|
|
403
|
-
|
|
404
|
-
|
|
432
|
+
e.label ? (s(), x("span", Oe, E(e.label), 1)) : V("", !0),
|
|
433
|
+
F("div", Te, [
|
|
434
|
+
y.value ? (s(), x("button", {
|
|
405
435
|
key: 0,
|
|
406
436
|
type: "button",
|
|
407
437
|
class: "phila-filter-chip-group__arrow phila-filter-chip-group__arrow--left",
|
|
408
438
|
"aria-label": "Scroll filters left",
|
|
409
|
-
onClick:
|
|
439
|
+
onClick: c[0] || (c[0] = (t) => A(-1))
|
|
410
440
|
}, [
|
|
411
|
-
|
|
412
|
-
icon:
|
|
441
|
+
T(p(L), {
|
|
442
|
+
icon: p(de),
|
|
413
443
|
size: "xxsmall",
|
|
414
444
|
inline: "",
|
|
415
445
|
decorative: ""
|
|
416
446
|
}, null, 8, ["icon"])
|
|
417
|
-
])) :
|
|
418
|
-
|
|
447
|
+
])) : V("", !0),
|
|
448
|
+
F("div", ne({
|
|
419
449
|
ref_key: "el",
|
|
420
|
-
ref:
|
|
450
|
+
ref: n,
|
|
421
451
|
class: "phila-filter-chip-group__row"
|
|
422
|
-
},
|
|
423
|
-
onClickCapture:
|
|
424
|
-
onScroll:
|
|
452
|
+
}, p(b), {
|
|
453
|
+
onClickCapture: d,
|
|
454
|
+
onScroll: $
|
|
425
455
|
}), [
|
|
426
|
-
e.filterButton ? (
|
|
456
|
+
e.filterButton ? (s(), B(M, {
|
|
427
457
|
key: 0,
|
|
428
458
|
size: e.size,
|
|
429
459
|
color: e.color,
|
|
430
|
-
icon:
|
|
431
|
-
text:
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
"
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
(r(!0), g(Q, null, ae(e.filters, (t) => (r(), V(ze, {
|
|
460
|
+
icon: p(fe),
|
|
461
|
+
text: u.value > 0 ? `Filters (${u.value})` : "Filters",
|
|
462
|
+
active: u.value > 0,
|
|
463
|
+
"aria-label": f.value,
|
|
464
|
+
onClick: c[1] || (c[1] = (t) => o("open-filters"))
|
|
465
|
+
}, null, 8, ["size", "color", "icon", "text", "active", "aria-label"])) : V("", !0),
|
|
466
|
+
(s(!0), x(H, null, ce(e.filters, (t) => (s(), B(Be, {
|
|
438
467
|
key: t.key,
|
|
439
468
|
label: t.label,
|
|
440
469
|
text: t.label,
|
|
@@ -444,31 +473,32 @@ const Be = {
|
|
|
444
473
|
"icon-color": t.iconColor,
|
|
445
474
|
choices: t.choices,
|
|
446
475
|
multiple: t.multiple,
|
|
447
|
-
"
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
"onUpdate:
|
|
451
|
-
|
|
476
|
+
"show-actions": t.showActions,
|
|
477
|
+
"model-value": v(t) ? e.modelValue[t.key] : void 0,
|
|
478
|
+
selected: !v(t) && e.modelValue[t.key] === !0,
|
|
479
|
+
"onUpdate:modelValue": (C) => z(t.key, C),
|
|
480
|
+
"onUpdate:selected": (C) => z(t.key, C)
|
|
481
|
+
}, null, 8, ["label", "text", "size", "color", "icon", "icon-color", "choices", "multiple", "show-actions", "model-value", "selected", "onUpdate:modelValue", "onUpdate:selected"]))), 128))
|
|
452
482
|
], 16),
|
|
453
|
-
|
|
483
|
+
I.value ? (s(), x("button", {
|
|
454
484
|
key: 1,
|
|
455
485
|
type: "button",
|
|
456
486
|
class: "phila-filter-chip-group__arrow phila-filter-chip-group__arrow--right",
|
|
457
487
|
"aria-label": "Scroll filters right",
|
|
458
|
-
onClick:
|
|
488
|
+
onClick: c[2] || (c[2] = (t) => A(1))
|
|
459
489
|
}, [
|
|
460
|
-
|
|
461
|
-
icon:
|
|
490
|
+
T(p(L), {
|
|
491
|
+
icon: p(ve),
|
|
462
492
|
size: "xxsmall",
|
|
463
493
|
inline: "",
|
|
464
494
|
decorative: ""
|
|
465
495
|
}, null, 8, ["icon"])
|
|
466
|
-
])) :
|
|
496
|
+
])) : V("", !0)
|
|
467
497
|
])
|
|
468
498
|
], 2));
|
|
469
499
|
}
|
|
470
|
-
}),
|
|
500
|
+
}), De = /* @__PURE__ */ le(Ae, [["__scopeId", "data-v-074e8b43"]]);
|
|
471
501
|
export {
|
|
472
|
-
|
|
473
|
-
|
|
502
|
+
Be as FilterChip,
|
|
503
|
+
De as FilterChipGroup
|
|
474
504
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phila/phila-ui-filter-chip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Filter chips for faceted filtering",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"vue": "^3.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@phila/phila-ui-core": "3.0.0-beta.
|
|
32
|
-
"@phila/phila-ui-radio": "0.
|
|
33
|
-
"@phila/phila-ui-checkbox": "0.
|
|
34
|
-
"@phila/phila-ui-button": "2.3.0-beta.
|
|
31
|
+
"@phila/phila-ui-core": "3.0.0-beta.9",
|
|
32
|
+
"@phila/phila-ui-radio": "1.0.0-beta.10",
|
|
33
|
+
"@phila/phila-ui-checkbox": "1.0.0-beta.10",
|
|
34
|
+
"@phila/phila-ui-button": "2.3.0-beta.10"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^24.0.0",
|