@gspa/ui 0.1.1 → 0.1.4

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.
Files changed (205) hide show
  1. package/README.md +18 -0
  2. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  3. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  4. package/dist/components/Accordion.cjs +1 -0
  5. package/dist/components/Accordion.js +192 -0
  6. package/dist/components/AccordionItem.cjs +1 -0
  7. package/dist/components/AccordionItem.js +109 -0
  8. package/dist/components/AddReminderModal.cjs +1 -0
  9. package/dist/components/AddReminderModal.js +107 -0
  10. package/dist/components/Alert.cjs +1 -0
  11. package/dist/components/Alert.js +222 -0
  12. package/dist/components/Avatar.cjs +1 -0
  13. package/dist/components/Avatar.js +86 -0
  14. package/dist/components/Badge.cjs +1 -0
  15. package/dist/components/Badge.js +109 -0
  16. package/dist/components/Breadcrumb.cjs +1 -0
  17. package/dist/components/Breadcrumb.js +72 -0
  18. package/dist/components/Button.cjs +1 -0
  19. package/dist/components/Button.js +190 -0
  20. package/dist/components/ButtonGroup.cjs +1 -0
  21. package/dist/components/ButtonGroup.js +46 -0
  22. package/dist/components/Calendar.cjs +1 -0
  23. package/dist/components/Calendar.js +341 -0
  24. package/dist/components/Card.cjs +1 -0
  25. package/dist/components/Card.js +316 -0
  26. package/dist/components/CardBody.cjs +1 -0
  27. package/dist/components/CardBody.js +34 -0
  28. package/dist/components/CardContent.cjs +1 -0
  29. package/dist/components/CardContent.js +17 -0
  30. package/dist/components/CardFooter.cjs +1 -0
  31. package/dist/components/CardFooter.js +34 -0
  32. package/dist/components/CardHeader.cjs +1 -0
  33. package/dist/components/CardHeader.js +91 -0
  34. package/dist/components/CardTitle.cjs +1 -0
  35. package/dist/components/CardTitle.js +17 -0
  36. package/dist/components/Checkbox.cjs +1 -0
  37. package/dist/components/Checkbox.js +185 -0
  38. package/dist/components/CircularProgress.cjs +1 -0
  39. package/dist/components/CircularProgress.js +141 -0
  40. package/dist/components/DataTable.cjs +1 -0
  41. package/dist/components/DataTable.js +863 -0
  42. package/dist/components/DataTableCell.cjs +1 -0
  43. package/dist/components/DataTableCell.js +95 -0
  44. package/dist/components/DataTableFilters.cjs +1 -0
  45. package/dist/components/DataTableFilters.js +519 -0
  46. package/dist/components/DataTableHeader.cjs +1 -0
  47. package/dist/components/DataTableHeader.js +116 -0
  48. package/dist/components/DataTablePagination.cjs +1 -0
  49. package/dist/components/DataTablePagination.js +290 -0
  50. package/dist/components/DataTableRow.cjs +1 -0
  51. package/dist/components/DataTableRow.js +199 -0
  52. package/dist/components/DataTableToolBar.cjs +1 -0
  53. package/dist/components/DataTableToolBar.js +477 -0
  54. package/dist/components/DatePicker.cjs +1 -0
  55. package/dist/components/DatePicker.js +401 -0
  56. package/dist/components/Divider.cjs +1 -0
  57. package/dist/components/Divider.js +103 -0
  58. package/dist/components/Dropdown.cjs +1 -0
  59. package/dist/components/Dropdown.js +104 -0
  60. package/dist/components/DropdownItem.cjs +1 -0
  61. package/dist/components/DropdownItem.js +60 -0
  62. package/dist/components/EventsCalendar.cjs +1 -0
  63. package/dist/components/EventsCalendar.js +863 -0
  64. package/dist/components/FileUpload.cjs +1 -0
  65. package/dist/components/FileUpload.js +195 -0
  66. package/dist/components/FilterDrawer.cjs +1 -0
  67. package/dist/components/FilterDrawer.js +412 -0
  68. package/dist/components/Footer.cjs +1 -0
  69. package/dist/components/Footer.js +157 -0
  70. package/dist/components/FormField.cjs +1 -0
  71. package/dist/components/FormField.js +190 -0
  72. package/dist/components/Graph.cjs +1 -0
  73. package/dist/components/Graph.js +164 -0
  74. package/dist/components/GraphFilters.cjs +1 -0
  75. package/dist/components/GraphFilters.js +305 -0
  76. package/dist/components/Header.cjs +1 -0
  77. package/dist/components/Header.js +674 -0
  78. package/dist/components/Icon.cjs +1 -0
  79. package/dist/components/Icon.js +51 -0
  80. package/dist/components/Image.cjs +1 -0
  81. package/dist/components/Image.js +112 -0
  82. package/dist/components/Input.cjs +1 -0
  83. package/dist/components/Input.js +166 -0
  84. package/dist/components/InputGroup.cjs +1 -0
  85. package/dist/components/InputGroup.js +45 -0
  86. package/dist/components/Label.cjs +1 -0
  87. package/dist/components/Label.js +46 -0
  88. package/dist/components/Link.cjs +1 -0
  89. package/dist/components/Link.js +119 -0
  90. package/dist/components/ListItem.cjs +1 -0
  91. package/dist/components/ListItem.js +89 -0
  92. package/dist/components/Loader.cjs +1 -0
  93. package/dist/components/Loader.js +154 -0
  94. package/dist/components/Logo.cjs +1 -0
  95. package/dist/components/Logo.js +67 -0
  96. package/dist/components/MenuItem.cjs +1 -0
  97. package/dist/components/MenuItem.js +66 -0
  98. package/dist/components/Modal.cjs +1 -0
  99. package/dist/components/Modal.js +110 -0
  100. package/dist/components/ModalBody.cjs +1 -0
  101. package/dist/components/ModalBody.js +33 -0
  102. package/dist/components/ModalFooter.cjs +1 -0
  103. package/dist/components/ModalFooter.js +33 -0
  104. package/dist/components/ModalHeader.cjs +1 -0
  105. package/dist/components/ModalHeader.js +24 -0
  106. package/dist/components/MultiSelect.cjs +1 -0
  107. package/dist/components/MultiSelect.js +211 -0
  108. package/dist/components/Notification.cjs +1 -0
  109. package/dist/components/Notification.js +121 -0
  110. package/dist/components/Option.cjs +1 -0
  111. package/dist/components/Option.js +44 -0
  112. package/dist/components/Progress.cjs +1 -0
  113. package/dist/components/Progress.js +77 -0
  114. package/dist/components/ProgressBar.cjs +1 -0
  115. package/dist/components/ProgressBar.js +101 -0
  116. package/dist/components/Radio.cjs +1 -0
  117. package/dist/components/Radio.js +81 -0
  118. package/dist/components/RailNav.cjs +1 -0
  119. package/dist/components/RailNav.js +124 -0
  120. package/dist/components/ReminderConfig.cjs +1 -0
  121. package/dist/components/ReminderConfig.js +375 -0
  122. package/dist/components/ReusableForm.cjs +1 -0
  123. package/dist/components/ReusableForm.js +657 -0
  124. package/dist/components/ReusableFormModal.cjs +1 -0
  125. package/dist/components/ReusableFormModal.js +112 -0
  126. package/dist/components/RightDrawer.cjs +1 -0
  127. package/dist/components/RightDrawer.js +143 -0
  128. package/dist/components/Search.cjs +1 -0
  129. package/dist/components/Search.js +252 -0
  130. package/dist/components/Select.cjs +1 -0
  131. package/dist/components/Select.js +243 -0
  132. package/dist/components/Sidebar.cjs +1 -0
  133. package/dist/components/Sidebar.js +372 -0
  134. package/dist/components/Slider.cjs +1 -0
  135. package/dist/components/Slider.js +42 -0
  136. package/dist/components/Spinner.cjs +1 -0
  137. package/dist/components/Spinner.js +87 -0
  138. package/dist/components/Stepper.cjs +1 -0
  139. package/dist/components/Stepper.js +12 -0
  140. package/dist/components/StepperItem.cjs +1 -0
  141. package/dist/components/StepperItem.js +33 -0
  142. package/dist/components/Switch.cjs +1 -0
  143. package/dist/components/Switch.js +112 -0
  144. package/dist/components/Tab.cjs +1 -0
  145. package/dist/components/Tab.js +134 -0
  146. package/dist/components/TabPanel.cjs +1 -0
  147. package/dist/components/TabPanel.js +49 -0
  148. package/dist/components/Text.cjs +1 -0
  149. package/dist/components/Text.js +84 -0
  150. package/dist/components/Textarea.cjs +1 -0
  151. package/dist/components/Textarea.js +102 -0
  152. package/dist/components/ThemeConfigurator.cjs +1 -0
  153. package/dist/components/ThemeConfigurator.js +50 -0
  154. package/dist/components/Timeline.cjs +1 -0
  155. package/dist/components/Timeline.js +24 -0
  156. package/dist/components/TimelineItem.cjs +1 -0
  157. package/dist/components/TimelineItem.js +63 -0
  158. package/dist/components/Toast.cjs +1 -0
  159. package/dist/components/Toast.js +231 -0
  160. package/dist/components/Tooltip.cjs +1 -0
  161. package/dist/components/Tooltip.js +124 -0
  162. package/dist/components/Typography.cjs +1 -0
  163. package/dist/components/Typography.js +267 -0
  164. package/dist/components/charts/BarChart.cjs +1 -0
  165. package/dist/components/charts/BarChart.js +323 -0
  166. package/dist/components/charts/LineChart.cjs +1 -0
  167. package/dist/components/charts/LineChart.js +322 -0
  168. package/dist/components/charts/PieChart.cjs +1 -0
  169. package/dist/components/charts/PieChart.js +311 -0
  170. package/dist/components/charts/StackedBarChart.cjs +1 -0
  171. package/dist/components/charts/StackedBarChart.js +348 -0
  172. package/dist/components/widgets/DashboardWidget.cjs +1 -0
  173. package/dist/components/widgets/DashboardWidget.js +309 -0
  174. package/dist/directives/tooltip.cjs +47 -0
  175. package/dist/directives/tooltip.js +115 -0
  176. package/dist/index.cjs +1 -0
  177. package/dist/index.esm.js +310 -19533
  178. package/dist/layouts/AuthLayout.cjs +1 -0
  179. package/dist/layouts/AuthLayout.js +190 -0
  180. package/dist/layouts/DashboardLayout.cjs +1 -0
  181. package/dist/layouts/DashboardLayout.js +244 -0
  182. package/dist/layouts/DefaultLayout.cjs +1 -0
  183. package/dist/layouts/DefaultLayout.js +94 -0
  184. package/dist/layouts/ErrorLayout.cjs +1 -0
  185. package/dist/layouts/ErrorLayout.js +452 -0
  186. package/dist/lib/auth.cjs +1 -0
  187. package/dist/lib/auth.js +4 -0
  188. package/dist/lib/theme.cjs +1 -0
  189. package/dist/lib/theme.js +135 -0
  190. package/dist/lib/toast.cjs +1 -0
  191. package/dist/lib/toast.js +81 -0
  192. package/dist/src/__tests__/AuthLayout.spec.d.ts +2 -0
  193. package/dist/src/__tests__/AuthLayout.spec.d.ts.map +1 -0
  194. package/dist/src/layouts/AuthLayout.vue.d.ts +10 -6
  195. package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
  196. package/dist/tsconfig.tsbuildinfo +1 -1
  197. package/dist/utils/cn.cjs +1 -0
  198. package/dist/utils/cn.js +7 -0
  199. package/package.json +43 -11
  200. package/dist/applogo.png +0 -0
  201. package/dist/favicon.ico +0 -0
  202. package/dist/index.js +0 -605
  203. package/dist/logo.png +0 -0
  204. package/dist/stlbacklogo.jpeg +0 -0
  205. package/dist/stlbacklogo.png +0 -0
@@ -0,0 +1,116 @@
1
+ import { computed as r, createElementBlock as o, createCommentVNode as a, openBlock as s, normalizeClass as i, renderSlot as c, createElementVNode as m, createBlock as u, withCtx as f, createTextVNode as p, toDisplayString as g } from "vue";
2
+ import v from "./Typography.js";
3
+ import { cva as l } from "class-variance-authority";
4
+ import { cn as n } from "../utils/cn.js";
5
+ const z = { class: "flex items-start justify-between" }, C = {
6
+ key: 0,
7
+ class: "flex items-center gap-2"
8
+ }, D = {
9
+ __name: "DataTableHeader",
10
+ props: {
11
+ title: {
12
+ type: String,
13
+ default: null
14
+ },
15
+ description: {
16
+ type: String,
17
+ default: null
18
+ },
19
+ variant: {
20
+ type: String,
21
+ default: "default",
22
+ validator: (t) => ["default", "minimal", "bordered"].includes(t)
23
+ },
24
+ padding: {
25
+ type: String,
26
+ default: "normal",
27
+ validator: (t) => ["compact", "normal", "comfortable"].includes(t)
28
+ }
29
+ },
30
+ setup(t) {
31
+ const d = t, b = l("border ui-border-strong rounded-2xl", {
32
+ variants: {
33
+ variant: {
34
+ default: "ui-border-strong",
35
+ minimal: "bg-transparent border-none",
36
+ bordered: "border-2 ui-border-strong"
37
+ },
38
+ padding: {
39
+ compact: "px-4 py-2",
40
+ normal: "px-6 py-4",
41
+ comfortable: "px-8 py-6"
42
+ }
43
+ },
44
+ defaultVariants: {
45
+ variant: "default",
46
+ padding: "normal"
47
+ }
48
+ }), x = l("font-semibold ui-text", {
49
+ variants: {
50
+ size: {
51
+ sm: "text-base",
52
+ md: "text-lg",
53
+ lg: "text-xl"
54
+ }
55
+ },
56
+ defaultVariants: {
57
+ size: "md"
58
+ }
59
+ }), y = l("ui-text mt-1", {
60
+ variants: {
61
+ size: {
62
+ sm: "text-xs",
63
+ md: "text-sm",
64
+ lg: "text-base"
65
+ }
66
+ },
67
+ defaultVariants: {
68
+ size: "md"
69
+ }
70
+ }), V = r(
71
+ () => n(b({
72
+ variant: d.variant,
73
+ padding: d.padding
74
+ }))
75
+ ), h = r(
76
+ () => n(x({ size: "md" }))
77
+ ), k = r(
78
+ () => n(y({ size: "md" }))
79
+ );
80
+ return (e, S) => t.title || t.description || e.$slots.header ? (s(), o("div", {
81
+ key: 0,
82
+ class: i(V.value)
83
+ }, [
84
+ c(e.$slots, "header", {}, () => [
85
+ m("div", z, [
86
+ m("div", null, [
87
+ t.title ? (s(), u(v, {
88
+ key: 0,
89
+ class: i(h.value)
90
+ }, {
91
+ default: f(() => [
92
+ p(g(t.title), 1)
93
+ ]),
94
+ _: 1
95
+ }, 8, ["class"])) : a("", !0),
96
+ t.description ? (s(), u(v, {
97
+ key: 1,
98
+ class: i(k.value)
99
+ }, {
100
+ default: f(() => [
101
+ p(g(t.description), 1)
102
+ ]),
103
+ _: 1
104
+ }, 8, ["class"])) : a("", !0)
105
+ ]),
106
+ e.$slots.filters ? (s(), o("div", C, [
107
+ c(e.$slots, "filters")
108
+ ])) : a("", !0)
109
+ ])
110
+ ])
111
+ ], 2)) : a("", !0);
112
+ }
113
+ };
114
+ export {
115
+ D as default
116
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("./Label.cjs"),S=require("./Option.cjs"),h=require("./Select.cjs"),u=require("class-variance-authority"),c=require("../utils/cn.cjs"),w={class:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between"},B={key:0,class:"text-sm ui-text text-center lg:text-left"},z={key:1,class:"text-sm ui-text text-center lg:text-left"},E={key:2,class:"flex items-center justify-center gap-4 lg:justify-start"},$={key:3,class:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between lg:w-auto lg:justify-end"},j={class:"flex items-center justify-center gap-2 sm:justify-start"},q={class:"flex items-center justify-center gap-1 sm:gap-2 flex-wrap"},D=["disabled"],M=["disabled"],L={class:"hidden md:flex items-center gap-1 ui-border-strong"},O=["onClick"],F=["disabled"],I=["disabled"],T={class:"text-sm ui-text text-center sm:text-left sm:ml-2"},A={__name:"DataTablePagination",props:{currentPage:{type:Number,required:!0},totalPages:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,required:!0},showPagination:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},selectedCount:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,25,50,100]},maxVisiblePages:{type:Number,default:7},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:currentPage","update:pageSize"],setup(t){const l=t,f=u.cva("border ui-border-strong rounded-2xl",{variants:{variant:{default:"bg-(--ui-bg) ",minimal:"bg-transparent ui-border-strong ",bordered:"bg-(--ui-bg) border-2 ui-border-strong "},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),b=u.cva("text-sm font-medium border rounded-md transition-colors duration-200",{variants:{state:{active:"ui-text border-(--ui-border-strong) bg-(--ui-primary-soft) ui-primary",inactive:"bg-(--ui-bg) ui-text ui-border-strong hover:text-(--ui-text)",disabled:"bg-(--ui-bg) ui-text ui-border-strong cursor-not-allowed"},size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{state:"inactive",size:"md"}}),p=u.cva("ui-text",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),v=u.cva("border ui-border-strong rounded-md focus:outline-none focus:ring-2 focus:ring-(--ui-primary) text-sm min-w-[60px] focus:border-transparent",{variants:{size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{size:"sm"}}),x=e.computed(()=>(l.currentPage-1)*l.pageSize+1),y=e.computed(()=>Math.min(l.currentPage*l.pageSize,l.total)),k=e.computed(()=>{const r=[],a=l.totalPages,n=l.currentPage,o=l.maxVisiblePages;if(a<=o)for(let i=1;i<=a;i++)r.push(i);else{const i=Math.floor(o/2);let d=Math.max(1,n-i),m=Math.min(a,d+o-1);m-d+1<o&&(d=Math.max(1,m-o+1));for(let g=d;g<=m;g++)r.push(g)}return r}),P=e.computed(()=>c.cn(f({variant:l.variant,padding:l.padding}))),V=e.computed(()=>c.cn(p({size:"md"}))),C=e.computed(()=>c.cn(v({size:"sm"}))),s=(r,a)=>{let n="inactive";return a?n="disabled":r&&(n="active"),c.cn(b({state:n,size:"md"}))};return(r,a)=>t.showPagination||r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(P.value)},[e.createElementVNode("div",w,[t.selectable&&t.selectedCount>0?(e.openBlock(),e.createElementBlock("div",B,e.toDisplayString(t.selectedCount)+" of "+e.toDisplayString(t.total)+" selected ",1)):(e.openBlock(),e.createElementBlock("div",z," Showing "+e.toDisplayString(x.value)+" to "+e.toDisplayString(y.value)+" of "+e.toDisplayString(t.total)+" entries ",1)),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",E,[e.renderSlot(r.$slots,"footer")])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",j,[e.createVNode(N.default,{for:"pageSize",class:e.normalizeClass(V.value),inline:!0},{default:e.withCtx(()=>[...a[5]||(a[5]=[e.createTextVNode("Show:",-1)])]),_:1},8,["class"]),e.createVNode(h.default,{id:"pageSize","model-value":t.pageSize.toString(),class:e.normalizeClass(C.value),"onUpdate:modelValue":a[0]||(a[0]=n=>r.$emit("update:pageSize",parseInt(n)))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,n=>(e.openBlock(),e.createBlock(S.default,{key:n,value:n.toString(),label:n.toString()},null,8,["value","label"]))),128))]),_:1},8,["model-value","class"])]),e.createElementVNode("div",q,[e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass([s(!1,t.currentPage===1),"hidden sm:inline-flex"]),title:"First page",onClick:a[1]||(a[1]=n=>r.$emit("update:currentPage",1))},[...a[6]||(a[6]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"})],-1)])],10,D),e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(s(!1,t.currentPage===1)),title:"Previous page",onClick:a[2]||(a[2]=n=>r.$emit("update:currentPage",t.currentPage-1))},[...a[7]||(a[7]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)])],10,M),e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n,class:e.normalizeClass(s(n===t.currentPage,!1)),onClick:o=>r.$emit("update:currentPage",n)},e.toDisplayString(n),11,O))),128))]),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(s(!1,t.currentPage===t.totalPages)),title:"Next page",onClick:a[3]||(a[3]=n=>r.$emit("update:currentPage",t.currentPage+1))},[...a[8]||(a[8]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})],-1)])],10,F),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass([s(!1,t.currentPage===t.totalPages),"hidden sm:inline-flex"]),title:"Last page",onClick:a[4]||(a[4]=n=>r.$emit("update:currentPage",t.totalPages))},[...a[9]||(a[9]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"})],-1)])],10,I)]),e.createElementVNode("div",T," Page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(t.totalPages),1)])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}};exports.default=A;
@@ -0,0 +1,290 @@
1
+ import { computed as g, createElementBlock as o, createCommentVNode as y, openBlock as n, normalizeClass as l, createElementVNode as s, toDisplayString as d, renderSlot as L, createVNode as P, withCtx as k, createTextVNode as I, Fragment as w, renderList as h, createBlock as D } from "vue";
2
+ import E from "./Label.js";
3
+ import F from "./Option.js";
4
+ import O from "./Select.js";
5
+ import { cva as b } from "class-variance-authority";
6
+ import { cn as v } from "../utils/cn.js";
7
+ const T = { class: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between" }, A = {
8
+ key: 0,
9
+ class: "text-sm ui-text text-center lg:text-left"
10
+ }, U = {
11
+ key: 1,
12
+ class: "text-sm ui-text text-center lg:text-left"
13
+ }, G = {
14
+ key: 2,
15
+ class: "flex items-center justify-center gap-4 lg:justify-start"
16
+ }, H = {
17
+ key: 3,
18
+ class: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between lg:w-auto lg:justify-end"
19
+ }, J = { class: "flex items-center justify-center gap-2 sm:justify-start" }, K = { class: "flex items-center justify-center gap-1 sm:gap-2 flex-wrap" }, Q = ["disabled"], R = ["disabled"], W = { class: "hidden md:flex items-center gap-1 ui-border-strong" }, X = ["onClick"], Y = ["disabled"], Z = ["disabled"], _ = { class: "text-sm ui-text text-center sm:text-left sm:ml-2" }, ne = {
20
+ __name: "DataTablePagination",
21
+ props: {
22
+ currentPage: {
23
+ type: Number,
24
+ required: !0
25
+ },
26
+ totalPages: {
27
+ type: Number,
28
+ required: !0
29
+ },
30
+ total: {
31
+ type: Number,
32
+ required: !0
33
+ },
34
+ pageSize: {
35
+ type: Number,
36
+ required: !0
37
+ },
38
+ showPagination: {
39
+ type: Boolean,
40
+ default: !0
41
+ },
42
+ selectable: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ selectedCount: {
47
+ type: Number,
48
+ default: 0
49
+ },
50
+ pageSizeOptions: {
51
+ type: Array,
52
+ default: () => [5, 10, 25, 50, 100]
53
+ },
54
+ maxVisiblePages: {
55
+ type: Number,
56
+ default: 7
57
+ },
58
+ variant: {
59
+ type: String,
60
+ default: "default",
61
+ validator: (e) => ["default", "minimal", "bordered"].includes(e)
62
+ },
63
+ padding: {
64
+ type: String,
65
+ default: "normal",
66
+ validator: (e) => ["compact", "normal", "comfortable"].includes(e)
67
+ }
68
+ },
69
+ emits: ["update:currentPage", "update:pageSize"],
70
+ setup(e) {
71
+ const i = e, C = b("border ui-border-strong rounded-2xl", {
72
+ variants: {
73
+ variant: {
74
+ default: "bg-(--ui-bg) ",
75
+ minimal: "bg-transparent ui-border-strong ",
76
+ bordered: "bg-(--ui-bg) border-2 ui-border-strong "
77
+ },
78
+ padding: {
79
+ compact: "px-4 py-2",
80
+ normal: "px-6 py-4",
81
+ comfortable: "px-8 py-6"
82
+ }
83
+ },
84
+ defaultVariants: {
85
+ variant: "default",
86
+ padding: "normal"
87
+ }
88
+ }), S = b("text-sm font-medium border rounded-md transition-colors duration-200", {
89
+ variants: {
90
+ state: {
91
+ active: "ui-text border-(--ui-border-strong) bg-(--ui-primary-soft) ui-primary",
92
+ inactive: "bg-(--ui-bg) ui-text ui-border-strong hover:text-(--ui-text)",
93
+ disabled: "bg-(--ui-bg) ui-text ui-border-strong cursor-not-allowed"
94
+ },
95
+ size: {
96
+ sm: "px-2 py-1",
97
+ md: "px-3 py-2",
98
+ lg: "px-4 py-3"
99
+ }
100
+ },
101
+ defaultVariants: {
102
+ state: "inactive",
103
+ size: "md"
104
+ }
105
+ }), z = b("ui-text", {
106
+ variants: {
107
+ size: {
108
+ sm: "text-sm",
109
+ md: "text-base",
110
+ lg: "text-lg"
111
+ }
112
+ },
113
+ defaultVariants: {
114
+ size: "md"
115
+ }
116
+ }), V = b("border ui-border-strong rounded-md focus:outline-none focus:ring-2 focus:ring-(--ui-primary) text-sm min-w-[60px] focus:border-transparent", {
117
+ variants: {
118
+ size: {
119
+ sm: "px-2 py-1",
120
+ md: "px-3 py-2",
121
+ lg: "px-4 py-3"
122
+ }
123
+ },
124
+ defaultVariants: {
125
+ size: "sm"
126
+ }
127
+ }), $ = g(() => (i.currentPage - 1) * i.pageSize + 1), j = g(() => Math.min(i.currentPage * i.pageSize, i.total)), B = g(() => {
128
+ const r = [], t = i.totalPages, a = i.currentPage, u = i.maxVisiblePages;
129
+ if (t <= u)
130
+ for (let c = 1; c <= t; c++)
131
+ r.push(c);
132
+ else {
133
+ const c = Math.floor(u / 2);
134
+ let f = Math.max(1, a - c), x = Math.min(t, f + u - 1);
135
+ x - f + 1 < u && (f = Math.max(1, x - u + 1));
136
+ for (let p = f; p <= x; p++)
137
+ r.push(p);
138
+ }
139
+ return r;
140
+ }), N = g(
141
+ () => v(C({
142
+ variant: i.variant,
143
+ padding: i.padding
144
+ }))
145
+ ), M = g(
146
+ () => v(z({ size: "md" }))
147
+ ), q = g(
148
+ () => v(V({ size: "sm" }))
149
+ ), m = (r, t) => {
150
+ let a = "inactive";
151
+ return t ? a = "disabled" : r && (a = "active"), v(S({
152
+ state: a,
153
+ size: "md"
154
+ }));
155
+ };
156
+ return (r, t) => e.showPagination || r.$slots.footer ? (n(), o("div", {
157
+ key: 0,
158
+ class: l(N.value)
159
+ }, [
160
+ s("div", T, [
161
+ e.selectable && e.selectedCount > 0 ? (n(), o("div", A, d(e.selectedCount) + " of " + d(e.total) + " selected ", 1)) : (n(), o("div", U, " Showing " + d($.value) + " to " + d(j.value) + " of " + d(e.total) + " entries ", 1)),
162
+ r.$slots.footer ? (n(), o("div", G, [
163
+ L(r.$slots, "footer")
164
+ ])) : y("", !0),
165
+ e.showPagination ? (n(), o("div", H, [
166
+ s("div", J, [
167
+ P(E, {
168
+ for: "pageSize",
169
+ class: l(M.value),
170
+ inline: !0
171
+ }, {
172
+ default: k(() => [...t[5] || (t[5] = [
173
+ I("Show:", -1)
174
+ ])]),
175
+ _: 1
176
+ }, 8, ["class"]),
177
+ P(O, {
178
+ id: "pageSize",
179
+ "model-value": e.pageSize.toString(),
180
+ class: l(q.value),
181
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => r.$emit("update:pageSize", parseInt(a)))
182
+ }, {
183
+ default: k(() => [
184
+ (n(!0), o(w, null, h(e.pageSizeOptions, (a) => (n(), D(F, {
185
+ key: a,
186
+ value: a.toString(),
187
+ label: a.toString()
188
+ }, null, 8, ["value", "label"]))), 128))
189
+ ]),
190
+ _: 1
191
+ }, 8, ["model-value", "class"])
192
+ ]),
193
+ s("div", K, [
194
+ s("button", {
195
+ disabled: e.currentPage === 1,
196
+ class: l([m(!1, e.currentPage === 1), "hidden sm:inline-flex"]),
197
+ title: "First page",
198
+ onClick: t[1] || (t[1] = (a) => r.$emit("update:currentPage", 1))
199
+ }, [...t[6] || (t[6] = [
200
+ s("svg", {
201
+ class: "w-4 h-4",
202
+ fill: "none",
203
+ viewBox: "0 0 24 24",
204
+ "stroke-width": "1.5",
205
+ stroke: "currentColor"
206
+ }, [
207
+ s("path", {
208
+ "stroke-linecap": "round",
209
+ "stroke-linejoin": "round",
210
+ d: "m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"
211
+ })
212
+ ], -1)
213
+ ])], 10, Q),
214
+ s("button", {
215
+ disabled: e.currentPage === 1,
216
+ class: l(m(!1, e.currentPage === 1)),
217
+ title: "Previous page",
218
+ onClick: t[2] || (t[2] = (a) => r.$emit("update:currentPage", e.currentPage - 1))
219
+ }, [...t[7] || (t[7] = [
220
+ s("svg", {
221
+ class: "w-4 h-4",
222
+ fill: "none",
223
+ viewBox: "0 0 24 24",
224
+ "stroke-width": "1.5",
225
+ stroke: "currentColor"
226
+ }, [
227
+ s("path", {
228
+ "stroke-linecap": "round",
229
+ "stroke-linejoin": "round",
230
+ d: "M15.75 19.5L8.25 12l7.5-7.5"
231
+ })
232
+ ], -1)
233
+ ])], 10, R),
234
+ s("div", W, [
235
+ (n(!0), o(w, null, h(B.value, (a) => (n(), o("button", {
236
+ key: a,
237
+ class: l(m(a === e.currentPage, !1)),
238
+ onClick: (u) => r.$emit("update:currentPage", a)
239
+ }, d(a), 11, X))), 128))
240
+ ]),
241
+ s("button", {
242
+ disabled: e.currentPage === e.totalPages,
243
+ class: l(m(!1, e.currentPage === e.totalPages)),
244
+ title: "Next page",
245
+ onClick: t[3] || (t[3] = (a) => r.$emit("update:currentPage", e.currentPage + 1))
246
+ }, [...t[8] || (t[8] = [
247
+ s("svg", {
248
+ class: "w-4 h-4",
249
+ fill: "none",
250
+ viewBox: "0 0 24 24",
251
+ "stroke-width": "1.5",
252
+ stroke: "currentColor"
253
+ }, [
254
+ s("path", {
255
+ "stroke-linecap": "round",
256
+ "stroke-linejoin": "round",
257
+ d: "m8.25 4.5 7.5 7.5-7.5 7.5"
258
+ })
259
+ ], -1)
260
+ ])], 10, Y),
261
+ s("button", {
262
+ disabled: e.currentPage === e.totalPages,
263
+ class: l([m(!1, e.currentPage === e.totalPages), "hidden sm:inline-flex"]),
264
+ title: "Last page",
265
+ onClick: t[4] || (t[4] = (a) => r.$emit("update:currentPage", e.totalPages))
266
+ }, [...t[9] || (t[9] = [
267
+ s("svg", {
268
+ class: "w-4 h-4",
269
+ fill: "none",
270
+ viewBox: "0 0 24 24",
271
+ "stroke-width": "1.5",
272
+ stroke: "currentColor"
273
+ }, [
274
+ s("path", {
275
+ "stroke-linecap": "round",
276
+ "stroke-linejoin": "round",
277
+ d: "m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"
278
+ })
279
+ ], -1)
280
+ ])], 10, Z)
281
+ ]),
282
+ s("div", _, " Page " + d(e.currentPage) + " of " + d(e.totalPages), 1)
283
+ ])) : y("", !0)
284
+ ])
285
+ ], 2)) : y("", !0);
286
+ }
287
+ };
288
+ export {
289
+ ne as default
290
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("class-variance-authority"),s=require("../utils/cn.cjs"),w=require("./Checkbox.cjs"),B=require("./DataTableCell.cjs"),S={__name:"DataTableRow",props:{item:{type:Object,required:!0},columns:{type:Array,required:!0},index:{type:Number,required:!0},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},striped:{type:Boolean,default:!0},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:a=>["compact","normal","comfortable"].includes(a)},variant:{type:String,default:"default",validator:a=>["default","bordered","minimal"].includes(a)},rowClass:{type:[String,Array,Object],default:""}},emits:["toggle-selection","row-click"],setup(a,{emit:u}){const l=a,f=u,m=d.cva("transition-colors",{variants:{striped:{true:"odd:bg-[color:color-mix(in oklab, var(--ui-primary-soft) 72%, var(--ui-surface) 28%)] even:bg-(--ui-surface-soft)",false:""},hoverable:{true:"hover:bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 20%)]",false:""},clickable:{true:"cursor-pointer hover:bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 20%)]",false:""},selected:{true:"ui-primary-soft border-l-2 border-(--ui-primary)",false:""},variant:{default:"border-b border-(--ui-border-strong) ",bordered:"border-b border-(--ui-border-strong) ",minimal:"border-b border-(--ui-border-strong) "}},compoundVariants:[{hoverable:!0,clickable:!0,class:"hover:bg-(--ui-surface)"}],defaultVariants:{striped:!1,hoverable:!0,clickable:!1,selected:!1,variant:"default"}}),c=d.cva("whitespace-nowrap text-sm ui-text",{variants:{density:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{density:"normal",align:"left"}}),i=r=>typeof r=="string"?r:r?.key||r?.field||"unknown",n=(r,o)=>{const t=i(o);return typeof o=="object"&&o.accessor?o.accessor(r):t&&t.includes(".")?t.split(".").reduce((C,h)=>C?.[h],r):r?.[t]},b=(r,o)=>{const t=n(r,o);return typeof o=="object"&&o.formatter?o.formatter(t,r):t==null?"":t instanceof Date?t.toLocaleDateString():Array.isArray(t)?t.join(", "):t},y=()=>{l.clickableRows&&f("row-click",{item:l.item,index:l.index})},g=r=>typeof r=="object"&&r.align?r.align:"left",v=e.computed(()=>s.cn(m({striped:l.striped,hoverable:l.hoverable&&!l.clickableRows,clickable:l.clickableRows,selected:l.isSelected,variant:l.variant}),l.rowClass)),p=()=>({compact:"sm",normal:"md",comfortable:"lg"})[l.density]||"md",k=e.computed(()=>s.cn(c({density:l.density}),"w-12")),x=e.computed(()=>s.cn(c({density:l.density,align:"right"}),"font-medium"));return(r,o)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass(v.value),onClick:y},[a.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(k.value)},[e.createVNode(w.default,{"model-value":a.isSelected,"onUpdate:modelValue":o[0]||(o[0]=t=>r.$emit("toggle-selection",a.item))},null,8,["model-value"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,t=>(e.openBlock(),e.createBlock(B.default,{key:i(t),item:a.item,column:t,value:n(a.item,t),align:g(t),padding:a.density,"text-size":p(),"text-color":t.textColor},{default:e.withCtx(()=>[e.renderSlot(r.$slots,`cell-${i(t)}`,{item:a.item,value:n(a.item,t),column:t,index:a.index},()=>[e.createTextVNode(e.toDisplayString(b(a.item,t)),1)])]),_:2},1032,["item","column","value","align","padding","text-size","text-color"]))),128)),r.$slots.actions?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(x.value)},[e.renderSlot(r.$slots,"actions",{item:a.item,index:a.index})],2)):e.createCommentVNode("",!0)],2))}};exports.default=S;
@@ -0,0 +1,199 @@
1
+ import { computed as c, createElementBlock as o, openBlock as i, normalizeClass as d, createCommentVNode as m, createVNode as j, Fragment as z, renderList as R, createBlock as A, withCtx as D, renderSlot as b, createTextVNode as N, toDisplayString as q } from "vue";
2
+ import { cva as y } from "class-variance-authority";
3
+ import { cn as u } from "../utils/cn.js";
4
+ import T from "./Checkbox.js";
5
+ import L from "./DataTableCell.js";
6
+ const G = {
7
+ __name: "DataTableRow",
8
+ props: {
9
+ item: {
10
+ type: Object,
11
+ required: !0
12
+ },
13
+ columns: {
14
+ type: Array,
15
+ required: !0
16
+ },
17
+ index: {
18
+ type: Number,
19
+ required: !0
20
+ },
21
+ selectable: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ isSelected: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ striped: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ hoverable: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ clickableRows: {
38
+ type: Boolean,
39
+ default: !1
40
+ },
41
+ density: {
42
+ type: String,
43
+ default: "normal",
44
+ validator: (r) => ["compact", "normal", "comfortable"].includes(r)
45
+ },
46
+ variant: {
47
+ type: String,
48
+ default: "default",
49
+ validator: (r) => ["default", "bordered", "minimal"].includes(r)
50
+ },
51
+ rowClass: {
52
+ type: [String, Array, Object],
53
+ default: ""
54
+ }
55
+ },
56
+ emits: ["toggle-selection", "row-click"],
57
+ setup(r, { emit: g }) {
58
+ const a = r, v = g, p = y(
59
+ "transition-colors",
60
+ {
61
+ variants: {
62
+ striped: {
63
+ true: "odd:bg-[color:color-mix(in oklab, var(--ui-primary-soft) 72%, var(--ui-surface) 28%)] even:bg-(--ui-surface-soft)",
64
+ false: ""
65
+ },
66
+ hoverable: {
67
+ true: "hover:bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 20%)]",
68
+ false: ""
69
+ },
70
+ clickable: {
71
+ true: "cursor-pointer hover:bg-[color:color-mix(in oklab, var(--ui-primary-soft), transparent 20%)]",
72
+ false: ""
73
+ },
74
+ selected: {
75
+ true: "ui-primary-soft border-l-2 border-(--ui-primary)",
76
+ false: ""
77
+ },
78
+ variant: {
79
+ default: "border-b border-(--ui-border-strong) ",
80
+ bordered: "border-b border-(--ui-border-strong) ",
81
+ minimal: "border-b border-(--ui-border-strong) "
82
+ }
83
+ },
84
+ compoundVariants: [
85
+ {
86
+ hoverable: !0,
87
+ clickable: !0,
88
+ class: "hover:bg-(--ui-surface)"
89
+ }
90
+ ],
91
+ defaultVariants: {
92
+ striped: !1,
93
+ hoverable: !0,
94
+ clickable: !1,
95
+ selected: !1,
96
+ variant: "default"
97
+ }
98
+ }
99
+ ), f = y("whitespace-nowrap text-sm ui-text", {
100
+ variants: {
101
+ density: {
102
+ compact: "px-4 py-2",
103
+ normal: "px-6 py-4",
104
+ comfortable: "px-8 py-6"
105
+ },
106
+ align: {
107
+ left: "text-left",
108
+ center: "text-center",
109
+ right: "text-right"
110
+ }
111
+ },
112
+ defaultVariants: {
113
+ density: "normal",
114
+ align: "left"
115
+ }
116
+ }), s = (t) => typeof t == "string" ? t : t?.key || t?.field || "unknown", n = (t, l) => {
117
+ const e = s(l);
118
+ return typeof l == "object" && l.accessor ? l.accessor(t) : e && e.includes(".") ? e.split(".").reduce((B, $) => B?.[$], t) : t?.[e];
119
+ }, k = (t, l) => {
120
+ const e = n(t, l);
121
+ return typeof l == "object" && l.formatter ? l.formatter(e, t) : e == null ? "" : e instanceof Date ? e.toLocaleDateString() : Array.isArray(e) ? e.join(", ") : e;
122
+ }, x = () => {
123
+ a.clickableRows && v("row-click", { item: a.item, index: a.index });
124
+ }, C = (t) => typeof t == "object" && t.align ? t.align : "left", w = c(
125
+ () => u(p({
126
+ striped: a.striped,
127
+ hoverable: a.hoverable && !a.clickableRows,
128
+ clickable: a.clickableRows,
129
+ selected: a.isSelected,
130
+ variant: a.variant
131
+ }), a.rowClass)
132
+ ), h = () => ({
133
+ compact: "sm",
134
+ normal: "md",
135
+ comfortable: "lg"
136
+ })[a.density] || "md", V = c(
137
+ () => u(
138
+ f({ density: a.density }),
139
+ "w-12"
140
+ )
141
+ ), S = c(
142
+ () => u(
143
+ f({
144
+ density: a.density,
145
+ align: "right"
146
+ }),
147
+ "font-medium"
148
+ )
149
+ );
150
+ return (t, l) => (i(), o("tr", {
151
+ class: d(w.value),
152
+ onClick: x
153
+ }, [
154
+ r.selectable ? (i(), o("td", {
155
+ key: 0,
156
+ class: d(V.value)
157
+ }, [
158
+ j(T, {
159
+ "model-value": r.isSelected,
160
+ "onUpdate:modelValue": l[0] || (l[0] = (e) => t.$emit("toggle-selection", r.item))
161
+ }, null, 8, ["model-value"])
162
+ ], 2)) : m("", !0),
163
+ (i(!0), o(z, null, R(r.columns, (e) => (i(), A(L, {
164
+ key: s(e),
165
+ item: r.item,
166
+ column: e,
167
+ value: n(r.item, e),
168
+ align: C(e),
169
+ padding: r.density,
170
+ "text-size": h(),
171
+ "text-color": e.textColor
172
+ }, {
173
+ default: D(() => [
174
+ b(t.$slots, `cell-${s(e)}`, {
175
+ item: r.item,
176
+ value: n(r.item, e),
177
+ column: e,
178
+ index: r.index
179
+ }, () => [
180
+ N(q(k(r.item, e)), 1)
181
+ ])
182
+ ]),
183
+ _: 2
184
+ }, 1032, ["item", "column", "value", "align", "padding", "text-size", "text-color"]))), 128)),
185
+ t.$slots.actions ? (i(), o("td", {
186
+ key: 1,
187
+ class: d(S.value)
188
+ }, [
189
+ b(t.$slots, "actions", {
190
+ item: r.item,
191
+ index: r.index
192
+ })
193
+ ], 2)) : m("", !0)
194
+ ], 2));
195
+ }
196
+ };
197
+ export {
198
+ G as default
199
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("./Button.cjs"),V=require("./Icon.cjs"),_=require("./FilterDrawer.cjs"),f=require("class-variance-authority"),c=require("../utils/cn.cjs"),ee=require("../_plugin-vue_export-helper-BHFhmbuH.cjs"),te={class:"flex flex-col rounded-2xl mb-2 px-2"},oe={class:"flex items-center gap-3"},le={key:0,class:"flex items-center gap-3"},ne={class:"text-sm ui-text"},re={class:"flex items-center gap-2"},ae={class:"flex items-center gap-3"},se=["title","onClick"],ie={key:1,class:"relative"},ue={class:"p-3"},de={class:"space-y-1"},ce={class:"flex items-center gap-2 cursor-pointer w-full"},me=["checked","onChange"],fe=["disabled"],pe={key:3,class:"flex items-center gap-2"},ve={key:4,class:"relative"},ge=["value","placeholder"],be={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"},ye={key:7,class:"flex items-center gap-2"},ke={key:1,class:"mt-2 px-3 py-2 border ui-border-strong rounded-lg flex flex-wrap items-center gap-2 ui-surface"},he=["onClick"],Be=[{key:"delete",label:"Delete",icon:{render(){return e.h("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})])}},variant:"danger"},{key:"edit",label:"Edit",icon:{render(){return e.h("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})])}},variant:"primary"}],Ce={name:"DataTableToolBar"},xe=Object.assign(Ce,{props:{selectedItems:{type:Array,default:()=>[]},totalItems:{type:Number,default:0},itemLabel:{type:String,default:"items"},showTableInfo:{type:Boolean,default:!1},showItemCount:{type:Boolean,default:!1},bulkActions:{type:Array,default:()=>Be},showDensityToggle:{type:Boolean,default:!0},showColumnToggle:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},searchQuery:{type:String,default:""},searchPlaceholder:{type:String,default:"Search..."},addButton:{type:Object,default:()=>({})},isRefreshing:{type:Boolean,default:!1},density:{type:String,default:"compact",validator:o=>["compact","normal","comfortable"].includes(o)},toggleableColumns:{type:Array,default:()=>[]},visibleColumns:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:o=>["default","minimal","bordered"].includes(o)},padding:{type:String,default:"normal",validator:o=>["compact","normal","comfortable"].includes(o)},themeScope:{type:String,default:"default",validator:o=>["default","module"].includes(o)},activeFilters:{type:Array,default:()=>[]},enableFilters:{type:Boolean,default:!1},filterFields:{type:Array,default:()=>[]},filterRules:{type:Object,default:()=>({logic:"all",rules:[]})},defaultFilterRules:{type:Object,default:()=>({logic:"all",rules:[]})}},emits:["bulk-action","update:density","toggle-column","refresh","update:search-query","add","add-button-click","update:filterRules"],setup(o,{emit:E}){const r=o,s=E,i=e.ref(!1),p=e.ref(!1),g=e.ref(!1),u=e.ref(null),v=e.ref(null),b=e.ref({}),y=e.computed(()=>r.selectedItems.length),k=e.computed(()=>Object.keys(r.addButton||{}).length>0),N=e.computed(()=>k.value?r.addButton.permission===void 0?!0:typeof r.addButton.permission=="function"?r.addButton.permission():!!r.addButton.permission:!1),h=e.computed(()=>!k.value||!N.value?!1:typeof r.addButton.visible=="function"?r.addButton.visible():r.addButton.visible===void 0?!0:!!r.addButton.visible),B=e.computed(()=>h.value?typeof r.addButton.disabled=="function"?r.addButton.disabled():!!r.addButton.disabled:!0),S=e.computed(()=>r.addButton.tooltip||r.addButton.label||"Add new item"),A=[{value:"compact",label:"Compact",icon:["fas","minus"]},{value:"normal",label:"Normal",icon:["fas","bars"]},{value:"comfortable",label:"Comfortable",icon:["fas","bars-staggered"]}],R=f.cva("flex items-center justify-between border ui-border-strong rounded-2xl",{variants:{variant:{default:"ui-border-strong",minimal:"bg-transparent ui-border-strong",bordered:" ui-border-strong"},padding:{compact:"p-2",normal:"p-4",comfortable:"p-6"}},defaultVariants:{variant:"default",padding:"normal"}}),F=f.cva("px-3 py-1.5 text-sm font-medium rounded-md flex items-center gap-1 transition-colors ",{variants:{variant:{danger:"ui-danger ui-danger-bg hover:bg-(--ui-danger-soft) border border-(--ui-danger-soft)",primary:"ui-primary ui-primary-soft hover:bg-(--ui-primary-soft) border border-(--ui-primary-soft)",secondary:"ui-text ui-bg hover:bg-(--ui-bg) border ui-border-strong"}},defaultVariants:{variant:"secondary"}}),$=f.cva("p-2 border ui-border-strong transition-colors ",{variants:{active:{true:"ui-primary-soft ui-primary border-(--ui-primary-soft)",false:"ui-surface ui-text hover:bg-(--ui-surface)"},position:{first:"rounded-l-md border-r-0",middle:"border-x-0",last:"rounded-r-md border-l-0"}},defaultVariants:{active:!1,position:"middle"}}),z=f.cva("px-3 py-2 text-sm border ui-border-strong rounded-md flex items-center gap-2 transition-colors ",{variants:{state:{normal:"ui-text hover:text-(--ui-text) hover:bg-(--ui-surface)",refreshing:"ui-text opacity-75 cursor-not-allowed"}},defaultVariants:{state:"normal"}}),D=e.computed(()=>c.cn(R({variant:r.variant,padding:r.padding}),r.themeScope==="module"&&"kv-module-themed-toolbar")),T=e.computed(()=>"text-md ui-text"),L=e.computed(()=>"flex items-center"),I=e.computed(()=>"flex items-center gap-2 px-3 py-2 text-sm ui-text hover:text-(--ui-text) border ui-border-strong rounded-md hover:brightness-105 transition-colors focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:ring-offset-1"),M=e.computed(()=>"ui-bg rounded-lg shadow-lg z-[9999] max-h-64 overflow-y-auto"),j=e.computed(()=>"text-xs font-medium ui-text uppercase tracking-wider mb-2 border-b ui-border-strong pb-2"),q=e.computed(()=>"py-1 hover:bg-(--ui-surface) rounded transition-colors"),O=e.computed(()=>"w-4 h-4 rounded ui-border-strong ui-primary focus:ring-(--ui-primary) focus:ring-2 focus:ring-offset-1"),H=e.computed(()=>"text-sm ui-text flex-1 select-none"),P=e.computed(()=>"w-72 pl-9 pr-3 py-2 text-sm border ui-border-strong rounded-md ui-surface ui-text placeholder:text-(--ui-text-muted) focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent transition-all"),d=()=>{if(!u.value)return;const t=u.value.getBoundingClientRect(),l=224,a=Math.max(12,t.right-l);b.value={position:"fixed",top:`${t.bottom+6}px`,left:`${a}px`,width:`${l}px`,zIndex:9999}},C=t=>{u.value&&v.value&&!u.value.contains(t.target)&&!v.value.contains(t.target)&&(i.value=!1)},Q=()=>{i.value=!i.value,i.value&&d()},U=t=>c.cn(F({variant:t.variant||"secondary"})),Z=t=>{let l="middle";return t==="compact"?l="first":t==="comfortable"&&(l="last"),c.cn($({active:r.density===t,position:l}))},G=()=>c.cn(z({state:r.isRefreshing?"refreshing":"normal"})),J=()=>c.cn("w-4 h-4",{"animate-spin":r.isRefreshing}),K=t=>r.visibleColumns.includes(t),W=(t,l)=>{s("toggle-column",{column:t,visible:l})},X=()=>{B.value||(s("add"),s("add-button-click",r.addButton),typeof r.addButton.onClick=="function"&&r.addButton.onClick())},x=e.computed(()=>(r.filterRules?.rules||[]).map(t=>({id:t.id,label:t.label,value:typeof t.value=="object"?`${t.value.from||""}${t.value.from||t.value.to?" to ":""}${t.value.to||""}`:String(t.value??"")}))),Y=t=>{const l=Array.isArray(r.filterRules?.rules)?r.filterRules.rules:[];s("update:filterRules",{logic:r.filterRules?.logic||"all",rules:l.filter(a=>a.id!==t)})};return e.watch(()=>r.defaultFilterRules,t=>{if(g.value||!r.enableFilters)return;const l=Array.isArray(t?.rules)?t.rules:[];l.length!==0&&(s("update:filterRules",{logic:t?.logic||"all",rules:l}),g.value=!0)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",C),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d)}),e.onUnmounted(()=>{document.removeEventListener("click",C),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}),(t,l)=>{const a=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",{class:e.normalizeClass(D.value)},[e.createElementVNode("div",oe,[y.value>0?(e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("span",ne,e.toDisplayString(y.value)+" selected ",1),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.bulkActions,n=>(e.openBlock(),e.createBlock(w.default,{key:n.key,class:e.normalizeClass(U(n)),onClick:m=>t.$emit("bulk-action",{action:n.key,items:o.selectedItems})},{default:e.withCtx(()=>[n.icon?(e.openBlock(),e.createBlock(a,{key:0,icon:n.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)]),_:2},1032,["class","onClick"]))),128))])])):o.showItemCount&&o.totalItems>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(T.value)},e.toDisplayString(o.totalItems)+" "+e.toDisplayString(o.itemLabel),3)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ae,[o.showDensityToggle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(L.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,n=>e.createElementVNode("button",{key:n.value,class:e.normalizeClass(Z(n.value)),title:n.label,type:"button",onClick:m=>t.$emit("update:density",n.value)},[e.createVNode(a,{icon:n.icon,class:"w-4 h-4"},null,8,["icon"])],10,se)),64))],2)):e.createCommentVNode("",!0),o.showColumnToggle?(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("button",{ref_key:"columnToggleButton",ref:u,class:e.normalizeClass(I.value),type:"button",onClick:e.withModifiers(Q,["stop"])},[e.createVNode(a,{icon:"columns",class:"w-4 h-4"}),l[7]||(l[7]=e.createElementVNode("span",null,"Columns",-1))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"columnMenu",ref:v,class:e.normalizeClass(M.value),style:e.normalizeStyle(b.value),onClick:l[0]||(l[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ue,[e.createElementVNode("div",{class:e.normalizeClass(j.value)}," Show Columns ",2),e.createElementVNode("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.toggleableColumns,n=>(e.openBlock(),e.createElementBlock("div",{key:n.key,class:e.normalizeClass(q.value)},[e.createElementVNode("label",ce,[e.createElementVNode("input",{type:"checkbox",checked:K(n.key),class:e.normalizeClass(O.value),onChange:m=>W(n.key,m.target.checked)},null,42,me),e.createElementVNode("span",{class:e.normalizeClass(H.value)},e.toDisplayString(n.label),3)])],2))),128))])])],6),[[e.vShow,i.value]])]))])):e.createCommentVNode("",!0),o.showRefresh?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:o.isRefreshing,class:e.normalizeClass(G()),type:"button",onClick:l[1]||(l[1]=n=>t.$emit("refresh"))},[e.createVNode(a,{icon:"sync",class:e.normalizeClass(J())},null,8,["class"]),l[8]||(l[8]=e.createElementVNode("span",null,"Refresh",-1))],10,fe)):e.createCommentVNode("",!0),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(t.$slots,"actions",{},void 0,!0)])):e.createCommentVNode("",!0),o.showSearch?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(a,{icon:"search",class:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 ui-text-soft"}),e.createElementVNode("input",{value:o.searchQuery,type:"text",placeholder:o.searchPlaceholder,class:e.normalizeClass(P.value),onInput:l[2]||(l[2]=n=>t.$emit("update:search-query",n.target.value))},null,42,ge)])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createBlock(w.default,{key:5,variant:o.addButton.variant||"success",disabled:B.value,title:S.value,onClick:X},{default:e.withCtx(()=>[e.createVNode(V.default,{icon:o.addButton.icon||"plus"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(o.addButton.label||"Add"),1)]),_:1},8,["variant","disabled","title"])):e.createCommentVNode("",!0),o.enableFilters?(e.openBlock(),e.createElementBlock("button",{key:6,class:"px-3 py-2 text-sm border ui-border-strong rounded-md hover:bg-(--ui-surface) flex items-center gap-2",onClick:l[3]||(l[3]=n=>p.value=!0)},[e.createVNode(a,{icon:"filter"}),l[9]||(l[9]=e.createTextVNode(" Filter ",-1)),(o.filterRules.rules||[]).length?(e.openBlock(),e.createElementBlock("span",be,e.toDisplayString((o.filterRules.rules||[]).length),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.$slots["actions-after-add"]?(e.openBlock(),e.createElementBlock("div",ye,[e.renderSlot(t.$slots,"actions-after-add",{},void 0,!0)])):e.createCommentVNode("",!0)])],2),o.enableFilters?(e.openBlock(),e.createBlock(_.default,{key:0,open:p.value,fields:o.filterFields,"model-value":o.filterRules,"onUpdate:modelValue":l[4]||(l[4]=n=>t.$emit("update:filterRules",n)),onClose:l[5]||(l[5]=n=>p.value=!1)},null,8,["open","fields","model-value"])):e.createCommentVNode("",!0),(o.enableFilters?x.value.length>0:o.activeFilters.length>0)?(e.openBlock(),e.createElementBlock("div",ke,[l[10]||(l[10]=e.createElementVNode("span",{class:"text-sm ui-text-soft"},"Filters:",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.enableFilters?x.value:o.activeFilters,n=>(e.openBlock(),e.createElementBlock("span",{key:n.id||`${n.label}-${n.value}`,class:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm border ui-border-strong ui-text"},[e.createTextVNode(e.toDisplayString(n.label)+": "+e.toDisplayString(n.value)+" ",1),o.enableFilters&&n.id?(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 ui-text-soft hover:ui-primary",onClick:m=>Y(n.id)},[e.createVNode(V.default,{icon:"xmark",class:"w-3 h-3"})],8,he)):e.createCommentVNode("",!0)]))),128)),o.enableFilters?(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 px-2 py-1 text-sm border border-(--ui-primary) rounded-md ui-primary hover:bg-(--ui-primary-soft)",onClick:l[6]||(l[6]=n=>t.$emit("update:filterRules",{logic:o.defaultFilterRules?.logic||"all",rules:o.defaultFilterRules?.rules||[]}))}," Clear filter ")):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"active-filter-actions",{},void 0,!0)])):e.createCommentVNode("",!0)])}}}),we=ee._export_sfc(xe,[["__scopeId","data-v-b6fc1eb4"]]);exports.default=we;