@open-xamu-co/ui-common-types 3.0.0-next.4 → 3.0.0-next.5

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": "@open-xamu-co/ui-common-types",
3
- "version": "3.0.0-next.4",
3
+ "version": "3.0.0-next.5",
4
4
  "description": "Xamu shared types",
5
5
  "author": "@xamu-co",
6
6
  "main": "src/index.ts",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@fortawesome/fontawesome-common-types": "^6.4.0",
35
- "@open-xamu-co/ui-common-enums": "^2.0.1-next.1",
35
+ "@open-xamu-co/ui-common-enums": "^3.0.0-next.1",
36
36
  "sweetalert2": "^11.7.5"
37
37
  },
38
38
  "engines": {
package/src/locale.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @localeType
5
5
  */
6
- export interface iLocaleBase {
6
+ export type tLocaleBase = {
7
7
  /** @example "Yes" */
8
8
  yes: string;
9
9
  /** @example "No" */
@@ -46,6 +46,8 @@ export interface iLocaleBase {
46
46
  pick: string;
47
47
  /** @example "Refresh" */
48
48
  refresh: string;
49
+ /** @example "Couldn't render the contents due to an unknown error" */
50
+ render_error: string;
49
51
  swal: {
50
52
  /** @example "Cancel" */
51
53
  cancel: string;
@@ -64,14 +66,14 @@ export interface iLocaleBase {
64
66
  /** @example "Don't close this window while we finish the task" */
65
67
  dont_close_window: string;
66
68
  };
67
- }
69
+ };
68
70
 
69
71
  /**
70
72
  * Input locale
71
73
  *
72
74
  * @localeType
73
75
  */
74
- export interface iLocaleInput {
76
+ export type tLocaleInput = {
75
77
  /** @example "Selected" */
76
78
  select_selected: string;
77
79
  /** @example "--SELECT--" */
@@ -116,14 +118,14 @@ export interface iLocaleInput {
116
118
  /** @example "There was an error uploding the files, try again later" */
117
119
  file_unknown_error_text: string;
118
120
  };
119
- }
121
+ };
120
122
 
121
123
  /**
122
124
  * Modal locale
123
125
  *
124
126
  * @localeType
125
127
  */
126
- export interface iLocaleModal {
128
+ export type tLocaleModal = {
127
129
  /** @example "Taking too long?" */
128
130
  modal_taking_too_long: string;
129
131
  swal: {
@@ -132,18 +134,20 @@ export interface iLocaleModal {
132
134
  /** @example "You are not allowed to perform this action" */
133
135
  modal_unauthorized_text: string;
134
136
  };
135
- }
137
+ };
136
138
 
137
139
  /**
138
140
  * Form locale
139
141
  *
140
142
  * @localeType
141
143
  */
142
- export interface iLocaleForm {
144
+ export type tLocaleForm = {
143
145
  /** @example "Options are required" */
144
146
  form_required_options: string;
145
147
  /** @example "No values are required | A value is required | {count} values are required" */
146
148
  form_requires_n_values: string;
149
+ /** @example "Loading countries..." */
150
+ form_loading_countries: string;
147
151
  /** @example "Look for country" */
148
152
  form_country: string;
149
153
  /** @example "Look for state" */
@@ -170,7 +174,9 @@ export interface iLocaleForm {
170
174
  form_complete_the_field: string;
171
175
  /** @example "Location" */
172
176
  form_location: string;
173
- /** @example "This field is required" */
177
+ /** @example "This field is invalid, fill it properly" */
178
+ form_invalid_field: string;
179
+ /** @example "This field is required and can't be empty" */
174
180
  form_required_field: string;
175
181
  /** @example "You should use a valid E-mail address" */
176
182
  form_use_valid_email: string;
@@ -183,14 +189,14 @@ export interface iLocaleForm {
183
189
  /** @example "Invalid data" */
184
190
  form_invalid_data: string;
185
191
  // swal: {};
186
- }
192
+ };
187
193
 
188
194
  /**
189
195
  * Table locale
190
196
  *
191
197
  * @localeType
192
198
  */
193
- export interface iLocaleTable {
199
+ export type tLocaleTable = {
194
200
  /** @example "See {name}" */
195
201
  table_see_values: string;
196
202
  /** @example "See: \"{name}\"" */
@@ -223,6 +229,10 @@ export interface iLocaleTable {
223
229
  table_options: string;
224
230
  /** @example "Open URL" */
225
231
  table_open_url: string;
232
+ /** @example "Hide all" */
233
+ table_hide_all: string;
234
+ /** @example "Show all" */
235
+ table_show_all: string;
226
236
  swal: {
227
237
  /** @example "Are you sure you want to delete this element?" */
228
238
  table_delete_node_title: string;
@@ -249,14 +259,14 @@ export interface iLocaleTable {
249
259
  /** @example "The item may not have been cloned | The items may not have been cloned" */
250
260
  table_possibly_not_cloned: string;
251
261
  };
252
- }
262
+ };
253
263
 
254
264
  /**
255
265
  * Pagination locale
256
266
  *
257
267
  * @localeType
258
268
  */
259
- export interface iLocalePagination {
269
+ export type tLocalePagination = {
260
270
  /** @example "No items | Single item | {count} items" */
261
271
  pagination_items: string;
262
272
  /** @example "No pages | Single page | {count} pages" */
@@ -278,25 +288,16 @@ export interface iLocalePagination {
278
288
  /** @example "Filter by:" */
279
289
  pagination_filter_by: string;
280
290
  // swal: {};
281
- }
291
+ };
282
292
 
283
293
  /**
284
294
  * Plugin locale
285
295
  *
286
296
  * @localeType
287
297
  */
288
- export type tPluginLocale = iLocaleBase &
289
- iLocaleInput &
290
- iLocaleModal &
291
- iLocaleForm &
292
- iLocaleTable &
293
- iLocalePagination;
294
-
295
- /**
296
- * Plugin locale key union
297
- *
298
- * @localeType
299
- */
300
- export type tPluginLocaleKey =
301
- | Exclude<keyof tPluginLocale, "swal">
302
- | `swal.${keyof Required<tPluginLocale>["swal"]}`;
298
+ export type tPluginLocale = tLocaleBase &
299
+ tLocaleInput &
300
+ tLocaleModal &
301
+ tLocaleForm &
302
+ tLocaleTable &
303
+ tLocalePagination;
package/src/styles.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { eColors } from "@open-xamu-co/ui-common-enums";
1
+ import { eSizes, eColors } from "@open-xamu-co/ui-common-enums";
2
2
 
3
3
  /**
4
4
  * Union of supported colors.
@@ -6,3 +6,8 @@ import { eColors } from "@open-xamu-co/ui-common-enums";
6
6
  */
7
7
  export type tThemeModifier = (typeof eColors)[keyof typeof eColors]; // to union
8
8
  export type tThemeTuple = [tThemeModifier, tThemeModifier?];
9
+
10
+ /**
11
+ * Allowed sizes
12
+ */
13
+ export type tSizeModifier = (typeof eSizes)[keyof typeof eSizes]; // to union
package/src/values.ts CHANGED
@@ -16,7 +16,8 @@ export type iNodeFn<T extends Record<string, any>> = (
16
16
  /**
17
17
  * used on FactoryTable and related components
18
18
  */
19
- export interface iProperty<T extends Record<string, any>> extends iSelectOption {
19
+ export interface iProperty<T extends Record<string, any> = Record<string, any>>
20
+ extends iSelectOption {
20
21
  /**
21
22
  * Function to create a node within the relation
22
23
  */