@mgdis/core-ui-helpers 1.2.2 → 1.3.1

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 (149) hide show
  1. package/dist/angular/index.cjs +27 -0
  2. package/dist/angular/index.cjs.map +1 -0
  3. package/dist/angular/index.d.ts +21 -0
  4. package/dist/angular/index.js +25 -0
  5. package/dist/angular/index.js.map +1 -0
  6. package/dist/angular/index.umd.js +33 -0
  7. package/dist/angular/index.umd.js.map +1 -0
  8. package/dist/locale/index.cjs +190 -0
  9. package/dist/locale/index.cjs.map +1 -0
  10. package/dist/locale/index.d.ts +110 -0
  11. package/dist/locale/index.js +181 -0
  12. package/dist/locale/index.js.map +1 -0
  13. package/dist/locale/index.umd.js +196 -0
  14. package/dist/locale/index.umd.js.map +1 -0
  15. package/dist/playwright/index.cjs +137 -0
  16. package/dist/playwright/index.cjs.map +1 -0
  17. package/dist/playwright/index.d.ts +39 -0
  18. package/dist/playwright/index.js +133 -0
  19. package/dist/playwright/index.js.map +1 -0
  20. package/dist/playwright/index.umd.js +143 -0
  21. package/dist/playwright/index.umd.js.map +1 -0
  22. package/dist/stencil/index.cjs +363 -0
  23. package/dist/stencil/index.cjs.map +1 -0
  24. package/dist/stencil/index.d.ts +222 -0
  25. package/dist/stencil/index.js +357 -0
  26. package/dist/stencil/index.js.map +1 -0
  27. package/dist/stencil/index.umd.js +369 -0
  28. package/dist/stencil/index.umd.js.map +1 -0
  29. package/dist/storybook/index.cjs +2335 -0
  30. package/dist/storybook/index.cjs.map +1 -0
  31. package/dist/storybook/index.d.ts +85 -0
  32. package/dist/storybook/index.js +2329 -0
  33. package/dist/storybook/index.js.map +1 -0
  34. package/dist/storybook/index.umd.js +2341 -0
  35. package/dist/storybook/index.umd.js.map +1 -0
  36. package/dist/tests/index.cjs +315 -0
  37. package/dist/tests/index.cjs.map +1 -0
  38. package/dist/tests/index.d.ts +100 -0
  39. package/dist/tests/index.js +309 -0
  40. package/dist/tests/index.js.map +1 -0
  41. package/dist/tests/index.umd.js +321 -0
  42. package/dist/tests/index.umd.js.map +1 -0
  43. package/dist/utils/index.cjs +441 -0
  44. package/dist/utils/index.cjs.map +1 -0
  45. package/dist/utils/index.d.ts +265 -0
  46. package/dist/utils/index.js +417 -0
  47. package/dist/utils/index.js.map +1 -0
  48. package/dist/utils/index.umd.js +447 -0
  49. package/dist/utils/index.umd.js.map +1 -0
  50. package/dist/vue/index.cjs +1935 -0
  51. package/dist/vue/index.cjs.map +1 -0
  52. package/dist/vue/index.d.ts +35 -0
  53. package/dist/vue/index.js +1933 -0
  54. package/dist/vue/index.js.map +1 -0
  55. package/dist/vue/index.umd.js +1941 -0
  56. package/dist/vue/index.umd.js.map +1 -0
  57. package/package.json +14 -11
  58. package/CHANGELOG.md +0 -101
  59. package/json-doc.test.json +0 -264
  60. package/rollup.config.mjs +0 -61
  61. package/src/angular/index.spec.ts +0 -8
  62. package/src/angular/index.ts +0 -1
  63. package/src/angular/mg-angular-logger/index.ts +0 -1
  64. package/src/angular/mg-angular-logger/mg-angular-logger.conf.ts +0 -3
  65. package/src/angular/mg-angular-logger/mg-angular-logger.spec.ts +0 -40
  66. package/src/angular/mg-angular-logger/mg-angular-logger.ts +0 -24
  67. package/src/locale/index.spec.ts +0 -24
  68. package/src/locale/index.ts +0 -1
  69. package/src/locale/locale.spec.ts +0 -291
  70. package/src/locale/locale.ts +0 -201
  71. package/src/playwright/config/index.ts +0 -43
  72. package/src/playwright/index.spec.ts +0 -16
  73. package/src/playwright/index.ts +0 -4
  74. package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +0 -48
  75. package/src/playwright/utils/index.ts +0 -1
  76. package/src/playwright/utils/utils.spec.ts +0 -50
  77. package/src/playwright/utils/utils.ts +0 -77
  78. package/src/stencil/ide/__snapshots__/cem.spec.ts.snap +0 -248
  79. package/src/stencil/ide/__snapshots__/ide.spec.ts.snap +0 -414
  80. package/src/stencil/ide/cem.spec.ts +0 -35
  81. package/src/stencil/ide/cem.ts +0 -96
  82. package/src/stencil/ide/ide.spec.ts +0 -29
  83. package/src/stencil/ide/ide.ts +0 -221
  84. package/src/stencil/ide/index.ts +0 -2
  85. package/src/stencil/index.spec.ts +0 -16
  86. package/src/stencil/index.ts +0 -2
  87. package/src/stencil/normalize-boolean-attributes/index.ts +0 -1
  88. package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.spec.ts +0 -63
  89. package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.ts +0 -40
  90. package/src/storybook/index.spec.ts +0 -19
  91. package/src/storybook/index.ts +0 -1
  92. package/src/storybook/stencil/__snapshots__/stencil.spec.ts.snap +0 -329
  93. package/src/storybook/stencil/index.ts +0 -1
  94. package/src/storybook/stencil/stencil-shim.d.ts +0 -1
  95. package/src/storybook/stencil/stencil.conf.ts +0 -4
  96. package/src/storybook/stencil/stencil.spec.ts +0 -170
  97. package/src/storybook/stencil/stencil.ts +0 -377
  98. package/src/tests/index.spec.ts +0 -20
  99. package/src/tests/index.ts +0 -1
  100. package/src/tests/unit/__snapshots__/unit.spec.ts.snap +0 -52
  101. package/src/tests/unit/index.ts +0 -1
  102. package/src/tests/unit/unit.conf.ts +0 -16
  103. package/src/tests/unit/unit.spec.ts +0 -206
  104. package/src/tests/unit/unit.ts +0 -333
  105. package/src/utils/attributes/class-list/class-list.spec.ts +0 -36
  106. package/src/utils/attributes/class-list/class-list.ts +0 -51
  107. package/src/utils/attributes/class-list/index.ts +0 -1
  108. package/src/utils/attributes/id/id.spec.ts +0 -54
  109. package/src/utils/attributes/id/id.ts +0 -47
  110. package/src/utils/attributes/id/index.ts +0 -1
  111. package/src/utils/attributes/index.ts +0 -3
  112. package/src/utils/attributes/to-kebab-case/index.ts +0 -1
  113. package/src/utils/attributes/to-kebab-case/to-kebab-case.spec.ts +0 -29
  114. package/src/utils/attributes/to-kebab-case/to-kebab-case.ts +0 -23
  115. package/src/utils/components/__snapshots__/components.spec.ts.snap +0 -313
  116. package/src/utils/components/components.conf.ts +0 -11
  117. package/src/utils/components/components.spec.ts +0 -192
  118. package/src/utils/components/components.ts +0 -152
  119. package/src/utils/components/index.ts +0 -2
  120. package/src/utils/date/date.spec.ts +0 -12
  121. package/src/utils/date/date.ts +0 -20
  122. package/src/utils/date/index.ts +0 -1
  123. package/src/utils/elements/elements.spec.ts +0 -17
  124. package/src/utils/elements/elements.ts +0 -18
  125. package/src/utils/elements/index.ts +0 -1
  126. package/src/utils/index.spec.ts +0 -84
  127. package/src/utils/index.ts +0 -8
  128. package/src/utils/number/index.ts +0 -1
  129. package/src/utils/number/number.spec.ts +0 -14
  130. package/src/utils/number/number.ts +0 -6
  131. package/src/utils/object/index.ts +0 -2
  132. package/src/utils/object/object.conf.ts +0 -4
  133. package/src/utils/object/object.spec.ts +0 -110
  134. package/src/utils/object/object.ts +0 -27
  135. package/src/utils/string/index.ts +0 -1
  136. package/src/utils/string/string.spec.ts +0 -54
  137. package/src/utils/string/string.ts +0 -39
  138. package/src/utils/windows/index.ts +0 -1
  139. package/src/utils/windows/windows.spec.ts +0 -69
  140. package/src/utils/windows/windows.ts +0 -50
  141. package/src/vue/index.spec.ts +0 -8
  142. package/src/vue/index.ts +0 -1
  143. package/src/vue/mg-model/index.ts +0 -1
  144. package/src/vue/mg-model/mg-model.conf.ts +0 -6
  145. package/src/vue/mg-model/mg-model.spec.ts +0 -50
  146. package/src/vue/mg-model/mg-model.ts +0 -55
  147. package/tsconfig.json +0 -17
  148. package/typedoc.json +0 -14
  149. package/vitest.config.mts +0 -13
@@ -0,0 +1,265 @@
1
+ /**
2
+ * Class to manage component classlist
3
+ */
4
+ declare class ClassList {
5
+ /**
6
+ * Available classes
7
+ */
8
+ classes: string[];
9
+ constructor(classlist?: string[]);
10
+ /**
11
+ * Add class
12
+ * @param className - class name to add
13
+ */
14
+ add: (className: string) => void;
15
+ /**
16
+ * Delete class
17
+ * @param className - class name to delete
18
+ */
19
+ delete: (className: string) => void;
20
+ /**
21
+ * Check if class exist in list
22
+ * @param className - class name to check
23
+ * @returns class name is in the list
24
+ */
25
+ has: (className: string) => boolean;
26
+ /**
27
+ * Join classes seperated by spaces
28
+ * @returns joined values
29
+ */
30
+ join: () => string;
31
+ }
32
+
33
+ /**
34
+ * Create random ID
35
+ * @param prefix - add prefix to created ID
36
+ * @param length - ID length
37
+ * @returns ID
38
+ */
39
+ declare const createID: (prefix?: string, length?: number) => string;
40
+ /**
41
+ * Validate html `id` format
42
+ * @param newValue - id value to validate
43
+ * @returns true if `id` is valid
44
+ */
45
+ declare const isValideID: (newValue: unknown) => boolean;
46
+ /**
47
+ * Format id from value
48
+ * @param value - id to transforme
49
+ * @returns valid id
50
+ */
51
+ declare const formatID: (value: unknown) => string | undefined;
52
+
53
+ /**
54
+ * Convert a string to kebab-case.
55
+ *
56
+ * This function ensures:
57
+ * - All characters are converted to lowercase. Based on : https://stackoverflow.com/questions/63116039/camelcase-to-kebab-case
58
+ * - Non-alphabetic characters (except numbers and hyphens) are replaced with hyphens.
59
+ * - Consecutive hyphens are replaced with a single hyphen.
60
+ * - Leading and trailing hyphens are removed.
61
+ *
62
+ * @param str - The input string to convert.
63
+ * @returns The kebab-case formatted string.
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * toKebabCase('XMLHttpRequest'); // 'xml-http-request'
68
+ * ```
69
+ */
70
+ declare const toKebabCase: (str: string) => string;
71
+
72
+ /**
73
+ * Define getPage type
74
+ */
75
+ type IGetPage<T> = (offset?: number, filter?: Parameters<Array<T>['filter']>[0]) => Page<T>;
76
+ /**
77
+ * Cursor type
78
+ */
79
+ type CursorType = 'first' | 'next' | 'previous' | 'last';
80
+
81
+ /**
82
+ * Use to process code next tick in the event loop
83
+ * @param callback - code to excute on next tick
84
+ * @returns differed code excution
85
+ */
86
+ declare const nextTick: (callback?: () => void) => Promise<void>;
87
+ /**
88
+ * Cursor possible values
89
+ */
90
+ declare const Cursor: Record<string, CursorType>;
91
+ /**
92
+ * Define a valid Page object and navigate throw page items with cursor.
93
+ * Page object entries follow the REST API page practices.
94
+ */
95
+ declare class Page<T> {
96
+ /**
97
+ * Define items
98
+ */
99
+ items: T[];
100
+ /**
101
+ * Define total
102
+ */
103
+ total: number;
104
+ /**
105
+ * Define top
106
+ */
107
+ top: number;
108
+ /**
109
+ * Define next
110
+ */
111
+ next?: IGetPage<T> | string | URL;
112
+ /**
113
+ * Define base index
114
+ */
115
+ readonly baseIndex = 1;
116
+ constructor(init: Partial<Pick<Page<T>, 'items' | 'top' | 'total' | 'next'>>);
117
+ /**
118
+ * Get index of items from cursor
119
+ * @param cursor - cursor to find
120
+ * @param oldItem - previous item
121
+ * @returns item index
122
+ */
123
+ getIndexFromCursor: (cursor?: CursorType, oldItem?: T) => number | null;
124
+ }
125
+ /**
126
+ * Paginate an items array to navigate into with pages.
127
+ * It follow REST standard and allow to navigate in items array with a similar format.
128
+ */
129
+ declare class Paginate<T> {
130
+ #private;
131
+ /**
132
+ * Define paginated items
133
+ */
134
+ items: Page<T>['items'];
135
+ constructor(items: Page<T>['items'], options?: {
136
+ step?: number;
137
+ top?: Page<T>['top'];
138
+ total?: Page<T>['total'];
139
+ next?: Page<T>['next'];
140
+ });
141
+ /**
142
+ * Get page
143
+ * @param offset - pagiantion offset
144
+ * @param filter - filter methode
145
+ * @returns formated page
146
+ */
147
+ getPage: IGetPage<T>;
148
+ }
149
+
150
+ /**
151
+ * Date RegExp, usefull to test if string is a follow the date pattern
152
+ * @example
153
+ * ```ts
154
+ * dateRegExp.test('mystring') // false
155
+ * dateRegExp.test('2020-12-31') // true
156
+ * ```
157
+ */
158
+ declare const dateRegExp: RegExp;
159
+ /**
160
+ * Formats a date object to a string with the pattern 'YYYY-MM-DD'.
161
+ * @param date - date to parse
162
+ * @returns string date with pattern 'YYYY-MM-DD'
163
+ * @example
164
+ * ```ts
165
+ * dateToString(new Date('2023-12-24')) // '2023-12-24'
166
+ * ```
167
+ */
168
+ declare const dateToString: (date: Date) => string | undefined;
169
+
170
+ /**
171
+ * Check if element belongs to the given tagNames list
172
+ * @param element - element to check
173
+ * @param tagNames - allowed tag names list
174
+ * @returns `true` if element tagName is in the tagNames list
175
+ */
176
+ declare const isTagName: (element: Element, tagNames: string[]) => boolean;
177
+ /**
178
+ * CSS selector to select focusable elements.
179
+ * @example
180
+ * ```ts
181
+ * const allFocusableElements: HTMLElement[] = Array.from(this.element.querySelectorAll(focusableElements));
182
+ * ```
183
+ */
184
+ declare const focusableElements = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button";
185
+
186
+ /**
187
+ * Validate number
188
+ * @param value - value to check
189
+ * @returns `true` if number is valid
190
+ */
191
+ declare const isValidNumber: (value: unknown) => value is number;
192
+
193
+ /**
194
+ * Check if a value is of object type.
195
+ * @param object - The value to validate.
196
+ * @returns `true` if the value is a valid object (non-null and not an array), otherwise `false`.
197
+ */
198
+ declare const isObject: <T>(object: unknown) => object is T;
199
+ /**
200
+ * Get object value from key
201
+ * @param object - object to query
202
+ * @param path - path of the property to get. Nested keys are allowed with `.` separators (eg: 'key0.key1.key2' = object[key0][key1][key2])
203
+ * @param defaultValue - The value returned for `undefined` resolved values
204
+ * @returns object value
205
+ */
206
+ declare const getObjectValueFromKey: <T, R>(object: T, path: string, defaultValue?: R) => R | undefined;
207
+
208
+ /**
209
+ * Define json object type
210
+ */
211
+ type ObjectType = Record<string, unknown>;
212
+
213
+ /**
214
+ * Typeguard function to check if all array items are strings.
215
+ * @param items - items to check
216
+ * @returns `true` if all items are strings
217
+ */
218
+ declare const allItemsAreString: (items: unknown) => items is string[];
219
+ /**
220
+ * Validate string
221
+ * @param value - value to check
222
+ * @returns `true` if string is valid
223
+ */
224
+ declare const isValidString: (value: unknown) => value is string;
225
+ /**
226
+ * Stringify value
227
+ * @param value - value to stringify
228
+ * @returns stringified value
229
+ */
230
+ declare const toString: (value: unknown) => string;
231
+ /**
232
+ * Cleans string characters by removing special characters and converting to lowercase.
233
+ * @param text - text to clean
234
+ * @returns cleaned string
235
+ * @example
236
+ * ```ts
237
+ * cleanString('âäàçéèêñù') // 'aaaceeenu'
238
+ * cleanString('BATMAN') // 'batman'
239
+ * ```
240
+ */
241
+ declare const cleanString: (text: string) => string;
242
+
243
+ /**
244
+ * Get windows
245
+ * @param localWindow - the window we are lookink for other windows
246
+ * @returns The list of windows found
247
+ */
248
+ declare const getWindows: (localWindow: Window) => Window[];
249
+ /**
250
+ * Get parent windows
251
+ * @param localWindow - the window we are lookink for parents
252
+ * @param windows - The list of allready found windows
253
+ * @returns The list of windows found
254
+ */
255
+ declare const getParentWindows: (localWindow: Window, windows?: Window[]) => Window[];
256
+ /**
257
+ * Get child windows
258
+ * @param localWindow - the window we are lookink for children
259
+ * @param windows - The list of allready found windows
260
+ * @returns The list of windows found
261
+ */
262
+ declare const getChildWindows: (localWindow: Window, windows?: Window[]) => Window[];
263
+
264
+ export { ClassList, Cursor, Page, Paginate, allItemsAreString, cleanString, createID, dateRegExp, dateToString, focusableElements, formatID, getChildWindows, getObjectValueFromKey, getParentWindows, getWindows, isObject, isTagName, isValidNumber, isValidString, isValideID, nextTick, toKebabCase, toString };
265
+ export type { CursorType, ObjectType };
@@ -0,0 +1,417 @@
1
+ /**
2
+ * Class to manage component classlist
3
+ */
4
+ class ClassList {
5
+ /**
6
+ * Available classes
7
+ */
8
+ classes;
9
+ constructor(classlist = []) {
10
+ this.classes = classlist;
11
+ }
12
+ /**
13
+ * Add class
14
+ * @param className - class name to add
15
+ */
16
+ add = (className) => {
17
+ if (!this.has(className)) {
18
+ this.classes.push(className);
19
+ }
20
+ };
21
+ /**
22
+ * Delete class
23
+ * @param className - class name to delete
24
+ */
25
+ delete = (className) => {
26
+ const index = this.classes.indexOf(className);
27
+ if (index > -1) {
28
+ this.classes.splice(index, 1);
29
+ }
30
+ };
31
+ /**
32
+ * Check if class exist in list
33
+ * @param className - class name to check
34
+ * @returns class name is in the list
35
+ */
36
+ has = (className) => {
37
+ return this.classes.includes(className);
38
+ };
39
+ /**
40
+ * Join classes seperated by spaces
41
+ * @returns joined values
42
+ */
43
+ join = () => {
44
+ return this.classes.join(' ');
45
+ };
46
+ }
47
+
48
+ /**
49
+ * Check if a value is of object type.
50
+ * @param object - The value to validate.
51
+ * @returns `true` if the value is a valid object (non-null and not an array), otherwise `false`.
52
+ */
53
+ const isObject = (object) => typeof object === 'object' && !Array.isArray(object) && object !== null;
54
+ /**
55
+ * Get object value from key
56
+ * @param object - object to query
57
+ * @param path - path of the property to get. Nested keys are allowed with `.` separators (eg: 'key0.key1.key2' = object[key0][key1][key2])
58
+ * @param defaultValue - The value returned for `undefined` resolved values
59
+ * @returns object value
60
+ */
61
+ const getObjectValueFromKey = (object, path, defaultValue) => {
62
+ const separator = '.';
63
+ if (!isObject(object) || typeof path !== 'string') {
64
+ return defaultValue;
65
+ }
66
+ const [current, ...next] = path.split(separator);
67
+ if (next.length) {
68
+ return getObjectValueFromKey(object[current], next.join(separator), defaultValue);
69
+ }
70
+ else {
71
+ return object[current] ?? defaultValue;
72
+ }
73
+ };
74
+
75
+ /**
76
+ * Typeguard function to check if all array items are strings.
77
+ * @param items - items to check
78
+ * @returns `true` if all items are strings
79
+ */
80
+ const allItemsAreString = (items) => Array.isArray(items) && items.every((item) => typeof item === 'string');
81
+ /**
82
+ * Validate string
83
+ * @param value - value to check
84
+ * @returns `true` if string is valid
85
+ */
86
+ const isValidString = (value) => typeof value === 'string' && value.trim() !== '';
87
+ /**
88
+ * Stringify value
89
+ * @param value - value to stringify
90
+ * @returns stringified value
91
+ */
92
+ const toString = (value) => (typeof value === 'object' ? JSON.stringify(value) : String(value));
93
+ /**
94
+ * Cleans string characters by removing special characters and converting to lowercase.
95
+ * @param text - text to clean
96
+ * @returns cleaned string
97
+ * @example
98
+ * ```ts
99
+ * cleanString('âäàçéèêñù') // 'aaaceeenu'
100
+ * cleanString('BATMAN') // 'batman'
101
+ * ```
102
+ */
103
+ const cleanString = (text) => typeof text === 'string'
104
+ ? text
105
+ .toLocaleLowerCase()
106
+ .normalize('NFD')
107
+ .replaceAll(/[\u0300-\u036f]/g, '')
108
+ : text;
109
+
110
+ /**
111
+ * Convert a string to kebab-case.
112
+ *
113
+ * This function ensures:
114
+ * - All characters are converted to lowercase. Based on : https://stackoverflow.com/questions/63116039/camelcase-to-kebab-case
115
+ * - Non-alphabetic characters (except numbers and hyphens) are replaced with hyphens.
116
+ * - Consecutive hyphens are replaced with a single hyphen.
117
+ * - Leading and trailing hyphens are removed.
118
+ *
119
+ * @param str - The input string to convert.
120
+ * @returns The kebab-case formatted string.
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * toKebabCase('XMLHttpRequest'); // 'xml-http-request'
125
+ * ```
126
+ */
127
+ const toKebabCase = (str) => str
128
+ .replace(/[A-Z]+(?![a-z])|[A-Z]/g, (match, offset) => (offset > 0 ? '-' : '') + match.toLowerCase())
129
+ .replace(/[^a-z0-9-]+/g, '-') // Replace non a-z, 0-9, or hyphen characters with a hyphen
130
+ .replace(/--+/g, '-') // Replace multiple consecutive hyphens with a single hyphen
131
+ .replace(/(?:^-)|(?:-$)/g, ''); // Remove leading hyphens or number or trailing hyphens
132
+
133
+ /**
134
+ * Create random ID
135
+ * @param prefix - add prefix to created ID
136
+ * @param length - ID length
137
+ * @returns ID
138
+ */
139
+ const createID = (prefix = '', length = 10) => {
140
+ const randomBytes = new Uint8Array(length);
141
+ crypto.getRandomValues(randomBytes);
142
+ const hexString = Array.from(randomBytes)
143
+ .map((byte) => byte.toString(16).padStart(2, '0'))
144
+ .join('')
145
+ .slice(0, length);
146
+ return prefix !== '' ? `${prefix}-${hexString}` : hexString;
147
+ };
148
+ /**
149
+ * Validate html `id` format
150
+ * @param newValue - id value to validate
151
+ * @returns true if `id` is valid
152
+ */
153
+ const isValideID = (newValue) => isValidString(newValue) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(newValue) !== null;
154
+ /**
155
+ * Format id from value
156
+ * @param value - id to transforme
157
+ * @returns valid id
158
+ */
159
+ const formatID = (value) => {
160
+ let id;
161
+ if (typeof value === 'string') {
162
+ id = value;
163
+ }
164
+ else if (Boolean(value) && typeof value === 'object' && (isObject(value) || Array.isArray(value))) {
165
+ id = JSON.stringify(value);
166
+ }
167
+ else if (value !== null && value !== undefined && typeof value !== 'boolean' && typeof value !== 'object') {
168
+ id = String(value);
169
+ }
170
+ return id ? toKebabCase(id) : id;
171
+ };
172
+
173
+ /**
174
+ * Use to process code next tick in the event loop
175
+ * @param callback - code to excute on next tick
176
+ * @returns differed code excution
177
+ */
178
+ const nextTick = async (callback) => {
179
+ if (callback)
180
+ return callback();
181
+ };
182
+ /**
183
+ * Cursor possible values
184
+ */
185
+ const Cursor = {
186
+ FIRST: 'first',
187
+ NEXT: 'next',
188
+ PREVIOUS: 'previous',
189
+ LAST: 'last',
190
+ };
191
+ const DEFAULT_TOP = 10;
192
+ /**
193
+ * Define a valid Page object and navigate throw page items with cursor.
194
+ * Page object entries follow the REST API page practices.
195
+ */
196
+ class Page {
197
+ /**
198
+ * Define items
199
+ */
200
+ items = [];
201
+ /**
202
+ * Define total
203
+ */
204
+ total;
205
+ /**
206
+ * Define top
207
+ */
208
+ top = DEFAULT_TOP;
209
+ /**
210
+ * Define next
211
+ */
212
+ next;
213
+ /**
214
+ * Define base index
215
+ */
216
+ baseIndex = 1;
217
+ constructor(init) {
218
+ if (!isObject(init)) {
219
+ throw new Error('Page - init must match IPage type.');
220
+ }
221
+ else {
222
+ if (Array.isArray(init.items))
223
+ this.items = init.items;
224
+ if (typeof init.top === 'number')
225
+ this.top = init.top;
226
+ this.total = typeof init.total === 'number' ? init.total : this.items.length;
227
+ this.next = init.next;
228
+ }
229
+ }
230
+ /**
231
+ * Get index of items from cursor
232
+ * @param cursor - cursor to find
233
+ * @param oldItem - previous item
234
+ * @returns item index
235
+ */
236
+ getIndexFromCursor = (cursor = 'first', oldItem) => {
237
+ const startIndex = 0;
238
+ if (!Array.isArray(this.items) || !this.items.length)
239
+ return null;
240
+ const lastIndex = this.items.length - this.baseIndex;
241
+ let newIndex;
242
+ let oldIndex = startIndex;
243
+ if (['previous', 'next'].includes(cursor) && oldItem) {
244
+ const findedIndex = this.items.findIndex((item) => JSON.stringify(item) === JSON.stringify(oldItem));
245
+ if (findedIndex === -1)
246
+ return startIndex;
247
+ oldIndex = findedIndex;
248
+ }
249
+ // Update index from cursor
250
+ if (cursor === 'first') {
251
+ newIndex = startIndex;
252
+ }
253
+ else if (cursor === 'last') {
254
+ newIndex = lastIndex;
255
+ }
256
+ else if (cursor === 'previous') {
257
+ newIndex =
258
+ JSON.stringify(this.items[oldIndex]) === JSON.stringify(this.items[startIndex])
259
+ ? lastIndex
260
+ : oldIndex - this.baseIndex;
261
+ }
262
+ else if (cursor === 'next') {
263
+ newIndex =
264
+ JSON.stringify(this.items[oldIndex]) === JSON.stringify(this.items[lastIndex])
265
+ ? startIndex
266
+ : oldIndex + this.baseIndex;
267
+ }
268
+ else {
269
+ newIndex = startIndex;
270
+ }
271
+ return newIndex;
272
+ };
273
+ }
274
+ /**
275
+ * Paginate an items array to navigate into with pages.
276
+ * It follow REST standard and allow to navigate in items array with a similar format.
277
+ */
278
+ class Paginate {
279
+ /**
280
+ * Define paginated items
281
+ */
282
+ items = [];
283
+ /* Privates */
284
+ #top = DEFAULT_TOP;
285
+ #next;
286
+ #total;
287
+ constructor(items, options) {
288
+ if (Array.isArray(items))
289
+ this.items = items;
290
+ if (options &&
291
+ (['string', 'function'].includes(typeof options.next) ||
292
+ (isObject(options.next) && URL.canParse(options.next))))
293
+ this.#next = options.next;
294
+ if (typeof options?.top === 'number')
295
+ this.#top = options.top;
296
+ if (typeof options?.total === 'number')
297
+ this.#total = options.total;
298
+ }
299
+ /**
300
+ * Get page
301
+ * @param offset - pagiantion offset
302
+ * @param filter - filter methode
303
+ * @returns formated page
304
+ */
305
+ getPage = (offset = 0, filter) => {
306
+ const items = typeof filter === 'function' ? this.items.filter(filter) : this.items;
307
+ let next;
308
+ if (this.#next)
309
+ next = this.#next;
310
+ else if (items.length > offset + this.#top)
311
+ next = () => this.getPage(offset + this.#top, filter);
312
+ return new Page({
313
+ items: items.slice(offset, offset + this.#top),
314
+ total: this.#total,
315
+ top: this.#top,
316
+ next,
317
+ });
318
+ };
319
+ }
320
+
321
+ /**
322
+ * Date RegExp, usefull to test if string is a follow the date pattern
323
+ * @example
324
+ * ```ts
325
+ * dateRegExp.test('mystring') // false
326
+ * dateRegExp.test('2020-12-31') // true
327
+ * ```
328
+ */
329
+ const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
330
+ /**
331
+ * Formats a date object to a string with the pattern 'YYYY-MM-DD'.
332
+ * @param date - date to parse
333
+ * @returns string date with pattern 'YYYY-MM-DD'
334
+ * @example
335
+ * ```ts
336
+ * dateToString(new Date('2023-12-24')) // '2023-12-24'
337
+ * ```
338
+ */
339
+ const dateToString = (date) => date.toISOString().split('T')[0];
340
+
341
+ /**
342
+ * Check if element belongs to the given tagNames list
343
+ * @param element - element to check
344
+ * @param tagNames - allowed tag names list
345
+ * @returns `true` if element tagName is in the tagNames list
346
+ */
347
+ const isTagName = (element, tagNames) => tagNames.includes(element?.tagName.toLowerCase());
348
+ /**
349
+ * CSS selector to select focusable elements.
350
+ * @example
351
+ * ```ts
352
+ * const allFocusableElements: HTMLElement[] = Array.from(this.element.querySelectorAll(focusableElements));
353
+ * ```
354
+ */
355
+ const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button';
356
+
357
+ /**
358
+ * Validate number
359
+ * @param value - value to check
360
+ * @returns `true` if number is valid
361
+ */
362
+ const isValidNumber = (value) => typeof value === 'number' && !Number.isNaN(value);
363
+
364
+ /**
365
+ * Get windows
366
+ * @param localWindow - the window we are lookink for other windows
367
+ * @returns The list of windows found
368
+ */
369
+ const getWindows = (localWindow) => {
370
+ const parentWindows = getParentWindows(localWindow);
371
+ const childWindows = getChildWindows(localWindow);
372
+ return [localWindow, ...parentWindows, ...childWindows];
373
+ };
374
+ /**
375
+ * Get parent windows
376
+ * @param localWindow - the window we are lookink for parents
377
+ * @param windows - The list of allready found windows
378
+ * @returns The list of windows found
379
+ */
380
+ const getParentWindows = (localWindow, windows = []) => {
381
+ // Check if is in iframe
382
+ if (localWindow.self !== localWindow.top) {
383
+ // Check if we have permission to access parent
384
+ try {
385
+ const parentWindow = localWindow.parent;
386
+ if (parentWindow) {
387
+ windows.push(parentWindow);
388
+ return getParentWindows(parentWindow, windows);
389
+ }
390
+ else
391
+ return windows;
392
+ }
393
+ catch (err) {
394
+ console.error('Different hosts between iframes:', err);
395
+ return windows;
396
+ }
397
+ }
398
+ return windows;
399
+ };
400
+ /**
401
+ * Get child windows
402
+ * @param localWindow - the window we are lookink for children
403
+ * @param windows - The list of allready found windows
404
+ * @returns The list of windows found
405
+ */
406
+ const getChildWindows = (localWindow, windows = []) => {
407
+ if (localWindow.frames.length > 0) {
408
+ for (const childWindow of Array.from(localWindow.frames)) {
409
+ windows.push(childWindow);
410
+ getChildWindows(childWindow, windows);
411
+ }
412
+ }
413
+ return windows;
414
+ };
415
+
416
+ export { ClassList, Cursor, Page, Paginate, allItemsAreString, cleanString, createID, dateRegExp, dateToString, focusableElements, formatID, getChildWindows, getObjectValueFromKey, getParentWindows, getWindows, isObject, isTagName, isValidNumber, isValidString, isValideID, nextTick, toKebabCase, toString };
417
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/utils/attributes/class-list/class-list.ts","../../src/utils/object/object.ts","../../src/utils/string/string.ts","../../src/utils/attributes/to-kebab-case/to-kebab-case.ts","../../src/utils/attributes/id/id.ts","../../src/utils/components/components.ts","../../src/utils/date/date.ts","../../src/utils/elements/elements.ts","../../src/utils/number/number.ts","../../src/utils/windows/windows.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":"AAAA;;AAEG;MACU,SAAS,CAAA;AACpB;;AAEG;AACH,IAAA,OAAO;AAEP,IAAA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