sprintify-ui 0.10.65 → 0.10.66
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/README.md +266 -266
- package/dist/{BaseCkeditor-D6D4FPEb.js → BaseCkeditor-B4PbYw6a.js} +2 -2
- package/dist/sprintify-ui.es.js +3324 -3461
- package/dist/style.css +3 -3
- package/dist/tailwindcss/button.js +260 -260
- package/dist/tailwindcss/index.js +21 -21
- package/dist/tailwindcss/input.js +22 -22
- package/dist/tailwindcss/overlay.js +12 -12
- package/dist/tailwindcss/table.js +91 -91
- package/dist/tailwindcss/theme.js +52 -52
- package/dist/types/components/BaseActionButtons.vue.d.ts +1 -1
- package/dist/types/components/BaseActionItem.vue.d.ts +7 -10
- package/dist/types/components/BaseAddressForm.vue.d.ts +1 -1
- package/dist/types/components/BaseAlert.vue.d.ts +24 -11
- package/dist/types/components/BaseApp.vue.d.ts +14 -12
- package/dist/types/components/BaseAssign.vue.d.ts +1 -1
- package/dist/types/components/BaseAutocomplete.vue.d.ts +665 -455
- package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +119 -24
- package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +1033 -412
- package/dist/types/components/BaseAvatarGroup.vue.d.ts +1 -1
- package/dist/types/components/BaseBadge.vue.d.ts +23 -11
- package/dist/types/components/BaseBelongsTo.vue.d.ts +998 -411
- package/dist/types/components/BaseBelongsToFetch.vue.d.ts +754 -371
- package/dist/types/components/BaseBoolean.vue.d.ts +1 -1
- package/dist/types/components/BaseBreadcrumbs.vue.d.ts +1 -1
- package/dist/types/components/BaseButton.vue.d.ts +78 -16
- package/dist/types/components/BaseButtonGroup.vue.d.ts +166 -15
- package/dist/types/components/BaseCard.vue.d.ts +26 -12
- package/dist/types/components/BaseCardRow.vue.d.ts +20 -11
- package/dist/types/components/BaseCharacterCounter.vue.d.ts +1 -1
- package/dist/types/components/BaseClipboard.vue.d.ts +45 -13
- package/dist/types/components/BaseCollapse.vue.d.ts +41 -20
- package/dist/types/components/BaseContainer.vue.d.ts +16 -11
- package/dist/types/components/BaseCounter.vue.d.ts +1 -1
- package/dist/types/components/BaseCropper.vue.d.ts +55 -30
- package/dist/types/components/BaseDataIterator.vue.d.ts +43 -42
- package/dist/types/components/BaseDataIteratorSectionBox.vue.d.ts +15 -12
- package/dist/types/components/BaseDataIteratorSectionColumns.vue.d.ts +1 -1
- package/dist/types/components/BaseDataIteratorSectionModal.vue.d.ts +19 -10
- package/dist/types/components/BaseDataTable.vue.d.ts +2090 -738
- package/dist/types/components/BaseDataTableTemplate.vue.d.ts +576 -100
- package/dist/types/components/BaseDatePicker.vue.d.ts +1 -1
- package/dist/types/components/BaseDateSelect.vue.d.ts +1 -1
- package/dist/types/components/BaseDescriptionList.vue.d.ts +12 -12
- package/dist/types/components/BaseDescriptionListItem.vue.d.ts +16 -15
- package/dist/types/components/BaseDialog.vue.d.ts +114 -413
- package/dist/types/components/BaseDisplayRelativeTime.vue.d.ts +55 -13
- package/dist/types/components/BaseDraggable.vue.d.ts +25 -16
- package/dist/types/components/BaseDropdown.vue.d.ts +155 -17
- package/dist/types/components/BaseDropdownAutocomplete.vue.d.ts +131 -16
- package/dist/types/components/BaseField.vue.d.ts +103 -12
- package/dist/types/components/BaseFieldI18n.vue.d.ts +1 -1
- package/dist/types/components/BaseFilePicker.vue.d.ts +35 -16
- package/dist/types/components/BaseFilePickerCrop.vue.d.ts +87 -42
- package/dist/types/components/BaseFileUploader.vue.d.ts +195 -29
- package/dist/types/components/BaseForm.vue.d.ts +161 -20
- package/dist/types/components/BaseGantt.vue.d.ts +1130 -409
- package/dist/types/components/BaseHasMany.vue.d.ts +590 -347
- package/dist/types/components/BaseHasManyFetch.vue.d.ts +602 -251
- package/dist/types/components/BaseHeader.vue.d.ts +1 -1
- package/dist/types/components/BaseIconPicker.vue.d.ts +1 -1
- package/dist/types/components/BaseInputError.vue.d.ts +23 -11
- package/dist/types/components/BaseJsonReaderItem.vue.d.ts +1 -1
- package/dist/types/components/BaseLayoutNotificationItemContent.vue.d.ts +1 -1
- package/dist/types/components/BaseLayoutSidebar.vue.d.ts +124 -16
- package/dist/types/components/BaseLayoutSidebarConfigurable.vue.d.ts +115 -13
- package/dist/types/components/BaseLayoutStacked.vue.d.ts +69 -22
- package/dist/types/components/BaseLayoutStackedConfigurable.vue.d.ts +120 -10
- package/dist/types/components/BaseLazy.vue.d.ts +20 -15
- package/dist/types/components/BaseMediaGallery.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaGalleryItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaLibrary.vue.d.ts +234 -34
- package/dist/types/components/BaseMediaListItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaPicturesItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMenu.vue.d.ts +233 -30
- package/dist/types/components/BaseMenuItem.vue.d.ts +1 -1
- package/dist/types/components/BaseModalCenter.vue.d.ts +88 -12
- package/dist/types/components/BaseModalSide.vue.d.ts +85 -12
- package/dist/types/components/BaseNavbar.vue.d.ts +88 -22
- package/dist/types/components/BaseNavbarItem.vue.d.ts +1 -1
- package/dist/types/components/BaseNavbarItemContent.vue.d.ts +1 -1
- package/dist/types/components/BaseNavbarSideItem.vue.d.ts +1 -1
- package/dist/types/components/BaseNavbarSideItemContent.vue.d.ts +1 -1
- package/dist/types/components/BasePagination.vue.d.ts +1 -1
- package/dist/types/components/BaseRadioGroup.vue.d.ts +113 -13
- package/dist/types/components/BaseReadMore.vue.d.ts +31 -12
- package/dist/types/components/BaseRichText.vue.d.ts +1 -1
- package/dist/types/components/BaseSelect.vue.d.ts +149 -12
- package/dist/types/components/BaseShortcut.vue.d.ts +1 -1
- package/dist/types/components/BaseSideNavigation.vue.d.ts +11 -12
- package/dist/types/components/BaseSideNavigationItem.vue.d.ts +22 -13
- package/dist/types/components/BaseSkeleton.vue.d.ts +3 -3
- package/dist/types/components/BaseStepper.vue.d.ts +1 -1
- package/dist/types/components/BaseSwitch.vue.d.ts +122 -13
- package/dist/types/components/BaseSystemAlert.vue.d.ts +58 -11
- package/dist/types/components/BaseTabItem.vue.d.ts +35 -18
- package/dist/types/components/BaseTable.vue.d.ts +29 -14
- package/dist/types/components/BaseTableBody.vue.d.ts +9 -12
- package/dist/types/components/BaseTableCell.vue.d.ts +40 -15
- package/dist/types/components/BaseTableColumn.vue.d.ts +3 -3
- package/dist/types/components/BaseTableHead.vue.d.ts +14 -12
- package/dist/types/components/BaseTableHeader.vue.d.ts +46 -17
- package/dist/types/components/BaseTableRow.vue.d.ts +40 -13
- package/dist/types/components/BaseTabs.vue.d.ts +21 -15
- package/dist/types/components/BaseTagAutocomplete.vue.d.ts +602 -203
- package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +807 -348
- package/dist/types/components/BaseTextareaAutoresize.vue.d.ts +1 -1
- package/dist/types/components/BaseTimeline.vue.d.ts +1 -1
- package/dist/types/components/BaseTimelineItem.vue.d.ts +1 -1
- package/dist/types/components/BaseToast.vue.d.ts +1 -1
- package/dist/types/components/BaseTooltip.vue.d.ts +41 -15
- package/dist/types/components/BaseUniqueCode.vue.d.ts +1 -1
- package/dist/types/stories/PageInputSizes.vue.d.ts +1 -1
- package/dist/types/stories/PageShow.vue.d.ts +1 -1
- package/dist/types/svg/BaseEmptyState.vue.d.ts +1 -1
- package/dist/types/svg/BaseSpinnerSmall.vue.d.ts +1 -1
- package/package.json +135 -135
- package/src/assets/base-cropper.css +61 -61
- package/src/assets/base-date-picker.css +4 -4
- package/src/assets/base-rich-text.css +270 -270
- package/src/assets/base-spinner.css +18 -18
- package/src/assets/base-tabs.css +4 -4
- package/src/assets/base-time-picker.css +9 -9
- package/src/assets/flatpickr.css +247 -247
- package/src/assets/form.css +6 -6
- package/src/assets/google-pac.css +25 -25
- package/src/assets/main.css +56 -56
- package/src/assets/tailwind.css +2 -2
- package/src/changelog.mdx +6 -6
- package/src/components/BaseActionButtons.vue +76 -76
- package/src/components/BaseActionItem.vue +80 -80
- package/src/components/BaseActionItemButton.vue +75 -75
- package/src/components/BaseAddressForm.stories.js +114 -114
- package/src/components/BaseAddressForm.vue +382 -382
- package/src/components/BaseAlert.stories.js +75 -75
- package/src/components/BaseAlert.vue +101 -101
- package/src/components/BaseApp.vue +16 -16
- package/src/components/BaseAppDialogs.vue +126 -126
- package/src/components/BaseAppSnackbars.vue +40 -40
- package/src/components/BaseAssign.mdx +98 -98
- package/src/components/BaseAssign.stories.js +78 -78
- package/src/components/BaseAssign.vue +366 -366
- package/src/components/BaseAutocomplete.stories.js +243 -243
- package/src/components/BaseAutocomplete.vue +603 -603
- package/src/components/BaseAutocompleteDrawer.vue +386 -386
- package/src/components/BaseAutocompleteFetch.stories.js +224 -224
- package/src/components/BaseAutocompleteFetch.vue +314 -314
- package/src/components/BaseAvatar.stories.js +39 -39
- package/src/components/BaseAvatar.vue +164 -164
- package/src/components/BaseAvatarGroup.stories.js +71 -71
- package/src/components/BaseAvatarGroup.vue +148 -148
- package/src/components/BaseBadge.stories.js +130 -130
- package/src/components/BaseBadge.vue +97 -97
- package/src/components/BaseBelongsTo.stories.js +220 -220
- package/src/components/BaseBelongsTo.vue +164 -164
- package/src/components/BaseBelongsToFetch.stories.js +223 -223
- package/src/components/BaseBelongsToFetch.vue +213 -213
- package/src/components/BaseBoolean.stories.js +35 -35
- package/src/components/BaseBoolean.vue +26 -26
- package/src/components/BaseBreadcrumbs.stories.js +50 -50
- package/src/components/BaseBreadcrumbs.vue +109 -109
- package/src/components/BaseButton.stories.js +126 -126
- package/src/components/BaseButton.vue +279 -279
- package/src/components/BaseButtonGroup.stories.js +114 -114
- package/src/components/BaseButtonGroup.vue +193 -193
- package/src/components/BaseCard.stories.js +63 -63
- package/src/components/BaseCard.vue +49 -49
- package/src/components/BaseCardRow.vue +53 -53
- package/src/components/BaseCharacterCounter.stories.js +30 -30
- package/src/components/BaseCharacterCounter.vue +64 -64
- package/src/components/BaseCkeditor.vue +154 -154
- package/src/components/BaseClipboard.stories.js +55 -55
- package/src/components/BaseClipboard.vue +105 -105
- package/src/components/BaseCollapse.stories.js +168 -168
- package/src/components/BaseCollapse.vue +98 -98
- package/src/components/BaseColor.stories.js +66 -66
- package/src/components/BaseColor.vue +155 -155
- package/src/components/BaseContainer.stories.js +34 -34
- package/src/components/BaseContainer.vue +64 -64
- package/src/components/BaseCounter.stories.js +47 -47
- package/src/components/BaseCounter.vue +83 -83
- package/src/components/BaseCropper.stories.js +113 -113
- package/src/components/BaseCropper.vue +390 -390
- package/src/components/BaseCropperModal.stories.js +54 -54
- package/src/components/BaseCropperModal.vue +143 -143
- package/src/components/BaseDataIterator.stories.js +292 -292
- package/src/components/BaseDataIterator.vue +986 -986
- package/src/components/BaseDataIteratorSectionBox.vue +36 -36
- package/src/components/BaseDataIteratorSectionButton.vue +42 -42
- package/src/components/BaseDataIteratorSectionColumns.vue +150 -150
- package/src/components/BaseDataIteratorSectionModal.vue +41 -41
- package/src/components/BaseDataTable.stories.js +393 -393
- package/src/components/BaseDataTable.vue +966 -966
- package/src/components/BaseDataTableRowAction.vue +70 -70
- package/src/components/BaseDataTableTemplate.vue +831 -838
- package/src/components/BaseDatePicker.stories.js +166 -166
- package/src/components/BaseDatePicker.vue +372 -372
- package/src/components/BaseDateSelect.stories.js +68 -68
- package/src/components/BaseDateSelect.vue +222 -222
- package/src/components/BaseDescriptionList.stories.js +35 -35
- package/src/components/BaseDescriptionList.vue +13 -13
- package/src/components/BaseDescriptionListItem.vue +47 -47
- package/src/components/BaseDialog.stories.js +95 -95
- package/src/components/BaseDialog.vue +221 -221
- package/src/components/BaseDisplayRelativeTime.stories.js +47 -47
- package/src/components/BaseDisplayRelativeTime.vue +126 -126
- package/src/components/BaseDraggable.stories.js +34 -34
- package/src/components/BaseDraggable.vue +111 -111
- package/src/components/BaseDropdown.stories.js +164 -164
- package/src/components/BaseDropdown.vue +74 -74
- package/src/components/BaseDropdownAutocomplete.stories.js +208 -208
- package/src/components/BaseDropdownAutocomplete.vue +203 -203
- package/src/components/BaseField.vue +151 -151
- package/src/components/BaseFieldI18n.stories.js +37 -37
- package/src/components/BaseFieldI18n.vue +170 -170
- package/src/components/BaseFilePicker.stories.js +84 -84
- package/src/components/BaseFilePicker.vue +163 -163
- package/src/components/BaseFilePickerCrop.stories.js +135 -135
- package/src/components/BaseFilePickerCrop.vue +130 -130
- package/src/components/BaseFileUploader.stories.js +101 -101
- package/src/components/BaseFileUploader.vue +185 -185
- package/src/components/BaseForm.mdx +87 -87
- package/src/components/BaseForm.stories.js +133 -133
- package/src/components/BaseForm.vue +372 -372
- package/src/components/BaseGantt.stories.js +145 -145
- package/src/components/BaseGantt.vue +384 -384
- package/src/components/BaseHasMany.stories.js +211 -211
- package/src/components/BaseHasMany.vue +135 -135
- package/src/components/BaseHasManyFetch.stories.js +278 -278
- package/src/components/BaseHasManyFetch.vue +222 -222
- package/src/components/BaseHeader.stories.js +137 -137
- package/src/components/BaseHeader.vue +141 -141
- package/src/components/BaseIconPicker.stories.js +22 -22
- package/src/components/BaseIconPicker.vue +225 -225
- package/src/components/BaseInput.stories.js +202 -202
- package/src/components/BaseInput.vue +402 -402
- package/src/components/BaseInputError.vue +39 -39
- package/src/components/BaseInputLabel.stories.js +36 -36
- package/src/components/BaseInputLabel.vue +83 -83
- package/src/components/BaseInputPercent.stories.js +66 -66
- package/src/components/BaseInputPercent.vue +139 -139
- package/src/components/BaseJsonReader.stories.js +120 -120
- package/src/components/BaseJsonReader.vue +51 -51
- package/src/components/BaseJsonReaderItem.vue +119 -119
- package/src/components/BaseLayoutNotificationDropdown.vue +153 -153
- package/src/components/BaseLayoutNotificationItem.vue +53 -53
- package/src/components/BaseLayoutNotificationItemContent.vue +41 -41
- package/src/components/BaseLayoutSidebar.vue +300 -300
- package/src/components/BaseLayoutSidebarConfigurable.stories.js +217 -217
- package/src/components/BaseLayoutSidebarConfigurable.vue +202 -202
- package/src/components/BaseLayoutStacked.vue +78 -78
- package/src/components/BaseLayoutStackedConfigurable.stories.js +181 -181
- package/src/components/BaseLayoutStackedConfigurable.vue +196 -196
- package/src/components/BaseLazy.stories.js +59 -59
- package/src/components/BaseLazy.vue +80 -80
- package/src/components/BaseLoadingCover.stories.js +55 -55
- package/src/components/BaseLoadingCover.vue +101 -101
- package/src/components/BaseMediaGallery.vue +96 -96
- package/src/components/BaseMediaGalleryItem.vue +101 -101
- package/src/components/BaseMediaItem.stories.js +41 -41
- package/src/components/BaseMediaItem.vue +80 -80
- package/src/components/BaseMediaLibrary.stories.js +267 -267
- package/src/components/BaseMediaLibrary.vue +357 -357
- package/src/components/BaseMediaList.vue +67 -67
- package/src/components/BaseMediaListItem.vue +213 -213
- package/src/components/BaseMediaPictures.vue +64 -64
- package/src/components/BaseMediaPicturesItem.vue +100 -100
- package/src/components/BaseMediaPreview.stories.js +72 -72
- package/src/components/BaseMediaPreview.vue +106 -106
- package/src/components/BaseMenu.stories.js +134 -134
- package/src/components/BaseMenu.vue +187 -187
- package/src/components/BaseMenuItem.vue +177 -177
- package/src/components/BaseModalCenter.stories.js +68 -68
- package/src/components/BaseModalCenter.vue +128 -128
- package/src/components/BaseModalSide.stories.js +61 -61
- package/src/components/BaseModalSide.vue +130 -130
- package/src/components/BaseNavbar.stories.js +152 -152
- package/src/components/BaseNavbar.vue +191 -191
- package/src/components/BaseNavbarItem.vue +108 -108
- package/src/components/BaseNavbarItemContent.vue +124 -124
- package/src/components/BaseNavbarSideItem.vue +187 -187
- package/src/components/BaseNavbarSideItemContent.vue +126 -126
- package/src/components/BasePagination.stories.js +35 -35
- package/src/components/BasePagination.vue +266 -266
- package/src/components/BasePanel.stories.js +56 -56
- package/src/components/BasePanel.vue +42 -42
- package/src/components/BasePassword.stories.js +80 -80
- package/src/components/BasePassword.vue +87 -87
- package/src/components/BaseProgressCircle.stories.js +27 -27
- package/src/components/BaseProgressCircle.vue +80 -80
- package/src/components/BaseRadioGroup.stories.js +87 -87
- package/src/components/BaseRadioGroup.vue +124 -124
- package/src/components/BaseReadMore.stories.js +30 -30
- package/src/components/BaseReadMore.vue +73 -73
- package/src/components/BaseRichText.stories.js +90 -90
- package/src/components/BaseRichText.vue +87 -87
- package/src/components/BaseScrollColumn.vue +128 -128
- package/src/components/BaseSelect.stories.js +151 -151
- package/src/components/BaseSelect.vue +241 -241
- package/src/components/BaseShortcut.stories.js +100 -100
- package/src/components/BaseShortcut.vue +114 -114
- package/src/components/BaseSideNavigation.stories.js +85 -85
- package/src/components/BaseSideNavigation.vue +32 -32
- package/src/components/BaseSideNavigationItem.vue +99 -99
- package/src/components/BaseSkeleton.stories.js +36 -36
- package/src/components/BaseSkeleton.vue +40 -40
- package/src/components/BaseStatistic.stories.js +51 -51
- package/src/components/BaseStatistic.vue +98 -98
- package/src/components/BaseStepper.stories.js +94 -94
- package/src/components/BaseStepper.vue +72 -72
- package/src/components/BaseStepperItem.stories.js +65 -65
- package/src/components/BaseStepperItem.vue +149 -149
- package/src/components/BaseSwitch.stories.js +133 -133
- package/src/components/BaseSwitch.vue +228 -226
- package/src/components/BaseSystemAlert.stories.js +63 -63
- package/src/components/BaseSystemAlert.vue +89 -89
- package/src/components/BaseTabItem.vue +192 -192
- package/src/components/BaseTable.stories.js +214 -214
- package/src/components/BaseTable.vue +111 -111
- package/src/components/BaseTableBody.vue +14 -14
- package/src/components/BaseTableCell.vue +204 -204
- package/src/components/BaseTableColumn.vue +140 -140
- package/src/components/BaseTableHead.vue +38 -38
- package/src/components/BaseTableHeader.vue +139 -139
- package/src/components/BaseTableRow.vue +197 -197
- package/src/components/BaseTabs.stories.js +165 -165
- package/src/components/BaseTabs.vue +203 -203
- package/src/components/BaseTagAutocomplete.stories.js +271 -271
- package/src/components/BaseTagAutocomplete.vue +565 -565
- package/src/components/BaseTagAutocompleteFetch.stories.js +211 -211
- package/src/components/BaseTagAutocompleteFetch.vue +237 -237
- package/src/components/BaseTextarea.stories.js +81 -81
- package/src/components/BaseTextarea.vue +138 -138
- package/src/components/BaseTextareaAutoresize.stories.js +125 -125
- package/src/components/BaseTextareaAutoresize.vue +187 -187
- package/src/components/BaseTimePicker.stories.js +68 -68
- package/src/components/BaseTimePicker.vue +379 -379
- package/src/components/BaseTimeline.stories.js +55 -55
- package/src/components/BaseTimeline.vue +38 -38
- package/src/components/BaseTimelineItem.stories.js +77 -77
- package/src/components/BaseTimelineItem.vue +90 -90
- package/src/components/BaseToast.stories.js +50 -50
- package/src/components/BaseToast.vue +43 -43
- package/src/components/BaseTooltip.stories.js +65 -65
- package/src/components/BaseTooltip.vue +93 -93
- package/src/components/BaseUniqueCode.stories.js +36 -36
- package/src/components/BaseUniqueCode.vue +183 -183
- package/src/components/SlotComponent.ts +37 -37
- package/src/components/index.ts +222 -222
- package/src/composables/breakpoints.ts +94 -94
- package/src/composables/clickOutside.ts +80 -80
- package/src/composables/field.ts +156 -156
- package/src/composables/hasOptions.ts +86 -86
- package/src/composables/inputSize.ts +35 -35
- package/src/composables/isLastColumn.ts +30 -30
- package/src/composables/mediaQuery.ts +42 -42
- package/src/composables/modal.ts +73 -73
- package/src/composables/paginatedData.ts +76 -76
- package/src/composables/tooltip.ts +84 -84
- package/src/constants/MyConstants.ts +1 -1
- package/src/constants/index.ts +5 -5
- package/src/env.d.ts +15 -15
- package/src/i18n/index.ts +60 -60
- package/src/index.ts +138 -138
- package/src/lang/en.json +101 -101
- package/src/lang/fr.json +101 -101
- package/src/services/gantt/format.ts +133 -133
- package/src/services/gantt/timescale.ts +250 -250
- package/src/services/gantt/types.ts +81 -81
- package/src/services/table/classes.ts +37 -37
- package/src/services/table/customKeyActions.ts +2 -2
- package/src/services/table/types.ts +27 -27
- package/src/stores/dialogs.ts +48 -48
- package/src/stores/i18n.ts +14 -14
- package/src/stores/snackbars.ts +47 -47
- package/src/stores/systemAlerts.ts +32 -32
- package/src/stories/InputSizes.stories.js +21 -21
- package/src/stories/List.stories.js +136 -136
- package/src/stories/PageInputSizes.vue +228 -228
- package/src/stories/PageShow.vue +423 -423
- package/src/stories/Show.stories.js +21 -21
- package/src/svg/BaseEmptyState.vue +38 -38
- package/src/svg/BaseSpinnerLarge.vue +40 -40
- package/src/svg/BaseSpinnerSmall.vue +13 -13
- package/src/types/Color.ts +9 -9
- package/src/types/Country.ts +4 -4
- package/src/types/ImagePickerResult.ts +5 -5
- package/src/types/Media.ts +10 -10
- package/src/types/Notification.ts +11 -11
- package/src/types/Region.ts +5 -5
- package/src/types/Status.ts +5 -5
- package/src/types/StepperItem.ts +8 -8
- package/src/types/ToolbarOption.ts +1 -1
- package/src/types/UploadedFile.ts +11 -11
- package/src/types/User.ts +7 -7
- package/src/types/index.ts +302 -302
- package/src/utils/blob.ts +30 -30
- package/src/utils/colors.ts +239 -239
- package/src/utils/cropper/avatar.ts +33 -33
- package/src/utils/cropper/cover.ts +41 -41
- package/src/utils/cropper/presetInterface.ts +16 -16
- package/src/utils/cropper/presets.ts +7 -7
- package/src/utils/deepIncludes.ts +76 -76
- package/src/utils/fileSizeFormat.ts +15 -15
- package/src/utils/fileValidations.ts +26 -26
- package/src/utils/getApiData.ts +11 -11
- package/src/utils/index.ts +18 -18
- package/src/utils/resizeImageFromURI.ts +118 -118
- package/src/utils/scrollPreventer.ts +11 -11
- package/src/utils/sizeBehaviors.ts +3 -3
- package/src/utils/sizes.ts +38 -38
- package/src/utils/slots.ts +12 -12
- package/src/utils/storage.ts +36 -36
- package/src/utils/toHumanList.ts +20 -20
- package/src/utils/uuid.ts +7 -7
|
@@ -1,384 +1,384 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="flex"
|
|
4
|
-
:style="{
|
|
5
|
-
maxHeight: `${maxHeight}px`,
|
|
6
|
-
}"
|
|
7
|
-
>
|
|
8
|
-
<!-- Sidebar -->
|
|
9
|
-
<div
|
|
10
|
-
class="border-r border-slate-300 relative shrink-0"
|
|
11
|
-
:style="{ minWidth: `${SIDEBAR_WIDTH}px` }"
|
|
12
|
-
>
|
|
13
|
-
<!-- Top-left Corner-->
|
|
14
|
-
<div
|
|
15
|
-
:style="{
|
|
16
|
-
height: `${HEADER_HEIGHT}px`,
|
|
17
|
-
zIndex: 1
|
|
18
|
-
}"
|
|
19
|
-
class="border-b relative border-slate-300 bg-white"
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
<!-- Sidebar Items-->
|
|
23
|
-
|
|
24
|
-
<ul
|
|
25
|
-
class=""
|
|
26
|
-
:style="{
|
|
27
|
-
transform: `translateY(${scrollY}px)`,
|
|
28
|
-
}"
|
|
29
|
-
>
|
|
30
|
-
<li
|
|
31
|
-
v-for="row in rowsInternal"
|
|
32
|
-
:key="row.id"
|
|
33
|
-
class="border-b border-slate-300 flex last:border-none"
|
|
34
|
-
:style="{
|
|
35
|
-
height: `${props.rowHeight}px`,
|
|
36
|
-
}"
|
|
37
|
-
@click="$emit('row:click', row)"
|
|
38
|
-
>
|
|
39
|
-
<slot
|
|
40
|
-
name="sidebarItem"
|
|
41
|
-
:row="row"
|
|
42
|
-
>
|
|
43
|
-
<div class="px-2 flex items-center">
|
|
44
|
-
<p class="font-semibold text-sm">
|
|
45
|
-
{{ row.name }}
|
|
46
|
-
</p>
|
|
47
|
-
</div>
|
|
48
|
-
</slot>
|
|
49
|
-
</li>
|
|
50
|
-
</ul>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<!-- Content -->
|
|
54
|
-
|
|
55
|
-
<div
|
|
56
|
-
ref="contentRef"
|
|
57
|
-
class="grow flex flex-col items-stretch relative overflow-hidden"
|
|
58
|
-
>
|
|
59
|
-
<!-- Time Scale Header -->
|
|
60
|
-
|
|
61
|
-
<div
|
|
62
|
-
class="bg-white border-b shrink-0 border-slate-300 w-full"
|
|
63
|
-
:style="{
|
|
64
|
-
zIndex: 1,
|
|
65
|
-
height: HEADER_HEIGHT + 'px',
|
|
66
|
-
width: `${width}px`,
|
|
67
|
-
transform: `translateX(${scrollX}px)`,
|
|
68
|
-
}"
|
|
69
|
-
>
|
|
70
|
-
<svg
|
|
71
|
-
:view-box="`${width} ${HEADER_HEIGHT}`"
|
|
72
|
-
:width="width"
|
|
73
|
-
:height="HEADER_HEIGHT"
|
|
74
|
-
>
|
|
75
|
-
<g
|
|
76
|
-
v-for="group in groups"
|
|
77
|
-
:key="group.x"
|
|
78
|
-
>
|
|
79
|
-
<text
|
|
80
|
-
:x="group.labelX"
|
|
81
|
-
:y="15"
|
|
82
|
-
class="text-[12px] font-semibold text-slate-900"
|
|
83
|
-
fill="currentColor"
|
|
84
|
-
:text-anchor="group.labelTextAnchor"
|
|
85
|
-
>
|
|
86
|
-
{{ group.label }}
|
|
87
|
-
</text>
|
|
88
|
-
<line
|
|
89
|
-
:x1="group.x + group.width"
|
|
90
|
-
:x2="group.x + group.width"
|
|
91
|
-
:y1="0"
|
|
92
|
-
:y2="HEADER_HEIGHT"
|
|
93
|
-
:stroke="slate[300]"
|
|
94
|
-
></line>
|
|
95
|
-
</g>
|
|
96
|
-
|
|
97
|
-
<g
|
|
98
|
-
v-for="tick in ticks"
|
|
99
|
-
:key="tick.x"
|
|
100
|
-
:transform="`translate(${tick.x}, 0)`"
|
|
101
|
-
>
|
|
102
|
-
<text
|
|
103
|
-
:x="tick.align == 'middle' ? tick.width / 2 : 0"
|
|
104
|
-
:y="33"
|
|
105
|
-
class="text-[11px] text-slate-500"
|
|
106
|
-
fill="currentColor"
|
|
107
|
-
text-anchor="middle"
|
|
108
|
-
>
|
|
109
|
-
{{ tick.label }}
|
|
110
|
-
</text>
|
|
111
|
-
|
|
112
|
-
<line
|
|
113
|
-
v-if="tick.align == 'middle'"
|
|
114
|
-
:x1="tick.width - tick.width"
|
|
115
|
-
:x2="tick.width - tick.width"
|
|
116
|
-
:y1="24"
|
|
117
|
-
:y2="HEADER_HEIGHT"
|
|
118
|
-
:stroke="tick.thick ? slate[400] : slate[300]"
|
|
119
|
-
></line>
|
|
120
|
-
</g>
|
|
121
|
-
</svg>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
<div
|
|
125
|
-
v-if="currentGroup"
|
|
126
|
-
class="absolute top-0 left-0 inline-flex"
|
|
127
|
-
:style="{
|
|
128
|
-
zIndex: 1,
|
|
129
|
-
}"
|
|
130
|
-
>
|
|
131
|
-
<div class="text-xs font-semibold pt-[3px] bg-white px-2">
|
|
132
|
-
{{ currentGroup.label }}
|
|
133
|
-
</div>
|
|
134
|
-
<div class="bg-gradient-to-r from-white to-transparent w-20" />
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
|
-
<!-- Gantt Items -->
|
|
138
|
-
|
|
139
|
-
<ul
|
|
140
|
-
ref="itemsRef"
|
|
141
|
-
class="relative w-full overflow-scroll grow"
|
|
142
|
-
>
|
|
143
|
-
<li
|
|
144
|
-
v-for="row in rowsInternal"
|
|
145
|
-
:key="row.id"
|
|
146
|
-
class="border-b relative border-slate-300 last:border-none"
|
|
147
|
-
:style="{
|
|
148
|
-
height: `${props.rowHeight}px`,
|
|
149
|
-
width: `${width}px`,
|
|
150
|
-
}"
|
|
151
|
-
>
|
|
152
|
-
<button
|
|
153
|
-
v-for="item in row.items"
|
|
154
|
-
:key="item.id"
|
|
155
|
-
type="button"
|
|
156
|
-
class="absolute flex"
|
|
157
|
-
:style="{
|
|
158
|
-
transform: `translate(${item.x}px, ${item.y}px)`,
|
|
159
|
-
height: item.height + 'px',
|
|
160
|
-
width: item.width + 'px',
|
|
161
|
-
}"
|
|
162
|
-
:title="`${item.name} - ${item.start.toFormat('yyyy-MM-dd HH:mm:ss')} - ${item.end.toFormat('yyyy-MM-dd HH:mm:ss')}`"
|
|
163
|
-
@click="$emit('item:click', item)"
|
|
164
|
-
>
|
|
165
|
-
<slot
|
|
166
|
-
name="item"
|
|
167
|
-
:item="item"
|
|
168
|
-
>
|
|
169
|
-
<div
|
|
170
|
-
:style="{
|
|
171
|
-
backgroundColor: item.color,
|
|
172
|
-
}"
|
|
173
|
-
class="flex w-full h-full items-center rounded hover:opacity-80 duration-200"
|
|
174
|
-
>
|
|
175
|
-
<p
|
|
176
|
-
class="text-white text-xs font-medium px-2 py-1 truncate"
|
|
177
|
-
style="text-shadow: 0.5px 0.5px rgba(0,0,0,0.1);"
|
|
178
|
-
>
|
|
179
|
-
{{ item.name }}
|
|
180
|
-
</p>
|
|
181
|
-
</div>
|
|
182
|
-
</slot>
|
|
183
|
-
</button>
|
|
184
|
-
</li>
|
|
185
|
-
</ul>
|
|
186
|
-
|
|
187
|
-
<!-- Vertical lines -->
|
|
188
|
-
|
|
189
|
-
<div
|
|
190
|
-
class="absolute left-0 pointer-events-none"
|
|
191
|
-
:style="{
|
|
192
|
-
top: `${HEADER_HEIGHT}px`,
|
|
193
|
-
width: `${width}px`,
|
|
194
|
-
height: height + 'px',
|
|
195
|
-
transform: `translateX(${scrollX}px)`,
|
|
196
|
-
}"
|
|
197
|
-
>
|
|
198
|
-
<svg
|
|
199
|
-
:view-box="`${width} ${height}`"
|
|
200
|
-
:width="width"
|
|
201
|
-
:height="height"
|
|
202
|
-
>
|
|
203
|
-
<g
|
|
204
|
-
v-for="group in groups"
|
|
205
|
-
:key="group.x"
|
|
206
|
-
>
|
|
207
|
-
<line
|
|
208
|
-
:x1="group.x"
|
|
209
|
-
:x2="group.x"
|
|
210
|
-
y1="0"
|
|
211
|
-
:y2="height"
|
|
212
|
-
stroke="black"
|
|
213
|
-
:opacity="0.2"
|
|
214
|
-
></line>
|
|
215
|
-
</g>
|
|
216
|
-
<g
|
|
217
|
-
v-for="tick in ticks"
|
|
218
|
-
:key="tick.x"
|
|
219
|
-
>
|
|
220
|
-
<line
|
|
221
|
-
:x1="tick.x"
|
|
222
|
-
:x2="tick.x"
|
|
223
|
-
:y1="0"
|
|
224
|
-
:y2="height"
|
|
225
|
-
stroke="black"
|
|
226
|
-
:opacity="tick.thick ? 0.2 : 0.05"
|
|
227
|
-
></line>
|
|
228
|
-
</g>
|
|
229
|
-
</svg>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<!-- Now line -->
|
|
233
|
-
|
|
234
|
-
<div
|
|
235
|
-
v-if="nowLine"
|
|
236
|
-
class="absolute left-0 pointer-events-none"
|
|
237
|
-
:style="{
|
|
238
|
-
top: `${HEADER_HEIGHT}px`,
|
|
239
|
-
width: `${width}px`,
|
|
240
|
-
height: height + 'px',
|
|
241
|
-
transform: `translateX(${scrollX}px)`,
|
|
242
|
-
}"
|
|
243
|
-
>
|
|
244
|
-
<svg
|
|
245
|
-
:view-box="`${width} ${height}`"
|
|
246
|
-
:width="width"
|
|
247
|
-
:height="height"
|
|
248
|
-
>
|
|
249
|
-
<line
|
|
250
|
-
:x1="nowLine.x"
|
|
251
|
-
:x2="nowLine.x"
|
|
252
|
-
y1="0"
|
|
253
|
-
:y2="height"
|
|
254
|
-
stroke="red"
|
|
255
|
-
stroke-width="2"
|
|
256
|
-
style="filter: drop-shadow(0px 0px 2px rgb(0 0 0 / 0.1));"
|
|
257
|
-
></line>
|
|
258
|
-
</svg>
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
</div>
|
|
262
|
-
</template>
|
|
263
|
-
|
|
264
|
-
<script lang="ts" setup>
|
|
265
|
-
import { useElementSize, useScroll } from '@vueuse/core';
|
|
266
|
-
import { Format } from '@/services/gantt/format';
|
|
267
|
-
import { FormatConfig, GanttRow, GanttRowFormatted, Group, Tick, NowLine } from '@/services/gantt/types';
|
|
268
|
-
import { debounce } from 'lodash';
|
|
269
|
-
import { slate } from 'tailwindcss/colors';
|
|
270
|
-
|
|
271
|
-
const props = withDefaults(defineProps<{
|
|
272
|
-
rows: GanttRow[],
|
|
273
|
-
rowHeight?: number,
|
|
274
|
-
rowPadding?: number,
|
|
275
|
-
maxHeight?: number,
|
|
276
|
-
includeToday?: boolean,
|
|
277
|
-
}>(), {
|
|
278
|
-
rowHeight: 40,
|
|
279
|
-
rowPadding: 4,
|
|
280
|
-
maxHeight: undefined,
|
|
281
|
-
includeToday: true,
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
defineEmits([
|
|
285
|
-
'item:click',
|
|
286
|
-
'row:click',
|
|
287
|
-
]);
|
|
288
|
-
|
|
289
|
-
// Config
|
|
290
|
-
|
|
291
|
-
const SIDEBAR_WIDTH = 120;
|
|
292
|
-
const HEADER_HEIGHT = 40;
|
|
293
|
-
|
|
294
|
-
// Init
|
|
295
|
-
|
|
296
|
-
const contentRef = ref<HTMLDivElement | null>(null);
|
|
297
|
-
const contentSize = useElementSize(contentRef);
|
|
298
|
-
const itemsRef = ref<HTMLUListElement | null>(null);
|
|
299
|
-
|
|
300
|
-
const width = ref(800);
|
|
301
|
-
const height = ref(100);
|
|
302
|
-
|
|
303
|
-
const rowsInternal = ref<GanttRowFormatted[]>([]);
|
|
304
|
-
const groups = ref<Group[]>([]);
|
|
305
|
-
const ticks = ref<Tick[]>([]);
|
|
306
|
-
const nowLine = ref<NowLine | null>(null);
|
|
307
|
-
|
|
308
|
-
const config = computed<FormatConfig>(() => {
|
|
309
|
-
return {
|
|
310
|
-
rows: props.rows,
|
|
311
|
-
minWidth: contentSize.width.value,
|
|
312
|
-
rowHeight: props.rowHeight,
|
|
313
|
-
rowPadding: props.rowPadding,
|
|
314
|
-
includeToday: props.includeToday,
|
|
315
|
-
};
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
function init() {
|
|
319
|
-
const format = (new Format(config.value)).handle();
|
|
320
|
-
|
|
321
|
-
width.value = format.width;
|
|
322
|
-
height.value = format.height;
|
|
323
|
-
|
|
324
|
-
rowsInternal.value = format.rows;
|
|
325
|
-
|
|
326
|
-
groups.value = format.groups;
|
|
327
|
-
ticks.value = format.ticks;
|
|
328
|
-
|
|
329
|
-
nowLine.value = format.nowLine;
|
|
330
|
-
|
|
331
|
-
// Scroll to now line
|
|
332
|
-
|
|
333
|
-
nextTick(() => {
|
|
334
|
-
if (nowLine.value && itemsRef.value) {
|
|
335
|
-
const scrollLeft = nowLine.value.x + contentSize.width.value / 2;
|
|
336
|
-
itemsRef.value.scrollLeft = scrollLeft;
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Init triggers
|
|
342
|
-
|
|
343
|
-
const initDebounced = debounce(init, 200);
|
|
344
|
-
|
|
345
|
-
onMounted(() => {
|
|
346
|
-
// Wait for the contentSize to be available
|
|
347
|
-
setTimeout(() => {
|
|
348
|
-
init();
|
|
349
|
-
watch(() => config.value, initDebounced, { deep: true });
|
|
350
|
-
}, 1);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
// Scroll
|
|
354
|
-
|
|
355
|
-
const scrollX = ref(0);
|
|
356
|
-
const scrollY = ref(0);
|
|
357
|
-
|
|
358
|
-
useScroll(itemsRef, {
|
|
359
|
-
onScroll: (e: any) => {
|
|
360
|
-
if (!e.target) return;
|
|
361
|
-
|
|
362
|
-
scrollX.value = -e.target.scrollLeft;
|
|
363
|
-
scrollY.value = -e.target.scrollTop;
|
|
364
|
-
},
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// Current Group
|
|
368
|
-
|
|
369
|
-
const currentGroup = computed<Group | undefined>(() => {
|
|
370
|
-
|
|
371
|
-
const offsetLeft = -scrollX.value;
|
|
372
|
-
|
|
373
|
-
return groups.value
|
|
374
|
-
// Sort by x descending
|
|
375
|
-
.sort((a, b) => {
|
|
376
|
-
return b.x - a.x;
|
|
377
|
-
})
|
|
378
|
-
.find((group) => {
|
|
379
|
-
// - 1 to avoid flashing when scrolling
|
|
380
|
-
return group.x <= offsetLeft && group.x + group.width >= offsetLeft - 1;
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex"
|
|
4
|
+
:style="{
|
|
5
|
+
maxHeight: `${maxHeight}px`,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<!-- Sidebar -->
|
|
9
|
+
<div
|
|
10
|
+
class="border-r border-slate-300 relative shrink-0"
|
|
11
|
+
:style="{ minWidth: `${SIDEBAR_WIDTH}px` }"
|
|
12
|
+
>
|
|
13
|
+
<!-- Top-left Corner-->
|
|
14
|
+
<div
|
|
15
|
+
:style="{
|
|
16
|
+
height: `${HEADER_HEIGHT}px`,
|
|
17
|
+
zIndex: 1
|
|
18
|
+
}"
|
|
19
|
+
class="border-b relative border-slate-300 bg-white"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<!-- Sidebar Items-->
|
|
23
|
+
|
|
24
|
+
<ul
|
|
25
|
+
class=""
|
|
26
|
+
:style="{
|
|
27
|
+
transform: `translateY(${scrollY}px)`,
|
|
28
|
+
}"
|
|
29
|
+
>
|
|
30
|
+
<li
|
|
31
|
+
v-for="row in rowsInternal"
|
|
32
|
+
:key="row.id"
|
|
33
|
+
class="border-b border-slate-300 flex last:border-none"
|
|
34
|
+
:style="{
|
|
35
|
+
height: `${props.rowHeight}px`,
|
|
36
|
+
}"
|
|
37
|
+
@click="$emit('row:click', row)"
|
|
38
|
+
>
|
|
39
|
+
<slot
|
|
40
|
+
name="sidebarItem"
|
|
41
|
+
:row="row"
|
|
42
|
+
>
|
|
43
|
+
<div class="px-2 flex items-center">
|
|
44
|
+
<p class="font-semibold text-sm">
|
|
45
|
+
{{ row.name }}
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
</slot>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<!-- Content -->
|
|
54
|
+
|
|
55
|
+
<div
|
|
56
|
+
ref="contentRef"
|
|
57
|
+
class="grow flex flex-col items-stretch relative overflow-hidden"
|
|
58
|
+
>
|
|
59
|
+
<!-- Time Scale Header -->
|
|
60
|
+
|
|
61
|
+
<div
|
|
62
|
+
class="bg-white border-b shrink-0 border-slate-300 w-full"
|
|
63
|
+
:style="{
|
|
64
|
+
zIndex: 1,
|
|
65
|
+
height: HEADER_HEIGHT + 'px',
|
|
66
|
+
width: `${width}px`,
|
|
67
|
+
transform: `translateX(${scrollX}px)`,
|
|
68
|
+
}"
|
|
69
|
+
>
|
|
70
|
+
<svg
|
|
71
|
+
:view-box="`${width} ${HEADER_HEIGHT}`"
|
|
72
|
+
:width="width"
|
|
73
|
+
:height="HEADER_HEIGHT"
|
|
74
|
+
>
|
|
75
|
+
<g
|
|
76
|
+
v-for="group in groups"
|
|
77
|
+
:key="group.x"
|
|
78
|
+
>
|
|
79
|
+
<text
|
|
80
|
+
:x="group.labelX"
|
|
81
|
+
:y="15"
|
|
82
|
+
class="text-[12px] font-semibold text-slate-900"
|
|
83
|
+
fill="currentColor"
|
|
84
|
+
:text-anchor="group.labelTextAnchor"
|
|
85
|
+
>
|
|
86
|
+
{{ group.label }}
|
|
87
|
+
</text>
|
|
88
|
+
<line
|
|
89
|
+
:x1="group.x + group.width"
|
|
90
|
+
:x2="group.x + group.width"
|
|
91
|
+
:y1="0"
|
|
92
|
+
:y2="HEADER_HEIGHT"
|
|
93
|
+
:stroke="slate[300]"
|
|
94
|
+
></line>
|
|
95
|
+
</g>
|
|
96
|
+
|
|
97
|
+
<g
|
|
98
|
+
v-for="tick in ticks"
|
|
99
|
+
:key="tick.x"
|
|
100
|
+
:transform="`translate(${tick.x}, 0)`"
|
|
101
|
+
>
|
|
102
|
+
<text
|
|
103
|
+
:x="tick.align == 'middle' ? tick.width / 2 : 0"
|
|
104
|
+
:y="33"
|
|
105
|
+
class="text-[11px] text-slate-500"
|
|
106
|
+
fill="currentColor"
|
|
107
|
+
text-anchor="middle"
|
|
108
|
+
>
|
|
109
|
+
{{ tick.label }}
|
|
110
|
+
</text>
|
|
111
|
+
|
|
112
|
+
<line
|
|
113
|
+
v-if="tick.align == 'middle'"
|
|
114
|
+
:x1="tick.width - tick.width"
|
|
115
|
+
:x2="tick.width - tick.width"
|
|
116
|
+
:y1="24"
|
|
117
|
+
:y2="HEADER_HEIGHT"
|
|
118
|
+
:stroke="tick.thick ? slate[400] : slate[300]"
|
|
119
|
+
></line>
|
|
120
|
+
</g>
|
|
121
|
+
</svg>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div
|
|
125
|
+
v-if="currentGroup"
|
|
126
|
+
class="absolute top-0 left-0 inline-flex"
|
|
127
|
+
:style="{
|
|
128
|
+
zIndex: 1,
|
|
129
|
+
}"
|
|
130
|
+
>
|
|
131
|
+
<div class="text-xs font-semibold pt-[3px] bg-white px-2">
|
|
132
|
+
{{ currentGroup.label }}
|
|
133
|
+
</div>
|
|
134
|
+
<div class="bg-gradient-to-r from-white to-transparent w-20" />
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<!-- Gantt Items -->
|
|
138
|
+
|
|
139
|
+
<ul
|
|
140
|
+
ref="itemsRef"
|
|
141
|
+
class="relative w-full overflow-scroll grow"
|
|
142
|
+
>
|
|
143
|
+
<li
|
|
144
|
+
v-for="row in rowsInternal"
|
|
145
|
+
:key="row.id"
|
|
146
|
+
class="border-b relative border-slate-300 last:border-none"
|
|
147
|
+
:style="{
|
|
148
|
+
height: `${props.rowHeight}px`,
|
|
149
|
+
width: `${width}px`,
|
|
150
|
+
}"
|
|
151
|
+
>
|
|
152
|
+
<button
|
|
153
|
+
v-for="item in row.items"
|
|
154
|
+
:key="item.id"
|
|
155
|
+
type="button"
|
|
156
|
+
class="absolute flex"
|
|
157
|
+
:style="{
|
|
158
|
+
transform: `translate(${item.x}px, ${item.y}px)`,
|
|
159
|
+
height: item.height + 'px',
|
|
160
|
+
width: item.width + 'px',
|
|
161
|
+
}"
|
|
162
|
+
:title="`${item.name} - ${item.start.toFormat('yyyy-MM-dd HH:mm:ss')} - ${item.end.toFormat('yyyy-MM-dd HH:mm:ss')}`"
|
|
163
|
+
@click="$emit('item:click', item)"
|
|
164
|
+
>
|
|
165
|
+
<slot
|
|
166
|
+
name="item"
|
|
167
|
+
:item="item"
|
|
168
|
+
>
|
|
169
|
+
<div
|
|
170
|
+
:style="{
|
|
171
|
+
backgroundColor: item.color,
|
|
172
|
+
}"
|
|
173
|
+
class="flex w-full h-full items-center rounded hover:opacity-80 duration-200"
|
|
174
|
+
>
|
|
175
|
+
<p
|
|
176
|
+
class="text-white text-xs font-medium px-2 py-1 truncate"
|
|
177
|
+
style="text-shadow: 0.5px 0.5px rgba(0,0,0,0.1);"
|
|
178
|
+
>
|
|
179
|
+
{{ item.name }}
|
|
180
|
+
</p>
|
|
181
|
+
</div>
|
|
182
|
+
</slot>
|
|
183
|
+
</button>
|
|
184
|
+
</li>
|
|
185
|
+
</ul>
|
|
186
|
+
|
|
187
|
+
<!-- Vertical lines -->
|
|
188
|
+
|
|
189
|
+
<div
|
|
190
|
+
class="absolute left-0 pointer-events-none"
|
|
191
|
+
:style="{
|
|
192
|
+
top: `${HEADER_HEIGHT}px`,
|
|
193
|
+
width: `${width}px`,
|
|
194
|
+
height: height + 'px',
|
|
195
|
+
transform: `translateX(${scrollX}px)`,
|
|
196
|
+
}"
|
|
197
|
+
>
|
|
198
|
+
<svg
|
|
199
|
+
:view-box="`${width} ${height}`"
|
|
200
|
+
:width="width"
|
|
201
|
+
:height="height"
|
|
202
|
+
>
|
|
203
|
+
<g
|
|
204
|
+
v-for="group in groups"
|
|
205
|
+
:key="group.x"
|
|
206
|
+
>
|
|
207
|
+
<line
|
|
208
|
+
:x1="group.x"
|
|
209
|
+
:x2="group.x"
|
|
210
|
+
y1="0"
|
|
211
|
+
:y2="height"
|
|
212
|
+
stroke="black"
|
|
213
|
+
:opacity="0.2"
|
|
214
|
+
></line>
|
|
215
|
+
</g>
|
|
216
|
+
<g
|
|
217
|
+
v-for="tick in ticks"
|
|
218
|
+
:key="tick.x"
|
|
219
|
+
>
|
|
220
|
+
<line
|
|
221
|
+
:x1="tick.x"
|
|
222
|
+
:x2="tick.x"
|
|
223
|
+
:y1="0"
|
|
224
|
+
:y2="height"
|
|
225
|
+
stroke="black"
|
|
226
|
+
:opacity="tick.thick ? 0.2 : 0.05"
|
|
227
|
+
></line>
|
|
228
|
+
</g>
|
|
229
|
+
</svg>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<!-- Now line -->
|
|
233
|
+
|
|
234
|
+
<div
|
|
235
|
+
v-if="nowLine"
|
|
236
|
+
class="absolute left-0 pointer-events-none"
|
|
237
|
+
:style="{
|
|
238
|
+
top: `${HEADER_HEIGHT}px`,
|
|
239
|
+
width: `${width}px`,
|
|
240
|
+
height: height + 'px',
|
|
241
|
+
transform: `translateX(${scrollX}px)`,
|
|
242
|
+
}"
|
|
243
|
+
>
|
|
244
|
+
<svg
|
|
245
|
+
:view-box="`${width} ${height}`"
|
|
246
|
+
:width="width"
|
|
247
|
+
:height="height"
|
|
248
|
+
>
|
|
249
|
+
<line
|
|
250
|
+
:x1="nowLine.x"
|
|
251
|
+
:x2="nowLine.x"
|
|
252
|
+
y1="0"
|
|
253
|
+
:y2="height"
|
|
254
|
+
stroke="red"
|
|
255
|
+
stroke-width="2"
|
|
256
|
+
style="filter: drop-shadow(0px 0px 2px rgb(0 0 0 / 0.1));"
|
|
257
|
+
></line>
|
|
258
|
+
</svg>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</template>
|
|
263
|
+
|
|
264
|
+
<script lang="ts" setup>
|
|
265
|
+
import { useElementSize, useScroll } from '@vueuse/core';
|
|
266
|
+
import { Format } from '@/services/gantt/format';
|
|
267
|
+
import { FormatConfig, GanttRow, GanttRowFormatted, Group, Tick, NowLine } from '@/services/gantt/types';
|
|
268
|
+
import { debounce } from 'lodash';
|
|
269
|
+
import { slate } from 'tailwindcss/colors';
|
|
270
|
+
|
|
271
|
+
const props = withDefaults(defineProps<{
|
|
272
|
+
rows: GanttRow[],
|
|
273
|
+
rowHeight?: number,
|
|
274
|
+
rowPadding?: number,
|
|
275
|
+
maxHeight?: number,
|
|
276
|
+
includeToday?: boolean,
|
|
277
|
+
}>(), {
|
|
278
|
+
rowHeight: 40,
|
|
279
|
+
rowPadding: 4,
|
|
280
|
+
maxHeight: undefined,
|
|
281
|
+
includeToday: true,
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
defineEmits([
|
|
285
|
+
'item:click',
|
|
286
|
+
'row:click',
|
|
287
|
+
]);
|
|
288
|
+
|
|
289
|
+
// Config
|
|
290
|
+
|
|
291
|
+
const SIDEBAR_WIDTH = 120;
|
|
292
|
+
const HEADER_HEIGHT = 40;
|
|
293
|
+
|
|
294
|
+
// Init
|
|
295
|
+
|
|
296
|
+
const contentRef = ref<HTMLDivElement | null>(null);
|
|
297
|
+
const contentSize = useElementSize(contentRef);
|
|
298
|
+
const itemsRef = ref<HTMLUListElement | null>(null);
|
|
299
|
+
|
|
300
|
+
const width = ref(800);
|
|
301
|
+
const height = ref(100);
|
|
302
|
+
|
|
303
|
+
const rowsInternal = ref<GanttRowFormatted[]>([]);
|
|
304
|
+
const groups = ref<Group[]>([]);
|
|
305
|
+
const ticks = ref<Tick[]>([]);
|
|
306
|
+
const nowLine = ref<NowLine | null>(null);
|
|
307
|
+
|
|
308
|
+
const config = computed<FormatConfig>(() => {
|
|
309
|
+
return {
|
|
310
|
+
rows: props.rows,
|
|
311
|
+
minWidth: contentSize.width.value,
|
|
312
|
+
rowHeight: props.rowHeight,
|
|
313
|
+
rowPadding: props.rowPadding,
|
|
314
|
+
includeToday: props.includeToday,
|
|
315
|
+
};
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
function init() {
|
|
319
|
+
const format = (new Format(config.value)).handle();
|
|
320
|
+
|
|
321
|
+
width.value = format.width;
|
|
322
|
+
height.value = format.height;
|
|
323
|
+
|
|
324
|
+
rowsInternal.value = format.rows;
|
|
325
|
+
|
|
326
|
+
groups.value = format.groups;
|
|
327
|
+
ticks.value = format.ticks;
|
|
328
|
+
|
|
329
|
+
nowLine.value = format.nowLine;
|
|
330
|
+
|
|
331
|
+
// Scroll to now line
|
|
332
|
+
|
|
333
|
+
nextTick(() => {
|
|
334
|
+
if (nowLine.value && itemsRef.value) {
|
|
335
|
+
const scrollLeft = nowLine.value.x + contentSize.width.value / 2;
|
|
336
|
+
itemsRef.value.scrollLeft = scrollLeft;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Init triggers
|
|
342
|
+
|
|
343
|
+
const initDebounced = debounce(init, 200);
|
|
344
|
+
|
|
345
|
+
onMounted(() => {
|
|
346
|
+
// Wait for the contentSize to be available
|
|
347
|
+
setTimeout(() => {
|
|
348
|
+
init();
|
|
349
|
+
watch(() => config.value, initDebounced, { deep: true });
|
|
350
|
+
}, 1);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// Scroll
|
|
354
|
+
|
|
355
|
+
const scrollX = ref(0);
|
|
356
|
+
const scrollY = ref(0);
|
|
357
|
+
|
|
358
|
+
useScroll(itemsRef, {
|
|
359
|
+
onScroll: (e: any) => {
|
|
360
|
+
if (!e.target) return;
|
|
361
|
+
|
|
362
|
+
scrollX.value = -e.target.scrollLeft;
|
|
363
|
+
scrollY.value = -e.target.scrollTop;
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
// Current Group
|
|
368
|
+
|
|
369
|
+
const currentGroup = computed<Group | undefined>(() => {
|
|
370
|
+
|
|
371
|
+
const offsetLeft = -scrollX.value;
|
|
372
|
+
|
|
373
|
+
return groups.value
|
|
374
|
+
// Sort by x descending
|
|
375
|
+
.sort((a, b) => {
|
|
376
|
+
return b.x - a.x;
|
|
377
|
+
})
|
|
378
|
+
.find((group) => {
|
|
379
|
+
// - 1 to avoid flashing when scrolling
|
|
380
|
+
return group.x <= offsetLeft && group.x + group.width >= offsetLeft - 1;
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
</script>
|