@open-xamu-co/ui-common-types 3.0.0-next.13 → 3.0.0-next.15

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.13",
3
+ "version": "3.0.0-next.15",
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": "^3.0.0-next.5",
35
+ "@open-xamu-co/ui-common-enums": "^3.0.0-next.6",
36
36
  "sweetalert2": "^11.11.1"
37
37
  },
38
38
  "engines": {
package/src/form.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { IconName } from "@fortawesome/fontawesome-common-types";
2
2
 
3
- import { eFormTypeComplex, eFormTypeSimple } from "@open-xamu-co/ui-common-enums";
3
+ import { eFormTypeBase, eFormTypeComplex, eFormTypeSimple } from "@open-xamu-co/ui-common-enums";
4
4
 
5
5
  import type { iSelectOption } from "./values.js";
6
6
 
@@ -95,12 +95,14 @@ export type iFormIconProps = { brand?: boolean; regular?: boolean };
95
95
 
96
96
  export type tFormIcon = [IconName | undefined, iFormIconProps];
97
97
 
98
- export type iFormValue = string | number | boolean | File;
98
+ export type iFormValue = string | number | boolean | File | Date;
99
99
 
100
100
  /**
101
101
  * Simple input
102
102
  */
103
- export interface iFormInputDefault<T extends eFormTypeSimple | eFormTypeComplex = eFormTypeSimple> {
103
+ export interface iFormInputDefault<
104
+ T extends eFormTypeBase | eFormTypeSimple | eFormTypeComplex = eFormTypeSimple,
105
+ > {
104
106
  required?: boolean;
105
107
  type?: T;
106
108
  /**
@@ -114,8 +116,8 @@ export interface iFormInputDefault<T extends eFormTypeSimple | eFormTypeComplex
114
116
  /**
115
117
  * Complex input, sub input support
116
118
  */
117
- export interface iFormInput<V extends iFormValue = iFormValue>
118
- extends iFormInputDefault<eFormTypeSimple | eFormTypeComplex> {
119
+ export interface iFormInput<V extends iFormValue = iFormValue, Vk extends V | V[] = V | V[]>
120
+ extends iFormInputDefault<eFormTypeBase | eFormTypeSimple | eFormTypeComplex> {
119
121
  name: string;
120
122
  options?: (string | number | iFormOption)[];
121
123
  /**
@@ -123,7 +125,7 @@ export interface iFormInput<V extends iFormValue = iFormValue>
123
125
  *
124
126
  * @old value
125
127
  */
126
- values?: (V | V[])[];
128
+ values?: Vk[];
127
129
  defaults?: [iFormInputDefault, iFormInputDefault, ...iFormInputDefault[]];
128
130
  /**
129
131
  * Visible over the field, should describe it
package/src/values.ts CHANGED
@@ -38,3 +38,5 @@ export interface iProperty<
38
38
  */
39
39
  deleteNode?: iNodeFn<T, [T?]>;
40
40
  }
41
+
42
+ export type tPropertyOrderFn = (a: [string, any], b: [string, any]) => -1 | 0 | 1;