@etsoo/shared 1.1.83 → 1.1.84

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/README.md CHANGED
@@ -121,6 +121,8 @@ Data type definitions and type safe functions. ListItemType and ListItemType1 ar
121
121
  |MConstructor|Mixins constructor|
122
122
  |ObjType|Generic object type|
123
123
  |Optional|Make properties optional|
124
+ |PlacementEnum|Placement enum|
125
+ |Placement|Placement type|
124
126
  |RequireAtLeastOne|Require at least one property of the keys|
125
127
  |Simple|Basic or basic array type|
126
128
  |SimpleEnum|Simple type enum|
@@ -114,6 +114,25 @@ export declare namespace DataTypes {
114
114
  * Vertical align
115
115
  */
116
116
  type VAlign = Lowercase<keyof typeof VAlignEnum>;
117
+ /**
118
+ * Placement enum
119
+ */
120
+ enum PlacementEnum {
121
+ TopLeft = 0,
122
+ TopCenter = 1,
123
+ TopRight = 2,
124
+ MiddleLeft = 3,
125
+ Center = 4,
126
+ MiddleRight = 5,
127
+ BottomLeft = 6,
128
+ BottomCenter = 7,
129
+ BottomRight = 8,
130
+ Unknown = 9
131
+ }
132
+ /**
133
+ * Placement type
134
+ */
135
+ type Placement = keyof typeof PlacementEnum;
117
136
  /**
118
137
  * Number and string combination id type
119
138
  */
@@ -76,6 +76,22 @@ var DataTypes;
76
76
  VAlignEnum[VAlignEnum["Center"] = 2] = "Center";
77
77
  VAlignEnum[VAlignEnum["Bottom"] = 3] = "Bottom";
78
78
  })(VAlignEnum = DataTypes.VAlignEnum || (DataTypes.VAlignEnum = {}));
79
+ /**
80
+ * Placement enum
81
+ */
82
+ let PlacementEnum;
83
+ (function (PlacementEnum) {
84
+ PlacementEnum[PlacementEnum["TopLeft"] = 0] = "TopLeft";
85
+ PlacementEnum[PlacementEnum["TopCenter"] = 1] = "TopCenter";
86
+ PlacementEnum[PlacementEnum["TopRight"] = 2] = "TopRight";
87
+ PlacementEnum[PlacementEnum["MiddleLeft"] = 3] = "MiddleLeft";
88
+ PlacementEnum[PlacementEnum["Center"] = 4] = "Center";
89
+ PlacementEnum[PlacementEnum["MiddleRight"] = 5] = "MiddleRight";
90
+ PlacementEnum[PlacementEnum["BottomLeft"] = 6] = "BottomLeft";
91
+ PlacementEnum[PlacementEnum["BottomCenter"] = 7] = "BottomCenter";
92
+ PlacementEnum[PlacementEnum["BottomRight"] = 8] = "BottomRight";
93
+ PlacementEnum[PlacementEnum["Unknown"] = 9] = "Unknown"; // Reserved for modal, only one instance held at the same time
94
+ })(PlacementEnum = DataTypes.PlacementEnum || (DataTypes.PlacementEnum = {}));
79
95
  /**
80
96
  * Convert value to target type
81
97
  * @param input Input value
@@ -79,16 +79,12 @@ export declare namespace DomUtils {
79
79
  const getCulture: <T extends DataTypes.StringRecord>(items: Readonly<{
80
80
  name: string;
81
81
  label: string;
82
- resources: T; /**
83
- * Current detected culture
84
- */
82
+ resources: T;
85
83
  compatibleNames?: string[] | undefined;
86
84
  }>[], culture: string) => [Readonly<{
87
85
  name: string;
88
86
  label: string;
89
- resources: T; /**
90
- * Current detected culture
91
- */
87
+ resources: T;
92
88
  compatibleNames?: string[] | undefined;
93
89
  }> | undefined, CultureMatch];
94
90
  /**
@@ -114,6 +114,25 @@ export declare namespace DataTypes {
114
114
  * Vertical align
115
115
  */
116
116
  type VAlign = Lowercase<keyof typeof VAlignEnum>;
117
+ /**
118
+ * Placement enum
119
+ */
120
+ enum PlacementEnum {
121
+ TopLeft = 0,
122
+ TopCenter = 1,
123
+ TopRight = 2,
124
+ MiddleLeft = 3,
125
+ Center = 4,
126
+ MiddleRight = 5,
127
+ BottomLeft = 6,
128
+ BottomCenter = 7,
129
+ BottomRight = 8,
130
+ Unknown = 9
131
+ }
132
+ /**
133
+ * Placement type
134
+ */
135
+ type Placement = keyof typeof PlacementEnum;
117
136
  /**
118
137
  * Number and string combination id type
119
138
  */
@@ -73,6 +73,22 @@ export var DataTypes;
73
73
  VAlignEnum[VAlignEnum["Center"] = 2] = "Center";
74
74
  VAlignEnum[VAlignEnum["Bottom"] = 3] = "Bottom";
75
75
  })(VAlignEnum = DataTypes.VAlignEnum || (DataTypes.VAlignEnum = {}));
76
+ /**
77
+ * Placement enum
78
+ */
79
+ let PlacementEnum;
80
+ (function (PlacementEnum) {
81
+ PlacementEnum[PlacementEnum["TopLeft"] = 0] = "TopLeft";
82
+ PlacementEnum[PlacementEnum["TopCenter"] = 1] = "TopCenter";
83
+ PlacementEnum[PlacementEnum["TopRight"] = 2] = "TopRight";
84
+ PlacementEnum[PlacementEnum["MiddleLeft"] = 3] = "MiddleLeft";
85
+ PlacementEnum[PlacementEnum["Center"] = 4] = "Center";
86
+ PlacementEnum[PlacementEnum["MiddleRight"] = 5] = "MiddleRight";
87
+ PlacementEnum[PlacementEnum["BottomLeft"] = 6] = "BottomLeft";
88
+ PlacementEnum[PlacementEnum["BottomCenter"] = 7] = "BottomCenter";
89
+ PlacementEnum[PlacementEnum["BottomRight"] = 8] = "BottomRight";
90
+ PlacementEnum[PlacementEnum["Unknown"] = 9] = "Unknown"; // Reserved for modal, only one instance held at the same time
91
+ })(PlacementEnum = DataTypes.PlacementEnum || (DataTypes.PlacementEnum = {}));
76
92
  /**
77
93
  * Convert value to target type
78
94
  * @param input Input value
@@ -79,16 +79,12 @@ export declare namespace DomUtils {
79
79
  const getCulture: <T extends DataTypes.StringRecord>(items: Readonly<{
80
80
  name: string;
81
81
  label: string;
82
- resources: T; /**
83
- * Current detected culture
84
- */
82
+ resources: T;
85
83
  compatibleNames?: string[] | undefined;
86
84
  }>[], culture: string) => [Readonly<{
87
85
  name: string;
88
86
  label: string;
89
- resources: T; /**
90
- * Current detected culture
91
- */
87
+ resources: T;
92
88
  compatibleNames?: string[] | undefined;
93
89
  }> | undefined, CultureMatch];
94
90
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.1.83",
3
+ "version": "1.1.84",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -56,8 +56,8 @@
56
56
  "devDependencies": {
57
57
  "@types/jest": "^29.2.4",
58
58
  "@types/lodash.isequal": "^4.5.6",
59
- "@typescript-eslint/eslint-plugin": "^5.46.1",
60
- "@typescript-eslint/parser": "^5.46.1",
59
+ "@typescript-eslint/eslint-plugin": "^5.47.0",
60
+ "@typescript-eslint/parser": "^5.47.0",
61
61
  "eslint": "^8.30.0",
62
62
  "eslint-config-airbnb-base": "^15.0.0",
63
63
  "eslint-plugin-import": "^2.26.0",
package/src/DataTypes.ts CHANGED
@@ -148,6 +148,30 @@ export namespace DataTypes {
148
148
  */
149
149
  export type VAlign = Lowercase<keyof typeof VAlignEnum>;
150
150
 
151
+ /**
152
+ * Placement enum
153
+ */
154
+ export enum PlacementEnum {
155
+ TopLeft,
156
+ TopCenter,
157
+ TopRight,
158
+
159
+ MiddleLeft,
160
+ Center,
161
+ MiddleRight,
162
+
163
+ BottomLeft,
164
+ BottomCenter,
165
+ BottomRight,
166
+
167
+ Unknown // Reserved for modal, only one instance held at the same time
168
+ }
169
+
170
+ /**
171
+ * Placement type
172
+ */
173
+ export type Placement = keyof typeof PlacementEnum;
174
+
151
175
  /**
152
176
  * Number and string combination id type
153
177
  */