sprintify-ui 0.8.41 → 0.8.42

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 (137) hide show
  1. package/dist/sprintify-ui.es.js +4910 -4972
  2. package/dist/types/components/BaseActionItem.vue.d.ts +5 -15
  3. package/dist/types/components/BaseActionItemButton.vue.d.ts +4 -25
  4. package/dist/types/components/BaseAddressForm.vue.d.ts +6 -45
  5. package/dist/types/components/BaseAlert.vue.d.ts +11 -37
  6. package/dist/types/components/BaseApp.vue.d.ts +8 -3
  7. package/dist/types/components/BaseAppDialogs.vue.d.ts +1 -1
  8. package/dist/types/components/BaseAppSnackbars.vue.d.ts +1 -1
  9. package/dist/types/components/BaseAutocomplete.vue.d.ts +585 -37
  10. package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +24 -16
  11. package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +526 -36
  12. package/dist/types/components/BaseAvatar.vue.d.ts +4 -4
  13. package/dist/types/components/BaseAvatarGroup.vue.d.ts +4 -4
  14. package/dist/types/components/BaseBadge.vue.d.ts +11 -35
  15. package/dist/types/components/BaseBelongsTo.vue.d.ts +524 -34
  16. package/dist/types/components/BaseBelongsToFetch.vue.d.ts +484 -35
  17. package/dist/types/components/BaseBoolean.vue.d.ts +3 -12
  18. package/dist/types/components/BaseBreadcrumbs.vue.d.ts +4 -4
  19. package/dist/types/components/BaseButton.vue.d.ts +17 -53
  20. package/dist/types/components/BaseButtonGroup.vue.d.ts +19 -14
  21. package/dist/types/components/BaseCalendar.vue.d.ts +46 -13
  22. package/dist/types/components/BaseCard.vue.d.ts +13 -6
  23. package/dist/types/components/BaseCardRow.vue.d.ts +13 -31
  24. package/dist/types/components/BaseCharacterCounter.vue.d.ts +4 -4
  25. package/dist/types/components/BaseClipboard.vue.d.ts +14 -6
  26. package/dist/types/components/BaseCollapse.vue.d.ts +20 -52
  27. package/dist/types/components/BaseColor.vue.d.ts +8 -8
  28. package/dist/types/components/BaseContainer.vue.d.ts +11 -33
  29. package/dist/types/components/BaseCounter.vue.d.ts +4 -4
  30. package/dist/types/components/BaseCropper.vue.d.ts +29 -30
  31. package/dist/types/components/BaseCropperModal.vue.d.ts +8 -17
  32. package/dist/types/components/BaseDataIterator.vue.d.ts +6 -6
  33. package/dist/types/components/BaseDataIteratorSectionBox.vue.d.ts +10 -14
  34. package/dist/types/components/BaseDataIteratorSectionButton.vue.d.ts +6 -15
  35. package/dist/types/components/BaseDataIteratorSectionColumns.vue.d.ts +4 -4
  36. package/dist/types/components/BaseDataIteratorSectionModal.vue.d.ts +13 -17
  37. package/dist/types/components/BaseDataTable.vue.d.ts +842 -26
  38. package/dist/types/components/BaseDataTableRowAction.vue.d.ts +4 -25
  39. package/dist/types/components/BaseDataTableTemplate.vue.d.ts +129 -14
  40. package/dist/types/components/BaseDatePicker.vue.d.ts +7 -56
  41. package/dist/types/components/BaseDateSelect.vue.d.ts +5 -5
  42. package/dist/types/components/BaseDescriptionList.vue.d.ts +8 -3
  43. package/dist/types/components/BaseDescriptionListItem.vue.d.ts +11 -4
  44. package/dist/types/components/BaseDialog.vue.d.ts +516 -8
  45. package/dist/types/components/BaseDisplayRelativeTime.vue.d.ts +15 -8
  46. package/dist/types/components/BaseDraggable.vue.d.ts +18 -20
  47. package/dist/types/components/BaseDropdown.vue.d.ts +18 -10
  48. package/dist/types/components/BaseDropdownAutocomplete.vue.d.ts +23 -16
  49. package/dist/types/components/BaseField.vue.d.ts +12 -7
  50. package/dist/types/components/BaseFieldI18n.vue.d.ts +7 -7
  51. package/dist/types/components/BaseFilePicker.vue.d.ts +20 -44
  52. package/dist/types/components/BaseFilePickerCrop.vue.d.ts +51 -39
  53. package/dist/types/components/BaseFileUploader.vue.d.ts +40 -76
  54. package/dist/types/components/BaseForm.vue.d.ts +22 -15
  55. package/dist/types/components/BaseGantt.vue.d.ts +21 -40
  56. package/dist/types/components/BaseHasMany.vue.d.ts +325 -39
  57. package/dist/types/components/BaseHeader.vue.d.ts +4 -37
  58. package/dist/types/components/BaseIconPicker.vue.d.ts +6 -31
  59. package/dist/types/components/BaseInput.vue.d.ts +12 -12
  60. package/dist/types/components/BaseInputError.vue.d.ts +11 -6
  61. package/dist/types/components/BaseInputLabel.vue.d.ts +4 -4
  62. package/dist/types/components/BaseInputPercent.vue.d.ts +9 -9
  63. package/dist/types/components/BaseJsonReader.vue.d.ts +4 -29
  64. package/dist/types/components/BaseJsonReaderItem.vue.d.ts +3 -12
  65. package/dist/types/components/BaseLayoutNotificationDropdown.vue.d.ts +5 -5
  66. package/dist/types/components/BaseLayoutNotificationItem.vue.d.ts +4 -4
  67. package/dist/types/components/BaseLayoutNotificationItemContent.vue.d.ts +3 -12
  68. package/dist/types/components/BaseLayoutSidebar.vue.d.ts +16 -11
  69. package/dist/types/components/BaseLayoutSidebarConfigurable.vue.d.ts +13 -8
  70. package/dist/types/components/BaseLayoutStacked.vue.d.ts +22 -42
  71. package/dist/types/components/BaseLayoutStackedConfigurable.vue.d.ts +12 -7
  72. package/dist/types/components/BaseLazy.vue.d.ts +24 -15
  73. package/dist/types/components/BaseLoadingCover.vue.d.ts +5 -5
  74. package/dist/types/components/BaseMediaGallery.vue.d.ts +5 -5
  75. package/dist/types/components/BaseMediaGalleryItem.vue.d.ts +5 -5
  76. package/dist/types/components/BaseMediaItem.vue.d.ts +5 -5
  77. package/dist/types/components/BaseMediaLibrary.vue.d.ts +38 -33
  78. package/dist/types/components/BaseMediaList.vue.d.ts +5 -5
  79. package/dist/types/components/BaseMediaListItem.vue.d.ts +6 -6
  80. package/dist/types/components/BaseMediaPictures.vue.d.ts +5 -5
  81. package/dist/types/components/BaseMediaPicturesItem.vue.d.ts +5 -5
  82. package/dist/types/components/BaseMediaPreview.vue.d.ts +5 -5
  83. package/dist/types/components/BaseMenu.vue.d.ts +31 -23
  84. package/dist/types/components/BaseMenuItem.vue.d.ts +5 -5
  85. package/dist/types/components/BaseModalCenter.vue.d.ts +14 -9
  86. package/dist/types/components/BaseModalSide.vue.d.ts +14 -9
  87. package/dist/types/components/BaseNavbar.vue.d.ts +23 -16
  88. package/dist/types/components/BaseNavbarItem.vue.d.ts +5 -5
  89. package/dist/types/components/BaseNavbarItemContent.vue.d.ts +4 -4
  90. package/dist/types/components/BaseNavbarSideItem.vue.d.ts +5 -5
  91. package/dist/types/components/BaseNavbarSideItemContent.vue.d.ts +4 -4
  92. package/dist/types/components/BasePagination.vue.d.ts +5 -5
  93. package/dist/types/components/BasePanel.vue.d.ts +5 -5
  94. package/dist/types/components/BasePassword.vue.d.ts +8 -8
  95. package/dist/types/components/BaseProgressCircle.vue.d.ts +4 -4
  96. package/dist/types/components/BaseRadioGroup.vue.d.ts +15 -10
  97. package/dist/types/components/BaseReadMore.vue.d.ts +13 -6
  98. package/dist/types/components/BaseRichText.vue.d.ts +6 -6
  99. package/dist/types/components/BaseScrollColumn.vue.d.ts +5 -5
  100. package/dist/types/components/BaseSelect.vue.d.ts +15 -8
  101. package/dist/types/components/BaseShortcut.vue.d.ts +5 -5
  102. package/dist/types/components/BaseSideNavigation.vue.d.ts +11 -27
  103. package/dist/types/components/BaseSideNavigationItem.vue.d.ts +13 -31
  104. package/dist/types/components/BaseSkeleton.vue.d.ts +4 -4
  105. package/dist/types/components/BaseStatistic.vue.d.ts +6 -4
  106. package/dist/types/components/BaseStepper.vue.d.ts +4 -4
  107. package/dist/types/components/BaseStepperItem.vue.d.ts +5 -5
  108. package/dist/types/components/BaseSwitch.vue.d.ts +14 -9
  109. package/dist/types/components/BaseSystemAlert.vue.d.ts +12 -7
  110. package/dist/types/components/BaseTabItem.vue.d.ts +15 -31
  111. package/dist/types/components/BaseTable.vue.d.ts +15 -45
  112. package/dist/types/components/BaseTableBody.vue.d.ts +8 -3
  113. package/dist/types/components/BaseTableCell.vue.d.ts +13 -47
  114. package/dist/types/components/BaseTableColumn.vue.d.ts +8 -8
  115. package/dist/types/components/BaseTableHead.vue.d.ts +11 -27
  116. package/dist/types/components/BaseTableHeader.vue.d.ts +15 -35
  117. package/dist/types/components/BaseTableRow.vue.d.ts +15 -41
  118. package/dist/types/components/BaseTabs.vue.d.ts +14 -27
  119. package/dist/types/components/BaseTagAutocomplete.vue.d.ts +235 -39
  120. package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +457 -39
  121. package/dist/types/components/BaseTextarea.vue.d.ts +8 -8
  122. package/dist/types/components/BaseTextareaAutoresize.vue.d.ts +8 -8
  123. package/dist/types/components/BaseTimePicker.vue.d.ts +6 -6
  124. package/dist/types/components/BaseTimeline.vue.d.ts +3 -3
  125. package/dist/types/components/BaseTimelineItem.vue.d.ts +3 -3
  126. package/dist/types/components/BaseToast.vue.d.ts +3 -12
  127. package/dist/types/components/BaseTooltip.vue.d.ts +15 -36
  128. package/dist/types/components/BaseUniqueCode.vue.d.ts +5 -5
  129. package/dist/types/components/SlotComponent.d.ts +4 -4
  130. package/dist/types/stories/PageInputSizes.vue.d.ts +1 -1
  131. package/dist/types/stories/PageShow.vue.d.ts +1 -1
  132. package/dist/types/svg/BaseEmptyState.vue.d.ts +1 -1
  133. package/dist/types/svg/BaseSpinnerLarge.vue.d.ts +1 -1
  134. package/dist/types/svg/BaseSpinnerSmall.vue.d.ts +1 -1
  135. package/package.json +1 -6
  136. package/src/components/BaseLazy.stories.js +28 -7
  137. package/src/components/BaseLazy.vue +64 -10
@@ -1,14 +1,14 @@
1
1
  import { TimelineItem } from '../types';
2
2
  import { PropType } from 'vue';
3
- declare const _default: import("vue").DefineComponent<{
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
4
  items: {
5
5
  required: true;
6
6
  type: PropType<TimelineItem[]>;
7
7
  };
8
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
9
  items: {
10
10
  required: true;
11
11
  type: PropType<TimelineItem[]>;
12
12
  };
13
- }>>, {}, {}>;
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
14
  export default _default;
@@ -1,14 +1,14 @@
1
1
  import { TimelineItem } from '../types';
2
2
  import { PropType } from 'vue';
3
- declare const _default: import("vue").DefineComponent<{
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
4
  item: {
5
5
  required: true;
6
6
  type: PropType<TimelineItem>;
7
7
  };
8
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
9
  item: {
10
10
  required: true;
11
11
  type: PropType<TimelineItem>;
12
12
  };
13
- }>>, {}, {}>;
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
14
  export default _default;
@@ -1,17 +1,8 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
1
+ declare const _default: import("vue").DefineComponent<{
2
2
  text: string;
3
3
  color: string;
4
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
4
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
5
5
  text: string;
6
6
  color: string;
7
- }>>>, {}, {}>;
7
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
8
  export default _default;
9
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
- type __VLS_TypePropsToOption<T> = {
11
- [K in keyof T]-?: {} extends Pick<T, K> ? {
12
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
- } : {
14
- type: import('vue').PropType<T[K]>;
15
- required: true;
16
- };
17
- };
@@ -1,60 +1,39 @@
1
1
  import { UseFloatingOptions } from '@floating-ui/vue';
2
2
  declare function __VLS_template(): {
3
- default?(_: {}): any;
4
- tooltip?(_: {}): any;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ tooltip?(_: {}): any;
6
+ };
7
+ refs: {
8
+ targetRef: HTMLDivElement;
9
+ tooltipRef: HTMLDivElement;
10
+ };
11
+ attrs: Partial<{}>;
5
12
  };
6
- declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import("vue").DefineComponent<{
7
15
  visible?: boolean;
8
16
  text?: string | null | undefined;
9
17
  class?: string[] | string | null | undefined;
10
18
  floatingOptions?: UseFloatingOptions;
11
19
  interactive?: boolean;
12
- }>, {
13
- visible: boolean;
14
- text: null;
15
- class: null;
16
- floatingOptions: undefined;
17
- interactive: boolean;
18
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
20
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
19
21
  visible?: boolean;
20
22
  text?: string | null | undefined;
21
23
  class?: string[] | string | null | undefined;
22
24
  floatingOptions?: UseFloatingOptions;
23
25
  interactive?: boolean;
24
- }>, {
25
- visible: boolean;
26
- text: null;
27
- class: null;
28
- floatingOptions: undefined;
29
- interactive: boolean;
30
- }>>>, {
26
+ }> & Readonly<{}>, {
31
27
  class: string | string[] | null;
32
28
  text: string | null;
33
29
  visible: boolean;
34
30
  floatingOptions: UseFloatingOptions;
35
31
  interactive: boolean;
36
- }, {}>;
37
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
38
34
  export default _default;
39
- type __VLS_WithDefaults<P, D> = {
40
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
41
- default: D[K];
42
- }> : P[K];
43
- };
44
- type __VLS_Prettify<T> = {
45
- [K in keyof T]: T[K];
46
- } & {};
47
35
  type __VLS_WithTemplateSlots<T, S> = T & {
48
36
  new (): {
49
37
  $slots: S;
50
38
  };
51
39
  };
52
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
53
- type __VLS_TypePropsToOption<T> = {
54
- [K in keyof T]-?: {} extends Pick<T, K> ? {
55
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
56
- } : {
57
- type: import('vue').PropType<T[K]>;
58
- required: true;
59
- };
60
- };
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
3
  modelValue: {
4
4
  required: true;
5
5
  type: PropType<string | number | null>;
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  default: string;
13
13
  type: PropType<"numeric" | "alphanumeric">;
14
14
  };
15
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
16
  "update:modelValue": (...args: any[]) => void;
17
17
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  modelValue: {
@@ -27,9 +27,9 @@ declare const _default: import("vue").DefineComponent<{
27
27
  default: string;
28
28
  type: PropType<"numeric" | "alphanumeric">;
29
29
  };
30
- }>> & {
30
+ }>> & Readonly<{
31
31
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
32
- }, {
32
+ }>, {
33
33
  type: "numeric" | "alphanumeric";
34
- }, {}>;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
35
  export default _default;
@@ -2,7 +2,7 @@ import { DefineComponent } from 'vue';
2
2
  /**
3
3
  * Base component to manually render the slot of component
4
4
  */
5
- declare const _default: DefineComponent<{
5
+ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
6
6
  component: {
7
7
  type: ObjectConstructor;
8
8
  required: true;
@@ -19,7 +19,7 @@ declare const _default: DefineComponent<{
19
19
  type: StringConstructor;
20
20
  default: string;
21
21
  };
22
- }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
23
  component: {
24
24
  type: ObjectConstructor;
25
25
  required: true;
@@ -36,8 +36,8 @@ declare const _default: DefineComponent<{
36
36
  type: StringConstructor;
37
37
  default: string;
38
38
  };
39
- }>>, {
39
+ }>> & Readonly<{}>, {
40
40
  name: string;
41
41
  tag: string;
42
- }, {}>;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
43
43
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.41",
3
+ "version": "0.8.42",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && vue-tsc && vite build",
@@ -53,14 +53,9 @@
53
53
  "@commitlint/cli": "^17.8.1",
54
54
  "@commitlint/config-conventional": "^17.8.1",
55
55
  "@iconify/vue": "^4.1.1",
56
- "@storybook/addon-actions": "^8.3.0",
57
56
  "@storybook/addon-controls": "^8.3.0",
58
57
  "@storybook/addon-docs": "^8.3.0",
59
- "@storybook/addon-essentials": "^8.3.0",
60
- "@storybook/addon-interactions": "^8.3.0",
61
- "@storybook/addon-links": "^8.3.0",
62
58
  "@storybook/manager-api": "^8.3.0",
63
- "@storybook/test": "^8.3.0",
64
59
  "@storybook/theming": "^8.3.0",
65
60
  "@storybook/vue3": "^8.3.0",
66
61
  "@storybook/vue3-vite": "^8.3.0",
@@ -2,10 +2,13 @@ import BaseLazy from "./BaseLazy.vue";
2
2
 
3
3
  export default {
4
4
  title: "Utils/BaseLazy",
5
- description: "BaseLazy component",
6
5
  component: BaseLazy,
7
- args: {
8
- delay: 1000,
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: "A lazy loading component that shows a preview while the main content is loading.",
10
+ },
11
+ },
9
12
  },
10
13
  };
11
14
 
@@ -18,10 +21,10 @@ const Template = (args) => ({
18
21
  },
19
22
  template: `
20
23
  <div>
21
- <BaseLazy v-bind="args">
24
+ <BaseLazy v-for="i in 300" v-bind="args" class="border-b">
22
25
  <template #default>
23
26
  <div class="flex items-center p-3 bg-blue-500 text-blue-900 h-20">
24
- <p class="text-center">Rendered content</p>
27
+ <p class="text-center">Rendered content [{{ i }}]</p>
25
28
  </div>
26
29
  </template>
27
30
  <template #preview>
@@ -34,5 +37,23 @@ const Template = (args) => ({
34
37
  `,
35
38
  });
36
39
 
37
- export const Demo = Template.bind({});
38
- Demo.args = {};
40
+ export const Mount = Template.bind({});
41
+ Mount.args = {
42
+ delay: 2000,
43
+ trigger: 'mount'
44
+ };
45
+
46
+ export const Intersection = Template.bind({});
47
+ Intersection.args = {
48
+ delay: 1000,
49
+ trigger: 'intersection'
50
+ };
51
+
52
+ export const IntersectionMargin = Template.bind({});
53
+ IntersectionMargin.args = {
54
+ trigger: 'intersection',
55
+ intersectionConfig: {
56
+ rootMargin: '500px',
57
+ },
58
+ delay: 1000,
59
+ };
@@ -1,26 +1,80 @@
1
1
  <template>
2
- <slot
2
+ <div ref="nodeRef">
3
+
4
+ <slot
3
5
  v-if="shouldRender"
4
6
  name="default"
5
- />
6
- <slot
7
+ />
8
+ <slot
7
9
  v-else
8
10
  name="preview"
9
- />
11
+ />
12
+ </div>
10
13
  </template>
11
14
 
12
15
  <script lang="ts" setup>
13
16
 
14
- const props = defineProps<{
17
+ import { useIntersectionObserver, UseIntersectionObserverOptions } from '@vueuse/core';
18
+
19
+ const nodeRef = ref<HTMLElement | null>(null);
20
+
21
+ const TRIGGER_MOUNT = 'mount';
22
+ const TRIGGER_INTERSECTION = 'intersection';
23
+
24
+ const props = withDefaults(defineProps<{
15
25
  delay?: number;
16
- }>();
26
+ trigger?: typeof TRIGGER_MOUNT | typeof TRIGGER_INTERSECTION;
27
+ intersectionConfig?: UseIntersectionObserverOptions;
28
+ }>(), {
29
+ delay: 200,
30
+ trigger: TRIGGER_MOUNT,
31
+ intersectionConfig: undefined,
32
+ });
33
+
34
+ const inViewport = ref(false);
35
+ const delayCompleted = ref(false);
36
+ let timeoutId = 0;
37
+
38
+ if (props.trigger === TRIGGER_INTERSECTION) {
17
39
 
18
- const shouldRender = ref(false);
40
+ useIntersectionObserver(
41
+ nodeRef,
42
+ (ctx) => inViewport.value = ctx[0].isIntersecting,
43
+ props.intersectionConfig
44
+ );
19
45
 
20
- onMounted(() => {
21
- setTimeout(() => {
22
- shouldRender.value = true;
46
+ watch(
47
+ inViewport,
48
+ () => {
49
+ startTimeout();
50
+ }
51
+ );
52
+ } else {
53
+ onMounted(() => {
54
+ startTimeout();
55
+ });
56
+ }
57
+
58
+ onUnmounted(() => {
59
+ clearTimeout(timeoutId);
60
+ });
61
+
62
+ function startTimeout() {
63
+ clearTimeout(timeoutId);
64
+
65
+ delayCompleted.value = false;
66
+
67
+ timeoutId = setTimeout(() => {
68
+ delayCompleted.value = true;
23
69
  }, props.delay);
70
+ }
71
+
72
+ const shouldRender = computed(() => {
73
+ if (props.trigger === TRIGGER_MOUNT) {
74
+ return delayCompleted.value;
75
+ }
76
+
77
+ return inViewport.value && delayCompleted.value;
24
78
  });
25
79
 
26
80
  </script>