cisse-vue-ui 0.5.11 → 0.5.13

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.
@@ -5,52 +5,58 @@ const BadgeType_vue_vue_type_script_setup_true_lang = require("./BadgeType.vue_v
5
5
  const vue$1 = require("@iconify/vue");
6
6
  const useDropdown = require("./useDropdown-DHFnd259.cjs");
7
7
  const _hoisted_1$c = { class: "flex flex-col overflow-hidden rounded-lg bg-white shadow-md dark:bg-slate-950" };
8
- const _hoisted_2$9 = {
9
- key: 0,
10
- class: "border-b border-gray-200 dark:border-gray-700"
11
- };
8
+ const _hoisted_2$9 = { class: "flex flex-col gap-0.5" };
12
9
  const _hoisted_3$7 = {
13
- key: 1,
14
- class: "flex items-center justify-between border-b border-gray-200 px-5 py-3 dark:border-gray-700"
15
- };
16
- const _hoisted_4$6 = { class: "flex flex-col gap-0.5" };
17
- const _hoisted_5$4 = {
18
- key: 0,
19
- class: "text-md font-semibold text-gray-800 dark:text-gray-200"
20
- };
21
- const _hoisted_6$4 = {
22
10
  key: 1,
23
11
  class: "text-sm font-normal text-gray-600 dark:text-gray-400"
24
12
  };
25
- const _hoisted_7$4 = { class: "flex gap-2" };
13
+ const _hoisted_4$6 = { class: "flex gap-2" };
26
14
  const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
27
15
  __name: "CardComponent",
28
16
  props: {
29
17
  title: {},
30
- description: {}
18
+ description: {},
19
+ titleClass: {},
20
+ dividerClass: {}
31
21
  },
32
22
  setup(__props) {
23
+ const props = __props;
24
+ const titleClasses = vue.computed(
25
+ () => props.titleClass || "text-gray-800 dark:text-gray-200"
26
+ );
27
+ const dividerClasses = vue.computed(
28
+ () => props.dividerClass || "border-gray-200 dark:border-gray-700"
29
+ );
33
30
  return (_ctx, _cache) => {
34
31
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
35
- _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
32
+ _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", {
33
+ key: 0,
34
+ class: vue.normalizeClass(["border-b", dividerClasses.value])
35
+ }, [
36
36
  vue.renderSlot(_ctx.$slots, "header")
37
- ])) : __props.title || __props.description || _ctx.$slots.title || _ctx.$slots.description || _ctx.$slots.actions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$7, [
38
- vue.createElementVNode("div", _hoisted_4$6, [
39
- __props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$4, [
37
+ ], 2)) : __props.title || __props.description || _ctx.$slots.title || _ctx.$slots.description || _ctx.$slots.actions ? (vue.openBlock(), vue.createElementBlock("div", {
38
+ key: 1,
39
+ class: vue.normalizeClass(["flex items-center justify-between border-b px-5 py-3", dividerClasses.value])
40
+ }, [
41
+ vue.createElementVNode("div", _hoisted_2$9, [
42
+ __props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
43
+ key: 0,
44
+ class: vue.normalizeClass(["text-md font-semibold", titleClasses.value])
45
+ }, [
40
46
  vue.renderSlot(_ctx.$slots, "title", {}, () => [
41
47
  vue.createTextVNode(vue.toDisplayString(__props.title), 1)
42
48
  ])
43
- ])) : vue.createCommentVNode("", true),
44
- __props.description || _ctx.$slots.description ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$4, [
49
+ ], 2)) : vue.createCommentVNode("", true),
50
+ __props.description || _ctx.$slots.description ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$7, [
45
51
  vue.renderSlot(_ctx.$slots, "description", {}, () => [
46
52
  vue.createTextVNode(vue.toDisplayString(__props.description), 1)
47
53
  ])
48
54
  ])) : vue.createCommentVNode("", true)
49
55
  ]),
50
- vue.createElementVNode("div", _hoisted_7$4, [
56
+ vue.createElementVNode("div", _hoisted_4$6, [
51
57
  vue.renderSlot(_ctx.$slots, "actions")
52
58
  ])
53
- ])) : vue.createCommentVNode("", true),
59
+ ], 2)) : vue.createCommentVNode("", true),
54
60
  vue.renderSlot(_ctx.$slots, "default")
55
61
  ]);
56
62
  };
@@ -64,20 +70,29 @@ const _hoisted_5$3 = {
64
70
  key: 0,
65
71
  class: "w-12 px-3 py-3"
66
72
  };
67
- const _hoisted_6$3 = {
73
+ const _hoisted_6$3 = ["onClick"];
74
+ const _hoisted_7$3 = {
75
+ key: 0,
76
+ d: "M7 14l5-5 5 5H7z"
77
+ };
78
+ const _hoisted_8$3 = {
79
+ key: 1,
80
+ d: "M7 10l5 5 5-5H7z"
81
+ };
82
+ const _hoisted_9$3 = {
68
83
  key: 1,
69
84
  class: "px-3 py-3 text-right"
70
85
  };
71
- const _hoisted_7$3 = { class: "divide-y divide-black/10 font-medium dark:divide-white/10" };
72
- const _hoisted_8$3 = {
86
+ const _hoisted_10$2 = { class: "divide-y divide-black/10 font-medium dark:divide-white/10" };
87
+ const _hoisted_11$1 = {
73
88
  key: 0,
74
89
  class: "px-3 py-4"
75
90
  };
76
- const _hoisted_9$3 = {
91
+ const _hoisted_12$1 = {
77
92
  key: 1,
78
93
  class: "flex items-center justify-end gap-2 px-3 py-4"
79
94
  };
80
- const _hoisted_10$2 = { key: 0 };
95
+ const _hoisted_13 = { key: 0 };
81
96
  const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
82
97
  __name: "TableComponent",
83
98
  props: {
@@ -86,9 +101,11 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
86
101
  selectable: { type: Boolean, default: false },
87
102
  selectedItems: {},
88
103
  selectableFilter: {},
89
- keyField: { default: "id" }
104
+ keyField: { default: "id" },
105
+ sortBy: {},
106
+ sortDirection: {}
90
107
  },
91
- emits: ["select", "selectAll"],
108
+ emits: ["select", "selectAll", "sort"],
92
109
  setup(__props, { emit: __emit }) {
93
110
  const slots = vue.useSlots();
94
111
  const props = __props;
@@ -166,6 +183,14 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
166
183
  emit("select", getKey(item));
167
184
  };
168
185
  const hasActionSlot = vue.computed(() => !!slots.action);
186
+ const handleSort = (property) => {
187
+ if (!property.sortable) return;
188
+ const newDirection = props.sortBy === property.name && props.sortDirection === "asc" ? "desc" : "asc";
189
+ emit("sort", property.name, newDirection);
190
+ };
191
+ const isSortedColumn = (property) => {
192
+ return props.sortBy === property.name;
193
+ };
169
194
  return (_ctx, _cache) => {
170
195
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
171
196
  vue.createElementVNode("div", _hoisted_2$8, [
@@ -183,23 +208,55 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
183
208
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(visibleProperties.value, (property) => {
184
209
  return vue.openBlock(), vue.createElementBlock("th", {
185
210
  key: property.name,
186
- class: vue.normalizeClass([getAlignmentClass(property.align), "px-3 py-3"])
211
+ class: vue.normalizeClass([
212
+ getAlignmentClass(property.align),
213
+ "px-3 py-3",
214
+ property.sortable ? "cursor-pointer select-none hover:bg-black/5 dark:hover:bg-white/5" : ""
215
+ ]),
216
+ onClick: ($event) => handleSort(property)
187
217
  }, [
188
- vue.renderSlot(_ctx.$slots, "header-" + property.name, { property }, () => [
189
- vue.createTextVNode(vue.toDisplayString(property.label ?? property.name), 1)
190
- ])
191
- ], 2);
218
+ vue.createElementVNode("div", {
219
+ class: vue.normalizeClass(["flex items-center gap-1", {
220
+ "justify-center": property.align === "center",
221
+ "justify-end": property.align === "right"
222
+ }])
223
+ }, [
224
+ vue.renderSlot(_ctx.$slots, "header-" + property.name, { property }, () => [
225
+ vue.createTextVNode(vue.toDisplayString(property.label ?? property.name), 1)
226
+ ]),
227
+ property.sortable ? (vue.openBlock(), vue.createElementBlock("svg", {
228
+ key: 0,
229
+ class: vue.normalizeClass([
230
+ "w-4 h-4 transition-colors",
231
+ isSortedColumn(property) ? "text-primary-500" : "text-gray-400"
232
+ ]),
233
+ viewBox: "0 0 24 24",
234
+ fill: "currentColor"
235
+ }, [
236
+ isSortedColumn(property) && __props.sortDirection === "asc" ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_7$3)) : isSortedColumn(property) && __props.sortDirection === "desc" ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_8$3)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
237
+ _cache[1] || (_cache[1] = vue.createElementVNode("path", {
238
+ d: "M7 14l5-5 5 5H7z",
239
+ class: "opacity-40"
240
+ }, null, -1)),
241
+ _cache[2] || (_cache[2] = vue.createElementVNode("path", {
242
+ d: "M7 10l5 5 5-5H7z",
243
+ class: "opacity-40"
244
+ }, null, -1))
245
+ ], 64))
246
+ ], 2)) : vue.createCommentVNode("", true)
247
+ ], 2)
248
+ ], 10, _hoisted_6$3);
192
249
  }), 128)),
193
- hasActionSlot.value ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_6$3)) : vue.createCommentVNode("", true)
250
+ hasActionSlot.value ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_9$3)) : vue.createCommentVNode("", true)
194
251
  ])
195
252
  ]),
196
- vue.createElementVNode("tbody", _hoisted_7$3, [
253
+ vue.createElementVNode("tbody", _hoisted_10$2, [
197
254
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.items, (item) => {
198
255
  return vue.openBlock(), vue.createElementBlock("tr", {
199
256
  key: getKey(item),
200
257
  class: vue.normalizeClass(["hover:bg-black/5 dark:hover:bg-white/5 transition-colors", { "bg-primary/5 dark:bg-primary/10": isSelected(item) }])
201
258
  }, [
202
- __props.selectable ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_8$3, [
259
+ __props.selectable ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_11$1, [
203
260
  isSelectable(item) ? (vue.openBlock(), vue.createBlock(Checkbox_vue_vue_type_script_setup_true_lang._sfc_main, {
204
261
  key: 0,
205
262
  "model-value": isSelected(item),
@@ -227,7 +284,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
227
284
  ])
228
285
  ], 2);
229
286
  }), 128)),
230
- hasActionSlot.value ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_9$3, [
287
+ hasActionSlot.value ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_12$1, [
231
288
  vue.renderSlot(_ctx.$slots, "action", { item })
232
289
  ])) : vue.createCommentVNode("", true)
233
290
  ], 2);
@@ -235,7 +292,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
235
292
  ])
236
293
  ])
237
294
  ]),
238
- !__props.items || __props.items.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$2, [
295
+ !__props.items || __props.items.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
239
296
  vue.renderSlot(_ctx.$slots, "empty")
240
297
  ])) : vue.createCommentVNode("", true)
241
298
  ]);
@@ -568,9 +625,11 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
568
625
  selectable: { type: Boolean, default: false },
569
626
  selectedItems: {},
570
627
  selectableFilter: {},
571
- breakpoint: { default: "lg" }
628
+ breakpoint: { default: "lg" },
629
+ sortBy: {},
630
+ sortDirection: {}
572
631
  },
573
- emits: ["select", "selectAll"],
632
+ emits: ["select", "selectAll", "sort"],
574
633
  setup(__props, { emit: __emit }) {
575
634
  const props = __props;
576
635
  const emit = __emit;
@@ -648,8 +707,11 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
648
707
  selectable: __props.selectable,
649
708
  "selected-items": __props.selectedItems,
650
709
  "selectable-filter": __props.selectableFilter,
710
+ "sort-by": __props.sortBy,
711
+ "sort-direction": __props.sortDirection,
651
712
  onSelect: _cache[2] || (_cache[2] = ($event) => emit("select", $event)),
652
- onSelectAll: _cache[3] || (_cache[3] = ($event) => emit("selectAll"))
713
+ onSelectAll: _cache[3] || (_cache[3] = ($event) => emit("selectAll")),
714
+ onSort: _cache[4] || (_cache[4] = (col, dir) => emit("sort", col, dir))
653
715
  }, vue.createSlots({
654
716
  empty: vue.withCtx(() => [
655
717
  vue.renderSlot(_ctx.$slots, "empty")
@@ -677,7 +739,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
677
739
  ]),
678
740
  key: "0"
679
741
  } : void 0
680
- ]), 1032, ["items", "properties", "key-field", "selectable", "selected-items", "selectable-filter"])
742
+ ]), 1032, ["items", "properties", "key-field", "selectable", "selected-items", "selectable-filter", "sort-by", "sort-direction"])
681
743
  ]),
682
744
  _: 3
683
745
  }))
@@ -2076,4 +2138,4 @@ exports._sfc_main$6 = _sfc_main$c;
2076
2138
  exports._sfc_main$7 = _sfc_main$b;
2077
2139
  exports._sfc_main$8 = _sfc_main$a;
2078
2140
  exports._sfc_main$9 = _sfc_main$9;
2079
- //# sourceMappingURL=Timeline.vue_vue_type_script_setup_true_lang-1yrOZ-T-.cjs.map
2141
+ //# sourceMappingURL=Timeline.vue_vue_type_script_setup_true_lang-CqeiZOID.cjs.map