cynx-lib 1.3.115 → 1.3.117

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 (44) hide show
  1. package/gen.js +77 -77
  2. package/package.json +1 -1
  3. package/ui/components/ActionsMenu.jsx +357 -357
  4. package/ui/components/BrandingCard.jsx +6 -6
  5. package/ui/components/Drawer.jsx +208 -208
  6. package/ui/components/Globe.jsx +764 -764
  7. package/ui/components/HoverCard.jsx +85 -85
  8. package/ui/components/PrivacyBlur.jsx +603 -603
  9. package/utils/index.js +24 -24
  10. package/utils/utils/db.cjs +6 -6
  11. package/utils/utils/db.js +8 -8
  12. package/utils/utils/duration.js +139 -139
  13. package/utils/utils/oidc.js +214 -214
  14. package/utils/utils/realtime.js +1634 -1634
  15. package/utils/utils/server.js +371 -371
  16. package/utils/utils/session.js +131 -131
  17. package/utils/utils/session_manager.js +580 -580
  18. package/utils/utils/sso_manager.js +702 -702
  19. package/utils/utils/storage.js +393 -393
  20. package/utils/utils/ui.js +111 -111
  21. package/vue/components/Badge.vue +79 -79
  22. package/vue/components/Button.vue +209 -209
  23. package/vue/components/Checkbox.vue +103 -103
  24. package/vue/components/CircularProgress.vue +383 -383
  25. package/vue/components/Divider.vue +94 -94
  26. package/vue/components/Drawer.vue +243 -243
  27. package/vue/components/InfoBadge.vue +223 -223
  28. package/vue/components/Input.vue +341 -341
  29. package/vue/components/LinearProgress.vue +268 -268
  30. package/vue/components/Modal.vue +226 -226
  31. package/vue/components/Pagination.vue +199 -199
  32. package/vue/components/Select.vue +713 -713
  33. package/vue/components/Sidebar.vue +955 -955
  34. package/vue/components/Skeleton.vue +91 -91
  35. package/vue/components/Spinner.vue +263 -263
  36. package/vue/components/StatusTag.vue +89 -89
  37. package/vue/components/TabBar.vue +176 -176
  38. package/vue/components/Table.vue +393 -393
  39. package/vue/components/TimePicker.vue +399 -399
  40. package/vue/components/Toggle.vue +115 -115
  41. package/vue/components/XTable.vue +140 -140
  42. package/vue/composables/useAutoSkeletonRows.ts +71 -71
  43. package/vue/index.d.ts +67 -67
  44. package/vue/index.js +86 -86
@@ -1,223 +1,223 @@
1
- <script setup lang="ts">
2
- import { computed, useSlots } from "vue";
3
-
4
- export interface InfoBadgeItem {
5
- id?: string | number;
6
- key?: string | number;
7
- icon?: any;
8
- label?: string | number;
9
- value?: string | number;
10
- color?: string;
11
- title?: string;
12
- dot?: boolean;
13
- onClick?: (e: MouseEvent) => void;
14
- }
15
-
16
- const SIZES: Record<string, any> = {
17
- xs: {
18
- height: "24px",
19
- padding: "0 8px",
20
- fontSize: "10px",
21
- iconSize: 12,
22
- dotSize: ".65rem",
23
- sepHeight: "10px",
24
- gap: "6px",
25
- borderRadius: "var(--radxs, 6px)",
26
- },
27
- sm: {
28
- height: "28px",
29
- padding: "0 10px",
30
- fontSize: "11px",
31
- iconSize: 13,
32
- dotSize: ".7rem",
33
- sepHeight: "12px",
34
- gap: "8px",
35
- borderRadius: "var(--rads, 8px)",
36
- },
37
- md: {
38
- height: "32px",
39
- padding: "0 12px",
40
- fontSize: "12px",
41
- iconSize: 14,
42
- dotSize: ".75rem",
43
- sepHeight: "14px",
44
- gap: "10px",
45
- borderRadius: "var(--rad, 10px)",
46
- },
47
- lg: {
48
- height: "36px",
49
- padding: "0 14px",
50
- fontSize: "13px",
51
- iconSize: 16,
52
- dotSize: ".8rem",
53
- sepHeight: "16px",
54
- gap: "12px",
55
- borderRadius: "var(--rad, 10px)",
56
- },
57
- };
58
-
59
- const VARIANTS: Record<string, any> = {
60
- default: {
61
- background: "var(--surface, #ffffff)",
62
- border: "1px solid var(--border, #d7d8e0)",
63
- boxShadow: "var(--shadow, 0 1px 2px rgba(0, 0, 0, 0.05))",
64
- },
65
- surface: {
66
- background: "var(--surface, #ffffff)",
67
- border: "1px solid var(--border, #d7d8e0)",
68
- boxShadow: "var(--shadow, 0 1px 2px rgba(0, 0, 0, 0.05))",
69
- },
70
- flat: {
71
- background: "var(--grey-1, #f5f5f8)",
72
- border: "1px solid var(--border, #d7d8e0)",
73
- boxShadow: "none",
74
- },
75
- ghost: {
76
- background: "transparent",
77
- border: "1px solid var(--border, #d7d8e0)",
78
- boxShadow: "none",
79
- },
80
- };
81
-
82
- const props = withDefaults(
83
- defineProps<{
84
- items?: InfoBadgeItem[];
85
- icon?: any;
86
- label?: string | number;
87
- value?: string | number;
88
- color?: string;
89
- title?: string;
90
- dot?: boolean;
91
- size?: "xs" | "sm" | "md" | "lg";
92
- variant?: "default" | "surface" | "flat" | "ghost";
93
- }>(),
94
- {
95
- items: undefined,
96
- icon: undefined,
97
- label: undefined,
98
- value: undefined,
99
- color: undefined,
100
- title: undefined,
101
- dot: true,
102
- size: "sm",
103
- variant: "default",
104
- }
105
- );
106
-
107
- const emit = defineEmits<{
108
- (e: "click", event: MouseEvent): void;
109
- }>();
110
-
111
- const slots = useSlots();
112
- const sz = computed(() => SIZES[props.size] || SIZES.sm);
113
- const vr = computed(() => VARIANTS[props.variant] || VARIANTS.default);
114
-
115
- const resolvedItems = computed<InfoBadgeItem[]>(() => {
116
- if (Array.isArray(props.items) && props.items.length > 0) {
117
- return props.items;
118
- }
119
- if (props.icon != null || props.value != null || props.label != null) {
120
- return [
121
- {
122
- icon: props.icon,
123
- label: props.label,
124
- value: props.value,
125
- color: props.color,
126
- title: props.title,
127
- },
128
- ];
129
- }
130
- return [];
131
- });
132
- </script>
133
-
134
- <template>
135
- <div
136
- class="inline-flex items-center box-border select-none"
137
- :style="{
138
- height: sz.height,
139
- padding: sz.padding,
140
- borderRadius: sz.borderRadius,
141
- background: vr.background,
142
- border: vr.border,
143
- boxShadow: vr.boxShadow,
144
- gap: sz.gap,
145
- }"
146
- :title="title"
147
- @click="(e) => emit('click', e)"
148
- >
149
- <slot v-if="slots.default" />
150
- <template v-else>
151
- <template v-for="(it, idx) in resolvedItems" :key="it.id || it.key || idx">
152
- <div
153
- v-if="idx > 0"
154
- :style="{
155
- width: '1px',
156
- height: sz.sepHeight,
157
- background: 'var(--border, #d7d8e0)',
158
- flexShrink: 0,
159
- }"
160
- />
161
- <div
162
- class="inline-flex items-center"
163
- :style="{
164
- gap: '5px',
165
- cursor: it.onClick ? 'pointer' : 'inherit',
166
- }"
167
- :title="it.title"
168
- @click="it.onClick"
169
- >
170
- <span
171
- v-if="it.icon"
172
- class="inline-flex items-center justify-center flex-shrink-0"
173
- :style="{
174
- color: it.color || 'inherit',
175
- }"
176
- >
177
- <component
178
- :is="it.icon"
179
- v-if="typeof it.icon === 'object' || typeof it.icon === 'function'"
180
- :size="sz.iconSize"
181
- />
182
- <template v-else>{{ it.icon }}</template>
183
- </span>
184
-
185
- <span
186
- v-if="it.label !== undefined && it.label !== null"
187
- :style="{
188
- fontSize: sz.fontSize,
189
- fontWeight: 600,
190
- color: (it.color && it.color !== 'inherit') ? it.color : 'var(--primary-text, #0f111c)',
191
- }"
192
- >
193
- {{ it.label }}
194
- </span>
195
-
196
- <span
197
- v-if="(it.dot !== undefined ? it.dot : dot) && (it.icon || it.label) && it.value !== undefined && it.value !== null"
198
- :style="{
199
- fontSize: sz.dotSize,
200
- color: 'var(--muted, #9b9daa)',
201
- lineHeight: 1,
202
- }"
203
- >
204
- •
205
- </span>
206
-
207
- <span
208
- v-if="it.value !== undefined && it.value !== null"
209
- :style="{
210
- fontSize: sz.fontSize,
211
- fontWeight: 600,
212
- color: 'var(--primary-text, #0f111c)',
213
- fontVariantNumeric: 'tabular-nums',
214
- lineHeight: 1,
215
- }"
216
- >
217
- {{ it.value }}
218
- </span>
219
- </div>
220
- </template>
221
- </template>
222
- </div>
223
- </template>
1
+ <script setup lang="ts">
2
+ import { computed, useSlots } from "vue";
3
+
4
+ export interface InfoBadgeItem {
5
+ id?: string | number;
6
+ key?: string | number;
7
+ icon?: any;
8
+ label?: string | number;
9
+ value?: string | number;
10
+ color?: string;
11
+ title?: string;
12
+ dot?: boolean;
13
+ onClick?: (e: MouseEvent) => void;
14
+ }
15
+
16
+ const SIZES: Record<string, any> = {
17
+ xs: {
18
+ height: "24px",
19
+ padding: "0 8px",
20
+ fontSize: "10px",
21
+ iconSize: 12,
22
+ dotSize: ".65rem",
23
+ sepHeight: "10px",
24
+ gap: "6px",
25
+ borderRadius: "var(--radxs, 6px)",
26
+ },
27
+ sm: {
28
+ height: "28px",
29
+ padding: "0 10px",
30
+ fontSize: "11px",
31
+ iconSize: 13,
32
+ dotSize: ".7rem",
33
+ sepHeight: "12px",
34
+ gap: "8px",
35
+ borderRadius: "var(--rads, 8px)",
36
+ },
37
+ md: {
38
+ height: "32px",
39
+ padding: "0 12px",
40
+ fontSize: "12px",
41
+ iconSize: 14,
42
+ dotSize: ".75rem",
43
+ sepHeight: "14px",
44
+ gap: "10px",
45
+ borderRadius: "var(--rad, 10px)",
46
+ },
47
+ lg: {
48
+ height: "36px",
49
+ padding: "0 14px",
50
+ fontSize: "13px",
51
+ iconSize: 16,
52
+ dotSize: ".8rem",
53
+ sepHeight: "16px",
54
+ gap: "12px",
55
+ borderRadius: "var(--rad, 10px)",
56
+ },
57
+ };
58
+
59
+ const VARIANTS: Record<string, any> = {
60
+ default: {
61
+ background: "var(--surface, #ffffff)",
62
+ border: "1px solid var(--border, #d7d8e0)",
63
+ boxShadow: "var(--shadow, 0 1px 2px rgba(0, 0, 0, 0.05))",
64
+ },
65
+ surface: {
66
+ background: "var(--surface, #ffffff)",
67
+ border: "1px solid var(--border, #d7d8e0)",
68
+ boxShadow: "var(--shadow, 0 1px 2px rgba(0, 0, 0, 0.05))",
69
+ },
70
+ flat: {
71
+ background: "var(--grey-1, #f5f5f8)",
72
+ border: "1px solid var(--border, #d7d8e0)",
73
+ boxShadow: "none",
74
+ },
75
+ ghost: {
76
+ background: "transparent",
77
+ border: "1px solid var(--border, #d7d8e0)",
78
+ boxShadow: "none",
79
+ },
80
+ };
81
+
82
+ const props = withDefaults(
83
+ defineProps<{
84
+ items?: InfoBadgeItem[];
85
+ icon?: any;
86
+ label?: string | number;
87
+ value?: string | number;
88
+ color?: string;
89
+ title?: string;
90
+ dot?: boolean;
91
+ size?: "xs" | "sm" | "md" | "lg";
92
+ variant?: "default" | "surface" | "flat" | "ghost";
93
+ }>(),
94
+ {
95
+ items: undefined,
96
+ icon: undefined,
97
+ label: undefined,
98
+ value: undefined,
99
+ color: undefined,
100
+ title: undefined,
101
+ dot: true,
102
+ size: "sm",
103
+ variant: "default",
104
+ }
105
+ );
106
+
107
+ const emit = defineEmits<{
108
+ (e: "click", event: MouseEvent): void;
109
+ }>();
110
+
111
+ const slots = useSlots();
112
+ const sz = computed(() => SIZES[props.size] || SIZES.sm);
113
+ const vr = computed(() => VARIANTS[props.variant] || VARIANTS.default);
114
+
115
+ const resolvedItems = computed<InfoBadgeItem[]>(() => {
116
+ if (Array.isArray(props.items) && props.items.length > 0) {
117
+ return props.items;
118
+ }
119
+ if (props.icon != null || props.value != null || props.label != null) {
120
+ return [
121
+ {
122
+ icon: props.icon,
123
+ label: props.label,
124
+ value: props.value,
125
+ color: props.color,
126
+ title: props.title,
127
+ },
128
+ ];
129
+ }
130
+ return [];
131
+ });
132
+ </script>
133
+
134
+ <template>
135
+ <div
136
+ class="inline-flex items-center box-border select-none"
137
+ :style="{
138
+ height: sz.height,
139
+ padding: sz.padding,
140
+ borderRadius: sz.borderRadius,
141
+ background: vr.background,
142
+ border: vr.border,
143
+ boxShadow: vr.boxShadow,
144
+ gap: sz.gap,
145
+ }"
146
+ :title="title"
147
+ @click="(e) => emit('click', e)"
148
+ >
149
+ <slot v-if="slots.default" />
150
+ <template v-else>
151
+ <template v-for="(it, idx) in resolvedItems" :key="it.id || it.key || idx">
152
+ <div
153
+ v-if="idx > 0"
154
+ :style="{
155
+ width: '1px',
156
+ height: sz.sepHeight,
157
+ background: 'var(--border, #d7d8e0)',
158
+ flexShrink: 0,
159
+ }"
160
+ />
161
+ <div
162
+ class="inline-flex items-center"
163
+ :style="{
164
+ gap: '5px',
165
+ cursor: it.onClick ? 'pointer' : 'inherit',
166
+ }"
167
+ :title="it.title"
168
+ @click="it.onClick"
169
+ >
170
+ <span
171
+ v-if="it.icon"
172
+ class="inline-flex items-center justify-center flex-shrink-0"
173
+ :style="{
174
+ color: it.color || 'inherit',
175
+ }"
176
+ >
177
+ <component
178
+ :is="it.icon"
179
+ v-if="typeof it.icon === 'object' || typeof it.icon === 'function'"
180
+ :size="sz.iconSize"
181
+ />
182
+ <template v-else>{{ it.icon }}</template>
183
+ </span>
184
+
185
+ <span
186
+ v-if="it.label !== undefined && it.label !== null"
187
+ :style="{
188
+ fontSize: sz.fontSize,
189
+ fontWeight: 600,
190
+ color: (it.color && it.color !== 'inherit') ? it.color : 'var(--primary-text, #0f111c)',
191
+ }"
192
+ >
193
+ {{ it.label }}
194
+ </span>
195
+
196
+ <span
197
+ v-if="(it.dot !== undefined ? it.dot : dot) && (it.icon || it.label) && it.value !== undefined && it.value !== null"
198
+ :style="{
199
+ fontSize: sz.dotSize,
200
+ color: 'var(--muted, #9b9daa)',
201
+ lineHeight: 1,
202
+ }"
203
+ >
204
+ •
205
+ </span>
206
+
207
+ <span
208
+ v-if="it.value !== undefined && it.value !== null"
209
+ :style="{
210
+ fontSize: sz.fontSize,
211
+ fontWeight: 600,
212
+ color: 'var(--primary-text, #0f111c)',
213
+ fontVariantNumeric: 'tabular-nums',
214
+ lineHeight: 1,
215
+ }"
216
+ >
217
+ {{ it.value }}
218
+ </span>
219
+ </div>
220
+ </template>
221
+ </template>
222
+ </div>
223
+ </template>