@mgdis/core-ui-helpers 1.0.5 → 1.0.7
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/.turbo/turbo-build.log +53 -52
- package/CHANGELOG.md +14 -0
- package/dist/playwright/index.cjs +2 -2
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.js +2 -2
- package/dist/playwright/index.js.map +1 -1
- package/dist/playwright/index.umd.js +2 -2
- package/dist/playwright/index.umd.js.map +1 -1
- package/dist/storybook/index.cjs +241 -153
- package/dist/storybook/index.cjs.map +1 -1
- package/dist/storybook/index.js +241 -153
- package/dist/storybook/index.js.map +1 -1
- package/dist/storybook/index.umd.js +241 -153
- package/dist/storybook/index.umd.js.map +1 -1
- package/package.json +17 -18
- package/rollup.config.mjs +1 -1
- package/src/playwright/utils/__snapshots__/utils.spec.ts.snap +4 -4
- package/src/playwright/utils/utils.spec.ts +1 -1
- package/src/playwright/utils/utils.ts +2 -2
- package/src/stencil/ide/ide.spec.ts +5 -1
- package/src/stencil/index.spec.ts +5 -1
- package/src/storybook/index.spec.ts +5 -1
- package/src/storybook/stencil/stencil.spec.ts +4 -0
- package/src/tests/unit/__snapshots__/unit.spec.ts.snap +4 -4
- package/src/utils/components/__snapshots__/components.spec.ts.snap +1 -1
package/package.json
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/core-ui-helpers",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@playwright/test": "1.
|
|
6
|
+
"@playwright/test": "1.57.0",
|
|
7
7
|
"@stencil/core": "4.38.0",
|
|
8
8
|
"lodash": "4.17.21",
|
|
9
|
-
"vue": "npm:vue@2.7.16"
|
|
10
|
-
"vue-template-compiler": "2.7.16"
|
|
9
|
+
"vue": "npm:vue@2.7.16"
|
|
11
10
|
},
|
|
12
11
|
"devDependencies": {
|
|
13
|
-
"@rollup/plugin-commonjs": "
|
|
14
|
-
"@rollup/plugin-node-resolve": "16.0.
|
|
15
|
-
"@rollup/plugin-typescript": "12.
|
|
16
|
-
"@types/lodash": "4.17.
|
|
17
|
-
"@types/node": "
|
|
18
|
-
"@vitest/coverage-istanbul": "
|
|
12
|
+
"@rollup/plugin-commonjs": "29.0.0",
|
|
13
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
14
|
+
"@rollup/plugin-typescript": "12.3.0",
|
|
15
|
+
"@types/lodash": "4.17.21",
|
|
16
|
+
"@types/node": "24.10.4",
|
|
17
|
+
"@vitest/coverage-istanbul": "4.0.16",
|
|
19
18
|
"@vue/test-utils": "npm:@vue/test-utils@1.3.6",
|
|
20
|
-
"htmlfy": "0.
|
|
21
|
-
"rollup": "4.
|
|
22
|
-
"rollup-plugin-dts": "6.
|
|
19
|
+
"htmlfy": "1.0.1",
|
|
20
|
+
"rollup": "4.53.5",
|
|
21
|
+
"rollup-plugin-dts": "6.3.0",
|
|
23
22
|
"tslib": "2.8.1",
|
|
24
|
-
"typedoc": "0.28.
|
|
23
|
+
"typedoc": "0.28.15",
|
|
25
24
|
"typedoc-plugin-markdown": "4.9.0",
|
|
26
|
-
"vitest": "
|
|
25
|
+
"vitest": "4.0.16",
|
|
27
26
|
"vue-jest": "3.0.7",
|
|
28
|
-
"@core-ui/tsconfig": "1.0.
|
|
29
|
-
"@core-ui/
|
|
30
|
-
"@core-ui/
|
|
27
|
+
"@core-ui/tsconfig": "1.0.10",
|
|
28
|
+
"@core-ui/vitest-config": "1.0.5",
|
|
29
|
+
"@core-ui/typedoc-config": "1.0.2"
|
|
31
30
|
},
|
|
32
31
|
"exports": {
|
|
33
32
|
"./dist/angular": {
|
package/rollup.config.mjs
CHANGED
|
@@ -16,7 +16,7 @@ exports[`utils > renderAttributes > Should render attributes 7`] = `"empty-strin
|
|
|
16
16
|
|
|
17
17
|
exports[`utils > renderAttributes > Should render attributes 8`] = `"name="0""`;
|
|
18
18
|
|
|
19
|
-
exports[`utils > renderAttributes > Should render attributes 9`] = `""`;
|
|
19
|
+
exports[`utils > renderAttributes > Should render attributes 9`] = `"name="false""`;
|
|
20
20
|
|
|
21
21
|
exports[`utils > renderAttributes > Should render attributes 10`] = `"name="""`;
|
|
22
22
|
|
|
@@ -34,15 +34,15 @@ exports[`utils > renderProperties > Should not render attributes as properties 3
|
|
|
34
34
|
|
|
35
35
|
exports[`utils > renderProperties > Should not render attributes as properties 4`] = `
|
|
36
36
|
"
|
|
37
|
-
"
|
|
37
|
+
;"
|
|
38
38
|
`;
|
|
39
39
|
|
|
40
40
|
exports[`utils > renderProperties > Should render properties, case id selector 1`] = `
|
|
41
41
|
"
|
|
42
|
-
document.querySelector('div').object={};document.querySelector('div').array=[]"
|
|
42
|
+
document.querySelector('div').object={};document.querySelector('div').array=[];"
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
45
|
exports[`utils > renderProperties > Should render properties, case id selector 2`] = `
|
|
46
46
|
"
|
|
47
|
-
document.querySelector('div').object={};document.querySelector('div').array=[];document.querySelector('div').fn=() => {\\n }"
|
|
47
|
+
document.querySelector('div').object={};document.querySelector('div').array=[];document.querySelector('div').fn=() => {\\n };"
|
|
48
48
|
`;
|
|
@@ -26,7 +26,7 @@ describe('utils', () => {
|
|
|
26
26
|
describe('renderProperties', () => {
|
|
27
27
|
test('Should render properties, case id selector', () => {
|
|
28
28
|
const res = renderProperties({ object: {} }, '#id');
|
|
29
|
-
expect(res).toEqual("\n document.getElementById('id').object={}");
|
|
29
|
+
expect(res).toEqual("\n document.getElementById('id').object={};");
|
|
30
30
|
});
|
|
31
31
|
test.each([undefined, null, {}, { name: 'batman' }])('Should not render attributes as properties', args => {
|
|
32
32
|
const res = renderProperties(args as Record<string, unknown>, 'div');
|
|
@@ -15,7 +15,7 @@ import { isObject, isValidString } from '../../utils';
|
|
|
15
15
|
export const renderAttributes = (args: Record<string, unknown>): string =>
|
|
16
16
|
(isObject<Record<string, never>>(args) &&
|
|
17
17
|
Object.keys(args)
|
|
18
|
-
.filter(key => ![null, undefined
|
|
18
|
+
.filter(key => ![null, undefined].includes(args[key]) && !['object', 'function'].includes(typeof args[key]))
|
|
19
19
|
.map(key => {
|
|
20
20
|
const attribute: string = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
21
21
|
const value: string = ['number', 'boolean'].includes(typeof args[key]) || isValidString(args[key]) ? String(args[key]).replace(/"/g, "'") : '';
|
|
@@ -59,6 +59,6 @@ export const renderProperties = (args: Record<string, unknown>, selector: string
|
|
|
59
59
|
.join('')
|
|
60
60
|
.split('</fn>"')
|
|
61
61
|
.join('') // remove fn end decorator
|
|
62
|
-
}
|
|
62
|
+
};`
|
|
63
63
|
: '';
|
|
64
64
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
1
|
+
import { describe, expect, test, vi } from 'vitest';
|
|
2
2
|
import { webTypesGenerator, vsCodeGenerator, vsCodeCssGenerator } from '.';
|
|
3
3
|
import { JsonDocs } from '@stencil/core/internal';
|
|
4
4
|
import jsonDocs from '../../../json-doc.test.json';
|
|
5
5
|
|
|
6
|
+
vi.mock('@stencil/core/internal/client', () => ({
|
|
7
|
+
renderVdom: vi.fn(),
|
|
8
|
+
}));
|
|
9
|
+
|
|
6
10
|
describe('ide', () => {
|
|
7
11
|
describe('webTypesGenerator', () => {
|
|
8
12
|
test('Should generate web types', () => {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
1
|
+
import { describe, expect, test, vi } from 'vitest';
|
|
2
2
|
import { webTypesGenerator, vsCodeGenerator, vsCodeCssGenerator } from '.';
|
|
3
3
|
|
|
4
|
+
vi.mock('@stencil/core/internal/client', () => ({
|
|
5
|
+
renderVdom: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
4
8
|
describe('stencil', () => {
|
|
5
9
|
describe('ide', () => {
|
|
6
10
|
test('import', () => {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
1
|
+
import { describe, expect, test, vi } from 'vitest';
|
|
2
2
|
import { filterArgs, getStorybookUrl, getStoryHTML, stencilWrapper, StorybookPreview } from '.';
|
|
3
3
|
|
|
4
|
+
vi.mock('@stencil/core/internal/client', () => ({
|
|
5
|
+
renderVdom: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
|
|
4
8
|
describe('storybook', () => {
|
|
5
9
|
describe('stencil', () => {
|
|
6
10
|
test('import', () => {
|
|
@@ -4,6 +4,10 @@ import { VNode } from '@stencil/core';
|
|
|
4
4
|
import jsonDocs from '../../../json-doc.test.json';
|
|
5
5
|
import { JsonDocs } from '@stencil/core/internal';
|
|
6
6
|
|
|
7
|
+
vi.mock('@stencil/core/internal/client', () => ({
|
|
8
|
+
renderVdom: vi.fn(),
|
|
9
|
+
}));
|
|
10
|
+
|
|
7
11
|
describe('stencil', () => {
|
|
8
12
|
describe('filterArgs', () => {
|
|
9
13
|
test('Should get renderable args, case filtred default args', () => {
|
|
@@ -12,11 +12,11 @@ MockMutationObserver {
|
|
|
12
12
|
exports[`unit > setupMutationObserverMock > Should render html 2`] = `
|
|
13
13
|
MockMutationObserver {
|
|
14
14
|
"cb": {
|
|
15
|
-
"disconnect": [MockFunction
|
|
15
|
+
"disconnect": [MockFunction],
|
|
16
16
|
"observe": [Function],
|
|
17
17
|
"takeRecords": [Function],
|
|
18
18
|
},
|
|
19
|
-
"disconnect": [MockFunction
|
|
19
|
+
"disconnect": [MockFunction],
|
|
20
20
|
"observe": [Function],
|
|
21
21
|
"takeRecords": [Function],
|
|
22
22
|
}
|
|
@@ -34,11 +34,11 @@ MockResizeObserver {
|
|
|
34
34
|
exports[`unit > setupResizeObserverMock > Should render html 2`] = `
|
|
35
35
|
MockResizeObserver {
|
|
36
36
|
"cb": {
|
|
37
|
-
"disconnect": [MockFunction
|
|
37
|
+
"disconnect": [MockFunction],
|
|
38
38
|
"observe": [Function],
|
|
39
39
|
"unobserve": [Function],
|
|
40
40
|
},
|
|
41
|
-
"disconnect": [MockFunction
|
|
41
|
+
"disconnect": [MockFunction],
|
|
42
42
|
"observe": [Function],
|
|
43
43
|
"unobserve": undefined,
|
|
44
44
|
}
|
|
@@ -130,7 +130,7 @@ Page {
|
|
|
130
130
|
}
|
|
131
131
|
`;
|
|
132
132
|
|
|
133
|
-
exports[`components > Paginate > getPage() > Shoud get paginated page from instance { items: [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34' ], options: { next: URL{
|
|
133
|
+
exports[`components > Paginate > getPage() > Shoud get paginated page from instance { items: [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34' ], options: { next: URL$1 { href: 'http://url.fr/next/page', origin: 'http://url.fr', protocol: 'http:', username: '', password: '', host: 'url.fr', hostname: 'url.fr', port: '', pathname: '/next/page', search: '', searchParams: [Object], hash: '' } } } 1`] = `
|
|
134
134
|
Page {
|
|
135
135
|
"baseIndex": 1,
|
|
136
136
|
"getIndexFromCursor": [Function],
|