@open-xamu-co/ui-components-vue 4.0.0-next.2 → 4.0.0-next.21

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 (54) hide show
  1. package/CHANGELOG.md +327 -0
  2. package/dist/components/action/ButtonLink.vue.d.ts +7 -1
  3. package/dist/components/base/Box.vue.d.ts +3 -3
  4. package/dist/components/base/Wrapper.vue.d.ts +1 -1
  5. package/dist/components/box/Editor.stories.d.ts +6 -0
  6. package/dist/components/box/Editor.vue.d.ts +33 -0
  7. package/dist/components/collapse/Simple.vue.d.ts +10 -2
  8. package/dist/components/form/Input.stories.d.ts +1 -0
  9. package/dist/components/form/InputLoop.vue.d.ts +1 -1
  10. package/dist/components/form/InputNValues.vue.d.ts +1 -1
  11. package/dist/components/form/InputOptions.vue.d.ts +9 -0
  12. package/dist/components/form/Simple.vue.d.ts +2 -2
  13. package/dist/components/input/Code.stories.d.ts +6 -0
  14. package/dist/components/input/Code.vue.d.ts +42 -0
  15. package/dist/components/input/File.stories.d.ts +1 -0
  16. package/dist/components/input/File.vue.d.ts +3 -1
  17. package/dist/components/loader/ContentFetch.vue.d.ts +10 -4
  18. package/dist/components/modal/Simple.stories.d.ts +1 -0
  19. package/dist/components/modal/Simple.vue.d.ts +9 -2
  20. package/dist/components/pagination/Content.vue.d.ts +10 -4
  21. package/dist/components/pagination/ContentTable.vue.d.ts +24 -11
  22. package/dist/components/pagination/Simple.vue.d.ts +2 -2
  23. package/dist/components/table/Body.vue.d.ts +1 -1
  24. package/dist/components/table/HeadActions.vue.d.ts +1 -1
  25. package/dist/components/table/HeadContent.vue.d.ts +1 -1
  26. package/dist/components/table/Simple.stories.d.ts +4 -0
  27. package/dist/components/table/Simple.vue.d.ts +2 -2
  28. package/dist/components/value/Complex.vue.d.ts +10 -1
  29. package/dist/components/value/List.vue.d.ts +13 -2
  30. package/dist/components/value/Simple.vue.d.ts +1 -1
  31. package/dist/composables/async.d.ts +4 -1
  32. package/dist/composables/markdown.d.ts +8 -0
  33. package/dist/composables/theme.d.ts +3 -1
  34. package/dist/index-BkugQnzT.cjs +75 -0
  35. package/dist/index-DJHxJ3Bp.js +83445 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +3 -0
  38. package/dist/index.js +39 -36
  39. package/dist/plugin.cjs +1 -1
  40. package/dist/plugin.js +118 -110
  41. package/dist/{theme-DWMJmaKP.js → theme-CDT3li7P.js} +1 -0
  42. package/dist/{theme-CChhGSbE.cjs → theme-DQ7tgo8n.cjs} +1 -1
  43. package/dist/theme.cjs +1 -1
  44. package/dist/theme.js +3 -2
  45. package/dist/types/plugin.d.ts +8 -0
  46. package/dist/types/props/base.d.ts +106 -0
  47. package/dist/types/props/index.d.ts +4 -0
  48. package/dist/types/props/modal.d.ts +67 -0
  49. package/dist/types/props/table.d.ts +253 -0
  50. package/dist/types/props/value.d.ts +37 -0
  51. package/package.json +20 -7
  52. package/dist/index-C46FseEI.js +0 -7098
  53. package/dist/index-w1g0Tp05.cjs +0 -4
  54. package/dist/types/props.d.ts +0 -408
@@ -1,408 +0,0 @@
1
- import type { iFormOption, tFormAutocomplete, tIndicative, tProp, tProps, tPropsModifier, tThemeModifier, tThemeTuple, tSizeModifier, iProperty, iNodeFn, tOrderBy, tPropertyOrderFn, tOrder, iPageInfo, iPagination } from "@open-xamu-co/ui-common-types";
2
- import type { AllowedComponentProps, RendererElement } from "vue";
3
- import type { vComponent } from "./plugin";
4
- export interface iUseModifiersProps {
5
- hidden?: string | tPropsModifier<string>;
6
- size?: tSizeModifier | number;
7
- }
8
- export interface iUseStateProps {
9
- /**
10
- * Alert state: Mostly useful on actions
11
- * Included here to make his usage less verbose
12
- *
13
- * @state
14
- * @example is--alert
15
- */
16
- alert?: boolean;
17
- /**
18
- * Active state: Mostly useful on actions
19
- * Included here to make his usage less verbose
20
- *
21
- * @state
22
- * @example is--active
23
- */
24
- active?: boolean;
25
- /**
26
- * Invalid state: Mostly useful on inputs
27
- * Included here to make his usage less verbose
28
- *
29
- * @state
30
- * @example is--invalid
31
- */
32
- invalid?: boolean;
33
- /**
34
- * prevent theme overrides
35
- *
36
- * @state
37
- * @example no--overrides
38
- */
39
- noThemeOverride?: boolean;
40
- /**
41
- * Component states
42
- *
43
- * @example invalid, active, alert
44
- */
45
- state?: Record<string, boolean>;
46
- }
47
- export interface iUseThemeProps {
48
- theme?: tThemeTuple | tProp<tThemeModifier>;
49
- /** invert given theme */
50
- invertTheme?: boolean;
51
- /**
52
- * apply shadow if given theme or themes are active
53
- */
54
- shadow?: boolean | tThemeModifier[];
55
- }
56
- export interface iUseThemeTooltipProps {
57
- ariaLabel?: string;
58
- /**
59
- * Show given text as tooltip on hover.
60
- *
61
- * Includes aria-label tag automatically
62
- */
63
- tooltip?: tProp;
64
- tooltipPosition?: "right" | "left" | "bottom" | "top";
65
- tooltipAsText?: boolean;
66
- }
67
- export interface iActionProps {
68
- to?: string | Record<string, unknown>;
69
- href?: string;
70
- target?: string;
71
- tel?: string;
72
- disabled?: boolean;
73
- mailto?: string;
74
- type?: "button" | "submit" | "reset";
75
- tag?: string;
76
- toggle?: tProp<"dropdown" | "list">;
77
- round?: string | tPropsModifier<string>;
78
- toggleState?: tProps<string>;
79
- indicative?: tIndicative;
80
- whatsapp?: boolean | string;
81
- download?: string;
82
- tabindex?: string;
83
- }
84
- interface iInputLikeProps {
85
- id?: string;
86
- name?: string;
87
- placeholder?: string;
88
- title?: string;
89
- required?: boolean;
90
- disabled?: boolean;
91
- tabindex?: string;
92
- }
93
- export interface iInputProps extends iInputLikeProps {
94
- /**
95
- * Input type
96
- * TODO?: limit types
97
- */
98
- type?: string;
99
- autocomplete?: tFormAutocomplete;
100
- }
101
- export interface iSelectProps extends iInputLikeProps {
102
- options?: Array<string | number | iFormOption>;
103
- /**
104
- * Multiple fields
105
- */
106
- multiple?: boolean;
107
- }
108
- export interface iModalButtonConfig {
109
- title?: string;
110
- visible?: boolean;
111
- btnClass?: string;
112
- }
113
- export interface iModalProps extends iUseThemeProps {
114
- /**
115
- * Modal is loading
116
- * Some of the modal contents could be still loading
117
- */
118
- loading?: boolean;
119
- /**
120
- * The title of the modal shown in .x-modal-header div. If empty title is not rendered
121
- */
122
- title?: string;
123
- subtitle?: string;
124
- /**
125
- * :class object which is attached to the modal modal element
126
- */
127
- modalClass?: string | string[] | Record<string, boolean>;
128
- /**
129
- * :class object which is attached to the modal modal content element
130
- *
131
- * Useless if content slot is used
132
- */
133
- modalContentClass?: string | string[] | Record<string, boolean>;
134
- /**
135
- * Save button config
136
- */
137
- saveButton?: iModalButtonConfig & {
138
- disabled?: boolean;
139
- };
140
- /**
141
- * Cancel button config
142
- */
143
- cancelButton?: iModalButtonConfig;
144
- /**
145
- * Are modal requirement meet?
146
- * This is intended to prevent the usage of certain modals
147
- *
148
- * This should not depend on any internal state
149
- *
150
- * @example User does not have enough permissions
151
- */
152
- hide?: boolean;
153
- /** Message to show when modal is hidden */
154
- hideMessage?: string;
155
- /** Hides the footer */
156
- hideFooter?: boolean;
157
- /** disables modal */
158
- disabled?: boolean;
159
- /**
160
- * Target element to append the modal to
161
- *
162
- * Another modal could be the target so it appears nested
163
- *
164
- * @default body
165
- */
166
- target?: string | RendererElement;
167
- /**
168
- * Shows/hides the modal
169
- * @private
170
- */
171
- modelValue?: boolean;
172
- }
173
- export interface iValueComplexProps extends iUseThemeProps {
174
- /**
175
- * Cell value
176
- */
177
- value: any;
178
- /**
179
- * Cell column property
180
- */
181
- property?: iProperty<any, any>;
182
- /**
183
- * Cell node, aka parent node
184
- *
185
- * The value prop will be a property of this node
186
- */
187
- node?: Record<string, any>;
188
- /**
189
- * This type seems to collide with nuxt/vue types
190
- * Setting it to any for compatibility
191
- */
192
- readonly?: any;
193
- classes?: tProps<string>;
194
- /**
195
- * Refresh the content
196
- */
197
- refresh?: () => unknown;
198
- modalProps?: iModalProps & AllowedComponentProps;
199
- /**
200
- * Prevent node functions from triggering refresh event (useful with firebase hydration)
201
- */
202
- omitRefresh?: boolean;
203
- verbose?: boolean;
204
- size?: tSizeModifier;
205
- }
206
- /**
207
- * Table property with additional meta for internal usage
208
- */
209
- export interface iTablePropertyMeta<Ti extends Record<string, any>> extends iProperty<Record<string, any>, Ti, vComponent<iValueComplexProps>> {
210
- value: string;
211
- canSort: boolean;
212
- }
213
- export interface iTableProps<Ti extends Record<string, any>, Tm extends Record<string, any> = Ti> extends iUseThemeProps {
214
- /**
215
- * Table nodes
216
- * an array of nodes
217
- *
218
- * @old rows
219
- */
220
- nodes: Ti[];
221
- /**
222
- * Map nodes as required
223
- * Also useful to omit nodes from the array
224
- */
225
- mapNodes?: (nodes: NoInfer<Ti>[]) => Tm[];
226
- hydrateNodes?: (newNodes: NoInfer<Ti>[] | null, newErrors?: unknown) => void;
227
- /**
228
- * Table column names
229
- * an array of property names
230
- *
231
- * @old columns
232
- */
233
- properties?: iProperty<any, NoInfer<Ti>, vComponent<iValueComplexProps>>[];
234
- propertyOrder?: tPropertyOrderFn;
235
- /**
236
- * read only table
237
- * @old editable(inverse)
238
- */
239
- readonly?: boolean;
240
- /**
241
- * Do nodes support pagination?
242
- */
243
- sort?: boolean | tOrderBy;
244
- /**
245
- * Function used to update a node
246
- */
247
- updateNode?: iNodeFn<NoInfer<Ti>>;
248
- /**
249
- * Function used to delete a node
250
- */
251
- deleteNode?: iNodeFn<NoInfer<Ti>>;
252
- /**
253
- * Function used to duplicate a node
254
- */
255
- cloneNode?: iNodeFn<NoInfer<Ti>>;
256
- /**
257
- * Function used to create a node children
258
- *
259
- * Useful to display the add button for the default slot contents
260
- */
261
- createNodeChildren?: iNodeFn<NoInfer<Ti>>;
262
- /**
263
- * Conditionally disable creating children for this particular property
264
- */
265
- disableCreateNodeChildren?: (p: NoInfer<Ti>) => boolean;
266
- /**
267
- * Conditionally show children for this particular property,
268
- */
269
- showNodeChildren?: (p: NoInfer<Ti>) => boolean;
270
- /**
271
- * Content clasess
272
- */
273
- classes?: tProps<string>;
274
- /**
275
- * Refresh the content
276
- */
277
- refresh?: () => unknown;
278
- /**
279
- * Table is nested within another
280
- */
281
- nested?: boolean;
282
- /**
283
- * Default children visibility
284
- */
285
- childrenVisibility?: boolean;
286
- /**
287
- * Human readable name
288
- *
289
- * @fallback property name
290
- */
291
- childrenName?: string;
292
- childrenCountKey?: keyof NoInfer<Ti> | keyof NoInfer<Tm>;
293
- modalProps?: iModalProps & AllowedComponentProps;
294
- /**
295
- * Prevent node functions from triggering refresh event (useful with firebase hydration)
296
- */
297
- omitRefresh?: boolean;
298
- size?: tSizeModifier;
299
- /**
300
- * Filter & order nodes through the router
301
- */
302
- withRoute?: boolean | iPagination;
303
- /**
304
- * Page info
305
- */
306
- pageInfo?: iPageInfo;
307
- /**
308
- * Show real node id or given component
309
- */
310
- preferId?: boolean | string | vComponent<{
311
- index: number;
312
- node: NoInfer<Ti>;
313
- }>;
314
- /**
315
- * Make the table container opaque
316
- */
317
- opaque?: boolean;
318
- }
319
- export interface iNodeVisibility {
320
- disableCreateNodeChildren?: boolean;
321
- showNodeChildren?: boolean;
322
- childrenCount: number;
323
- }
324
- export interface iMappedNode<Ti extends Record<string, any>, Tm extends Record<string, any> = Ti> {
325
- node: Tm;
326
- index: number;
327
- visibility: iNodeVisibility;
328
- hydrateNode: (newNode: Ti | null, _newErrors?: unknown) => void;
329
- createNodeChildrenAndRefresh: iNodeFn<Ti>;
330
- }
331
- export interface iMappedNodes<Ti extends Record<string, any>, Tm extends Record<string, any> = Ti> {
332
- nodes: iMappedNode<Ti, Tm>[];
333
- length: number;
334
- withChildren: boolean;
335
- }
336
- export interface iTableChildProps<Ti extends Record<string, any>, Tm extends Record<string, any> = Ti> extends iTableProps<Ti, Tm> {
337
- mappedNodes: iMappedNodes<Ti, Tm>;
338
- /**
339
- * Table unique identifier
340
- *
341
- * Prefer a predictable identifier
342
- */
343
- tableId: string;
344
- /**
345
- * Node property metadata
346
- *
347
- * This one assumes all objects within nodes are all the same
348
- */
349
- propertiesMeta: iTablePropertyMeta<Ti>[];
350
- isReadOnly: boolean;
351
- /** Ordering property */
352
- ordering: Record<string, tOrder>;
353
- /**
354
- * Visible and selected nodes
355
- *
356
- * [selected, show]
357
- */
358
- selectedNodes: [boolean, boolean][];
359
- selectedNodesCount: number;
360
- openNodesCount: number;
361
- /**
362
- * Can show children
363
- */
364
- canShowChildren(visibility: iNodeVisibility, mappedIndex: number): boolean;
365
- /**
366
- * Set pagination order
367
- *
368
- * @replace
369
- */
370
- setOrdering(property: string): void;
371
- /**
372
- * Toggle nodes selection
373
- */
374
- toggleAll(value?: boolean, index?: number): void;
375
- /**
376
- * Toggle nodes children visibility
377
- */
378
- toggleChildren(index: number): void;
379
- /**
380
- * Updates given node
381
- * sometimes it could fail but still update (api issue)
382
- *
383
- * @single
384
- */
385
- updateNodeAndRefresh: iNodeFn<Ti>;
386
- /**
387
- * Clones given node
388
- * sometimes it could fail but still clone (api issue)
389
- *
390
- * @single
391
- */
392
- cloneNodeAndRefresh: iNodeFn<Ti, [Ti, ((m?: boolean) => any) | undefined, HTMLElement?]>;
393
- /**
394
- * Deletes given node
395
- * sometimes it could fail but still delete (api issue)
396
- *
397
- * @single
398
- */
399
- deleteNodeAndRefresh: iNodeFn<Ti, [Ti, ((m?: boolean) => any) | undefined, HTMLElement?]>;
400
- /**
401
- * Deletes multiple selected nodes
402
- * sometimes it could fail but still delete (api issue)
403
- *
404
- * @batch
405
- */
406
- deleteNodesAndRefresh(nodes?: Ti[]): Promise<void>;
407
- }
408
- export {};