@mgdis/core-ui-helpers 1.2.0 → 1.2.2

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 (89) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +8 -8
  3. package/rollup.config.mjs +3 -3
  4. package/src/angular/mg-angular-logger/mg-angular-logger.spec.ts +1 -1
  5. package/src/angular/mg-angular-logger/mg-angular-logger.ts +2 -1
  6. package/src/locale/index.spec.ts +10 -1
  7. package/src/locale/locale.spec.ts +43 -18
  8. package/src/locale/locale.ts +13 -5
  9. package/src/playwright/utils/utils.spec.ts +16 -9
  10. package/src/playwright/utils/utils.ts +14 -6
  11. package/src/stencil/ide/cem.spec.ts +4 -4
  12. package/src/stencil/ide/cem.ts +9 -9
  13. package/src/stencil/ide/ide.ts +26 -26
  14. package/src/storybook/stencil/stencil.spec.ts +30 -6
  15. package/src/storybook/stencil/stencil.ts +24 -13
  16. package/src/tests/index.spec.ts +7 -1
  17. package/src/tests/unit/unit.conf.ts +9 -2
  18. package/src/tests/unit/unit.spec.ts +103 -61
  19. package/src/tests/unit/unit.ts +38 -11
  20. package/src/utils/attributes/id/id.spec.ts +9 -6
  21. package/src/utils/attributes/id/id.ts +3 -2
  22. package/src/utils/components/components.spec.ts +6 -6
  23. package/src/utils/components/components.ts +19 -5
  24. package/src/utils/elements/elements.ts +4 -2
  25. package/src/utils/number/number.spec.ts +2 -2
  26. package/src/utils/object/object.spec.ts +2 -2
  27. package/src/utils/object/object.ts +2 -1
  28. package/src/utils/string/string.spec.ts +12 -5
  29. package/src/utils/string/string.ts +2 -1
  30. package/src/utils/windows/windows.spec.ts +6 -2
  31. package/src/vue/mg-model/mg-model.ts +7 -2
  32. package/vitest.config.mts +1 -1
  33. package/.turbo/turbo-build.log +0 -52
  34. package/dist/angular/index.cjs +0 -27
  35. package/dist/angular/index.cjs.map +0 -1
  36. package/dist/angular/index.d.ts +0 -21
  37. package/dist/angular/index.js +0 -25
  38. package/dist/angular/index.js.map +0 -1
  39. package/dist/angular/index.umd.js +0 -33
  40. package/dist/angular/index.umd.js.map +0 -1
  41. package/dist/locale/index.cjs +0 -188
  42. package/dist/locale/index.cjs.map +0 -1
  43. package/dist/locale/index.d.ts +0 -110
  44. package/dist/locale/index.js +0 -179
  45. package/dist/locale/index.js.map +0 -1
  46. package/dist/locale/index.umd.js +0 -194
  47. package/dist/locale/index.umd.js.map +0 -1
  48. package/dist/playwright/index.cjs +0 -130
  49. package/dist/playwright/index.cjs.map +0 -1
  50. package/dist/playwright/index.d.ts +0 -39
  51. package/dist/playwright/index.js +0 -126
  52. package/dist/playwright/index.js.map +0 -1
  53. package/dist/playwright/index.umd.js +0 -136
  54. package/dist/playwright/index.umd.js.map +0 -1
  55. package/dist/stencil/index.cjs +0 -363
  56. package/dist/stencil/index.cjs.map +0 -1
  57. package/dist/stencil/index.d.ts +0 -222
  58. package/dist/stencil/index.js +0 -357
  59. package/dist/stencil/index.js.map +0 -1
  60. package/dist/stencil/index.umd.js +0 -369
  61. package/dist/stencil/index.umd.js.map +0 -1
  62. package/dist/storybook/index.cjs +0 -2333
  63. package/dist/storybook/index.cjs.map +0 -1
  64. package/dist/storybook/index.d.ts +0 -85
  65. package/dist/storybook/index.js +0 -2327
  66. package/dist/storybook/index.js.map +0 -1
  67. package/dist/storybook/index.umd.js +0 -2339
  68. package/dist/storybook/index.umd.js.map +0 -1
  69. package/dist/tests/index.cjs +0 -300
  70. package/dist/tests/index.cjs.map +0 -1
  71. package/dist/tests/index.d.ts +0 -100
  72. package/dist/tests/index.js +0 -294
  73. package/dist/tests/index.js.map +0 -1
  74. package/dist/tests/index.umd.js +0 -306
  75. package/dist/tests/index.umd.js.map +0 -1
  76. package/dist/utils/index.cjs +0 -433
  77. package/dist/utils/index.cjs.map +0 -1
  78. package/dist/utils/index.d.ts +0 -265
  79. package/dist/utils/index.js +0 -409
  80. package/dist/utils/index.js.map +0 -1
  81. package/dist/utils/index.umd.js +0 -439
  82. package/dist/utils/index.umd.js.map +0 -1
  83. package/dist/vue/index.cjs +0 -1934
  84. package/dist/vue/index.cjs.map +0 -1
  85. package/dist/vue/index.d.ts +0 -35
  86. package/dist/vue/index.js +0 -1932
  87. package/dist/vue/index.js.map +0 -1
  88. package/dist/vue/index.umd.js +0 -1940
  89. package/dist/vue/index.umd.js.map +0 -1
@@ -1,85 +0,0 @@
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 };