@gspa/ui 0.1.3 → 0.2.0
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/README.md +35 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js +205 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DZxttvYH.cjs +1 -0
- package/dist/DataTable.css +1 -0
- package/dist/DataTableToolBar.css +1 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-DimMUyA-.js +205 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-mEO-VA6R.cjs +1 -0
- package/dist/Header.css +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-C1OQn24h.cjs +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-CpBoY97r.js +137 -0
- package/dist/Loader.css +1 -0
- package/dist/ReminderConfig.css +1 -0
- package/dist/ReusableForm.css +1 -0
- package/dist/Sidebar.css +1 -0
- package/dist/Toast.css +1 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/Accordion.cjs +1 -0
- package/dist/components/Accordion.js +192 -0
- package/dist/components/AccordionItem.cjs +1 -0
- package/dist/components/AccordionItem.js +109 -0
- package/dist/components/AddReminderModal.cjs +1 -0
- package/dist/components/AddReminderModal.js +107 -0
- package/dist/components/Alert.cjs +1 -0
- package/dist/components/Alert.js +227 -0
- package/dist/components/Avatar.cjs +1 -0
- package/dist/components/Avatar.js +86 -0
- package/dist/components/Badge.cjs +1 -0
- package/dist/components/Badge.js +109 -0
- package/dist/components/Breadcrumb.cjs +1 -0
- package/dist/components/Breadcrumb.js +72 -0
- package/dist/components/Button.cjs +1 -0
- package/dist/components/Button.js +4 -0
- package/dist/components/ButtonGroup.cjs +1 -0
- package/dist/components/ButtonGroup.js +46 -0
- package/dist/components/Calendar.cjs +1 -0
- package/dist/components/Calendar.js +341 -0
- package/dist/components/Card.cjs +1 -0
- package/dist/components/Card.js +316 -0
- package/dist/components/CardBody.cjs +1 -0
- package/dist/components/CardBody.js +34 -0
- package/dist/components/CardContent.cjs +1 -0
- package/dist/components/CardContent.js +17 -0
- package/dist/components/CardFooter.cjs +1 -0
- package/dist/components/CardFooter.js +34 -0
- package/dist/components/CardHeader.cjs +1 -0
- package/dist/components/CardHeader.js +91 -0
- package/dist/components/CardTitle.cjs +1 -0
- package/dist/components/CardTitle.js +17 -0
- package/dist/components/Checkbox.cjs +1 -0
- package/dist/components/Checkbox.js +185 -0
- package/dist/components/CircularProgress.cjs +1 -0
- package/dist/components/CircularProgress.js +141 -0
- package/dist/components/DataTable.cjs +1 -0
- package/dist/components/DataTable.js +863 -0
- package/dist/components/DataTableCell.cjs +1 -0
- package/dist/components/DataTableCell.js +95 -0
- package/dist/components/DataTableFilters.cjs +1 -0
- package/dist/components/DataTableFilters.js +519 -0
- package/dist/components/DataTableHeader.cjs +1 -0
- package/dist/components/DataTableHeader.js +116 -0
- package/dist/components/DataTablePagination.cjs +1 -0
- package/dist/components/DataTablePagination.js +290 -0
- package/dist/components/DataTableRow.cjs +1 -0
- package/dist/components/DataTableRow.js +199 -0
- package/dist/components/DataTableToolBar.cjs +1 -0
- package/dist/components/DataTableToolBar.js +477 -0
- package/dist/components/DatePicker.cjs +1 -0
- package/dist/components/DatePicker.js +401 -0
- package/dist/components/Divider.cjs +1 -0
- package/dist/components/Divider.js +103 -0
- package/dist/components/Dropdown.cjs +1 -0
- package/dist/components/Dropdown.js +104 -0
- package/dist/components/DropdownItem.cjs +1 -0
- package/dist/components/DropdownItem.js +60 -0
- package/dist/components/EventsCalendar.cjs +1 -0
- package/dist/components/EventsCalendar.js +863 -0
- package/dist/components/FileUpload.cjs +1 -0
- package/dist/components/FileUpload.js +195 -0
- package/dist/components/FilterDrawer.cjs +1 -0
- package/dist/components/FilterDrawer.js +412 -0
- package/dist/components/Footer.cjs +1 -0
- package/dist/components/Footer.js +157 -0
- package/dist/components/FormField.cjs +1 -0
- package/dist/components/FormField.js +4 -0
- package/dist/components/Graph.cjs +1 -0
- package/dist/components/Graph.js +164 -0
- package/dist/components/GraphFilters.cjs +1 -0
- package/dist/components/GraphFilters.js +305 -0
- package/dist/components/Header.cjs +1 -0
- package/dist/components/Header.js +674 -0
- package/dist/components/Icon.cjs +1 -0
- package/dist/components/Icon.js +58 -0
- package/dist/components/Image.cjs +1 -0
- package/dist/components/Image.js +112 -0
- package/dist/components/Input.cjs +1 -0
- package/dist/components/Input.js +4 -0
- package/dist/components/InputGroup.cjs +1 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.cjs +1 -0
- package/dist/components/Label.js +46 -0
- package/dist/components/Link.cjs +1 -0
- package/dist/components/Link.js +119 -0
- package/dist/components/ListItem.cjs +1 -0
- package/dist/components/ListItem.js +89 -0
- package/dist/components/Loader.cjs +1 -0
- package/dist/components/Loader.js +154 -0
- package/dist/components/Logo.cjs +1 -0
- package/dist/components/Logo.js +67 -0
- package/dist/components/MenuItem.cjs +1 -0
- package/dist/components/MenuItem.js +66 -0
- package/dist/components/Modal.cjs +1 -0
- package/dist/components/Modal.js +110 -0
- package/dist/components/ModalBody.cjs +1 -0
- package/dist/components/ModalBody.js +33 -0
- package/dist/components/ModalFooter.cjs +1 -0
- package/dist/components/ModalFooter.js +33 -0
- package/dist/components/ModalHeader.cjs +1 -0
- package/dist/components/ModalHeader.js +24 -0
- package/dist/components/MultiSelect.cjs +1 -0
- package/dist/components/MultiSelect.js +211 -0
- package/dist/components/Notification.cjs +1 -0
- package/dist/components/Notification.js +121 -0
- package/dist/components/Option.cjs +1 -0
- package/dist/components/Option.js +44 -0
- package/dist/components/Progress.cjs +1 -0
- package/dist/components/Progress.js +77 -0
- package/dist/components/ProgressBar.cjs +1 -0
- package/dist/components/ProgressBar.js +101 -0
- package/dist/components/Radio.cjs +1 -0
- package/dist/components/Radio.js +81 -0
- package/dist/components/RailNav.cjs +1 -0
- package/dist/components/RailNav.js +124 -0
- package/dist/components/ReminderConfig.cjs +1 -0
- package/dist/components/ReminderConfig.js +375 -0
- package/dist/components/ReusableForm.cjs +1 -0
- package/dist/components/ReusableForm.js +686 -0
- package/dist/components/ReusableFormModal.cjs +1 -0
- package/dist/components/ReusableFormModal.js +112 -0
- package/dist/components/RightDrawer.cjs +1 -0
- package/dist/components/RightDrawer.js +143 -0
- package/dist/components/Search.cjs +1 -0
- package/dist/components/Search.js +252 -0
- package/dist/components/Select.cjs +1 -0
- package/dist/components/Select.js +243 -0
- package/dist/components/Sidebar.cjs +1 -0
- package/dist/components/Sidebar.js +372 -0
- package/dist/components/Slider.cjs +1 -0
- package/dist/components/Slider.js +42 -0
- package/dist/components/Spinner.cjs +1 -0
- package/dist/components/Spinner.js +87 -0
- package/dist/components/Stepper.cjs +1 -0
- package/dist/components/Stepper.js +12 -0
- package/dist/components/StepperItem.cjs +1 -0
- package/dist/components/StepperItem.js +33 -0
- package/dist/components/Switch.cjs +1 -0
- package/dist/components/Switch.js +112 -0
- package/dist/components/Tab.cjs +1 -0
- package/dist/components/Tab.js +134 -0
- package/dist/components/TabPanel.cjs +1 -0
- package/dist/components/TabPanel.js +49 -0
- package/dist/components/Text.cjs +1 -0
- package/dist/components/Text.js +84 -0
- package/dist/components/Textarea.cjs +1 -0
- package/dist/components/Textarea.js +102 -0
- package/dist/components/ThemeConfigurator.cjs +1 -0
- package/dist/components/ThemeConfigurator.js +73 -0
- package/dist/components/Timeline.cjs +1 -0
- package/dist/components/Timeline.js +24 -0
- package/dist/components/TimelineItem.cjs +1 -0
- package/dist/components/TimelineItem.js +63 -0
- package/dist/components/Toast.cjs +1 -0
- package/dist/components/Toast.js +231 -0
- package/dist/components/Tooltip.cjs +1 -0
- package/dist/components/Tooltip.js +124 -0
- package/dist/components/Typography.cjs +1 -0
- package/dist/components/Typography.js +267 -0
- package/dist/components/charts/BarChart.cjs +1 -0
- package/dist/components/charts/BarChart.js +323 -0
- package/dist/components/charts/LineChart.cjs +1 -0
- package/dist/components/charts/LineChart.js +322 -0
- package/dist/components/charts/PieChart.cjs +1 -0
- package/dist/components/charts/PieChart.js +311 -0
- package/dist/components/charts/StackedBarChart.cjs +1 -0
- package/dist/components/charts/StackedBarChart.js +348 -0
- package/dist/components/widgets/DashboardWidget.cjs +1 -0
- package/dist/components/widgets/DashboardWidget.js +309 -0
- package/dist/directives/tooltip.cjs +47 -0
- package/dist/directives/tooltip.js +115 -0
- package/dist/gspa-ui.css +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.esm.js +315 -19546
- package/dist/layouts/AuthLayout.cjs +1 -0
- package/dist/layouts/AuthLayout.js +188 -0
- package/dist/layouts/DashboardLayout.cjs +1 -0
- package/dist/layouts/DashboardLayout.js +244 -0
- package/dist/layouts/DefaultLayout.cjs +1 -0
- package/dist/layouts/DefaultLayout.js +94 -0
- package/dist/layouts/ErrorLayout.cjs +1 -0
- package/dist/layouts/ErrorLayout.js +452 -0
- package/dist/lib/auth.cjs +1 -0
- package/dist/lib/auth.js +4 -0
- package/dist/lib/form-field.cjs +1 -0
- package/dist/lib/form-field.js +4 -0
- package/dist/lib/icon.cjs +1 -0
- package/dist/lib/icon.js +4 -0
- package/dist/lib/theme.cjs +1 -0
- package/dist/lib/theme.js +145 -0
- package/dist/lib/toast.cjs +1 -0
- package/dist/lib/toast.js +81 -0
- package/dist/src/components/Alert.vue.d.ts.map +1 -1
- package/dist/src/components/Button.vue.d.ts +127 -29
- package/dist/src/components/Button.vue.d.ts.map +1 -1
- package/dist/src/components/Checkbox.vue.d.ts +2 -2
- package/dist/src/components/DataTable.vue.d.ts +1 -1
- package/dist/src/components/FormField.vue.d.ts +106 -38
- package/dist/src/components/FormField.vue.d.ts.map +1 -1
- package/dist/src/components/Icon.vue.d.ts.map +1 -1
- package/dist/src/components/Input.vue.d.ts +137 -33
- package/dist/src/components/Input.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableFormModal.vue.d.ts +1 -1
- package/dist/src/components/Textarea.vue.d.ts +2 -2
- package/dist/src/index.d.ts +9 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/layouts/AuthLayout.vue.d.ts +2 -0
- package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
- package/dist/src/lib/form-field.d.ts +2 -0
- package/dist/src/lib/form-field.d.ts.map +1 -0
- package/dist/src/lib/icon.d.ts +2 -0
- package/dist/src/lib/icon.d.ts.map +1 -0
- package/dist/src/lib/theme.d.ts +4 -0
- package/dist/src/lib/theme.d.ts.map +1 -1
- package/dist/src/types.d.ts +44 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/styles/auth-layout.css +1 -0
- package/dist/styles/button.css +1 -0
- package/dist/styles/form-field.css +1 -0
- package/dist/styles/input.css +1 -0
- package/dist/styles/tokens.css +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.js +7 -0
- package/package.json +45 -8
- package/dist/index.js +0 -605
- package/dist/src/__tests__/Alert.spec.d.ts +0 -2
- package/dist/src/__tests__/Alert.spec.d.ts.map +0 -1
- package/dist/src/__tests__/App.spec.d.ts +0 -2
- package/dist/src/__tests__/App.spec.d.ts.map +0 -1
- package/dist/src/__tests__/AuthLayout.spec.d.ts +0 -2
- package/dist/src/__tests__/AuthLayout.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Badge.spec.d.ts +0 -2
- package/dist/src/__tests__/Badge.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Button.spec.d.ts +0 -2
- package/dist/src/__tests__/Button.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Card.spec.d.ts +0 -2
- package/dist/src/__tests__/Card.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Checkbox.spec.d.ts +0 -2
- package/dist/src/__tests__/Checkbox.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Dropdown.spec.d.ts +0 -2
- package/dist/src/__tests__/Dropdown.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Input.spec.d.ts +0 -2
- package/dist/src/__tests__/Input.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Modal.spec.d.ts +0 -2
- package/dist/src/__tests__/Modal.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Radio.spec.d.ts +0 -2
- package/dist/src/__tests__/Radio.spec.d.ts.map +0 -1
- package/dist/src/__tests__/ReusableForm.spec.d.ts +0 -2
- package/dist/src/__tests__/ReusableForm.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Tabs.spec.d.ts +0 -2
- package/dist/src/__tests__/Tabs.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("class-variance-authority"),z=require("../utils/cn.cjs"),m=require("./Icon.cjs"),C=require("./CircularProgress.cjs"),M={class:"ui-surface-strong w-full"},T=["multiple","accept"],q={class:"ui-surface-strong flex items-center justify-center px-4 py-3"},j={class:"rounded-full p-2 mr-3"},O={class:"flex flex-col"},U={class:"text-xs ui-text"},$={key:0,class:"ml-2"},A={key:1,class:"mt-4 space-y-2"},L={class:"flex items-center space-x-3"},P={class:"flex flex-col"},G={class:"text-sm font-medium ui-text"},K={class:"flex items-center space-x-3"},W={class:"ui-success-soft rounded-md p-2"},H={class:"flex flex-col"},J={class:"text-sm font-medium ui-text"},Q={class:"text-xs ui-text"},R=["onClick"],X={__name:"FileUpload",props:{multiple:Boolean,accept:String,maxSize:Number,maxFiles:Number,variant:{type:String,default:"dashed",validator:l=>["default","dashed"].includes(l)}},emits:["files-selected","file-removed"],setup(l,{emit:x}){const a=l,u=x,s=e.ref([]),i=e.ref(!1),p=e.ref(null),c=e.ref([]),y=F.cva("border-2 border-dashed rounded-xl cursor-pointer transition-all duration-300 ease-in-out shadow-sm",{variants:{variant:{default:"ui-border-strong hover:border-(--ui-border-strong) hover:bg-(--ui-surface) focus-within:ring-2 focus-within:ring-(--ui-primary)",dashed:"border-(--ui-primary-soft) hover:border-(--ui-primary-soft) hover:bg-(--ui-primary-soft) focus-within:ring-2 focus-within:ring-(--ui-primary)"}}}),_=e.computed(()=>z.cn(y({variant:a.variant}),{"border-(--ui-success) ui-success-soft shadow-md":s.value.length>0&&!i.value,"border-(--ui-primary) ui-primary-soft ring-4 ring-(--ui-primary) shadow-lg":i.value,"border-(--ui-success) ui-success-soft ring-4 ring-(--ui-success) shadow-lg":s.value.length>0&&i.value})),k=r=>{r.preventDefault(),i.value=!1;const o=Array.from(r.dataTransfer.files);f(o)},N=r=>{r.preventDefault()},b=r=>{r.preventDefault(),i.value=!0},V=r=>{r.preventDefault(),i.value=!1},E=()=>{p.value?.click()},w=r=>{const o=Array.from(r.target.files);f(o)},f=r=>{const o=r.filter(t=>!(a.maxSize&&t.size>a.maxSize));if(o.length===0)return;if(a.maxFiles){const t=s.value.length+c.value.length;if(t>=a.maxFiles)return;const d=a.maxFiles-t;o.splice(d)}const n=o.map(t=>e.reactive({file:t,progress:0,uploading:!0}));c.value.push(...n),n.forEach(t=>{const d=2e3+Math.random()*2e3,h=50,D=100/(d/h),S=setInterval(()=>{t.progress+=D,t.progress>=100&&(t.progress=100,t.uploading=!1,clearInterval(S),setTimeout(()=>{a.multiple?(s.value.push(t.file),u("files-selected",s.value)):(s.value=[t.file],u("files-selected",t.file)),c.value.splice(c.value.indexOf(t),1)},450))},h)})},B=r=>{s.value.splice(r,1),a.multiple?u("file-removed",s.value):u("file-removed",s.value.length>0?s.value[0]:null)},g=r=>{if(r===0)return"0 Bytes";const o=1024,n=["Bytes","KB","MB","GB"],t=Math.floor(Math.log(r)/Math.log(o));return parseFloat((r/Math.pow(o,t)).toFixed(2))+" "+n[t]},v=r=>r<40?{row:"border-red-500 bg-red-50",text:"text-red-700"}:r<80?{row:"border-orange-500 bg-orange-50",text:"text-orange-700"}:{row:"border-green-500 bg-green-50",text:"text-green-700"};return(r,o)=>(e.openBlock(),e.createElementBlock("div",M,[!s.value.length||l.multiple?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(_.value),onDrop:k,onDragover:N,onDragenter:b,onDragleave:V,onClick:E},[e.createElementVNode("input",{ref_key:"fileInput",ref:p,type:"file",multiple:l.multiple,accept:l.accept,class:"hidden",onChange:w},null,40,T),e.createElementVNode("div",q,[e.createElementVNode("div",j,[e.createVNode(m.default,{icon:"upload",class:"h-6 w-6 ui-text"})]),e.createElementVNode("div",O,[o[0]||(o[0]=e.createElementVNode("p",{class:"text-sm font-medium ui-text"},[e.createElementVNode("span",{class:"ui-primary font-semibold"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),e.createElementVNode("p",U,[e.createTextVNode(e.toDisplayString(l.maxSize?`Up to ${g(l.maxSize)}`:"No size limit")+" ",1),l.accept?(e.openBlock(),e.createElementBlock("span",$,"• "+e.toDisplayString(l.accept),1)):e.createCommentVNode("",!0)])])])],34)):e.createCommentVNode("",!0),s.value.length>0||c.value.length>0?(e.openBlock(),e.createElementBlock("div",A,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(n,t)=>(e.openBlock(),e.createElementBlock("div",{key:`uploading-${t}`,class:e.normalizeClass(["flex items-center justify-between p-3 border rounded-lg shadow-sm transition-colors duration-300",v(n.progress).row])},[e.createElementVNode("div",L,[e.createVNode(C.default,{value:n.progress,max:100,size:"sm","dynamic-color":!0,class:"shrink-0"},null,8,["value"]),e.createElementVNode("div",P,[e.createElementVNode("span",G,e.toDisplayString(n.file.name),1),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-medium",v(n.progress).text])}," Uploading... "+e.toDisplayString(Math.round(n.progress))+"% ",3)])])],2))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,t)=>(e.openBlock(),e.createElementBlock("div",{key:`uploaded-${t}`,class:"flex items-center justify-between p-3 ui-surface border ui-border-strong rounded-lg shadow-sm hover:shadow-md transition-shadow"},[e.createElementVNode("div",K,[e.createElementVNode("div",W,[e.createVNode(m.default,{icon:"file",class:"h-5 w-5 ui-text"})]),e.createElementVNode("div",H,[e.createElementVNode("span",J,e.toDisplayString(n.name),1),e.createElementVNode("span",Q,e.toDisplayString(g(n.size)),1)])]),e.createElementVNode("button",{class:"ui-text hover:text-(--ui-danger) hover:bg-(--ui-danger-soft) rounded-full p-1 transition-colors",onClick:d=>B(t)},[e.createVNode(m.default,{icon:"x",class:"h-4 w-4"})],8,R)]))),128))])):e.createCommentVNode("",!0)]))}};exports.default=X;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ref as v, computed as L, createElementBlock as l, openBlock as u, createCommentVNode as h, normalizeClass as x, createElementVNode as s, createVNode as g, createTextVNode as z, toDisplayString as f, Fragment as D, renderList as S, reactive as G } from "vue";
|
|
2
|
+
import { cva as K } from "class-variance-authority";
|
|
3
|
+
import { cn as P } from "../utils/cn.js";
|
|
4
|
+
import _ from "./Icon.js";
|
|
5
|
+
import W from "./CircularProgress.js";
|
|
6
|
+
const q = { class: "ui-surface-strong w-full" }, H = ["multiple", "accept"], J = { class: "ui-surface-strong flex items-center justify-center px-4 py-3" }, Q = { class: "rounded-full p-2 mr-3" }, R = { class: "flex flex-col" }, X = { class: "text-xs ui-text" }, Y = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "ml-2"
|
|
9
|
+
}, Z = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "mt-4 space-y-2"
|
|
12
|
+
}, I = { class: "flex items-center space-x-3" }, ee = { class: "flex flex-col" }, te = { class: "text-sm font-medium ui-text" }, se = { class: "flex items-center space-x-3" }, re = { class: "ui-success-soft rounded-md p-2" }, oe = { class: "flex flex-col" }, ie = { class: "text-sm font-medium ui-text" }, ae = { class: "text-xs ui-text" }, ne = ["onClick"], me = {
|
|
13
|
+
__name: "FileUpload",
|
|
14
|
+
props: {
|
|
15
|
+
multiple: Boolean,
|
|
16
|
+
accept: String,
|
|
17
|
+
maxSize: Number,
|
|
18
|
+
// in bytes
|
|
19
|
+
maxFiles: Number,
|
|
20
|
+
// maximum number of files
|
|
21
|
+
variant: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "dashed",
|
|
24
|
+
validator: (a) => ["default", "dashed"].includes(a)
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["files-selected", "file-removed"],
|
|
28
|
+
setup(a, { emit: C }) {
|
|
29
|
+
const n = a, p = C, r = v([]), c = v(!1), b = v(null), d = v([]), B = K(
|
|
30
|
+
"border-2 border-dashed rounded-xl cursor-pointer transition-all duration-300 ease-in-out shadow-sm",
|
|
31
|
+
{
|
|
32
|
+
variants: {
|
|
33
|
+
variant: {
|
|
34
|
+
default: "ui-border-strong hover:border-(--ui-border-strong) hover:bg-(--ui-surface) focus-within:ring-2 focus-within:ring-(--ui-primary)",
|
|
35
|
+
dashed: "border-(--ui-primary-soft) hover:border-(--ui-primary-soft) hover:bg-(--ui-primary-soft) focus-within:ring-2 focus-within:ring-(--ui-primary)"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
), M = L(
|
|
40
|
+
() => P(
|
|
41
|
+
B({ variant: n.variant }),
|
|
42
|
+
{
|
|
43
|
+
"border-(--ui-success) ui-success-soft shadow-md": r.value.length > 0 && !c.value,
|
|
44
|
+
"border-(--ui-primary) ui-primary-soft ring-4 ring-(--ui-primary) shadow-lg": c.value,
|
|
45
|
+
"border-(--ui-success) ui-success-soft ring-4 ring-(--ui-success) shadow-lg": r.value.length > 0 && c.value
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
), N = (t) => {
|
|
49
|
+
t.preventDefault(), c.value = !1;
|
|
50
|
+
const o = Array.from(t.dataTransfer.files);
|
|
51
|
+
y(o);
|
|
52
|
+
}, $ = (t) => {
|
|
53
|
+
t.preventDefault();
|
|
54
|
+
}, T = (t) => {
|
|
55
|
+
t.preventDefault(), c.value = !0;
|
|
56
|
+
}, V = (t) => {
|
|
57
|
+
t.preventDefault(), c.value = !1;
|
|
58
|
+
}, E = () => {
|
|
59
|
+
b.value?.click();
|
|
60
|
+
}, U = (t) => {
|
|
61
|
+
const o = Array.from(t.target.files);
|
|
62
|
+
y(o);
|
|
63
|
+
}, y = (t) => {
|
|
64
|
+
const o = t.filter((e) => !(n.maxSize && e.size > n.maxSize));
|
|
65
|
+
if (o.length === 0) return;
|
|
66
|
+
if (n.maxFiles) {
|
|
67
|
+
const e = r.value.length + d.value.length;
|
|
68
|
+
if (e >= n.maxFiles)
|
|
69
|
+
return;
|
|
70
|
+
const m = n.maxFiles - e;
|
|
71
|
+
o.splice(m);
|
|
72
|
+
}
|
|
73
|
+
const i = o.map((e) => G({
|
|
74
|
+
file: e,
|
|
75
|
+
progress: 0,
|
|
76
|
+
uploading: !0
|
|
77
|
+
}));
|
|
78
|
+
d.value.push(...i), i.forEach((e) => {
|
|
79
|
+
const m = 2e3 + Math.random() * 2e3, k = 50, O = 100 / (m / k), A = setInterval(() => {
|
|
80
|
+
e.progress += O, e.progress >= 100 && (e.progress = 100, e.uploading = !1, clearInterval(A), setTimeout(() => {
|
|
81
|
+
n.multiple ? (r.value.push(e.file), p("files-selected", r.value)) : (r.value = [e.file], p("files-selected", e.file)), d.value.splice(d.value.indexOf(e), 1);
|
|
82
|
+
}, 450));
|
|
83
|
+
}, k);
|
|
84
|
+
});
|
|
85
|
+
}, j = (t) => {
|
|
86
|
+
r.value.splice(t, 1), n.multiple ? p("file-removed", r.value) : p("file-removed", r.value.length > 0 ? r.value[0] : null);
|
|
87
|
+
}, w = (t) => {
|
|
88
|
+
if (t === 0) return "0 Bytes";
|
|
89
|
+
const o = 1024, i = ["Bytes", "KB", "MB", "GB"], e = Math.floor(Math.log(t) / Math.log(o));
|
|
90
|
+
return parseFloat((t / Math.pow(o, e)).toFixed(2)) + " " + i[e];
|
|
91
|
+
}, F = (t) => t < 40 ? {
|
|
92
|
+
row: "border-red-500 bg-red-50",
|
|
93
|
+
text: "text-red-700"
|
|
94
|
+
} : t < 80 ? {
|
|
95
|
+
row: "border-orange-500 bg-orange-50",
|
|
96
|
+
text: "text-orange-700"
|
|
97
|
+
} : {
|
|
98
|
+
row: "border-green-500 bg-green-50",
|
|
99
|
+
text: "text-green-700"
|
|
100
|
+
};
|
|
101
|
+
return (t, o) => (u(), l("div", q, [
|
|
102
|
+
!r.value.length || a.multiple ? (u(), l("div", {
|
|
103
|
+
key: 0,
|
|
104
|
+
class: x(M.value),
|
|
105
|
+
onDrop: N,
|
|
106
|
+
onDragover: $,
|
|
107
|
+
onDragenter: T,
|
|
108
|
+
onDragleave: V,
|
|
109
|
+
onClick: E
|
|
110
|
+
}, [
|
|
111
|
+
s("input", {
|
|
112
|
+
ref_key: "fileInput",
|
|
113
|
+
ref: b,
|
|
114
|
+
type: "file",
|
|
115
|
+
multiple: a.multiple,
|
|
116
|
+
accept: a.accept,
|
|
117
|
+
class: "hidden",
|
|
118
|
+
onChange: U
|
|
119
|
+
}, null, 40, H),
|
|
120
|
+
s("div", J, [
|
|
121
|
+
s("div", Q, [
|
|
122
|
+
g(_, {
|
|
123
|
+
icon: "upload",
|
|
124
|
+
class: "h-6 w-6 ui-text"
|
|
125
|
+
})
|
|
126
|
+
]),
|
|
127
|
+
s("div", R, [
|
|
128
|
+
o[0] || (o[0] = s("p", { class: "text-sm font-medium ui-text" }, [
|
|
129
|
+
s("span", { class: "ui-primary font-semibold" }, "Click to upload"),
|
|
130
|
+
z(" or drag and drop ")
|
|
131
|
+
], -1)),
|
|
132
|
+
s("p", X, [
|
|
133
|
+
z(f(a.maxSize ? `Up to ${w(a.maxSize)}` : "No size limit") + " ", 1),
|
|
134
|
+
a.accept ? (u(), l("span", Y, "• " + f(a.accept), 1)) : h("", !0)
|
|
135
|
+
])
|
|
136
|
+
])
|
|
137
|
+
])
|
|
138
|
+
], 34)) : h("", !0),
|
|
139
|
+
r.value.length > 0 || d.value.length > 0 ? (u(), l("div", Z, [
|
|
140
|
+
(u(!0), l(D, null, S(d.value, (i, e) => (u(), l("div", {
|
|
141
|
+
key: `uploading-${e}`,
|
|
142
|
+
class: x([
|
|
143
|
+
"flex items-center justify-between p-3 border rounded-lg shadow-sm transition-colors duration-300",
|
|
144
|
+
F(i.progress).row
|
|
145
|
+
])
|
|
146
|
+
}, [
|
|
147
|
+
s("div", I, [
|
|
148
|
+
g(W, {
|
|
149
|
+
value: i.progress,
|
|
150
|
+
max: 100,
|
|
151
|
+
size: "sm",
|
|
152
|
+
"dynamic-color": !0,
|
|
153
|
+
class: "shrink-0"
|
|
154
|
+
}, null, 8, ["value"]),
|
|
155
|
+
s("div", ee, [
|
|
156
|
+
s("span", te, f(i.file.name), 1),
|
|
157
|
+
s("span", {
|
|
158
|
+
class: x(["text-xs font-medium", F(i.progress).text])
|
|
159
|
+
}, " Uploading... " + f(Math.round(i.progress)) + "% ", 3)
|
|
160
|
+
])
|
|
161
|
+
])
|
|
162
|
+
], 2))), 128)),
|
|
163
|
+
(u(!0), l(D, null, S(r.value, (i, e) => (u(), l("div", {
|
|
164
|
+
key: `uploaded-${e}`,
|
|
165
|
+
class: "flex items-center justify-between p-3 ui-surface border ui-border-strong rounded-lg shadow-sm hover:shadow-md transition-shadow"
|
|
166
|
+
}, [
|
|
167
|
+
s("div", se, [
|
|
168
|
+
s("div", re, [
|
|
169
|
+
g(_, {
|
|
170
|
+
icon: "file",
|
|
171
|
+
class: "h-5 w-5 ui-text"
|
|
172
|
+
})
|
|
173
|
+
]),
|
|
174
|
+
s("div", oe, [
|
|
175
|
+
s("span", ie, f(i.name), 1),
|
|
176
|
+
s("span", ae, f(w(i.size)), 1)
|
|
177
|
+
])
|
|
178
|
+
]),
|
|
179
|
+
s("button", {
|
|
180
|
+
class: "ui-text hover:text-(--ui-danger) hover:bg-(--ui-danger-soft) rounded-full p-1 transition-colors",
|
|
181
|
+
onClick: (m) => j(e)
|
|
182
|
+
}, [
|
|
183
|
+
g(_, {
|
|
184
|
+
icon: "x",
|
|
185
|
+
class: "h-4 w-4"
|
|
186
|
+
})
|
|
187
|
+
], 8, ne)
|
|
188
|
+
]))), 128))
|
|
189
|
+
])) : h("", !0)
|
|
190
|
+
]));
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
export {
|
|
194
|
+
me as default
|
|
195
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("./Icon.cjs"),P={key:0,class:"fixed inset-0 z-[70]"},Y={class:"absolute right-0 top-0 h-full w-full sm:w-[520px] ui-surface border-l ui-border-strong shadow-2xl flex flex-col"},G={class:"px-2 py-2 border-b ui-border-strong"},H={class:"flex items-center gap-3 ui-text"},J={class:"flex-1 overflow-auto"},Q=["onClick"],W={class:"text-base ui-text font-medium flex items-center gap-1"},X={key:0,class:"inline-flex items-center justify-center min-w-5 h-5 rounded-full text-xs ui-primary-bg text-white px-1"},Z={class:"flex items-center gap-2"},ee=["onClick"],te={key:0,class:"ui-surface-muted px-4 pb-3"},le={class:"flex items-center gap-2 py-2"},oe={class:"text-sm font-semibold ui-text"},ne=["value"],re={key:0,class:"flex items-center gap-2 border-b border-(--ui-primary) pb-1.5 mb-2"},ae={key:1,class:"space-y-2"},se=["checked","onChange"],ue={class:"grid grid-cols-2 gap-1.5"},ce=["onClick"],ie={key:2,class:"space-y-2"},de={key:0,class:"grid grid-cols-2 gap-2"},pe=["value","step","placeholder","onInput"],me=["value","step","placeholder","onInput"],ve=["value","type","step","placeholder","onInput"],ye={key:3,class:"space-y-2"},ke={key:0,class:"flex flex-wrap gap-1.5"},be=["onClick"],xe=["onClick"],ge={class:"space-y-1.5 max-h-56 overflow-auto"},he=["checked","onChange"],fe={key:4,class:"space-y-1.5 max-h-56 overflow-auto"},Ve=["checked","onChange"],Ee={class:"px-5 py-4 border-t ui-border-strong"},_e={class:"flex gap-6 text-sm mb-4 ui-text"},Ne=["checked"],we=["checked"],Be={class:"flex gap-3"},Ce={__name:"FilterDrawer",props:{open:{type:Boolean,default:!1},fields:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({logic:"all",rules:[]})}},emits:["close","update:modelValue","apply"],setup(N,{emit:$}){const v=N,y=$,h=e.ref(""),k=e.ref(""),u=e.ref("equals"),b=e.ref(""),i=e.ref(""),d=e.ref(""),c=e.ref("all"),r=e.ref([]);e.watch(()=>v.modelValue,l=>{c.value=l?.logic||"all",r.value=Array.isArray(l?.rules)?[...l.rules]:[]},{immediate:!0,deep:!0});const D=e.computed(()=>{const l=h.value.trim().toLowerCase();return l?v.fields.filter(o=>String(o.label).toLowerCase().includes(l)):v.fields}),f=l=>r.value.filter(o=>o.field===l).length,w=l=>{r.value=r.value.filter(o=>o.field!==l)},p=l=>r.value.find(o=>o.field===l),x=l=>{const o=p(l);return o?Array.isArray(o.value)?o.value:o.value==null?[]:[o.value]:[]},F=(l,o)=>{const t=(l.options||[]).find(n=>String(n.value)===String(o));return t?t.label:o},M=[{value:"equals",label:"Is"},{value:"not_equals",label:"Is not"},{value:"contains",label:"Contains"}],O=[{value:"equals",label:"Is"},{value:"not_equals",label:"Is not"},{value:"gte",label:"At least"},{value:"lte",label:"At most"},{value:"between",label:"Between"}],V=l=>l.type==="number"||l.type==="text"?!0:!["date","multiselect","multi","select"].includes(l.type)&&!(l.options||[]).length,L=l=>l.type==="date"?!0:!V(l),A=l=>l.type==="number"?O:M,E=l=>{const o=[{value:"today",label:"Today"},{value:"yesterday",label:"Yesterday"},{value:"overdue",label:"Overdue"},{value:"today_overdue",label:"Today + Overdue"}],t=Array.isArray(l.options)&&l.options.length>0?l.options:l.type==="date"?o:[],n=b.value.trim().toLowerCase();return n?t.filter(a=>String(a.label).toLowerCase().includes(n)):t},I=l=>{const o=k.value===l?"":l;k.value=o,b.value="";const t=p(l);u.value=t?.operator||"equals"},B=l=>{c.value=l},C=(l,o)=>r.value.some(t=>t.field===l&&String(t.value)===String(o)),R=(l,o)=>x(l).map(String).includes(String(o)),T=(l,o)=>{const t=x(l.key),a=t.map(String).includes(String(o))?t.filter(s=>String(s)!==String(o)):[...t,o];r.value=r.value.filter(s=>s.field!==l.key),a.length>0&&r.value.push({id:`${l.key}-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,field:l.key,label:l.label,operator:"in",value:a})},_=(l,o)=>{const t=r.value.findIndex(n=>n.field===l.key&&String(n.value)===String(o));if(t>=0){r.value.splice(t,1);return}r.value.push({id:`${l.key}-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,field:l.key,label:l.label,operator:u.value,value:o})},q=l=>{const o=p(l);return!o||o.operator==="between"?"":o.value??""},j=(l,o)=>{const t=l.type==="number"?o.trim():o;r.value=r.value.filter(n=>n.field!==l.key),t!==""&&r.value.push({id:`${l.key}-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,field:l.key,label:l.label,operator:u.value,value:t})},g=(l,o)=>{const t=p(l);return!t||t.operator!=="between"||typeof t.value!="object"||t.value===null?"":t.value[o]??""},S=(l,o,t)=>{const n={from:g(l.key,"from"),to:g(l.key,"to")};n[o]=t.trim(),r.value=r.value.filter(a=>a.field!==l.key),!(!n.from&&!n.to)&&r.value.push({id:`${l.key}-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,field:l.key,label:l.label,operator:"between",value:n})};e.watch(u,l=>{const o=k.value;if(!o)return;const t=v.fields.find(s=>s.key===o);if(!t||!V(t))return;const n=p(o);if(!n)return;if(r.value=r.value.filter(s=>s.field!==o),l==="between"&&t.type==="number"){const s=typeof n.value=="object"&&n.value!==null?{from:n.value.from??"",to:n.value.to??""}:{from:n.value??"",to:""};if(!s.from&&!s.to)return;r.value.push({...n,operator:"between",value:s});return}const a=typeof n.value=="object"&&n.value!==null?n.value.from??n.value.to??"":n.value;a!==""&&r.value.push({...n,operator:l,value:a})});const U=l=>{!i.value&&!d.value||(r.value=r.value.filter(o=>o.field!==l.key),r.value.push({id:`${l.key}-${Date.now()}`,field:l.key,label:l.label,operator:"between",value:{from:i.value,to:d.value}}))},z=()=>{const l={logic:c.value,rules:r.value};y("update:modelValue",l),y("apply",l),y("close")},K=()=>{r.value=[],c.value="all",i.value="",d.value="",y("update:modelValue",{logic:"all",rules:[]})};return(l,o)=>N.open?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",{class:"absolute inset-0 bg-black/35",onClick:o[0]||(o[0]=t=>l.$emit("close"))}),e.createElementVNode("aside",Y,[e.createElementVNode("div",{class:"px-4 py-3 flex items-center justify-between border-b ui-border-strong"},[o[9]||(o[9]=e.createElementVNode("h2",{class:"text-xl font-semibold ui-text"},"Filter",-1)),e.createElementVNode("button",{class:"ui-primary font-semibold",onClick:K},"Reset")]),e.createElementVNode("div",G,[e.createElementVNode("div",H,[e.createVNode(m.default,{icon:"search",class:"w-4 h-4 ui-primary"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=t=>h.value=t),placeholder:"Filter Search",class:"w-full bg-transparent outline-none text-base placeholder:ui-text"},null,512),[[e.vModelText,h.value]])])]),e.createElementVNode("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.key,class:"border-b ui-border-strong"},[e.createElementVNode("button",{class:"w-full px-4 py-2.5 flex items-center justify-between text-left hover:bg-(--ui-surface-muted)",onClick:n=>I(t.key)},[e.createElementVNode("span",W,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),f(t.key)>0?(e.openBlock(),e.createElementBlock("span",X,e.toDisplayString(f(t.key)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Z,[f(t.key)>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"h-5 min-w-7 px-1 rounded-full border ui-border-strong inline-flex items-center justify-center ui-text/80 hover:ui-primary hover:border-(--ui-primary)",onClick:e.withModifiers(n=>w(t.key),["stop"]),title:"Clear filter"},[e.createVNode(m.default,{icon:"xmark",class:"w-2.5 h-2.5"})],8,ee)):e.createCommentVNode("",!0),e.createVNode(m.default,{icon:"chevron-right",class:"w-4 h-4 ui-primary"})])],8,Q),k.value===t.key?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",le,[e.createElementVNode("span",oe,e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":o[2]||(o[2]=n=>u.value=n),class:"ml-auto rounded-md ui-surface border ui-border-strong px-3 py-2 text-sm ui-text"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A(t),n=>(e.openBlock(),e.createElementBlock("option",{key:n.value,value:n.value},e.toDisplayString(n.label),9,ne))),128))],512),[[e.vModelSelect,u.value]])]),L(t)?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(m.default,{icon:"search",class:"w-4 h-4 ui-primary"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[3]||(o[3]=n=>b.value=n),placeholder:"Search",class:"w-full bg-transparent outline-none text-sm ui-text"},null,512),[[e.vModelText,b.value]])])):e.createCommentVNode("",!0),t.type==="date"?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(t),n=>(e.openBlock(),e.createElementBlock("label",{key:String(n.value),class:"flex items-center gap-2 text-sm ui-text cursor-pointer py-0.5"},[e.createElementVNode("input",{type:"checkbox",checked:C(t.key,n.value),onChange:a=>_(t,n.value)},null,40,se),e.createElementVNode("span",null,e.toDisplayString(n.label),1)]))),128)),e.createElementVNode("div",ue,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[4]||(o[4]=n=>i.value=n),type:"date",class:"w-full ui-surface border ui-border-strong rounded-md px-2 py-1 text-sm ui-text"},null,512),[[e.vModelText,i.value]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[5]||(o[5]=n=>d.value=n),type:"date",class:"w-full ui-surface border ui-border-strong rounded-md px-2 py-1 text-sm ui-text"},null,512),[[e.vModelText,d.value]])]),e.createElementVNode("button",{class:"px-3 py-1.5 rounded-md ui-primary-bg text-white text-sm",onClick:n=>U(t)},"Apply Date Range",8,ce)])):V(t)?(e.openBlock(),e.createElementBlock("div",ie,[u.value==="between"&&t.type==="number"?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("input",{value:g(t.key,"from"),type:"number",step:t.step||"any",placeholder:t.minLabel||"Min",class:"w-full ui-surface border ui-border-strong rounded-md px-3 py-2 text-sm ui-text",onInput:n=>S(t,"from",n.target.value)},null,40,pe),e.createElementVNode("input",{value:g(t.key,"to"),type:"number",step:t.step||"any",placeholder:t.maxLabel||"Max",class:"w-full ui-surface border ui-border-strong rounded-md px-3 py-2 text-sm ui-text",onInput:n=>S(t,"to",n.target.value)},null,40,me)])):(e.openBlock(),e.createElementBlock("input",{key:1,value:q(t.key),type:t.type==="number"?"number":"text",step:t.type==="number"?t.step||"any":void 0,placeholder:t.placeholder||`Enter ${t.label}`,class:"w-full ui-surface border ui-border-strong rounded-md px-3 py-2 text-sm ui-text",onInput:n=>j(t,n.target.value)},null,40,ve))])):t.type==="multiselect"||t.type==="select"&&t.multiple?(e.openBlock(),e.createElementBlock("div",ye,[x(t.key).length>0?(e.openBlock(),e.createElementBlock("div",ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x(t.key),n=>(e.openBlock(),e.createElementBlock("span",{key:`${t.key}-${n}`,class:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs border ui-border-strong ui-text"},[e.createTextVNode(e.toDisplayString(F(t,n))+" ",1),e.createElementVNode("button",{class:"ui-text-soft hover:ui-primary",onClick:a=>_(t,n)},[e.createVNode(m.default,{icon:"xmark",class:"w-3 h-3"})],8,be)]))),128)),e.createElementVNode("button",{class:"text-xs ui-primary hover:underline ml-1",onClick:n=>w(t.key)}," Clear all ",8,xe)])):e.createCommentVNode("",!0),e.createElementVNode("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(t),n=>(e.openBlock(),e.createElementBlock("label",{key:String(n.value),class:"flex items-center gap-2 text-sm ui-text cursor-pointer py-0.5"},[e.createElementVNode("input",{type:"checkbox",checked:R(t.key,n.value),onChange:a=>T(t,n.value)},null,40,he),e.createElementVNode("span",null,e.toDisplayString(n.label),1)]))),128))])])):(e.openBlock(),e.createElementBlock("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(t),n=>(e.openBlock(),e.createElementBlock("label",{key:String(n.value),class:"flex items-center gap-2 text-sm ui-text cursor-pointer py-0.5"},[e.createElementVNode("input",{type:"checkbox",checked:C(t.key,n.value),onChange:a=>_(t,n.value)},null,40,Ve),e.createElementVNode("span",null,e.toDisplayString(n.label),1)]))),128))]))])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",Ee,[e.createElementVNode("div",_e,[e.createElementVNode("button",{class:"flex items-center gap-2",onClick:o[6]||(o[6]=t=>B("any"))},[e.createElementVNode("input",{type:"checkbox",checked:c.value==="any",class:"accent-(--ui-primary)"},null,8,Ne),o[10]||(o[10]=e.createTextVNode(" Any of these ",-1))]),e.createElementVNode("button",{class:"flex items-center gap-2",onClick:o[7]||(o[7]=t=>B("all"))},[e.createElementVNode("input",{type:"checkbox",checked:c.value==="all",class:"accent-(--ui-primary)"},null,8,we),o[11]||(o[11]=e.createTextVNode(" All of these ",-1))])]),e.createElementVNode("div",Be,[e.createElementVNode("button",{class:"px-5 py-2 rounded-lg ui-primary-bg text-white text-sm",onClick:z},"Find"),e.createElementVNode("button",{class:"px-5 py-2 rounded-lg border border-(--ui-primary) ui-primary text-sm",onClick:o[8]||(o[8]=t=>l.$emit("close"))},"Cancel")])])])])):e.createCommentVNode("",!0)}};exports.default=Ce;
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { ref as c, watch as N, computed as se, createElementBlock as o, createCommentVNode as y, openBlock as a, createElementVNode as n, createVNode as k, withDirectives as f, vModelText as D, Fragment as m, renderList as b, createTextVNode as F, toDisplayString as p, withModifiers as ne, vModelSelect as re } from "vue";
|
|
2
|
+
import _ from "./Icon.js";
|
|
3
|
+
const oe = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "fixed inset-0 z-[70]"
|
|
6
|
+
}, ae = { class: "absolute right-0 top-0 h-full w-full sm:w-[520px] ui-surface border-l ui-border-strong shadow-2xl flex flex-col" }, ue = { class: "px-2 py-2 border-b ui-border-strong" }, ie = { class: "flex items-center gap-3 ui-text" }, ce = { class: "flex-1 overflow-auto" }, pe = ["onClick"], de = { class: "text-base ui-text font-medium flex items-center gap-1" }, ve = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "inline-flex items-center justify-center min-w-5 h-5 rounded-full text-xs ui-primary-bg text-white px-1"
|
|
9
|
+
}, ye = { class: "flex items-center gap-2" }, me = ["onClick"], be = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "ui-surface-muted px-4 pb-3"
|
|
12
|
+
}, xe = { class: "flex items-center gap-2 py-2" }, ge = { class: "text-sm font-semibold ui-text" }, he = ["value"], ke = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "flex items-center gap-2 border-b border-(--ui-primary) pb-1.5 mb-2"
|
|
15
|
+
}, fe = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "space-y-2"
|
|
18
|
+
}, _e = ["checked", "onChange"], we = { class: "grid grid-cols-2 gap-1.5" }, Ce = ["onClick"], $e = {
|
|
19
|
+
key: 2,
|
|
20
|
+
class: "space-y-2"
|
|
21
|
+
}, Se = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "grid grid-cols-2 gap-2"
|
|
24
|
+
}, Ve = ["value", "step", "placeholder", "onInput"], Oe = ["value", "step", "placeholder", "onInput"], De = ["value", "type", "step", "placeholder", "onInput"], Fe = {
|
|
25
|
+
key: 3,
|
|
26
|
+
class: "space-y-2"
|
|
27
|
+
}, Ae = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "flex flex-wrap gap-1.5"
|
|
30
|
+
}, Re = ["onClick"], Ie = ["onClick"], Me = { class: "space-y-1.5 max-h-56 overflow-auto" }, Le = ["checked", "onChange"], je = {
|
|
31
|
+
key: 4,
|
|
32
|
+
class: "space-y-1.5 max-h-56 overflow-auto"
|
|
33
|
+
}, qe = ["checked", "onChange"], Te = { class: "px-5 py-4 border-t ui-border-strong" }, Ue = { class: "flex gap-6 text-sm mb-4 ui-text" }, Be = ["checked"], Ne = ["checked"], Ee = { class: "flex gap-3" }, Ye = {
|
|
34
|
+
__name: "FilterDrawer",
|
|
35
|
+
props: {
|
|
36
|
+
open: { type: Boolean, default: !1 },
|
|
37
|
+
fields: { type: Array, default: () => [] },
|
|
38
|
+
modelValue: { type: Object, default: () => ({ logic: "all", rules: [] }) }
|
|
39
|
+
},
|
|
40
|
+
emits: ["close", "update:modelValue", "apply"],
|
|
41
|
+
setup(j, { emit: E }) {
|
|
42
|
+
const w = j, C = E, A = c(""), $ = c(""), d = c("equals"), S = c(""), x = c(""), g = c(""), v = c("all"), r = c([]);
|
|
43
|
+
N(() => w.modelValue, (t) => {
|
|
44
|
+
v.value = t?.logic || "all", r.value = Array.isArray(t?.rules) ? [...t.rules] : [];
|
|
45
|
+
}, { immediate: !0, deep: !0 });
|
|
46
|
+
const z = se(() => {
|
|
47
|
+
const t = A.value.trim().toLowerCase();
|
|
48
|
+
return t ? w.fields.filter((l) => String(l.label).toLowerCase().includes(t)) : w.fields;
|
|
49
|
+
}), R = (t) => r.value.filter((l) => l.field === t).length, q = (t) => {
|
|
50
|
+
r.value = r.value.filter((l) => l.field !== t);
|
|
51
|
+
}, h = (t) => r.value.find((l) => l.field === t), V = (t) => {
|
|
52
|
+
const l = h(t);
|
|
53
|
+
return l ? Array.isArray(l.value) ? l.value : l.value == null ? [] : [l.value] : [];
|
|
54
|
+
}, K = (t, l) => {
|
|
55
|
+
const e = (t.options || []).find((s) => String(s.value) === String(l));
|
|
56
|
+
return e ? e.label : l;
|
|
57
|
+
}, Y = [
|
|
58
|
+
{ value: "equals", label: "Is" },
|
|
59
|
+
{ value: "not_equals", label: "Is not" },
|
|
60
|
+
{ value: "contains", label: "Contains" }
|
|
61
|
+
], G = [
|
|
62
|
+
{ value: "equals", label: "Is" },
|
|
63
|
+
{ value: "not_equals", label: "Is not" },
|
|
64
|
+
{ value: "gte", label: "At least" },
|
|
65
|
+
{ value: "lte", label: "At most" },
|
|
66
|
+
{ value: "between", label: "Between" }
|
|
67
|
+
], I = (t) => t.type === "number" || t.type === "text" ? !0 : !["date", "multiselect", "multi", "select"].includes(t.type) && !(t.options || []).length, H = (t) => t.type === "date" ? !0 : !I(t), J = (t) => t.type === "number" ? G : Y, M = (t) => {
|
|
68
|
+
const l = [
|
|
69
|
+
{ value: "today", label: "Today" },
|
|
70
|
+
{ value: "yesterday", label: "Yesterday" },
|
|
71
|
+
{ value: "overdue", label: "Overdue" },
|
|
72
|
+
{ value: "today_overdue", label: "Today + Overdue" }
|
|
73
|
+
], e = Array.isArray(t.options) && t.options.length > 0 ? t.options : t.type === "date" ? l : [], s = S.value.trim().toLowerCase();
|
|
74
|
+
return s ? e.filter((u) => String(u.label).toLowerCase().includes(s)) : e;
|
|
75
|
+
}, P = (t) => {
|
|
76
|
+
const l = $.value === t ? "" : t;
|
|
77
|
+
$.value = l, S.value = "";
|
|
78
|
+
const e = h(t);
|
|
79
|
+
d.value = e?.operator || "equals";
|
|
80
|
+
}, T = (t) => {
|
|
81
|
+
v.value = t;
|
|
82
|
+
}, U = (t, l) => r.value.some((e) => e.field === t && String(e.value) === String(l)), Q = (t, l) => V(t).map(String).includes(String(l)), W = (t, l) => {
|
|
83
|
+
const e = V(t.key), u = e.map(String).includes(String(l)) ? e.filter((i) => String(i) !== String(l)) : [...e, l];
|
|
84
|
+
r.value = r.value.filter((i) => i.field !== t.key), u.length > 0 && r.value.push({
|
|
85
|
+
id: `${t.key}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
86
|
+
field: t.key,
|
|
87
|
+
label: t.label,
|
|
88
|
+
operator: "in",
|
|
89
|
+
value: u
|
|
90
|
+
});
|
|
91
|
+
}, L = (t, l) => {
|
|
92
|
+
const e = r.value.findIndex((s) => s.field === t.key && String(s.value) === String(l));
|
|
93
|
+
if (e >= 0) {
|
|
94
|
+
r.value.splice(e, 1);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
r.value.push({
|
|
98
|
+
id: `${t.key}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
99
|
+
field: t.key,
|
|
100
|
+
label: t.label,
|
|
101
|
+
operator: d.value,
|
|
102
|
+
value: l
|
|
103
|
+
});
|
|
104
|
+
}, X = (t) => {
|
|
105
|
+
const l = h(t);
|
|
106
|
+
return !l || l.operator === "between" ? "" : l.value ?? "";
|
|
107
|
+
}, Z = (t, l) => {
|
|
108
|
+
const e = t.type === "number" ? l.trim() : l;
|
|
109
|
+
r.value = r.value.filter((s) => s.field !== t.key), e !== "" && r.value.push({
|
|
110
|
+
id: `${t.key}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
111
|
+
field: t.key,
|
|
112
|
+
label: t.label,
|
|
113
|
+
operator: d.value,
|
|
114
|
+
value: e
|
|
115
|
+
});
|
|
116
|
+
}, O = (t, l) => {
|
|
117
|
+
const e = h(t);
|
|
118
|
+
return !e || e.operator !== "between" || typeof e.value != "object" || e.value === null ? "" : e.value[l] ?? "";
|
|
119
|
+
}, B = (t, l, e) => {
|
|
120
|
+
const s = {
|
|
121
|
+
from: O(t.key, "from"),
|
|
122
|
+
to: O(t.key, "to")
|
|
123
|
+
};
|
|
124
|
+
s[l] = e.trim(), r.value = r.value.filter((u) => u.field !== t.key), !(!s.from && !s.to) && r.value.push({
|
|
125
|
+
id: `${t.key}-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
126
|
+
field: t.key,
|
|
127
|
+
label: t.label,
|
|
128
|
+
operator: "between",
|
|
129
|
+
value: s
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
N(d, (t) => {
|
|
133
|
+
const l = $.value;
|
|
134
|
+
if (!l) return;
|
|
135
|
+
const e = w.fields.find((i) => i.key === l);
|
|
136
|
+
if (!e || !I(e)) return;
|
|
137
|
+
const s = h(l);
|
|
138
|
+
if (!s) return;
|
|
139
|
+
if (r.value = r.value.filter((i) => i.field !== l), t === "between" && e.type === "number") {
|
|
140
|
+
const i = typeof s.value == "object" && s.value !== null ? {
|
|
141
|
+
from: s.value.from ?? "",
|
|
142
|
+
to: s.value.to ?? ""
|
|
143
|
+
} : { from: s.value ?? "", to: "" };
|
|
144
|
+
if (!i.from && !i.to) return;
|
|
145
|
+
r.value.push({
|
|
146
|
+
...s,
|
|
147
|
+
operator: "between",
|
|
148
|
+
value: i
|
|
149
|
+
});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const u = typeof s.value == "object" && s.value !== null ? s.value.from ?? s.value.to ?? "" : s.value;
|
|
153
|
+
u !== "" && r.value.push({
|
|
154
|
+
...s,
|
|
155
|
+
operator: t,
|
|
156
|
+
value: u
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
const ee = (t) => {
|
|
160
|
+
!x.value && !g.value || (r.value = r.value.filter((l) => l.field !== t.key), r.value.push({
|
|
161
|
+
id: `${t.key}-${Date.now()}`,
|
|
162
|
+
field: t.key,
|
|
163
|
+
label: t.label,
|
|
164
|
+
operator: "between",
|
|
165
|
+
value: { from: x.value, to: g.value }
|
|
166
|
+
}));
|
|
167
|
+
}, te = () => {
|
|
168
|
+
const t = { logic: v.value, rules: r.value };
|
|
169
|
+
C("update:modelValue", t), C("apply", t), C("close");
|
|
170
|
+
}, le = () => {
|
|
171
|
+
r.value = [], v.value = "all", x.value = "", g.value = "", C("update:modelValue", { logic: "all", rules: [] });
|
|
172
|
+
};
|
|
173
|
+
return (t, l) => j.open ? (a(), o("div", oe, [
|
|
174
|
+
n("div", {
|
|
175
|
+
class: "absolute inset-0 bg-black/35",
|
|
176
|
+
onClick: l[0] || (l[0] = (e) => t.$emit("close"))
|
|
177
|
+
}),
|
|
178
|
+
n("aside", ae, [
|
|
179
|
+
n("div", { class: "px-4 py-3 flex items-center justify-between border-b ui-border-strong" }, [
|
|
180
|
+
l[9] || (l[9] = n("h2", { class: "text-xl font-semibold ui-text" }, "Filter", -1)),
|
|
181
|
+
n("button", {
|
|
182
|
+
class: "ui-primary font-semibold",
|
|
183
|
+
onClick: le
|
|
184
|
+
}, "Reset")
|
|
185
|
+
]),
|
|
186
|
+
n("div", ue, [
|
|
187
|
+
n("div", ie, [
|
|
188
|
+
k(_, {
|
|
189
|
+
icon: "search",
|
|
190
|
+
class: "w-4 h-4 ui-primary"
|
|
191
|
+
}),
|
|
192
|
+
f(n("input", {
|
|
193
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => A.value = e),
|
|
194
|
+
placeholder: "Filter Search",
|
|
195
|
+
class: "w-full bg-transparent outline-none text-base placeholder:ui-text"
|
|
196
|
+
}, null, 512), [
|
|
197
|
+
[D, A.value]
|
|
198
|
+
])
|
|
199
|
+
])
|
|
200
|
+
]),
|
|
201
|
+
n("div", ce, [
|
|
202
|
+
(a(!0), o(m, null, b(z.value, (e) => (a(), o("div", {
|
|
203
|
+
key: e.key,
|
|
204
|
+
class: "border-b ui-border-strong"
|
|
205
|
+
}, [
|
|
206
|
+
n("button", {
|
|
207
|
+
class: "w-full px-4 py-2.5 flex items-center justify-between text-left hover:bg-(--ui-surface-muted)",
|
|
208
|
+
onClick: (s) => P(e.key)
|
|
209
|
+
}, [
|
|
210
|
+
n("span", de, [
|
|
211
|
+
F(p(e.label) + " ", 1),
|
|
212
|
+
R(e.key) > 0 ? (a(), o("span", ve, p(R(e.key)), 1)) : y("", !0)
|
|
213
|
+
]),
|
|
214
|
+
n("span", ye, [
|
|
215
|
+
R(e.key) > 0 ? (a(), o("button", {
|
|
216
|
+
key: 0,
|
|
217
|
+
class: "h-5 min-w-7 px-1 rounded-full border ui-border-strong inline-flex items-center justify-center ui-text/80 hover:ui-primary hover:border-(--ui-primary)",
|
|
218
|
+
onClick: ne((s) => q(e.key), ["stop"]),
|
|
219
|
+
title: "Clear filter"
|
|
220
|
+
}, [
|
|
221
|
+
k(_, {
|
|
222
|
+
icon: "xmark",
|
|
223
|
+
class: "w-2.5 h-2.5"
|
|
224
|
+
})
|
|
225
|
+
], 8, me)) : y("", !0),
|
|
226
|
+
k(_, {
|
|
227
|
+
icon: "chevron-right",
|
|
228
|
+
class: "w-4 h-4 ui-primary"
|
|
229
|
+
})
|
|
230
|
+
])
|
|
231
|
+
], 8, pe),
|
|
232
|
+
$.value === e.key ? (a(), o("div", be, [
|
|
233
|
+
n("div", xe, [
|
|
234
|
+
n("span", ge, p(e.label), 1),
|
|
235
|
+
f(n("select", {
|
|
236
|
+
"onUpdate:modelValue": l[2] || (l[2] = (s) => d.value = s),
|
|
237
|
+
class: "ml-auto rounded-md ui-surface border ui-border-strong px-3 py-2 text-sm ui-text"
|
|
238
|
+
}, [
|
|
239
|
+
(a(!0), o(m, null, b(J(e), (s) => (a(), o("option", {
|
|
240
|
+
key: s.value,
|
|
241
|
+
value: s.value
|
|
242
|
+
}, p(s.label), 9, he))), 128))
|
|
243
|
+
], 512), [
|
|
244
|
+
[re, d.value]
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
H(e) ? (a(), o("div", ke, [
|
|
248
|
+
k(_, {
|
|
249
|
+
icon: "search",
|
|
250
|
+
class: "w-4 h-4 ui-primary"
|
|
251
|
+
}),
|
|
252
|
+
f(n("input", {
|
|
253
|
+
"onUpdate:modelValue": l[3] || (l[3] = (s) => S.value = s),
|
|
254
|
+
placeholder: "Search",
|
|
255
|
+
class: "w-full bg-transparent outline-none text-sm ui-text"
|
|
256
|
+
}, null, 512), [
|
|
257
|
+
[D, S.value]
|
|
258
|
+
])
|
|
259
|
+
])) : y("", !0),
|
|
260
|
+
e.type === "date" ? (a(), o("div", fe, [
|
|
261
|
+
(a(!0), o(m, null, b(M(e), (s) => (a(), o("label", {
|
|
262
|
+
key: String(s.value),
|
|
263
|
+
class: "flex items-center gap-2 text-sm ui-text cursor-pointer py-0.5"
|
|
264
|
+
}, [
|
|
265
|
+
n("input", {
|
|
266
|
+
type: "checkbox",
|
|
267
|
+
checked: U(e.key, s.value),
|
|
268
|
+
onChange: (u) => L(e, s.value)
|
|
269
|
+
}, null, 40, _e),
|
|
270
|
+
n("span", null, p(s.label), 1)
|
|
271
|
+
]))), 128)),
|
|
272
|
+
n("div", we, [
|
|
273
|
+
f(n("input", {
|
|
274
|
+
"onUpdate:modelValue": l[4] || (l[4] = (s) => x.value = s),
|
|
275
|
+
type: "date",
|
|
276
|
+
class: "w-full ui-surface border ui-border-strong rounded-md px-2 py-1 text-sm ui-text"
|
|
277
|
+
}, null, 512), [
|
|
278
|
+
[D, x.value]
|
|
279
|
+
]),
|
|
280
|
+
f(n("input", {
|
|
281
|
+
"onUpdate:modelValue": l[5] || (l[5] = (s) => g.value = s),
|
|
282
|
+
type: "date",
|
|
283
|
+
class: "w-full ui-surface border ui-border-strong rounded-md px-2 py-1 text-sm ui-text"
|
|
284
|
+
}, null, 512), [
|
|
285
|
+
[D, g.value]
|
|
286
|
+
])
|
|
287
|
+
]),
|
|
288
|
+
n("button", {
|
|
289
|
+
class: "px-3 py-1.5 rounded-md ui-primary-bg text-white text-sm",
|
|
290
|
+
onClick: (s) => ee(e)
|
|
291
|
+
}, "Apply Date Range", 8, Ce)
|
|
292
|
+
])) : I(e) ? (a(), o("div", $e, [
|
|
293
|
+
d.value === "between" && e.type === "number" ? (a(), o("div", Se, [
|
|
294
|
+
n("input", {
|
|
295
|
+
value: O(e.key, "from"),
|
|
296
|
+
type: "number",
|
|
297
|
+
step: e.step || "any",
|
|
298
|
+
placeholder: e.minLabel || "Min",
|
|
299
|
+
class: "w-full ui-surface border ui-border-strong rounded-md px-3 py-2 text-sm ui-text",
|
|
300
|
+
onInput: (s) => B(e, "from", s.target.value)
|
|
301
|
+
}, null, 40, Ve),
|
|
302
|
+
n("input", {
|
|
303
|
+
value: O(e.key, "to"),
|
|
304
|
+
type: "number",
|
|
305
|
+
step: e.step || "any",
|
|
306
|
+
placeholder: e.maxLabel || "Max",
|
|
307
|
+
class: "w-full ui-surface border ui-border-strong rounded-md px-3 py-2 text-sm ui-text",
|
|
308
|
+
onInput: (s) => B(e, "to", s.target.value)
|
|
309
|
+
}, null, 40, Oe)
|
|
310
|
+
])) : (a(), o("input", {
|
|
311
|
+
key: 1,
|
|
312
|
+
value: X(e.key),
|
|
313
|
+
type: e.type === "number" ? "number" : "text",
|
|
314
|
+
step: e.type === "number" ? e.step || "any" : void 0,
|
|
315
|
+
placeholder: e.placeholder || `Enter ${e.label}`,
|
|
316
|
+
class: "w-full ui-surface border ui-border-strong rounded-md px-3 py-2 text-sm ui-text",
|
|
317
|
+
onInput: (s) => Z(e, s.target.value)
|
|
318
|
+
}, null, 40, De))
|
|
319
|
+
])) : e.type === "multiselect" || e.type === "select" && e.multiple ? (a(), o("div", Fe, [
|
|
320
|
+
V(e.key).length > 0 ? (a(), o("div", Ae, [
|
|
321
|
+
(a(!0), o(m, null, b(V(e.key), (s) => (a(), o("span", {
|
|
322
|
+
key: `${e.key}-${s}`,
|
|
323
|
+
class: "inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs border ui-border-strong ui-text"
|
|
324
|
+
}, [
|
|
325
|
+
F(p(K(e, s)) + " ", 1),
|
|
326
|
+
n("button", {
|
|
327
|
+
class: "ui-text-soft hover:ui-primary",
|
|
328
|
+
onClick: (u) => L(e, s)
|
|
329
|
+
}, [
|
|
330
|
+
k(_, {
|
|
331
|
+
icon: "xmark",
|
|
332
|
+
class: "w-3 h-3"
|
|
333
|
+
})
|
|
334
|
+
], 8, Re)
|
|
335
|
+
]))), 128)),
|
|
336
|
+
n("button", {
|
|
337
|
+
class: "text-xs ui-primary hover:underline ml-1",
|
|
338
|
+
onClick: (s) => q(e.key)
|
|
339
|
+
}, " Clear all ", 8, Ie)
|
|
340
|
+
])) : y("", !0),
|
|
341
|
+
n("div", Me, [
|
|
342
|
+
(a(!0), o(m, null, b(M(e), (s) => (a(), o("label", {
|
|
343
|
+
key: String(s.value),
|
|
344
|
+
class: "flex items-center gap-2 text-sm ui-text cursor-pointer py-0.5"
|
|
345
|
+
}, [
|
|
346
|
+
n("input", {
|
|
347
|
+
type: "checkbox",
|
|
348
|
+
checked: Q(e.key, s.value),
|
|
349
|
+
onChange: (u) => W(e, s.value)
|
|
350
|
+
}, null, 40, Le),
|
|
351
|
+
n("span", null, p(s.label), 1)
|
|
352
|
+
]))), 128))
|
|
353
|
+
])
|
|
354
|
+
])) : (a(), o("div", je, [
|
|
355
|
+
(a(!0), o(m, null, b(M(e), (s) => (a(), o("label", {
|
|
356
|
+
key: String(s.value),
|
|
357
|
+
class: "flex items-center gap-2 text-sm ui-text cursor-pointer py-0.5"
|
|
358
|
+
}, [
|
|
359
|
+
n("input", {
|
|
360
|
+
type: "checkbox",
|
|
361
|
+
checked: U(e.key, s.value),
|
|
362
|
+
onChange: (u) => L(e, s.value)
|
|
363
|
+
}, null, 40, qe),
|
|
364
|
+
n("span", null, p(s.label), 1)
|
|
365
|
+
]))), 128))
|
|
366
|
+
]))
|
|
367
|
+
])) : y("", !0)
|
|
368
|
+
]))), 128))
|
|
369
|
+
]),
|
|
370
|
+
n("div", Te, [
|
|
371
|
+
n("div", Ue, [
|
|
372
|
+
n("button", {
|
|
373
|
+
class: "flex items-center gap-2",
|
|
374
|
+
onClick: l[6] || (l[6] = (e) => T("any"))
|
|
375
|
+
}, [
|
|
376
|
+
n("input", {
|
|
377
|
+
type: "checkbox",
|
|
378
|
+
checked: v.value === "any",
|
|
379
|
+
class: "accent-(--ui-primary)"
|
|
380
|
+
}, null, 8, Be),
|
|
381
|
+
l[10] || (l[10] = F(" Any of these ", -1))
|
|
382
|
+
]),
|
|
383
|
+
n("button", {
|
|
384
|
+
class: "flex items-center gap-2",
|
|
385
|
+
onClick: l[7] || (l[7] = (e) => T("all"))
|
|
386
|
+
}, [
|
|
387
|
+
n("input", {
|
|
388
|
+
type: "checkbox",
|
|
389
|
+
checked: v.value === "all",
|
|
390
|
+
class: "accent-(--ui-primary)"
|
|
391
|
+
}, null, 8, Ne),
|
|
392
|
+
l[11] || (l[11] = F(" All of these ", -1))
|
|
393
|
+
])
|
|
394
|
+
]),
|
|
395
|
+
n("div", Ee, [
|
|
396
|
+
n("button", {
|
|
397
|
+
class: "px-5 py-2 rounded-lg ui-primary-bg text-white text-sm",
|
|
398
|
+
onClick: te
|
|
399
|
+
}, "Find"),
|
|
400
|
+
n("button", {
|
|
401
|
+
class: "px-5 py-2 rounded-lg border border-(--ui-primary) ui-primary text-sm",
|
|
402
|
+
onClick: l[8] || (l[8] = (e) => t.$emit("close"))
|
|
403
|
+
}, "Cancel")
|
|
404
|
+
])
|
|
405
|
+
])
|
|
406
|
+
])
|
|
407
|
+
])) : y("", !0);
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
export {
|
|
411
|
+
Ye as default
|
|
412
|
+
};
|