@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.
- package/dist/angular/index.cjs +27 -0
- package/dist/angular/index.cjs.map +1 -0
- package/dist/angular/index.d.ts +21 -0
- package/dist/angular/index.js +25 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/angular/index.umd.js +33 -0
- package/dist/angular/index.umd.js.map +1 -0
- package/dist/locale/index.cjs +190 -0
- package/dist/locale/index.cjs.map +1 -0
- package/dist/locale/index.d.ts +110 -0
- package/dist/locale/index.js +181 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/locale/index.umd.js +196 -0
- package/dist/locale/index.umd.js.map +1 -0
- package/dist/playwright/index.cjs +137 -0
- package/dist/playwright/index.cjs.map +1 -0
- package/dist/playwright/index.d.ts +39 -0
- package/dist/playwright/index.js +133 -0
- package/dist/playwright/index.js.map +1 -0
- package/dist/playwright/index.umd.js +143 -0
- package/dist/playwright/index.umd.js.map +1 -0
- package/dist/stencil/index.cjs +363 -0
- package/dist/stencil/index.cjs.map +1 -0
- package/dist/stencil/index.d.ts +222 -0
- package/dist/stencil/index.js +357 -0
- package/dist/stencil/index.js.map +1 -0
- package/dist/stencil/index.umd.js +369 -0
- package/dist/stencil/index.umd.js.map +1 -0
- package/dist/storybook/index.cjs +2335 -0
- package/dist/storybook/index.cjs.map +1 -0
- package/dist/storybook/index.d.ts +85 -0
- package/dist/storybook/index.js +2329 -0
- package/dist/storybook/index.js.map +1 -0
- package/dist/storybook/index.umd.js +2341 -0
- package/dist/storybook/index.umd.js.map +1 -0
- package/dist/tests/index.cjs +315 -0
- package/dist/tests/index.cjs.map +1 -0
- package/dist/tests/index.d.ts +100 -0
- package/dist/tests/index.js +309 -0
- package/dist/tests/index.js.map +1 -0
- package/dist/tests/index.umd.js +321 -0
- package/dist/tests/index.umd.js.map +1 -0
- package/dist/utils/index.cjs +441 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.ts +265 -0
- package/dist/utils/index.js +417 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.umd.js +447 -0
- package/dist/utils/index.umd.js.map +1 -0
- package/dist/vue/index.cjs +1935 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.ts +35 -0
- package/dist/vue/index.js +1933 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/index.umd.js +1941 -0
- package/dist/vue/index.umd.js.map +1 -0
- package/package.json +14 -11
- package/CHANGELOG.md +0 -101
- 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 -24
- package/src/locale/index.spec.ts +0 -24
- package/src/locale/index.ts +0 -1
- package/src/locale/locale.spec.ts +0 -291
- package/src/locale/locale.ts +0 -201
- 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 -50
- package/src/playwright/utils/utils.ts +0 -77
- 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 -170
- package/src/storybook/stencil/stencil.ts +0 -377
- package/src/tests/index.spec.ts +0 -20
- 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 -16
- package/src/tests/unit/unit.spec.ts +0 -206
- package/src/tests/unit/unit.ts +0 -333
- 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 -54
- package/src/utils/attributes/id/id.ts +0 -47
- 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 -152
- 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 -18
- 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 -27
- package/src/utils/string/index.ts +0 -1
- package/src/utils/string/string.spec.ts +0 -54
- package/src/utils/string/string.ts +0 -39
- package/src/utils/windows/index.ts +0 -1
- package/src/utils/windows/windows.spec.ts +0 -69
- 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 -55
- package/tsconfig.json +0 -17
- package/typedoc.json +0 -14
- package/vitest.config.mts +0 -13
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { VNode } from '@stencil/core';
|
|
2
|
+
import { JsonDocs } from '@stencil/core/internal';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Define compents default args type
|
|
6
|
+
*/
|
|
7
|
+
type ArgsType = {
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Filter default argument on component argument to prevent them to be rendered
|
|
13
|
+
* @param args - all possible args with custom values
|
|
14
|
+
* @param defaultValues - component default args values
|
|
15
|
+
* @param slots - slots
|
|
16
|
+
* @returns filtres args
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { filterArgs } from '@mgdis/core-ui-helpers/dist/storybook';
|
|
20
|
+
* const Template = (args: MgBadgeType): HTMLElement => <mg-badge {...filterArgs(args, { variant: 'info' }, ['actions'])}></mg-badge>;
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const filterArgs: <T>(args: T, defaultValues?: Partial<T>, slots?: string[]) => T;
|
|
24
|
+
/**
|
|
25
|
+
* Storybook stencil wrapper. Used to target element with `storybook-root` id and render virtual DOM inside.
|
|
26
|
+
* @param storyFn - storybook render function
|
|
27
|
+
* @param context - storybook context
|
|
28
|
+
* @returns rendered element
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* // .storybook/preview.ts
|
|
32
|
+
* import { stencilWrapper } from '@mgdis/core-ui-helpers/dist/storybook';
|
|
33
|
+
* export const decorators: Preview['decorators'] = [stencilWrapper];
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const stencilWrapper: (storyFn: (ctx: any) => void, context: ArgsType) => Element | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Get story HTML from virtual DOM.
|
|
39
|
+
* Mainly used to render, component code exemple in stories.
|
|
40
|
+
* @param vitualNode - story virtual DOM
|
|
41
|
+
* @returns stringified rendered HTML
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // .storybook/preview.ts
|
|
45
|
+
* import { getStoryHTML } from '@mgdis/core-ui-helpers/dist/storybook';
|
|
46
|
+
*
|
|
47
|
+
* export const parameters: Preview['parameters'] = {
|
|
48
|
+
* docs: {
|
|
49
|
+
* source: {
|
|
50
|
+
* transform: (_, ctx) => getStoryHTML(ctx.originalStoryFn(ctx.args)),
|
|
51
|
+
* }
|
|
52
|
+
* },
|
|
53
|
+
* };
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare const getStoryHTML: ({ $tag$, $attrs$, $children$, $text$ }: VNode) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieve Component Storybook URL from file path
|
|
59
|
+
* @param storybookBaseUrl - Storybook Base URL
|
|
60
|
+
* @param filePath - Component file path
|
|
61
|
+
* @returns Component Storybook URL
|
|
62
|
+
*/
|
|
63
|
+
declare const getStorybookUrl: (storybookBaseUrl: string, filePath: string | undefined) => string | undefined;
|
|
64
|
+
declare class StorybookPreview {
|
|
65
|
+
#private;
|
|
66
|
+
/**
|
|
67
|
+
* JsonDocs
|
|
68
|
+
*/
|
|
69
|
+
jsonDoc: JsonDocs;
|
|
70
|
+
constructor(jsonDoc: JsonDocs);
|
|
71
|
+
/**
|
|
72
|
+
* Extract component arg types from the component data
|
|
73
|
+
* @param tagName - tag name we want to extract the arg types from
|
|
74
|
+
* @returns component arg types
|
|
75
|
+
*/
|
|
76
|
+
extractArgTypes: (tagName: string) => {};
|
|
77
|
+
/**
|
|
78
|
+
* Extract component description from the component data
|
|
79
|
+
* @param tagName - tag name we want to extract the description from
|
|
80
|
+
* @returns component description
|
|
81
|
+
*/
|
|
82
|
+
extractComponentDescription: (tagName: string) => string | undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { StorybookPreview, filterArgs, getStoryHTML, getStorybookUrl, stencilWrapper };
|