@mgdis/core-ui-helpers 1.2.1 → 1.3.0
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/dist/angular/index.cjs +1 -1
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.js +1 -1
- package/dist/angular/index.js.map +1 -1
- package/dist/angular/index.umd.js +1 -1
- package/dist/angular/index.umd.js.map +1 -1
- package/dist/locale/index.cjs +3 -1
- package/dist/locale/index.cjs.map +1 -1
- package/dist/locale/index.js +3 -1
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/index.umd.js +3 -1
- package/dist/locale/index.umd.js.map +1 -1
- package/dist/playwright/index.cjs +12 -5
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.js +12 -5
- package/dist/playwright/index.js.map +1 -1
- package/dist/playwright/index.umd.js +12 -5
- package/dist/playwright/index.umd.js.map +1 -1
- package/dist/stencil/index.cjs +33 -33
- package/dist/stencil/index.cjs.map +1 -1
- package/dist/stencil/index.js +33 -33
- package/dist/stencil/index.js.map +1 -1
- package/dist/stencil/index.umd.js +33 -33
- package/dist/stencil/index.umd.js.map +1 -1
- package/dist/storybook/index.cjs +9 -7
- package/dist/storybook/index.cjs.map +1 -1
- package/dist/storybook/index.js +9 -7
- package/dist/storybook/index.js.map +1 -1
- package/dist/storybook/index.umd.js +9 -7
- package/dist/storybook/index.umd.js.map +1 -1
- package/dist/tests/index.cjs +24 -9
- package/dist/tests/index.cjs.map +1 -1
- package/dist/tests/index.d.ts +2 -2
- package/dist/tests/index.js +24 -9
- package/dist/tests/index.js.map +1 -1
- package/dist/tests/index.umd.js +24 -9
- package/dist/tests/index.umd.js.map +1 -1
- package/dist/utils/index.cjs +14 -6
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +14 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.umd.js +14 -6
- package/dist/utils/index.umd.js.map +1 -1
- package/dist/vue/index.cjs +2 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +2 -1
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/index.umd.js +2 -1
- package/dist/vue/index.umd.js.map +1 -1
- package/package.json +11 -8
- package/.turbo/turbo-build.log +0 -49
- package/CHANGELOG.md +0 -95
- package/json-doc.test.json +0 -264
- package/rollup.config.mjs +0 -61
- package/src/angular/index.spec.ts +0 -8
- package/src/angular/index.ts +0 -1
- package/src/angular/mg-angular-logger/index.ts +0 -1
- package/src/angular/mg-angular-logger/mg-angular-logger.conf.ts +0 -3
- package/src/angular/mg-angular-logger/mg-angular-logger.spec.ts +0 -40
- package/src/angular/mg-angular-logger/mg-angular-logger.ts +0 -23
- package/src/locale/index.spec.ts +0 -15
- package/src/locale/index.ts +0 -1
- package/src/locale/locale.spec.ts +0 -266
- package/src/locale/locale.ts +0 -193
- package/src/playwright/config/index.ts +0 -43
- package/src/playwright/index.spec.ts +0 -16
- package/src/playwright/index.ts +0 -4
- package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +0 -48
- package/src/playwright/utils/index.ts +0 -1
- package/src/playwright/utils/utils.spec.ts +0 -43
- package/src/playwright/utils/utils.ts +0 -69
- package/src/stencil/ide/__snapshots__/cem.spec.ts.snap +0 -248
- package/src/stencil/ide/__snapshots__/ide.spec.ts.snap +0 -414
- package/src/stencil/ide/cem.spec.ts +0 -35
- package/src/stencil/ide/cem.ts +0 -96
- package/src/stencil/ide/ide.spec.ts +0 -29
- package/src/stencil/ide/ide.ts +0 -221
- package/src/stencil/ide/index.ts +0 -2
- package/src/stencil/index.spec.ts +0 -16
- package/src/stencil/index.ts +0 -2
- package/src/stencil/normalize-boolean-attributes/index.ts +0 -1
- package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.spec.ts +0 -63
- package/src/stencil/normalize-boolean-attributes/normalize-boolean-attributes.ts +0 -40
- package/src/storybook/index.spec.ts +0 -19
- package/src/storybook/index.ts +0 -1
- package/src/storybook/stencil/__snapshots__/stencil.spec.ts.snap +0 -329
- package/src/storybook/stencil/index.ts +0 -1
- package/src/storybook/stencil/stencil-shim.d.ts +0 -1
- package/src/storybook/stencil/stencil.conf.ts +0 -4
- package/src/storybook/stencil/stencil.spec.ts +0 -146
- package/src/storybook/stencil/stencil.ts +0 -366
- package/src/tests/index.spec.ts +0 -14
- package/src/tests/index.ts +0 -1
- package/src/tests/unit/__snapshots__/unit.spec.ts.snap +0 -52
- package/src/tests/unit/index.ts +0 -1
- package/src/tests/unit/unit.conf.ts +0 -9
- package/src/tests/unit/unit.spec.ts +0 -164
- package/src/tests/unit/unit.ts +0 -306
- package/src/utils/attributes/class-list/class-list.spec.ts +0 -36
- package/src/utils/attributes/class-list/class-list.ts +0 -51
- package/src/utils/attributes/class-list/index.ts +0 -1
- package/src/utils/attributes/id/id.spec.ts +0 -51
- package/src/utils/attributes/id/id.ts +0 -46
- package/src/utils/attributes/id/index.ts +0 -1
- package/src/utils/attributes/index.ts +0 -3
- package/src/utils/attributes/to-kebab-case/index.ts +0 -1
- package/src/utils/attributes/to-kebab-case/to-kebab-case.spec.ts +0 -29
- package/src/utils/attributes/to-kebab-case/to-kebab-case.ts +0 -23
- package/src/utils/components/__snapshots__/components.spec.ts.snap +0 -313
- package/src/utils/components/components.conf.ts +0 -11
- package/src/utils/components/components.spec.ts +0 -192
- package/src/utils/components/components.ts +0 -138
- package/src/utils/components/index.ts +0 -2
- package/src/utils/date/date.spec.ts +0 -12
- package/src/utils/date/date.ts +0 -20
- package/src/utils/date/index.ts +0 -1
- package/src/utils/elements/elements.spec.ts +0 -17
- package/src/utils/elements/elements.ts +0 -16
- package/src/utils/elements/index.ts +0 -1
- package/src/utils/index.spec.ts +0 -84
- package/src/utils/index.ts +0 -8
- package/src/utils/number/index.ts +0 -1
- package/src/utils/number/number.spec.ts +0 -14
- package/src/utils/number/number.ts +0 -6
- package/src/utils/object/index.ts +0 -2
- package/src/utils/object/object.conf.ts +0 -4
- package/src/utils/object/object.spec.ts +0 -110
- package/src/utils/object/object.ts +0 -26
- package/src/utils/string/index.ts +0 -1
- package/src/utils/string/string.spec.ts +0 -47
- package/src/utils/string/string.ts +0 -38
- package/src/utils/windows/index.ts +0 -1
- package/src/utils/windows/windows.spec.ts +0 -65
- package/src/utils/windows/windows.ts +0 -50
- package/src/vue/index.spec.ts +0 -8
- package/src/vue/index.ts +0 -1
- package/src/vue/mg-model/index.ts +0 -1
- package/src/vue/mg-model/mg-model.conf.ts +0 -6
- package/src/vue/mg-model/mg-model.spec.ts +0 -50
- package/src/vue/mg-model/mg-model.ts +0 -50
- package/tsconfig.json +0 -17
- package/typedoc.json +0 -14
- package/vitest.config.mts +0 -13
package/json-doc.test.json
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"timestamp": "2024-01-01T00:00:00",
|
|
3
|
-
"compiler": {
|
|
4
|
-
"name": "@stencil/core",
|
|
5
|
-
"version": "4.16.0",
|
|
6
|
-
"typescriptVersion": "5.4.5"
|
|
7
|
-
},
|
|
8
|
-
"components": [
|
|
9
|
-
{
|
|
10
|
-
"filePath": "src/components/atoms/my-comp/my-comp.tsx",
|
|
11
|
-
"encapsulation": "shadow",
|
|
12
|
-
"tag": "my-comp",
|
|
13
|
-
"readme": "",
|
|
14
|
-
"docs": "",
|
|
15
|
-
"docsTags": [],
|
|
16
|
-
"usage": {},
|
|
17
|
-
"props": [
|
|
18
|
-
{
|
|
19
|
-
"name": "prop",
|
|
20
|
-
"type": "string",
|
|
21
|
-
"mutable": false,
|
|
22
|
-
"attr": "prop",
|
|
23
|
-
"reflectToAttr": false,
|
|
24
|
-
"docs": "docs",
|
|
25
|
-
"docsTags": [],
|
|
26
|
-
"values": [
|
|
27
|
-
{
|
|
28
|
-
"type": "string"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"optional": false,
|
|
32
|
-
"required": true
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "attr",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"mutable": false,
|
|
38
|
-
"reflectToAttr": false,
|
|
39
|
-
"docs": "docs",
|
|
40
|
-
"docsTags": [],
|
|
41
|
-
"values": [
|
|
42
|
-
{
|
|
43
|
-
"value": "blu",
|
|
44
|
-
"type": "string"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"value": "bli",
|
|
48
|
-
"type": "string"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"optional": false,
|
|
52
|
-
"required": true
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "multionetype",
|
|
56
|
-
"type": "(string | number)[]",
|
|
57
|
-
"mutable": false,
|
|
58
|
-
"attr": "multionetype",
|
|
59
|
-
"reflectToAttr": false,
|
|
60
|
-
"docs": "docs",
|
|
61
|
-
"docsTags": [],
|
|
62
|
-
"values": [
|
|
63
|
-
{
|
|
64
|
-
"type": "string"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"optional": false,
|
|
68
|
-
"required": true
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "number",
|
|
72
|
-
"type": "number",
|
|
73
|
-
"mutable": false,
|
|
74
|
-
"attr": "number",
|
|
75
|
-
"reflectToAttr": false,
|
|
76
|
-
"docs": "docs",
|
|
77
|
-
"docsTags": [],
|
|
78
|
-
"values": [
|
|
79
|
-
{
|
|
80
|
-
"type": "string"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"optional": false,
|
|
84
|
-
"required": true
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"name": "boolean",
|
|
88
|
-
"type": "boolean",
|
|
89
|
-
"mutable": false,
|
|
90
|
-
"attr": "boolean",
|
|
91
|
-
"reflectToAttr": false,
|
|
92
|
-
"docs": "docs",
|
|
93
|
-
"docsTags": [],
|
|
94
|
-
"values": [
|
|
95
|
-
{
|
|
96
|
-
"type": "string"
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"optional": false,
|
|
100
|
-
"required": true,
|
|
101
|
-
"default": "false"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"name": "objecttype",
|
|
105
|
-
"type": "{ type: string, value: \"blu\" | \"bli\" }",
|
|
106
|
-
"mutable": false,
|
|
107
|
-
"attr": "objecttype",
|
|
108
|
-
"reflectToAttr": false,
|
|
109
|
-
"docs": "docs",
|
|
110
|
-
"docsTags": [],
|
|
111
|
-
"values": [
|
|
112
|
-
{
|
|
113
|
-
"type": "string"
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
"optional": false,
|
|
117
|
-
"required": true
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"name": "multitype",
|
|
121
|
-
"type": "\"blu\" | \"bli\"",
|
|
122
|
-
"mutable": false,
|
|
123
|
-
"attr": "multitype",
|
|
124
|
-
"reflectToAttr": false,
|
|
125
|
-
"docs": "docs",
|
|
126
|
-
"docsTags": [],
|
|
127
|
-
"values": [
|
|
128
|
-
{
|
|
129
|
-
"value": "blu",
|
|
130
|
-
"type": "string"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"value": "bli",
|
|
134
|
-
"type": "string"
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
"optional": false,
|
|
138
|
-
"required": true
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"name": "multitypewithstring",
|
|
142
|
-
"type": "number | string",
|
|
143
|
-
"mutable": false,
|
|
144
|
-
"attr": "multitypewithstring",
|
|
145
|
-
"reflectToAttr": false,
|
|
146
|
-
"docs": "docs",
|
|
147
|
-
"docsTags": [],
|
|
148
|
-
"values": [
|
|
149
|
-
{
|
|
150
|
-
"type": "string"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
"optional": false,
|
|
154
|
-
"required": true
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"name": "arraytypes",
|
|
158
|
-
"type": "number[] | string[]",
|
|
159
|
-
"mutable": false,
|
|
160
|
-
"attr": "arraytypes",
|
|
161
|
-
"reflectToAttr": false,
|
|
162
|
-
"docs": "docs",
|
|
163
|
-
"docsTags": [],
|
|
164
|
-
"values": [
|
|
165
|
-
{
|
|
166
|
-
"type": "string"
|
|
167
|
-
}
|
|
168
|
-
],
|
|
169
|
-
"optional": false,
|
|
170
|
-
"required": true
|
|
171
|
-
}
|
|
172
|
-
],
|
|
173
|
-
"methods": [
|
|
174
|
-
{
|
|
175
|
-
"name": "method",
|
|
176
|
-
"returns": {
|
|
177
|
-
"type": "string",
|
|
178
|
-
"docs": ""
|
|
179
|
-
},
|
|
180
|
-
"complexType": {
|
|
181
|
-
"signature": "",
|
|
182
|
-
"parameters": [],
|
|
183
|
-
"references": {},
|
|
184
|
-
"return": "string"
|
|
185
|
-
},
|
|
186
|
-
"signature": "",
|
|
187
|
-
"parameters": [],
|
|
188
|
-
"docs": "docs",
|
|
189
|
-
"docsTags": []
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
|
-
"events": [
|
|
193
|
-
{
|
|
194
|
-
"event": "event",
|
|
195
|
-
"detail": "boolean",
|
|
196
|
-
"bubbles": true,
|
|
197
|
-
"complexType": {
|
|
198
|
-
"original": "",
|
|
199
|
-
"resolved": "boolean",
|
|
200
|
-
"references": {}
|
|
201
|
-
},
|
|
202
|
-
"cancelable": true,
|
|
203
|
-
"composed": true,
|
|
204
|
-
"docs": "docs",
|
|
205
|
-
"docsTags": []
|
|
206
|
-
}
|
|
207
|
-
],
|
|
208
|
-
"listeners": [
|
|
209
|
-
{
|
|
210
|
-
"event": "keydown",
|
|
211
|
-
"target": "window",
|
|
212
|
-
"capture": false,
|
|
213
|
-
"passive": false
|
|
214
|
-
}
|
|
215
|
-
],
|
|
216
|
-
"styles": [
|
|
217
|
-
{
|
|
218
|
-
"name": "--custom-property",
|
|
219
|
-
"annotation": "prop",
|
|
220
|
-
"docs": "Custom property documentation"
|
|
221
|
-
}
|
|
222
|
-
],
|
|
223
|
-
"slots": [
|
|
224
|
-
{
|
|
225
|
-
"name": "",
|
|
226
|
-
"docs": ""
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"name": "title",
|
|
230
|
-
"docs": ""
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
"parts": [
|
|
234
|
-
{
|
|
235
|
-
"name": "icon",
|
|
236
|
-
"docs": "docs"
|
|
237
|
-
}
|
|
238
|
-
],
|
|
239
|
-
"dependents": ["my-internal-comp"],
|
|
240
|
-
"dependencies": ["my-second-comp"],
|
|
241
|
-
"dependencyGraph": {}
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"encapsulation": "shadow",
|
|
245
|
-
"tag": "my-second-comp",
|
|
246
|
-
"overview": "overview",
|
|
247
|
-
"readme": "",
|
|
248
|
-
"docs": "",
|
|
249
|
-
"docsTags": [],
|
|
250
|
-
"usage": {},
|
|
251
|
-
"props": [],
|
|
252
|
-
"methods": [],
|
|
253
|
-
"events": [],
|
|
254
|
-
"listeners": [],
|
|
255
|
-
"styles": [],
|
|
256
|
-
"slots": [],
|
|
257
|
-
"parts": [],
|
|
258
|
-
"dependents": ["my-comp"],
|
|
259
|
-
"dependencies": ["my-internal-comp"],
|
|
260
|
-
"dependencyGraph": {}
|
|
261
|
-
}
|
|
262
|
-
],
|
|
263
|
-
"typeLibrary": {}
|
|
264
|
-
}
|
package/rollup.config.mjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
-
import typescript from '@rollup/plugin-typescript';
|
|
4
|
-
import dts from 'rollup-plugin-dts';
|
|
5
|
-
import fs from 'fs/promises';
|
|
6
|
-
|
|
7
|
-
const NAME = 'CoreUiHelpers';
|
|
8
|
-
const FOLDER = {
|
|
9
|
-
input: 'src',
|
|
10
|
-
output: 'dist',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const getFilePath = (folder, path, filname) => [folder, path, filname].join('/');
|
|
14
|
-
|
|
15
|
-
export default async () => {
|
|
16
|
-
const folders = await fs.readdir(FOLDER.input, { withFileTypes: true });
|
|
17
|
-
return folders
|
|
18
|
-
.filter(dirent => dirent.isDirectory())
|
|
19
|
-
.map(dirent => dirent.name)
|
|
20
|
-
.flatMap(folder => {
|
|
21
|
-
const input = getFilePath(FOLDER.input, folder, 'index.ts');
|
|
22
|
-
|
|
23
|
-
return [
|
|
24
|
-
{
|
|
25
|
-
input,
|
|
26
|
-
output: [
|
|
27
|
-
// ES module
|
|
28
|
-
{
|
|
29
|
-
file: getFilePath(FOLDER.output, folder, 'index.js'),
|
|
30
|
-
format: 'es',
|
|
31
|
-
sourcemap: true,
|
|
32
|
-
},
|
|
33
|
-
// CommonJS
|
|
34
|
-
{
|
|
35
|
-
file: getFilePath(FOLDER.output, folder, 'index.cjs'),
|
|
36
|
-
format: 'cjs',
|
|
37
|
-
sourcemap: true,
|
|
38
|
-
},
|
|
39
|
-
// UMD
|
|
40
|
-
{
|
|
41
|
-
file: getFilePath(FOLDER.output, folder, 'index.umd.js'),
|
|
42
|
-
format: 'umd',
|
|
43
|
-
sourcemap: true,
|
|
44
|
-
name: `${NAME}.${folder}`,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
plugins: [nodeResolve(), commonjs(), typescript()],
|
|
48
|
-
external: ['@playwright/test', 'vue'],
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
input,
|
|
52
|
-
// types
|
|
53
|
-
output: {
|
|
54
|
-
file: getFilePath(FOLDER.output, folder, 'index.d.ts'),
|
|
55
|
-
format: 'es',
|
|
56
|
-
},
|
|
57
|
-
plugins: [dts()],
|
|
58
|
-
},
|
|
59
|
-
];
|
|
60
|
-
});
|
|
61
|
-
};
|
package/src/angular/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './mg-angular-logger';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './mg-angular-logger';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test, vi } from 'vitest';
|
|
2
|
-
import { setMgAngularLogger } from '.';
|
|
3
|
-
import type { ConfigType } from './mg-angular-logger.conf';
|
|
4
|
-
|
|
5
|
-
const mgError = new Error('<mg-error');
|
|
6
|
-
const standardError = new Error('my error');
|
|
7
|
-
|
|
8
|
-
describe('mg-angular-logger', () => {
|
|
9
|
-
test('Should hide error when error message start with "<mg-"', () => {
|
|
10
|
-
const spy = vi.spyOn(console, 'error');
|
|
11
|
-
setMgAngularLogger(mgError as unknown as ConfigType);
|
|
12
|
-
console.error(new Error('<mg-'));
|
|
13
|
-
|
|
14
|
-
expect(spy).not.to.toHaveBeenCalled();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test('Should display error message does NOT start with "<mg-"', () => {
|
|
18
|
-
const spy = vi.spyOn(console, 'error');
|
|
19
|
-
setMgAngularLogger();
|
|
20
|
-
console.error(standardError);
|
|
21
|
-
|
|
22
|
-
expect(spy).toHaveBeenCalled();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test('Should display message when element is NOT an error start with "<mg-"', () => {
|
|
26
|
-
const spy = vi.spyOn(console, 'error');
|
|
27
|
-
setMgAngularLogger();
|
|
28
|
-
console.error('<mg-');
|
|
29
|
-
|
|
30
|
-
expect(spy).toHaveBeenCalled();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test.each([mgError, standardError])('Should display error logger is set on "error"', err => {
|
|
34
|
-
const spy = vi.spyOn(console, 'error');
|
|
35
|
-
setMgAngularLogger({ level: 'error' });
|
|
36
|
-
console.error(err);
|
|
37
|
-
|
|
38
|
-
expect(spy).toHaveBeenCalled();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ConfigType } from './mg-angular-logger.conf';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Set window logger custom rules for angular and mg-components
|
|
5
|
-
* @param config - logger configuration object
|
|
6
|
-
* @example
|
|
7
|
-
* ```js
|
|
8
|
-
* // main.js
|
|
9
|
-
* import { defineCustomElements } from '@mgdis/mg-components/loader';
|
|
10
|
-
* import { setMgAngularLogger } from '@mgdis/core-ui-helpers/dist/angular';
|
|
11
|
-
*
|
|
12
|
-
* // need to be set before `defineCustomElements` call
|
|
13
|
-
* setMgAngularLogger({level: 'error'});
|
|
14
|
-
* defineCustomElements();
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export const setMgAngularLogger = (config: ConfigType = { level: 'log' }): void => {
|
|
18
|
-
const error = console.error;
|
|
19
|
-
console.error = (...args: unknown[]) => {
|
|
20
|
-
// filter error when it come from a mg-components component error
|
|
21
|
-
if (config.level === 'error' || !args.some(arg => arg instanceof Error && arg.message.startsWith('<mg-'))) error.call(console, ...args);
|
|
22
|
-
};
|
|
23
|
-
};
|
package/src/locale/index.spec.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
2
|
-
import { defineLocales, localeByte, localeCurrency, localeDate, localeDatePattern, localeNumber, localePercent, localeUnit } from '.';
|
|
3
|
-
|
|
4
|
-
describe('locale', () => {
|
|
5
|
-
test('import', () => {
|
|
6
|
-
expect(localeDatePattern).toBeDefined();
|
|
7
|
-
expect(localeCurrency).toBeDefined();
|
|
8
|
-
expect(localeNumber).toBeDefined();
|
|
9
|
-
expect(localePercent).toBeDefined();
|
|
10
|
-
expect(localeUnit).toBeDefined();
|
|
11
|
-
expect(localeDate).toBeDefined();
|
|
12
|
-
expect(localeByte).toBeDefined();
|
|
13
|
-
expect(defineLocales).toBeDefined();
|
|
14
|
-
});
|
|
15
|
-
});
|
package/src/locale/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './locale';
|