@maggioli-design-system/mds-paginator 4.2.3 → 4.2.5

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 (34) hide show
  1. package/dist/collection/common/locale.js +10 -8
  2. package/dist/collection/common/number.js +5 -0
  3. package/dist/collection/common/slot.js +10 -1
  4. package/dist/collection/common/unit.js +16 -1
  5. package/dist/collection/components/mds-paginator/test/mds-paginator.stories.js +12 -8
  6. package/dist/collection/dictionary/button.js +20 -1
  7. package/dist/collection/dictionary/icon.js +1 -1
  8. package/dist/collection/dictionary/variant.js +9 -1
  9. package/dist/documentation.json +1 -1
  10. package/dist/stats.json +7 -6
  11. package/dist/types/common/number.d.ts +2 -0
  12. package/dist/types/common/slot.d.ts +2 -1
  13. package/dist/types/common/unit.d.ts +3 -1
  14. package/dist/types/components/mds-paginator/test/mds-paginator.stories.d.ts +14 -2
  15. package/dist/types/dictionary/button.d.ts +4 -1
  16. package/dist/types/dictionary/icon.d.ts +1 -1
  17. package/dist/types/dictionary/variant.d.ts +2 -1
  18. package/dist/types/type/button.d.ts +2 -0
  19. package/dist/types/type/variant.d.ts +1 -0
  20. package/documentation.json +34 -4
  21. package/package.json +3 -3
  22. package/src/common/locale.ts +10 -8
  23. package/src/common/number.ts +8 -0
  24. package/src/common/slot.ts +12 -0
  25. package/src/common/unit.ts +23 -0
  26. package/src/components/mds-paginator/test/mds-paginator.stories.tsx +16 -11
  27. package/src/dictionary/button.ts +25 -0
  28. package/src/dictionary/icon.ts +2 -1
  29. package/src/dictionary/variant.ts +11 -1
  30. package/src/tailwind/components.css +1 -1
  31. package/src/type/button.ts +15 -0
  32. package/src/type/variant.ts +8 -0
  33. package/src/fixtures/icons.json +0 -459
  34. package/src/fixtures/iconsauce.json +0 -306
@@ -19,15 +19,17 @@ export class Locale {
19
19
  };
20
20
  this.update = (doc) => {
21
21
  const context = doc !== null && doc !== void 0 ? doc : this.element.shadowRoot;
22
- context && context.querySelectorAll('*').forEach(el => {
23
- if (el.tagName.toLowerCase().startsWith('mds-')) {
24
- // eslint-disable-next-line no-restricted-syntax
25
- if (el && 'updateLang' in el) {
26
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
- el.updateLang();
22
+ if (context) {
23
+ context.querySelectorAll('*').forEach(el => {
24
+ if (el.tagName.toLowerCase().startsWith('mds-')) {
25
+ // eslint-disable-next-line no-restricted-syntax
26
+ if (el && 'updateLang' in el) {
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ el.updateLang();
29
+ }
28
30
  }
29
- }
30
- });
31
+ });
32
+ }
31
33
  };
32
34
  this.pluralize = (tag, context) => {
33
35
  const languagePhrase = this.config[this.language] ? this.config[this.language][tag] : this.config[this.rollbackLanguage][tag];
@@ -0,0 +1,5 @@
1
+ const randomNumber = (min, max, integer = false) => {
2
+ const num = Math.random() * (max - min) + min;
3
+ return integer ? Math.floor(num) : num;
4
+ };
5
+ export { randomNumber, };
@@ -25,4 +25,13 @@ const hasSlotted = (el, name) => {
25
25
  }
26
26
  return false;
27
27
  };
28
- export { hasSlottedElements, hasSlottedNodes, hasSlotted, };
28
+ const hasSlottedContent = (el, name) => {
29
+ var _a;
30
+ const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
31
+ const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
32
+ if (!slot)
33
+ return false;
34
+ const assignedNodes = slot.assignedNodes({ flatten: true });
35
+ return assignedNodes.some(node => { var _a; return node.nodeType === Node.TEXT_NODE && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== ''; });
36
+ };
37
+ export { hasSlottedElements, hasSlottedNodes, hasSlottedContent, hasSlotted, };
@@ -7,6 +7,15 @@ const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
7
7
  }
8
8
  return defaultValue;
9
9
  };
10
+ const cssDurationToSeconds = (duration, defaultValue = 1000) => {
11
+ if (duration.includes('ms')) {
12
+ return Number(duration.replace('ms', '')) / 1000;
13
+ }
14
+ if (duration.includes('s')) {
15
+ return Number(duration.replace('s', ''));
16
+ }
17
+ return defaultValue;
18
+ };
10
19
  const cssSizeToNumber = (size, defaultValue = 0) => {
11
20
  if (size.includes('px')) {
12
21
  return Number(size.replace('px', ''));
@@ -19,4 +28,10 @@ const cssSizeToNumber = (size, defaultValue = 0) => {
19
28
  }
20
29
  return defaultValue;
21
30
  };
22
- export { cssDurationToMilliseconds, cssSizeToNumber, };
31
+ const cssRotationToNumber = (size, defaultValue = 0) => {
32
+ if (size.includes('deg')) {
33
+ return Number(size.replace('deg', ''));
34
+ }
35
+ return defaultValue;
36
+ };
37
+ export { cssDurationToMilliseconds, cssDurationToSeconds, cssRotationToNumber, cssSizeToNumber, };
@@ -14,13 +14,17 @@ export default {
14
14
  },
15
15
  };
16
16
  const Template = args => h("mds-paginator", Object.assign({}, args));
17
- export const Default = Template.bind({});
18
- Default.args = {
19
- pages: 32,
17
+ export const Default = {
18
+ render: Template,
19
+ args: {
20
+ pages: 32,
21
+ },
20
22
  };
21
- export const CurrentPage = Template.bind({});
22
- CurrentPage.args = {
23
- 'current-page': 16,
24
- pages: 32,
23
+ export const CurrentPage = {
24
+ render: Template,
25
+ args: {
26
+ 'current-page': 16,
27
+ pages: 32,
28
+ },
29
+ story: lokiDisabled,
25
30
  };
26
- CurrentPage.story = lokiDisabled;
@@ -11,12 +11,27 @@ const buttonVariantDictionary = [
11
11
  'success',
12
12
  'warning',
13
13
  ];
14
+ const buttonDropdownVariantDictionary = [
15
+ 'ai',
16
+ 'dark',
17
+ 'error',
18
+ 'info',
19
+ 'light',
20
+ 'primary',
21
+ 'secondary',
22
+ 'success',
23
+ 'warning',
24
+ ];
14
25
  const buttonToneVariantDictionary = [
15
26
  'strong',
16
27
  'weak',
17
28
  'ghost',
18
29
  'quiet',
19
30
  ];
31
+ const buttonToneMinimalVariantDictionary = [
32
+ 'strong',
33
+ 'weak',
34
+ ];
20
35
  const buttonTargetDictionary = [
21
36
  'blank',
22
37
  'self',
@@ -27,6 +42,10 @@ const buttonSizeDictionary = [
27
42
  'lg',
28
43
  'xl',
29
44
  ];
45
+ const tabSizeDictionary = [
46
+ 'sm',
47
+ 'md',
48
+ ];
30
49
  const buttonIconPositionDictionary = [
31
50
  'left',
32
51
  'right',
@@ -36,4 +55,4 @@ const buttonTypeDictionary = [
36
55
  'submit',
37
56
  'reset',
38
57
  ];
39
- export { buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneVariantDictionary, buttonTypeDictionary, buttonVariantDictionary, };
58
+ export { buttonDropdownVariantDictionary, buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneMinimalVariantDictionary, buttonToneVariantDictionary, buttonTypeDictionary, buttonVariantDictionary, tabSizeDictionary, };
@@ -1,5 +1,5 @@
1
1
  import jsonIconsDictionary from "../fixtures/icons.json";
2
- import jsonMggIconsDictionary from "../fixtures/iconsauce.json";
2
+ import jsonMggIconsDictionary from "@maggioli-design-system/svg-icons/dist/iconsauce.json";
3
3
  const iconsDictionary = jsonIconsDictionary;
4
4
  const mggIconsDictionary = jsonMggIconsDictionary;
5
5
  const svgIconsDictionary = [
@@ -18,6 +18,14 @@ const themeStatusVariantDictionary = [
18
18
  'success',
19
19
  'warning',
20
20
  ];
21
+ const themeInputVariantDictionary = [
22
+ 'ai',
23
+ 'error',
24
+ 'info',
25
+ 'primary',
26
+ 'success',
27
+ 'warning',
28
+ ];
21
29
  const themeFullVariantDictionary = [
22
30
  'amaranth',
23
31
  'aqua',
@@ -113,4 +121,4 @@ const toneMinimalVariantDictionary = [
113
121
  'strong',
114
122
  'weak',
115
123
  ];
116
- export { themeFullVariantAvatarDictionary, themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, themeVariantChipDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneSmartVariantDictionary, toneVariantDictionary, };
124
+ export { themeFullVariantAvatarDictionary, themeFullVariantDictionary, themeInputVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantChipDictionary, themeVariantDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneSmartVariantDictionary, toneVariantDictionary, };
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-05-14T14:23:44",
2
+ "timestamp": "2026-01-16T13:49:34",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.27.2",
package/dist/stats.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
- "timestamp": "2025-05-14T14:23:44",
2
+ "timestamp": "2026-01-16T13:49:34",
3
3
  "compiler": {
4
4
  "name": "node",
5
- "version": "22.11.0"
5
+ "version": "22.15.0"
6
6
  },
7
7
  "app": {
8
8
  "namespace": "MdsPaginator",
9
9
  "fsNamespace": "mds-paginator",
10
10
  "components": 1,
11
11
  "entries": 1,
12
- "bundles": 104,
12
+ "bundles": 105,
13
13
  "outputs": [
14
14
  {
15
15
  "name": "dist-collection",
16
- "files": 56,
16
+ "files": 57,
17
17
  "generatedFiles": [
18
18
  "./dist/collection/common/aria.js",
19
19
  "./dist/collection/common/browser.js",
@@ -24,6 +24,7 @@
24
24
  "./dist/collection/common/icon.js",
25
25
  "./dist/collection/common/keyboard-manager.js",
26
26
  "./dist/collection/common/locale.js",
27
+ "./dist/collection/common/number.js",
27
28
  "./dist/collection/common/slot.js",
28
29
  "./dist/collection/common/string.js",
29
30
  "./dist/collection/common/unit.js",
@@ -543,6 +544,7 @@
543
544
  "./src/common/icon.ts": [],
544
545
  "./src/common/keyboard-manager.ts": [],
545
546
  "./src/common/locale.ts": [],
547
+ "./src/common/number.ts": [],
546
548
  "./src/common/slot.ts": [],
547
549
  "./src/common/string.ts": [],
548
550
  "./src/common/unit.ts": [],
@@ -572,8 +574,7 @@
572
574
  "./src/dictionary/file-extensions.ts": [],
573
575
  "./src/dictionary/floating-ui.ts": [],
574
576
  "./src/dictionary/icon.ts": [
575
- "./src/fixtures/icons.json",
576
- "./src/fixtures/iconsauce.json"
577
+ "./src/fixtures/icons.json"
577
578
  ],
578
579
  "./src/dictionary/input.ts": [],
579
580
  "./src/dictionary/keyboard.ts": [],
@@ -0,0 +1,2 @@
1
+ declare const randomNumber: (min: number, max: number, integer?: boolean) => number;
2
+ export { randomNumber, };
@@ -1,4 +1,5 @@
1
1
  declare const hasSlottedElements: (el: HTMLElement, name?: string) => boolean;
2
2
  declare const hasSlottedNodes: (el: HTMLElement, name?: string) => boolean;
3
3
  declare const hasSlotted: (el: HTMLElement, name?: string) => boolean;
4
- export { hasSlottedElements, hasSlottedNodes, hasSlotted, };
4
+ declare const hasSlottedContent: (el: HTMLElement, name?: string) => boolean;
5
+ export { hasSlottedElements, hasSlottedNodes, hasSlottedContent, hasSlotted, };
@@ -1,3 +1,5 @@
1
1
  declare const cssDurationToMilliseconds: (duration: string, defaultValue?: number) => number;
2
+ declare const cssDurationToSeconds: (duration: string, defaultValue?: number) => number;
2
3
  declare const cssSizeToNumber: (size: string, defaultValue?: number) => number;
3
- export { cssDurationToMilliseconds, cssSizeToNumber, };
4
+ declare const cssRotationToNumber: (size: string, defaultValue?: number) => number;
5
+ export { cssDurationToMilliseconds, cssDurationToSeconds, cssRotationToNumber, cssSizeToNumber, };
@@ -18,5 +18,17 @@ declare const _default: {
18
18
  };
19
19
  };
20
20
  export default _default;
21
- export declare const Default: any;
22
- export declare const CurrentPage: any;
21
+ export declare const Default: {
22
+ render: (args: any) => any;
23
+ args: {
24
+ pages: number;
25
+ };
26
+ };
27
+ export declare const CurrentPage: {
28
+ render: (args: any) => any;
29
+ args: {
30
+ 'current-page': number;
31
+ pages: number;
32
+ };
33
+ story: any;
34
+ };
@@ -1,7 +1,10 @@
1
1
  declare const buttonVariantDictionary: string[];
2
+ declare const buttonDropdownVariantDictionary: string[];
2
3
  declare const buttonToneVariantDictionary: string[];
4
+ declare const buttonToneMinimalVariantDictionary: string[];
3
5
  declare const buttonTargetDictionary: string[];
4
6
  declare const buttonSizeDictionary: string[];
7
+ declare const tabSizeDictionary: string[];
5
8
  declare const buttonIconPositionDictionary: string[];
6
9
  declare const buttonTypeDictionary: string[];
7
- export { buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneVariantDictionary, buttonTypeDictionary, buttonVariantDictionary, };
10
+ export { buttonDropdownVariantDictionary, buttonIconPositionDictionary, buttonSizeDictionary, buttonTargetDictionary, buttonToneMinimalVariantDictionary, buttonToneVariantDictionary, buttonTypeDictionary, buttonVariantDictionary, tabSizeDictionary, };
@@ -1,4 +1,4 @@
1
- declare const iconsDictionary: string[];
1
+ declare const iconsDictionary: any;
2
2
  declare const mggIconsDictionary: string[];
3
3
  declare const svgIconsDictionary: string[];
4
4
  export { iconsDictionary, mggIconsDictionary, svgIconsDictionary, };
@@ -1,6 +1,7 @@
1
1
  declare const themeVariantDictionary: string[];
2
2
  declare const themeLuminanceVariantDictionary: string[];
3
3
  declare const themeStatusVariantDictionary: string[];
4
+ declare const themeInputVariantDictionary: string[];
4
5
  declare const themeFullVariantDictionary: string[];
5
6
  declare const themeFullVariantAvatarDictionary: string[];
6
7
  declare const themeLabelVariantDictionary: string[];
@@ -10,4 +11,4 @@ declare const toneActionVariantDictionary: string[];
10
11
  declare const toneSimpleVariantDictionary: string[];
11
12
  declare const toneSmartVariantDictionary: string[];
12
13
  declare const toneMinimalVariantDictionary: string[];
13
- export { themeFullVariantAvatarDictionary, themeFullVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantDictionary, themeVariantChipDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneSmartVariantDictionary, toneVariantDictionary, };
14
+ export { themeFullVariantAvatarDictionary, themeFullVariantDictionary, themeInputVariantDictionary, themeLabelVariantDictionary, themeLuminanceVariantDictionary, themeStatusVariantDictionary, themeVariantChipDictionary, themeVariantDictionary, toneActionVariantDictionary, toneMinimalVariantDictionary, toneSimpleVariantDictionary, toneSmartVariantDictionary, toneVariantDictionary, };
@@ -1,5 +1,7 @@
1
1
  export type ButtonType = 'a' | 'button' | 'reset' | 'submit';
2
2
  export type ButtonTargetType = 'self' | 'blank';
3
3
  export type ButtonSizeType = 'sm' | 'md' | 'lg' | 'xl';
4
+ export type TabSizeType = 'sm' | 'md';
4
5
  export type ButtonIconPositionType = 'left' | 'right';
5
6
  export type ButtonVariantType = 'ai' | 'apple' | 'dark' | 'error' | 'google' | 'info' | 'light' | 'primary' | 'secondary' | 'success' | 'warning';
7
+ export type ButtonDropdownVariantType = 'ai' | 'dark' | 'error' | 'info' | 'light' | 'primary' | 'secondary' | 'success' | 'warning';
@@ -1,4 +1,5 @@
1
1
  export type ThemeStatusVariantType = 'error' | 'info' | 'success' | 'warning';
2
+ export type ThemeInputVariantType = 'primary' | 'ai' | 'error' | 'info' | 'success' | 'warning';
2
3
  export type ThemeVariantType = 'ai' | 'dark' | 'error' | 'info' | 'light' | 'primary' | 'success' | 'warning';
3
4
  export type ThemeFullVariantType = 'amaranth' | 'aqua' | 'blue' | 'dark' | 'error' | 'green' | 'info' | 'light' | 'lime' | 'orange' | 'orchid' | 'sky' | 'success' | 'violet' | 'warning' | 'yellow';
4
5
  export type ThemeFullVariantAvatarType = 'amaranth' | 'aqua' | 'blue' | 'error' | 'green' | 'info' | 'lime' | 'orange' | 'orchid' | 'primary' | 'sky' | 'success' | 'violet' | 'warning' | 'yellow';
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-05-14T12:14:14",
2
+ "timestamp": "2026-01-16T12:28:24",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.27.2",
@@ -253,6 +253,11 @@
253
253
  "docstring": "",
254
254
  "path": "src/type/text.ts"
255
255
  },
256
+ "src/type/button.ts::ButtonDropdownVariantType": {
257
+ "declaration": "export type ButtonDropdownVariantType =\n | 'ai'\n | 'dark'\n | 'error'\n | 'info'\n | 'light'\n | 'primary'\n | 'secondary'\n | 'success'\n | 'warning'",
258
+ "docstring": "",
259
+ "path": "src/type/button.ts"
260
+ },
256
261
  "src/components/mds-calendar-cell/meta/types.ts::CalendarCellType": {
257
262
  "declaration": "export type CalendarCellType =\n | 'other'\n | 'current'\n | 'weekend'",
258
263
  "docstring": "",
@@ -274,7 +279,7 @@
274
279
  "path": "src/type/variant.ts"
275
280
  },
276
281
  "src/components/mds-chip/meta/interface.ts::MdsChipEvent": {
277
- "declaration": "interface MdsChipEvent {\n event: Event\n element: HTMLMdsChipElement\n}",
282
+ "declaration": "interface MdsChipEvent {\n event: Event\n selected?: boolean\n element: HTMLMdsChipElement\n}",
278
283
  "docstring": "",
279
284
  "path": "src/components/mds-chip/meta/interface.ts"
280
285
  },
@@ -393,8 +398,8 @@
393
398
  "docstring": "",
394
399
  "path": "src/type/input.ts"
395
400
  },
396
- "src/type/variant.ts::ThemeStatusVariantType": {
397
- "declaration": "export type ThemeStatusVariantType =\n | 'error'\n | 'info'\n | 'success'\n | 'warning'",
401
+ "src/type/variant.ts::ThemeInputVariantType": {
402
+ "declaration": "export type ThemeInputVariantType =\n | 'primary'\n | 'ai'\n | 'error'\n | 'info'\n | 'success'\n | 'warning'",
398
403
  "docstring": "",
399
404
  "path": "src/type/variant.ts"
400
405
  },
@@ -423,6 +428,11 @@
423
428
  "docstring": "",
424
429
  "path": "src/components/mds-input/meta/validators.ts"
425
430
  },
431
+ "src/type/variant.ts::ThemeStatusVariantType": {
432
+ "declaration": "export type ThemeStatusVariantType =\n | 'error'\n | 'info'\n | 'success'\n | 'warning'",
433
+ "docstring": "",
434
+ "path": "src/type/variant.ts"
435
+ },
426
436
  "src/components/mds-input-switch/meta/types.ts::InputSwitchSizeType": {
427
437
  "declaration": "export type InputSwitchSizeType =\n | 'sm'\n | 'md'\n | 'lg'",
428
438
  "docstring": "",
@@ -478,6 +488,11 @@
478
488
  "docstring": "",
479
489
  "path": "src/type/typography.ts"
480
490
  },
491
+ "src/components/mds-mention/meta/type.ts::MentionSize": {
492
+ "declaration": "export type MentionSize =\n | 'sm'\n | 'md'\n | 'lg'",
493
+ "docstring": "",
494
+ "path": "src/components/mds-mention/meta/type.ts"
495
+ },
481
496
  "src/components/mds-modal/meta/types.ts::ModalPositionType": {
482
497
  "declaration": "export type ModalPositionType =\n | 'bottom'\n | 'bottom-left'\n | 'bottom-right'\n | 'center'\n | 'left'\n | 'right'\n | 'top'\n | 'top-left'\n | 'top-right'",
483
498
  "docstring": "",
@@ -518,6 +533,11 @@
518
533
  "docstring": "",
519
534
  "path": "src/components/mds-policy-ai/meta/types.ts"
520
535
  },
536
+ "src/type/button.ts::TabSizeType": {
537
+ "declaration": "export type TabSizeType =\n | 'sm'\n | 'md'",
538
+ "docstring": "",
539
+ "path": "src/type/button.ts"
540
+ },
521
541
  "src/components/mds-pref-animation/meta/types.ts::AnimationModeType": {
522
542
  "declaration": "export type AnimationModeType =\n | 'reduce'\n | 'no-preference'\n | 'system'",
523
543
  "docstring": "",
@@ -598,6 +618,11 @@
598
618
  "docstring": "",
599
619
  "path": "src/components/mds-radial-menu/meta/types.ts"
600
620
  },
621
+ "src/components.d.ts::ModalOverflowType": {
622
+ "declaration": "any",
623
+ "docstring": "",
624
+ "path": "src/components.d.ts"
625
+ },
601
626
  "src/components/mds-stepper-bar/meta/event-detail.ts::MdsStepperBarEventDetail": {
602
627
  "declaration": "export interface MdsStepperBarEventDetail {\n step: number\n value: string\n}",
603
628
  "docstring": "",
@@ -608,6 +633,11 @@
608
633
  "docstring": "",
609
634
  "path": "src/components/mds-stepper-bar-item/meta/event-detail.ts"
610
635
  },
636
+ "src/components/mds-tab/meta/type.ts::DirectionType": {
637
+ "declaration": "export type DirectionType =\n | 'horizontal'\n | 'vertical'",
638
+ "docstring": "",
639
+ "path": "src/components/mds-tab/meta/type.ts"
640
+ },
611
641
  "src/type/animation.ts::HorizontalActionsAnimationType": {
612
642
  "declaration": "export type HorizontalActionsAnimationType =\n | 'fade'\n | 'slide'",
613
643
  "docstring": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-paginator",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "description": "mds-paginator is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "test": "stencil test --spec --e2e"
25
25
  },
26
26
  "dependencies": {
27
- "@maggioli-design-system/mds-paginator-item": "3.2.3",
28
- "@maggioli-design-system/styles": "15.10.0",
27
+ "@maggioli-design-system/mds-paginator-item": "3.2.5",
28
+ "@maggioli-design-system/styles": "15.11.0",
29
29
  "@stencil/core": "4.27.2"
30
30
  },
31
31
  "license": "MIT",
@@ -41,15 +41,17 @@ export class Locale {
41
41
 
42
42
  update = (doc?: Document | ShadowRoot): void => {
43
43
  const context = doc ?? this.element.shadowRoot
44
- context && context.querySelectorAll('*').forEach(el => {
45
- if (el.tagName.toLowerCase().startsWith('mds-')) {
46
- // eslint-disable-next-line no-restricted-syntax
47
- if (el && 'updateLang' in el) {
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- (el as any).updateLang()
44
+ if (context) {
45
+ context.querySelectorAll('*').forEach(el => {
46
+ if (el.tagName.toLowerCase().startsWith('mds-')) {
47
+ // eslint-disable-next-line no-restricted-syntax
48
+ if (el && 'updateLang' in el) {
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ (el as any).updateLang()
51
+ }
50
52
  }
51
- }
52
- })
53
+ })
54
+ }
53
55
  }
54
56
 
55
57
  private pluralize = (tag: string | string[], context: Record<string, string | number | boolean>): string => {
@@ -0,0 +1,8 @@
1
+ const randomNumber = (min: number, max: number, integer: boolean = false): number => {
2
+ const num = Math.random() * (max - min) + min
3
+ return integer ? Math.floor(num) : num
4
+ }
5
+
6
+ export {
7
+ randomNumber,
8
+ }
@@ -28,8 +28,20 @@ const hasSlotted = (el: HTMLElement, name?: string): boolean => {
28
28
  return false
29
29
  }
30
30
 
31
+ const hasSlottedContent = (el: HTMLElement, name?: string): boolean => {
32
+ const query = name ? `slot[name="${name}"]` : 'slot:not([name])'
33
+ const slot: HTMLSlotElement = el.shadowRoot?.querySelector(query) as HTMLSlotElement
34
+ if (!slot) return false
35
+
36
+ const assignedNodes = slot.assignedNodes({ flatten: true })
37
+ return assignedNodes.some(node =>
38
+ node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== '',
39
+ )
40
+ }
41
+
31
42
  export {
32
43
  hasSlottedElements,
33
44
  hasSlottedNodes,
45
+ hasSlottedContent,
34
46
  hasSlotted,
35
47
  }
@@ -11,6 +11,19 @@ const cssDurationToMilliseconds = (duration: string, defaultValue = 1000): numbe
11
11
  return defaultValue
12
12
  }
13
13
 
14
+ const cssDurationToSeconds = (duration: string, defaultValue = 1000): number => {
15
+
16
+ if (duration.includes('ms')) {
17
+ return Number(duration.replace('ms', '')) / 1000
18
+ }
19
+
20
+ if (duration.includes('s')) {
21
+ return Number(duration.replace('s', ''))
22
+ }
23
+
24
+ return defaultValue
25
+ }
26
+
14
27
  const cssSizeToNumber = (size: string, defaultValue = 0): number => {
15
28
  if (size.includes('px')) {
16
29
  return Number(size.replace('px', ''))
@@ -27,7 +40,17 @@ const cssSizeToNumber = (size: string, defaultValue = 0): number => {
27
40
  return defaultValue
28
41
  }
29
42
 
43
+ const cssRotationToNumber = (size: string, defaultValue = 0): number => {
44
+ if (size.includes('deg')) {
45
+ return Number(size.replace('deg', ''))
46
+ }
47
+
48
+ return defaultValue
49
+ }
50
+
30
51
  export {
31
52
  cssDurationToMilliseconds,
53
+ cssDurationToSeconds,
54
+ cssRotationToNumber,
32
55
  cssSizeToNumber,
33
56
  }
@@ -14,18 +14,23 @@ export default {
14
14
  },
15
15
  },
16
16
  }
17
- const Template = args =>
18
- <mds-paginator {...args}/>
17
+ const Template = args => <mds-paginator {...args} />
19
18
 
20
- export const Default = Template.bind({})
21
- Default.args = {
22
- pages: 32,
23
- }
19
+ export const Default = {
20
+ render: Template,
24
21
 
25
- export const CurrentPage = Template.bind({})
26
- CurrentPage.args = {
27
- 'current-page': 16,
28
- pages: 32,
22
+ args: {
23
+ pages: 32,
24
+ },
29
25
  }
30
26
 
31
- CurrentPage.story = lokiDisabled
27
+ export const CurrentPage = {
28
+ render: Template,
29
+
30
+ args: {
31
+ 'current-page': 16,
32
+ pages: 32,
33
+ },
34
+
35
+ story: lokiDisabled,
36
+ }
@@ -12,6 +12,18 @@ const buttonVariantDictionary = [
12
12
  'warning',
13
13
  ]
14
14
 
15
+ const buttonDropdownVariantDictionary = [
16
+ 'ai',
17
+ 'dark',
18
+ 'error',
19
+ 'info',
20
+ 'light',
21
+ 'primary',
22
+ 'secondary',
23
+ 'success',
24
+ 'warning',
25
+ ]
26
+
15
27
  const buttonToneVariantDictionary = [
16
28
  'strong',
17
29
  'weak',
@@ -19,6 +31,11 @@ const buttonToneVariantDictionary = [
19
31
  'quiet',
20
32
  ]
21
33
 
34
+ const buttonToneMinimalVariantDictionary = [
35
+ 'strong',
36
+ 'weak',
37
+ ]
38
+
22
39
  const buttonTargetDictionary = [
23
40
  'blank',
24
41
  'self',
@@ -31,6 +48,11 @@ const buttonSizeDictionary = [
31
48
  'xl',
32
49
  ]
33
50
 
51
+ const tabSizeDictionary = [
52
+ 'sm',
53
+ 'md',
54
+ ]
55
+
34
56
  const buttonIconPositionDictionary = [
35
57
  'left',
36
58
  'right',
@@ -43,10 +65,13 @@ const buttonTypeDictionary = [
43
65
  ]
44
66
 
45
67
  export {
68
+ buttonDropdownVariantDictionary,
46
69
  buttonIconPositionDictionary,
47
70
  buttonSizeDictionary,
48
71
  buttonTargetDictionary,
72
+ buttonToneMinimalVariantDictionary,
49
73
  buttonToneVariantDictionary,
50
74
  buttonTypeDictionary,
51
75
  buttonVariantDictionary,
76
+ tabSizeDictionary,
52
77
  }
@@ -1,5 +1,6 @@
1
1
  import jsonIconsDictionary from '../fixtures/icons.json'
2
- import jsonMggIconsDictionary from '../fixtures/iconsauce.json'
2
+ import jsonMggIconsDictionary from '@maggioli-design-system/svg-icons/dist/iconsauce.json'
3
+
3
4
  const iconsDictionary = jsonIconsDictionary
4
5
  const mggIconsDictionary = jsonMggIconsDictionary
5
6
  const svgIconsDictionary = [