@v1nt1248/3nclient-lib 0.3.8 → 0.3.11

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 (84) hide show
  1. package/README.md +3 -2
  2. package/dist/components/ui3n-autocomplete/types.d.ts +100 -0
  3. package/dist/components/ui3n-badge/types.d.ts +14 -0
  4. package/dist/components/ui3n-badge/ui3n-badge.vue.d.ts +2 -4
  5. package/dist/components/ui3n-breadcrumbs/types.d.ts +50 -0
  6. package/dist/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue.d.ts +2 -4
  7. package/dist/components/ui3n-button/types.d.ts +21 -0
  8. package/dist/components/ui3n-button/ui3n-button.vue.d.ts +2 -4
  9. package/dist/components/ui3n-checkbox/types.d.ts +44 -0
  10. package/dist/components/ui3n-chip/types.d.ts +49 -0
  11. package/dist/components/ui3n-dialog/types.d.ts +103 -0
  12. package/dist/components/ui3n-drop-files/types.d.ts +31 -0
  13. package/dist/components/ui3n-editable/types.d.ts +102 -0
  14. package/dist/components/ui3n-emoji/types.d.ts +13 -0
  15. package/dist/components/ui3n-icon/types.d.ts +10 -0
  16. package/dist/components/ui3n-input/types.d.ts +85 -0
  17. package/dist/components/ui3n-input-file/types.d.ts +29 -0
  18. package/dist/components/ui3n-list/types.d.ts +35 -0
  19. package/dist/components/ui3n-menu/types.d.ts +89 -0
  20. package/dist/components/ui3n-notification/types.d.ts +28 -0
  21. package/dist/components/ui3n-progress/types.d.ts +49 -0
  22. package/dist/components/ui3n-radio-group/types.d.ts +78 -0
  23. package/dist/components/ui3n-selector/types.d.ts +95 -0
  24. package/dist/components/ui3n-slider/types.d.ts +51 -0
  25. package/dist/components/ui3n-step-line-bar/types.d.ts +12 -0
  26. package/dist/components/ui3n-switch/types.d.ts +31 -0
  27. package/dist/components/ui3n-table/types.d.ts +198 -0
  28. package/dist/components/ui3n-tabs/types.d.ts +38 -0
  29. package/dist/components/ui3n-text/types.d.ts +56 -0
  30. package/dist/components/ui3n-tooltip/types.d.ts +69 -0
  31. package/dist/components/ui3n-virtual-scroll/types.d.ts +18 -0
  32. package/dist/constants/general.d.ts +0 -1
  33. package/dist/constants/plugins-keys.d.ts +0 -2
  34. package/dist/index.d.ts +0 -8
  35. package/dist/plugins/index.d.ts +1 -4
  36. package/dist/style.css +1 -1
  37. package/dist/ui3n-components.js +14949 -14627
  38. package/dist/ui3n-plugins.d.ts +3 -11
  39. package/dist/ui3n-plugins.js +338 -367
  40. package/dist/ui3n-utils.js +422 -439
  41. package/dist/utils/copy-to-clipboard.d.ts +1 -0
  42. package/dist/utils/execute-function.d.ts +29 -0
  43. package/dist/utils/index.d.ts +3 -0
  44. package/dist/utils/remove-whitespace-in-string.d.ts +1 -0
  45. package/dist/utils/ui/get-element-color.d.ts +1 -1
  46. package/package.json +29 -26
  47. package/src/components/ui3n-autocomplete/types.ts +100 -0
  48. package/src/components/ui3n-badge/types.ts +16 -0
  49. package/src/components/ui3n-badge/ui3n-badge-simple.vue +10 -9
  50. package/src/components/ui3n-badge/ui3n-badge.vue +37 -36
  51. package/src/components/ui3n-breadcrumbs/types.ts +51 -0
  52. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +69 -69
  53. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +7 -8
  54. package/src/components/ui3n-button/types.ts +23 -0
  55. package/src/components/ui3n-button/ui3n-button.vue +27 -29
  56. package/src/components/ui3n-checkbox/types.ts +44 -0
  57. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +16 -23
  58. package/src/components/ui3n-chip/types.ts +51 -0
  59. package/src/components/ui3n-dialog/types.ts +103 -0
  60. package/src/components/ui3n-drop-files/types.ts +31 -0
  61. package/src/components/ui3n-editable/types.ts +102 -0
  62. package/src/components/ui3n-editable/useContentEditable.ts +4 -2
  63. package/src/components/ui3n-emoji/types.ts +13 -0
  64. package/src/components/ui3n-icon/types.ts +10 -0
  65. package/src/components/ui3n-input/types.ts +85 -0
  66. package/src/components/ui3n-input/ui3n-input.vue +15 -3
  67. package/src/components/ui3n-input-file/types.ts +29 -0
  68. package/src/components/ui3n-list/types.ts +35 -0
  69. package/src/components/ui3n-menu/types.ts +89 -0
  70. package/src/components/ui3n-notification/types.ts +28 -0
  71. package/src/components/ui3n-progress/types.ts +49 -0
  72. package/src/components/ui3n-radio-group/types.ts +78 -0
  73. package/src/components/ui3n-selector/types.ts +96 -1
  74. package/src/components/ui3n-slider/types.ts +51 -0
  75. package/src/components/ui3n-step-line-bar/types.ts +12 -0
  76. package/src/components/ui3n-switch/types.ts +31 -0
  77. package/src/components/ui3n-table/types.ts +204 -0
  78. package/src/components/ui3n-tabs/types.ts +38 -0
  79. package/src/components/ui3n-text/types.ts +56 -0
  80. package/src/components/ui3n-tooltip/types.ts +69 -0
  81. package/src/components/ui3n-virtual-scroll/types.ts +18 -0
  82. package/dist/plugins/i18n/i18n.d.ts +0 -9
  83. package/dist/plugins/i18n/store-i18n.d.ts +0 -7
  84. package/dist/plugins/i18n/types.d.ts +0 -9
@@ -1,108 +1,312 @@
1
1
  import { VNode, type Ref, type ComputedRef } from 'vue';
2
2
 
3
+ /**
4
+ * Base table item interface
5
+ */
3
6
  export interface Ui3nTableBodyBaseItem {
7
+ /**
8
+ * Item ID
9
+ */
4
10
  id?: string | number | symbol;
5
11
  }
6
12
 
13
+ /**
14
+ * Table sort type
15
+ */
7
16
  export type Ui3nTableSort<T extends Ui3nTableBodyBaseItem> = {
17
+ /**
18
+ * Sort field
19
+ */
8
20
  field: keyof T;
21
+ /**
22
+ * Sort direction
23
+ */
9
24
  direction: 'asc' | 'desc';
10
25
  };
11
26
 
27
+ /**
28
+ * Table configuration type
29
+ */
12
30
  export type Ui3nTableConfig<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
31
+ /**
32
+ * Table name
33
+ */
13
34
  tableName?: string;
35
+ /**
36
+ * Sort order
37
+ */
14
38
  sortOrder?: Ui3nTableSort<T>;
39
+ /**
40
+ * Selection mode
41
+ */
15
42
  selectable?: 'single' | 'multiple';
16
43
  // draggableRows?: boolean; // ToDo this will be done in the next version
17
44
  // draggableColumns?: boolean; // ToDo this will be done in the next version
45
+ /**
46
+ * Column styles
47
+ */
18
48
  columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
49
+ /**
50
+ * Field to use as row key
51
+ */
19
52
  fieldAsRowKey?: keyof T;
53
+ /**
54
+ * Whether to show no data message
55
+ * @default true
56
+ */
20
57
  showNoDataMessage?: boolean;
58
+ /**
59
+ * Minimum height for unused place
60
+ */
21
61
  minHeightUnusedPlace?: number | string;
22
62
  };
23
63
 
64
+ /**
65
+ * Table header properties type
66
+ */
24
67
  export type Ui3nTableHeadProps<T extends Ui3nTableBodyBaseItem> = {
68
+ /**
69
+ * Header key
70
+ */
25
71
  key: keyof T;
72
+ /**
73
+ * Header text
74
+ */
26
75
  text: string;
76
+ /**
77
+ * Whether header is sortable
78
+ * @default false
79
+ */
27
80
  sortable?: boolean;
81
+ /**
82
+ * Header cell style
83
+ */
28
84
  headCellStyle?: Record<string, string>;
85
+ /**
86
+ * Format function
87
+ */
29
88
  format?: (content: unknown) => string;
89
+ /**
90
+ * Whether header is hidden
91
+ * @default false
92
+ */
30
93
  hidden?: boolean;
94
+ /**
95
+ * Header index
96
+ */
31
97
  index?: number;
32
98
  };
33
99
 
100
+ /**
101
+ * Table body properties type
102
+ */
34
103
  export type Ui3nTableBodyProps<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
104
+ /**
105
+ * Body content
106
+ */
35
107
  content: T[];
108
+ /**
109
+ * Row styles
110
+ */
36
111
  rowsStyle?: { [P in T[K] as string | number]: Record<string, string> };
37
112
  };
38
113
 
114
+ /**
115
+ * Table component properties
116
+ */
39
117
  export interface Ui3nTableProps<T extends Ui3nTableBodyBaseItem> {
118
+ /**
119
+ * Table configuration
120
+ */
40
121
  config: Ui3nTableConfig<T>;
122
+ /**
123
+ * Table header
124
+ */
41
125
  head: Ui3nTableHeadProps<T>[];
126
+ /**
127
+ * Table body
128
+ */
42
129
  body: Ui3nTableBodyProps<T>;
43
130
  }
44
131
 
132
+ /**
133
+ * Table component events
134
+ */
45
135
  export interface Ui3nTableEmits<T extends Ui3nTableBodyBaseItem> {
136
+ /**
137
+ * Emitted when sort changes
138
+ */
46
139
  (ev: 'change:sort', val: Ui3nTableSort<T>): void;
140
+ /**
141
+ * Emitted when row is selected
142
+ */
47
143
  (ev: 'select:row', val: T[]): void;
48
144
  }
49
145
 
146
+ /**
147
+ * Table other slots
148
+ */
50
149
  export type Ui3nTableOtherSlots = {
150
+ /**
151
+ * No data slot
152
+ */
51
153
  'no-data': () => VNode;
154
+ /**
155
+ * Unused place slot
156
+ */
52
157
  'unused-place': () => VNode;
53
158
  };
54
159
 
160
+ /**
161
+ * Table group actions slot
162
+ */
55
163
  export type Ui3nTableGroupActionsSlot<T extends Ui3nTableBodyBaseItem> = {
164
+ /**
165
+ * Group actions slot
166
+ */
56
167
  'group-actions': ({ selectedRows }: { selectedRows: T[] }) => VNode;
57
168
  };
58
169
 
170
+ /**
171
+ * Table header cell slot
172
+ */
59
173
  export type Ui3nTableHeaderCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
174
+ /**
175
+ * Header cell slot
176
+ */
60
177
  [p in `header-cell-${K}`]: () => VNode;
61
178
  };
62
179
 
180
+ /**
181
+ * Table body row slot scope
182
+ */
63
183
  export type Ui3nTableBodyRowSlotScope<T extends Ui3nTableBodyBaseItem, K extends keyof T = keyof T> = {
184
+ /**
185
+ * Row data
186
+ */
64
187
  row: T;
188
+ /**
189
+ * Row style
190
+ */
65
191
  rowStyle?: Record<string, string>;
192
+ /**
193
+ * Row index
194
+ */
66
195
  rowIndex: number;
196
+ /**
197
+ * Whether row is selected
198
+ */
67
199
  isRowSelected?: boolean;
200
+ /**
201
+ * Column styles
202
+ */
68
203
  columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
204
+ /**
205
+ * Events
206
+ */
69
207
  events?: {
208
+ /**
209
+ * Select function
210
+ */
70
211
  select: (row: T, withoutEvents?: boolean) => void;
71
212
  };
72
213
  };
73
214
 
215
+ /**
216
+ * Table body row slot
217
+ */
74
218
  export type Ui3nTableBodyRowSlot<T extends Ui3nTableBodyBaseItem> = {
219
+ /**
220
+ * Row slot
221
+ */
75
222
  row: (scope: Ui3nTableBodyRowSlotScope<T>) => VNode;
76
223
  };
77
224
 
225
+ /**
226
+ * Table body row cell slot scope
227
+ */
78
228
  export type Ui3nTableBodyRowCellSlotScope<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
229
+ /**
230
+ * Row data
231
+ */
79
232
  row: T;
233
+ /**
234
+ * Row index
235
+ */
80
236
  rowIndex: number;
237
+ /**
238
+ * Whether row is selected
239
+ */
81
240
  isRowSelected?: boolean;
241
+ /**
242
+ * Column styles
243
+ */
82
244
  columnStyle?: { [P in Omit<K, 'id'> as string | number]: Record<string, string> };
245
+ /**
246
+ * Cell data
247
+ */
83
248
  cell: T[K];
84
249
  };
85
250
 
251
+ /**
252
+ * Table body row cell slot
253
+ */
86
254
  export type Ui3nTableBodyRowCellSlot<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = {
255
+ /**
256
+ * Row cell slot
257
+ */
87
258
  [p in `row-cell-${K}`]: (scope: Ui3nTableBodyRowCellSlotScope<T, K>) => VNode;
88
259
  };
89
260
 
261
+ /**
262
+ * Table slots
263
+ */
90
264
  export type Ui3nTableSlots<T extends Ui3nTableBodyBaseItem, K extends string & keyof T> = Ui3nTableOtherSlots &
91
265
  Ui3nTableGroupActionsSlot<T> &
92
266
  Ui3nTableHeaderCellSlot<T, K> &
93
267
  Ui3nTableBodyRowSlot<T> &
94
268
  Ui3nTableBodyRowCellSlot<T, K>;
95
269
 
270
+ /**
271
+ * Table sort icon properties
272
+ */
96
273
  export interface Ui3nTableSortIconProps {
274
+ /**
275
+ * Icon size
276
+ */
97
277
  size?: string | number;
278
+ /**
279
+ * Icon color
280
+ */
98
281
  color?: string;
282
+ /**
283
+ * Icon value
284
+ */
99
285
  value: 'asc' | 'desc';
100
286
  }
101
287
 
288
+ /**
289
+ * Table expose
290
+ */
102
291
  export type Ui3nTableExpose<T extends Ui3nTableBodyBaseItem> = {
292
+ /**
293
+ * Selected rows
294
+ */
103
295
  selectedRows: Ref<Set<T> | Array<T[keyof T]>>;
296
+ /**
297
+ * Selected rows array
298
+ */
104
299
  selectedRowsArray: ComputedRef<T[]>;
300
+ /**
301
+ * Whether has group actions row
302
+ */
105
303
  hasGroupActionsRow: Ref<boolean>;
304
+ /**
305
+ * Get row style
306
+ */
106
307
  getRowStyle: (row: T) => Record<string, string>;
308
+ /**
309
+ * Close group actions row
310
+ */
107
311
  closeGroupActionsRow: () => void;
108
312
  };
@@ -1,19 +1,57 @@
1
1
  import { VNode } from 'vue';
2
2
 
3
+ /**
4
+ * Tabs component properties
5
+ */
3
6
  export interface Ui3nTabsProps {
7
+ /**
8
+ * Current active tab index
9
+ */
4
10
  modelValue: number;
11
+ /**
12
+ * Direction of tabs
13
+ * @default 'horizontal'
14
+ */
5
15
  itemDirection?: 'horizontal' | 'vertical';
16
+ /**
17
+ * Active tab color
18
+ */
6
19
  activeColor?: string;
20
+ /**
21
+ * Inactive tab color
22
+ */
7
23
  inactiveColor?: string;
24
+ /**
25
+ * Indicator color
26
+ */
8
27
  indicatorColor?: string;
28
+ /**
29
+ * Indicator size
30
+ */
9
31
  indicatorSize?: number | string;
32
+ /**
33
+ * Indicator position
34
+ * @default 'normal'
35
+ */
10
36
  indicatorPosition?: 'normal' | 'reverse';
11
37
  }
12
38
 
39
+ /**
40
+ * Tabs component emits
41
+ */
13
42
  export interface Ui3nTabsEmits {
43
+ /**
44
+ * Emitted when model value updates
45
+ */
14
46
  (ev: 'update:modelValue', val: number): void;
15
47
  }
16
48
 
49
+ /**
50
+ * Tabs component slots
51
+ */
17
52
  export interface Ui3nTabsSlots {
53
+ /**
54
+ * Default slot
55
+ */
18
56
  default: () => VNode;
19
57
  }
@@ -1,19 +1,60 @@
1
1
  export interface Ui3nTextProps {
2
+ /**
3
+ * Text value
4
+ */
2
5
  modelValue: string;
6
+ /**
7
+ * Number of rows
8
+ */
3
9
  rows?: number;
10
+ /**
11
+ * Maximum number of rows
12
+ */
4
13
  maxRows?: number;
14
+ /**
15
+ * Text label
16
+ */
5
17
  label?: string;
18
+ /**
19
+ * Text placeholder
20
+ */
6
21
  placeholder?: string;
22
+ /**
23
+ * Validation rules
24
+ */
7
25
  rules?: Array<(v: string) => string | boolean>;
26
+ /**
27
+ * Whether to validate at startup
28
+ * @default false
29
+ */
8
30
  validateAtStartup?: boolean;
31
+ /**
32
+ * Whether text is disabled
33
+ * @default false
34
+ */
9
35
  disabled?: boolean;
10
36
  }
11
37
 
12
38
  export interface Ui3nTextEmits {
39
+ /**
40
+ * Called when text is initialized
41
+ */
13
42
  (event: 'init', value: HTMLTextAreaElement): void;
43
+ /**
44
+ * Called when text value changes
45
+ */
14
46
  (event: 'input', value: string): void;
47
+ /**
48
+ * Called when text value changes
49
+ */
15
50
  (event: 'change', value: string): void;
51
+ /**
52
+ * Called when key is pressed
53
+ */
16
54
  (event: 'keydown', value: KeyboardEvent): void;
55
+ /**
56
+ * Called when Enter key is pressed
57
+ */
17
58
  (
18
59
  event: 'enter',
19
60
  value: {
@@ -24,9 +65,24 @@ export interface Ui3nTextEmits {
24
65
  metaKey: boolean;
25
66
  },
26
67
  ): void;
68
+ /**
69
+ * Called when Escape key is pressed
70
+ */
27
71
  (event: 'escape', value: Event): void;
72
+ /**
73
+ * Called when text is focused
74
+ */
28
75
  (event: 'focus', value: Event): void;
76
+ /**
77
+ * Called when text loses focus
78
+ */
29
79
  (event: 'blur', value: Event): void;
80
+ /**
81
+ * Called when model value updates
82
+ */
30
83
  (event: 'update:modelValue', value: string): void;
84
+ /**
85
+ * Called when validation status updates
86
+ */
31
87
  (event: 'update:valid', value: boolean): void;
32
88
  }
@@ -1,5 +1,8 @@
1
1
  import { VNode } from 'vue';
2
2
 
3
+ /**
4
+ * Tooltip placement types
5
+ */
3
6
  export type Ui3nTooltipPlacement =
4
7
  | 'top'
5
8
  | 'top-start'
@@ -14,29 +17,95 @@ export type Ui3nTooltipPlacement =
14
17
  | 'left-start'
15
18
  | 'left-end';
16
19
 
20
+ /**
21
+ * Tooltip component properties
22
+ */
17
23
  export interface Ui3nTooltipProps {
24
+ /**
25
+ * Whether tooltip is open
26
+ */
18
27
  modelValue?: boolean;
28
+ /**
29
+ * Tooltip content
30
+ */
19
31
  content?: string;
32
+ /**
33
+ * Maximum content width
34
+ */
20
35
  maxContentWidth?: number | string;
36
+ /**
37
+ * Tooltip color
38
+ */
21
39
  color?: string;
40
+ /**
41
+ * Tooltip text color
42
+ */
22
43
  textColor?: string;
44
+ /**
45
+ * Tooltip placement
46
+ */
23
47
  placement?: Ui3nTooltipPlacement;
48
+ /**
49
+ * Position strategy
50
+ * @default 'absolute'
51
+ */
24
52
  positionStrategy?: 'absolute' | 'fixed';
53
+ /**
54
+ * Offset X
55
+ */
25
56
  offsetX?: string | number;
57
+ /**
58
+ * Offset Y
59
+ */
26
60
  offsetY?: string | number;
61
+ /**
62
+ * Trigger type
63
+ * @default 'hover'
64
+ */
27
65
  trigger?: 'click' | 'hover' | 'manual';
66
+ /**
67
+ * Whether tooltip is disabled
68
+ * @default false
69
+ */
28
70
  disabled?: boolean;
29
71
  }
30
72
 
73
+ /**
74
+ * Tooltip component emits
75
+ */
31
76
  export interface Ui3nTooltipEmits {
77
+ /**
78
+ * Called when tooltip is opening
79
+ */
32
80
  (ev: 'open'): void;
81
+ /**
82
+ * Called when tooltip is opened
83
+ */
33
84
  (ev: 'opened'): void;
85
+ /**
86
+ * Called when tooltip is closing
87
+ */
34
88
  (ev: 'close'): void;
89
+ /**
90
+ * Called when tooltip is closed
91
+ */
35
92
  (ev: 'closed'): void;
93
+ /**
94
+ * Emitted when model value updates
95
+ */
36
96
  (ev: 'update:modelValue', value: boolean): void;
37
97
  }
38
98
 
99
+ /**
100
+ * Tooltip component slots
101
+ */
39
102
  export interface Ui3nTooltipSlots {
103
+ /**
104
+ * Default slot
105
+ */
40
106
  default: () => VNode;
107
+ /**
108
+ * Content slot
109
+ */
41
110
  content?: () => VNode;
42
111
  }
@@ -1,11 +1,29 @@
1
1
  import { VNode } from 'vue';
2
2
 
3
+ /**
4
+ * Virtual scroll component properties
5
+ */
3
6
  export interface Ui3nVirtualScrollProps<T> {
7
+ /**
8
+ * List of items to render
9
+ */
4
10
  items: T[];
11
+ /**
12
+ * Minimum height of child element
13
+ */
5
14
  minChildHeight: number;
15
+ /**
16
+ * Number of items to render ahead
17
+ */
6
18
  renderAhead?: number;
7
19
  }
8
20
 
21
+ /**
22
+ * Virtual scroll component slots
23
+ */
9
24
  export interface Ui3nVirtualScrollSlots<T> {
25
+ /**
26
+ * Item slot
27
+ */
10
28
  item: ({ value, index }: { value: T; index: number }) => VNode;
11
29
  }
@@ -1,9 +0,0 @@
1
- import { Plugin } from 'vue';
2
- export declare const i18n: Plugin;
3
- declare module '@vue/runtime-core' {
4
- interface ComponentCustomProperties {
5
- $locale: string;
6
- $tr: (key: string, placeholders?: Record<string, string>) => string;
7
- $changeLocale: (lang: string) => void;
8
- }
9
- }
@@ -1,7 +0,0 @@
1
- export declare function storeI18n(context: any): {
2
- $i18n: {
3
- locale: string;
4
- changeLocale: (lang: string) => void;
5
- tr: (key: string, placeholders?: Record<string, string>) => string;
6
- };
7
- };
@@ -1,9 +0,0 @@
1
- export interface I18nOptions {
2
- lang: string;
3
- messages: Record<string, Record<string, string>>;
4
- }
5
- export interface I18nPlugin {
6
- $locale: string;
7
- $tr: (key: string, placeholders?: Record<string, string>) => string;
8
- $changeLocale: (lang: string) => void;
9
- }