cynx-lib 1.3.58 → 1.3.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-lib",
3
- "version": "1.3.58",
3
+ "version": "1.3.60",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -11,6 +11,7 @@ const props = withDefaults(
11
11
  perPage?: number;
12
12
  pageSize?: number;
13
13
  disabled?: boolean;
14
+ size?: "xs" | "sm" | "md" | "lg";
14
15
  }>(),
15
16
  {
16
17
  page: 1,
@@ -18,6 +19,7 @@ const props = withDefaults(
18
19
  total: 0,
19
20
  perPage: 20,
20
21
  disabled: false,
22
+ size: "md",
21
23
  }
22
24
  );
23
25
 
@@ -69,6 +71,20 @@ const handlePageChange = (newPage: number) => {
69
71
  emit("update:page", newPage);
70
72
  emit("change", newPage);
71
73
  };
74
+
75
+ const iconSize = computed(() => {
76
+ if (props.size === "xs") return 13;
77
+ if (props.size === "sm") return 14;
78
+ if (props.size === "lg") return 18;
79
+ return 16;
80
+ });
81
+
82
+ const buttonHeightClass = computed(() => {
83
+ if (props.size === "xs") return "h-6 min-w-[24px] text-[11px]";
84
+ if (props.size === "sm") return "h-7 min-w-[28px] text-[11.5px]";
85
+ if (props.size === "lg") return "h-9 min-w-[36px] text-sm";
86
+ return "h-8 min-w-[32px] text-xs";
87
+ });
72
88
  </script>
73
89
 
74
90
  <template>
@@ -80,30 +96,31 @@ const handlePageChange = (newPage: number) => {
80
96
  <div v-else />
81
97
 
82
98
  <!-- Page Buttons -->
83
- <div class="flex items-center gap-1">
99
+ <div class="flex items-center gap-1.5">
84
100
  <Button
85
- variant="ghost"
86
- size="xs"
101
+ variant="icon"
102
+ :size="size"
87
103
  :disabled="disabled || page <= 1"
88
104
  title="Previous page"
89
105
  @click="handlePageChange(page - 1)"
90
106
  >
91
107
  <template #icon>
92
- <ChevronLeft :size="14" />
108
+ <ChevronLeft :size="iconSize" />
93
109
  </template>
94
110
  </Button>
95
111
 
96
112
  <template v-for="(item, i) in pageItems" :key="`p-${i}`">
97
113
  <span
98
114
  v-if="item === '...'"
99
- class="px-1 text-xs text-slate-400 dark:text-slate-500"
115
+ :class="[buttonHeightClass, 'inline-flex items-center justify-center text-slate-400 dark:text-slate-500 font-medium select-none']"
100
116
  >
101
117
  …
102
118
  </span>
103
119
  <Button
120
+ v-else
104
121
  :variant="item === page ? 'primary' : 'ghost'"
105
- size="xs"
106
- class="min-w-[28px] h-7 px-2 font-semibold text-xs"
122
+ :size="size"
123
+ :class="[buttonHeightClass, 'px-2 font-semibold transition-colors', item !== page ? 'hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-700 dark:text-slate-200' : '']"
107
124
  :disabled="disabled"
108
125
  @click="handlePageChange(Number(item))"
109
126
  >
@@ -112,14 +129,14 @@ const handlePageChange = (newPage: number) => {
112
129
  </template>
113
130
 
114
131
  <Button
115
- variant="ghost"
116
- size="xs"
132
+ variant="icon"
133
+ :size="size"
117
134
  :disabled="disabled || page >= totalPages"
118
135
  title="Next page"
119
136
  @click="handlePageChange(page + 1)"
120
137
  >
121
138
  <template #icon>
122
- <ChevronRight :size="14" />
139
+ <ChevronRight :size="iconSize" />
123
140
  </template>
124
141
  </Button>
125
142
  </div>
@@ -126,10 +126,11 @@ const getSkeletonWidth = (rIdx: number, cIdx: number, key: string) => {
126
126
  ]"
127
127
  :style="height ? { height: formatWidth(height) } : undefined"
128
128
  >
129
- <!-- Scrollable Single Unified Table Container (100% Column Alignment) -->
129
+ <!-- Scrollable Single Unified Table Container (100% Column Alignment & Stable Gutter) -->
130
130
  <div
131
131
  ref="bodyScrollRef"
132
132
  class="w-full overflow-x-auto overflow-y-auto custom-scrollbar flex-1 relative"
133
+ style="scrollbar-gutter: stable;"
133
134
  >
134
135
  <table class="w-full border-collapse text-left text-xs table-fixed">
135
136
  <colgroup>
@@ -294,3 +295,23 @@ const getSkeletonWidth = (rIdx: number, cIdx: number, key: string) => {
294
295
  </div>
295
296
  </div>
296
297
  </template>
298
+
299
+ <style scoped>
300
+ .custom-scrollbar {
301
+ scrollbar-width: thin;
302
+ }
303
+ .custom-scrollbar::-webkit-scrollbar {
304
+ width: 6px;
305
+ height: 6px;
306
+ }
307
+ .custom-scrollbar::-webkit-scrollbar-track {
308
+ background: transparent;
309
+ }
310
+ .custom-scrollbar::-webkit-scrollbar-thumb {
311
+ background-color: rgba(148, 163, 184, 0.3);
312
+ border-radius: 6px;
313
+ }
314
+ .custom-scrollbar::-webkit-scrollbar-thumb:hover {
315
+ background-color: rgba(148, 163, 184, 0.5);
316
+ }
317
+ </style>