@open-xamu-co/ui-common-types 3.0.0-next.3 → 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.3",
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/form.ts CHANGED
@@ -171,6 +171,8 @@ export interface iFormResponse<R = any, T = any> {
171
171
  errors?: any;
172
172
  /**
173
173
  * Swal target
174
+ *
175
+ * If the swal was triggered from a modal, then use it as render target
174
176
  */
175
177
  modalTarget?: T;
176
178
  }
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,16 @@ 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 = {
77
+ /** @example "Selected" */
78
+ select_selected: string;
75
79
  /** @example "--SELECT--" */
76
80
  select_placeholder: string;
77
81
  /** @example "Restablish field" */
@@ -114,14 +118,14 @@ export interface iLocaleInput {
114
118
  /** @example "There was an error uploding the files, try again later" */
115
119
  file_unknown_error_text: string;
116
120
  };
117
- }
121
+ };
118
122
 
119
123
  /**
120
124
  * Modal locale
121
125
  *
122
126
  * @localeType
123
127
  */
124
- export interface iLocaleModal {
128
+ export type tLocaleModal = {
125
129
  /** @example "Taking too long?" */
126
130
  modal_taking_too_long: string;
127
131
  swal: {
@@ -130,18 +134,20 @@ export interface iLocaleModal {
130
134
  /** @example "You are not allowed to perform this action" */
131
135
  modal_unauthorized_text: string;
132
136
  };
133
- }
137
+ };
134
138
 
135
139
  /**
136
140
  * Form locale
137
141
  *
138
142
  * @localeType
139
143
  */
140
- export interface iLocaleForm {
144
+ export type tLocaleForm = {
141
145
  /** @example "Options are required" */
142
146
  form_required_options: string;
143
147
  /** @example "No values are required | A value is required | {count} values are required" */
144
148
  form_requires_n_values: string;
149
+ /** @example "Loading countries..." */
150
+ form_loading_countries: string;
145
151
  /** @example "Look for country" */
146
152
  form_country: string;
147
153
  /** @example "Look for state" */
@@ -168,7 +174,9 @@ export interface iLocaleForm {
168
174
  form_complete_the_field: string;
169
175
  /** @example "Location" */
170
176
  form_location: string;
171
- /** @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" */
172
180
  form_required_field: string;
173
181
  /** @example "You should use a valid E-mail address" */
174
182
  form_use_valid_email: string;
@@ -181,14 +189,14 @@ export interface iLocaleForm {
181
189
  /** @example "Invalid data" */
182
190
  form_invalid_data: string;
183
191
  // swal: {};
184
- }
192
+ };
185
193
 
186
194
  /**
187
195
  * Table locale
188
196
  *
189
197
  * @localeType
190
198
  */
191
- export interface iLocaleTable {
199
+ export type tLocaleTable = {
192
200
  /** @example "See {name}" */
193
201
  table_see_values: string;
194
202
  /** @example "See: \"{name}\"" */
@@ -221,6 +229,10 @@ export interface iLocaleTable {
221
229
  table_options: string;
222
230
  /** @example "Open URL" */
223
231
  table_open_url: string;
232
+ /** @example "Hide all" */
233
+ table_hide_all: string;
234
+ /** @example "Show all" */
235
+ table_show_all: string;
224
236
  swal: {
225
237
  /** @example "Are you sure you want to delete this element?" */
226
238
  table_delete_node_title: string;
@@ -247,14 +259,14 @@ export interface iLocaleTable {
247
259
  /** @example "The item may not have been cloned | The items may not have been cloned" */
248
260
  table_possibly_not_cloned: string;
249
261
  };
250
- }
262
+ };
251
263
 
252
264
  /**
253
265
  * Pagination locale
254
266
  *
255
267
  * @localeType
256
268
  */
257
- export interface iLocalePagination {
269
+ export type tLocalePagination = {
258
270
  /** @example "No items | Single item | {count} items" */
259
271
  pagination_items: string;
260
272
  /** @example "No pages | Single page | {count} pages" */
@@ -276,25 +288,16 @@ export interface iLocalePagination {
276
288
  /** @example "Filter by:" */
277
289
  pagination_filter_by: string;
278
290
  // swal: {};
279
- }
291
+ };
280
292
 
281
293
  /**
282
294
  * Plugin locale
283
295
  *
284
296
  * @localeType
285
297
  */
286
- export type tPluginLocale = iLocaleBase &
287
- iLocaleInput &
288
- iLocaleModal &
289
- iLocaleForm &
290
- iLocaleTable &
291
- iLocalePagination;
292
-
293
- /**
294
- * Plugin locale key union
295
- *
296
- * @localeType
297
- */
298
- export type tPluginLocaleKey =
299
- | Exclude<keyof tPluginLocale, "swal">
300
- | `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
  */