mediacube-ui-v2 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.vue.d.ts +2 -0
- package/dist/assets/iconsSprite.svg +1 -0
- package/dist/assets/img/img/no_table_data.png +0 -0
- package/dist/assets/img/img/no_user.png +0 -0
- package/dist/assets/tokens/json/animations.json.d.ts +8 -0
- package/dist/assets/tokens/json/border-radius.json.d.ts +26 -0
- package/dist/assets/tokens/json/box-shadows.json.d.ts +26 -0
- package/dist/assets/tokens/json/colors.json.d.ts +73 -0
- package/dist/assets/tokens/json/durations.json.d.ts +12 -0
- package/dist/assets/tokens/json/easings.json.d.ts +5 -0
- package/dist/assets/tokens/json/font-families.json.d.ts +6 -0
- package/dist/assets/tokens/json/font-sizes.json.d.ts +20 -0
- package/dist/assets/tokens/json/font-weights.json.d.ts +14 -0
- package/dist/assets/tokens/json/gradients.json.d.ts +15 -0
- package/dist/assets/tokens/json/index.d.ts +18 -0
- package/dist/assets/tokens/json/letter-spacings.json.d.ts +6 -0
- package/dist/assets/tokens/json/line-heights.json.d.ts +20 -0
- package/dist/assets/tokens/json/media-queries.json.d.ts +28 -0
- package/dist/assets/tokens/json/opacities.json.d.ts +7 -0
- package/dist/assets/tokens/json/sizes.json.d.ts +44 -0
- package/dist/assets/tokens/json/spacings.json.d.ts +36 -0
- package/dist/assets/tokens/json/z-indexes.json.d.ts +14 -0
- package/dist/{types/components → components}/elements/McAvatar/McAvatar.vue.d.ts +5 -5
- package/dist/{types/components → components}/elements/McBadge/McBadge.vue.d.ts +3 -3
- package/dist/components/elements/McBottomLoader/McBottomLoader.vue.d.ts +14 -0
- package/dist/{types/components → components}/elements/McButton/McButton.vue.d.ts +12 -13
- package/dist/{types/components → components}/elements/McChip/McChip.vue.d.ts +6 -7
- package/dist/{types/components → components}/elements/McDatepicker/McDatepicker.vue.d.ts +1 -2
- package/dist/{types/components → components}/elements/McDraggable/McDraggable.vue.d.ts +4 -4
- package/dist/{types/components → components}/elements/McFieldCheckbox/McFieldCheckbox.vue.d.ts +1 -1
- package/dist/{types/components → components}/elements/McFieldRadio/McFieldRadio.vue.d.ts +8 -8
- package/dist/{types/components → components}/elements/McFieldRadioGroup/McFieldRadioGroup.vue.d.ts +1 -1
- package/dist/{types/components → components}/elements/McFieldRange/McFieldRange.vue.d.ts +6 -6
- package/dist/{types/components → components}/elements/McFieldSelect/McFieldSelect.vue.d.ts +11 -12
- package/dist/{types/components → components}/elements/McFieldText/McFieldText.vue.d.ts +9 -9
- package/dist/{types/components → components}/elements/McFieldToggle/McFieldToggle.vue.d.ts +6 -6
- package/dist/{types/components → components}/elements/McInfinityLoadingTrigger/McInfinityLoadingTrigger.vue.d.ts +4 -4
- package/dist/components/elements/McNodata/McNoData.vue.d.ts +110 -0
- package/dist/components/elements/McNotification/McNotification.vue.d.ts +124 -0
- package/dist/{types/components → components}/elements/McProgress/McProgress.vue.d.ts +5 -5
- package/dist/{types/components → components}/elements/McSeparator/McSeparator.vue.d.ts +4 -4
- package/dist/{types/components → components}/elements/McSlideUpDown/McSlideUpDown.vue.d.ts +5 -5
- package/dist/{types/components → components}/elements/McStack/McStack.vue.d.ts +4 -4
- package/dist/{types/components → components}/elements/McSvgIcon/McSvgIcon.vue.d.ts +9 -9
- package/dist/{types/components → components}/elements/McTitle/McTitle.vue.d.ts +7 -7
- package/dist/{types/components → components}/elements/McTooltip/McTooltip.vue.d.ts +6 -6
- package/dist/components/index.d.ts +61 -0
- package/dist/{types/components → components}/patterns/McAccordion/McAccordion.vue.d.ts +4 -4
- package/dist/{types/components → components}/patterns/McCell/McCell.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McCollapse/McCollapse.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McDropdown/McDropdown.vue.d.ts +7 -7
- package/dist/components/patterns/McDropdown/McDropdownPanel.vue.d.ts +22 -0
- package/dist/{types/components → components}/patterns/McFilter/McFilter.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McFilter/McFilterChip/McFilterChip.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McFilter/McFilterTags/McFilterTags.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McGridCol/McGridCol.vue.d.ts +4 -4
- package/dist/{types/components → components}/patterns/McGridRow/McGridRow.vue.d.ts +5 -5
- package/dist/{types/components → components}/patterns/McOverlay/McOverlay.vue.d.ts +4 -4
- package/dist/{types/components → components}/patterns/McPreview/McPreview.vue.d.ts +4 -4
- package/dist/components/patterns/McSideBar/McSideBar.vue.d.ts +292 -0
- package/dist/{types/components → components}/patterns/McSideBar/McSideBarBottom/McSideBarBottom.vue.d.ts +5 -5
- package/dist/{types/components → components}/patterns/McSideBar/McSideBarButton/McSideBarButton.vue.d.ts +6 -6
- package/dist/{types/components → components}/patterns/McSideBar/McSideBarCenter/McSideBarCenter.vue.d.ts +6 -6
- package/dist/components/patterns/McSideBar/McSideBarTop/McSideBarTop.vue.d.ts +123 -0
- package/dist/components/patterns/McTab/McTab.vue.d.ts +224 -0
- package/dist/{types/components → components}/patterns/McTabs/McTabs.vue.d.ts +7 -8
- package/dist/{types/components → components}/patterns/McWrapScroll/McWrapScroll.vue.d.ts +7 -7
- package/dist/components/templates/McDrawer/McDrawer.vue.d.ts +104 -0
- package/dist/{types/components → components}/templates/McDrawer/McDrawerContainer.vue.d.ts +5 -5
- package/dist/{types/components → components}/templates/McDrawer/McDrawerContentTemplate/McDrawerContentTemplate.vue.d.ts +4 -4
- package/dist/{types/components → components}/templates/McModal/McModal.vue.d.ts +7 -7
- package/dist/{types/components → components}/templates/McModal/McModalContainer.vue.d.ts +5 -5
- package/dist/components/templates/McTable/McTable/McTable.vue.d.ts +295 -0
- package/dist/{types/components → components}/templates/McTable/McTableCard/McTableCard.vue.d.ts +6 -6
- package/dist/{types/components → components}/templates/McTable/McTableCard/McTableCardHeader/McTableCardHeader.vue.d.ts +4 -4
- package/dist/components/templates/McTable/McTableSkeletonLoading/McTableSkeletonLoading.vue.d.ts +18 -0
- package/dist/{types/components → components}/templates/McTable/McTableSort/McTableSort.vue.d.ts +7 -7
- package/dist/{types/components → components}/templates/McTopBar/McTopBar.vue.d.ts +4 -4
- package/dist/{types/components → components}/templates/McVirtualScroll/McVirtualScroll.vue.d.ts +4 -4
- package/dist/{types/composables → composables}/index.d.ts +1 -1
- package/dist/{types/composables → composables}/useDrawer.d.ts +1 -1
- package/dist/composables/useFieldErrors.d.ts +5 -0
- package/dist/{types/composables → composables}/useTooltip.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10522 -13
- package/dist/main.d.ts +0 -0
- package/dist/{types/mocks → mocks}/filterMocks.d.ts +1 -1
- package/dist/mocks/icons.json.d.ts +3 -0
- package/dist/{types/mocks → mocks}/sidebar.d.ts +1 -1
- package/dist/{types/mocks → mocks}/tableData.d.ts +1 -1
- package/dist/types/{types/IButton.d.ts → IButton.d.ts} +5 -5
- package/dist/types/{types/ICell.d.ts → ICell.d.ts} +1 -1
- package/dist/types/{types/IChip.d.ts → IChip.d.ts} +2 -2
- package/dist/types/{types/IDatepicker.d.ts → IDatepicker.d.ts} +1 -1
- package/dist/types/{types/IDirections.d.ts → IDirections.d.ts} +1 -1
- package/dist/types/{types/IDrawer.d.ts → IDrawer.d.ts} +2 -2
- package/dist/types/{types/IDropdown.d.ts → IDropdown.d.ts} +1 -1
- package/dist/types/{types/IFilter.d.ts → IFilter.d.ts} +1 -1
- package/dist/types/{types/IInput.d.ts → IInput.d.ts} +1 -1
- package/dist/types/{types/IModal.d.ts → IModal.d.ts} +2 -2
- package/dist/types/{types/IPreview.d.ts → IPreview.d.ts} +1 -1
- package/dist/types/{types/IRadio.d.ts → IRadio.d.ts} +1 -1
- package/dist/types/{types/IRadioGroup.d.ts → IRadioGroup.d.ts} +1 -1
- package/dist/types/{types/ISelect.d.ts → ISelect.d.ts} +1 -1
- package/dist/types/{types/ISideBar.d.ts → ISideBar.d.ts} +5 -5
- package/dist/types/{types/ITable.d.ts → ITable.d.ts} +2 -2
- package/dist/types/{types/ITabs.d.ts → ITabs.d.ts} +4 -4
- package/dist/types/{types/ITitle.d.ts → ITitle.d.ts} +1 -1
- package/dist/types/{types/ITooltip.d.ts → ITooltip.d.ts} +1 -1
- package/dist/types/index.d.ts +36 -9
- package/dist/types/{types/styles → styles}/Alignment.d.ts +1 -1
- package/dist/types/{types/styles → styles}/Grid.d.ts +1 -1
- package/dist/types/{types/styles → styles}/Weights.d.ts +1 -1
- package/dist/{types/utils → utils}/dayjs.d.ts +1 -2
- package/dist/{types/utils → utils}/mcGridColAdaptiveProps.d.ts +1 -1
- package/dist/{types/utils → utils}/mcTitleAdaptiveProps.d.ts +1 -1
- package/package.json +5 -3
- package/dist/App.vue.js +0 -54
- package/dist/assets/tokens/json/animations.json +0 -6
- package/dist/assets/tokens/json/border-radius.json +0 -24
- package/dist/assets/tokens/json/box-shadows.json +0 -24
- package/dist/assets/tokens/json/colors.json +0 -71
- package/dist/assets/tokens/json/durations.json +0 -10
- package/dist/assets/tokens/json/easings.json +0 -3
- package/dist/assets/tokens/json/font-families.json +0 -4
- package/dist/assets/tokens/json/font-sizes.json +0 -18
- package/dist/assets/tokens/json/font-weights.json +0 -12
- package/dist/assets/tokens/json/gradients.json +0 -13
- package/dist/assets/tokens/json/index.js +0 -18
- package/dist/assets/tokens/json/letter-spacings.json +0 -4
- package/dist/assets/tokens/json/line-heights.json +0 -18
- package/dist/assets/tokens/json/media-queries.json +0 -26
- package/dist/assets/tokens/json/opacities.json +0 -5
- package/dist/assets/tokens/json/sizes.json +0 -42
- package/dist/assets/tokens/json/spacings.json +0 -34
- package/dist/assets/tokens/json/z-indexes.json +0 -12
- package/dist/components/elements/McAvatar/McAvatar.vue.js +0 -412
- package/dist/components/elements/McBadge/McBadge.vue.js +0 -188
- package/dist/components/elements/McBottomLoader/McBottomLoader.vue.js +0 -83
- package/dist/components/elements/McButton/McButton.vue.js +0 -1037
- package/dist/components/elements/McChip/McChip.vue.js +0 -326
- package/dist/components/elements/McCropper/McCropper.vue.js +0 -98
- package/dist/components/elements/McDatepicker/McDatepicker.vue.js +0 -1255
- package/dist/components/elements/McDraggable/McDraggable.vue.js +0 -280
- package/dist/components/elements/McFieldCheckbox/McFieldCheckbox.vue.js +0 -542
- package/dist/components/elements/McFieldRadio/McFieldRadio.vue.js +0 -489
- package/dist/components/elements/McFieldRadioGroup/McFieldRadioGroup.vue.js +0 -471
- package/dist/components/elements/McFieldRange/McFieldRange.vue.js +0 -547
- package/dist/components/elements/McFieldSelect/McFieldSelect.vue.js +0 -1440
- package/dist/components/elements/McFieldText/McFieldText.vue.js +0 -1404
- package/dist/components/elements/McFieldToggle/McFieldToggle.vue.js +0 -408
- package/dist/components/elements/McInfinityLoadingTrigger/McInfinityLoadingTrigger.vue.js +0 -192
- package/dist/components/elements/McNodata/McNoData.vue.js +0 -319
- package/dist/components/elements/McNotification/McNotification.vue.js +0 -367
- package/dist/components/elements/McProgress/McProgress.vue.js +0 -361
- package/dist/components/elements/McSeparator/McSeparator.vue.js +0 -325
- package/dist/components/elements/McSlideUpDown/McSlideUpDown.vue.js +0 -271
- package/dist/components/elements/McStack/McStack.vue.js +0 -180
- package/dist/components/elements/McSvgIcon/McSvgIcon.vue.js +0 -289
- package/dist/components/elements/McTitle/McTitle.vue.js +0 -468
- package/dist/components/elements/McTooltip/McTooltip.vue.js +0 -246
- package/dist/components/index.js +0 -73
- package/dist/components/patterns/McAccordion/McAccordion.vue.js +0 -120
- package/dist/components/patterns/McCell/McCell.vue.js +0 -197
- package/dist/components/patterns/McCollapse/McCollapse.vue.js +0 -315
- package/dist/components/patterns/McDropdown/McDropdown.vue.js +0 -366
- package/dist/components/patterns/McDropdown/McDropdownPanel.vue.js +0 -83
- package/dist/components/patterns/McFilter/McFilter.vue.js +0 -1068
- package/dist/components/patterns/McFilter/McFilterChip/McFilterChip.vue.js +0 -211
- package/dist/components/patterns/McFilter/McFilterTags/McFilterTags.vue.js +0 -552
- package/dist/components/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue.js +0 -188
- package/dist/components/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue.js +0 -238
- package/dist/components/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue.js +0 -359
- package/dist/components/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue.js +0 -171
- package/dist/components/patterns/McGridCol/McGridCol.vue.js +0 -246
- package/dist/components/patterns/McGridRow/McGridRow.vue.js +0 -292
- package/dist/components/patterns/McOverlay/McOverlay.vue.js +0 -107
- package/dist/components/patterns/McPreview/McPreview.vue.js +0 -118
- package/dist/components/patterns/McSideBar/McSideBar.vue.js +0 -740
- package/dist/components/patterns/McSideBar/McSideBarBottom/McSideBarBottom.vue.js +0 -204
- package/dist/components/patterns/McSideBar/McSideBarButton/McSideBarButton.vue.js +0 -510
- package/dist/components/patterns/McSideBar/McSideBarCenter/McSideBarCenter.vue.js +0 -413
- package/dist/components/patterns/McSideBar/McSideBarTop/McSideBarTop.vue.js +0 -419
- package/dist/components/patterns/McTab/McTab.vue.js +0 -518
- package/dist/components/patterns/McTabs/McTabs.vue.js +0 -427
- package/dist/components/patterns/McWrapScroll/McWrapScroll.vue.js +0 -422
- package/dist/components/templates/McDrawer/McDrawer.vue.js +0 -304
- package/dist/components/templates/McDrawer/McDrawerContainer.vue.js +0 -133
- package/dist/components/templates/McDrawer/McDrawerContentTemplate/McDrawerContentTemplate.vue.js +0 -134
- package/dist/components/templates/McModal/McModal.vue.js +0 -664
- package/dist/components/templates/McModal/McModalContainer.vue.js +0 -119
- package/dist/components/templates/McTable/McTable/McTable.vue.js +0 -862
- package/dist/components/templates/McTable/McTableCard/McTableCard.vue.js +0 -339
- package/dist/components/templates/McTable/McTableCard/McTableCardHeader/McTableCardHeader.vue.js +0 -119
- package/dist/components/templates/McTable/McTableSkeletonLoading/McTableSkeletonLoading.vue.js +0 -118
- package/dist/components/templates/McTable/McTableSort/McTableSort.vue.js +0 -136
- package/dist/components/templates/McTopBar/McTopBar.vue.js +0 -309
- package/dist/components/templates/McVirtualScroll/McVirtualScroll.vue.js +0 -239
- package/dist/composables/index.js +0 -8
- package/dist/composables/useDrawer.js +0 -72
- package/dist/composables/useEncodeDecode.js +0 -25
- package/dist/composables/useFieldErrors.js +0 -20
- package/dist/composables/useHelper.js +0 -79
- package/dist/composables/useModal.js +0 -71
- package/dist/composables/useRandomNumber.js +0 -10
- package/dist/composables/useTooltip.js +0 -154
- package/dist/consts/table.js +0 -6
- package/dist/enums/Cell.js +0 -6
- package/dist/enums/Chip.js +0 -11
- package/dist/enums/Datepicker.js +0 -42
- package/dist/enums/Drawer.js +0 -5
- package/dist/enums/Dropdown.js +0 -12
- package/dist/enums/Filter.js +0 -14
- package/dist/enums/Grid.js +0 -24
- package/dist/enums/Input.js +0 -20
- package/dist/enums/Modal.js +0 -5
- package/dist/enums/Preview.js +0 -6
- package/dist/enums/Radio.js +0 -5
- package/dist/enums/RadioGroup.js +0 -5
- package/dist/enums/Select.js +0 -11
- package/dist/enums/Sidebar.js +0 -5
- package/dist/enums/Tab.js +0 -6
- package/dist/enums/Title.js +0 -21
- package/dist/enums/Tooltip.js +0 -15
- package/dist/enums/index.js +0 -22
- package/dist/enums/ui/Alignment.js +0 -6
- package/dist/enums/ui/Button.js +0 -24
- package/dist/enums/ui/Directions.js +0 -5
- package/dist/enums/ui/Weights.js +0 -7
- package/dist/main.js +0 -6
- package/dist/mocks/authUser.js +0 -162
- package/dist/mocks/categories.js +0 -107
- package/dist/mocks/filterMocks.js +0 -128
- package/dist/mocks/icons.json +0 -1
- package/dist/mocks/menuLangs.js +0 -19
- package/dist/mocks/sidebar.js +0 -125
- package/dist/mocks/tableData.js +0 -8180
- package/dist/types/App.vue.d.ts +0 -2
- package/dist/types/IButton.js +0 -1
- package/dist/types/ICell.js +0 -1
- package/dist/types/IChip.js +0 -1
- package/dist/types/ICollapse.js +0 -1
- package/dist/types/IDatepicker.js +0 -1
- package/dist/types/IDirections.js +0 -1
- package/dist/types/IDrawer.js +0 -1
- package/dist/types/IDropdown.js +0 -1
- package/dist/types/IFilter.js +0 -1
- package/dist/types/IGrid.js +0 -1
- package/dist/types/IInput.js +0 -1
- package/dist/types/IModal.js +0 -1
- package/dist/types/IPreview.js +0 -1
- package/dist/types/IRadio.js +0 -1
- package/dist/types/IRadioGroup.js +0 -1
- package/dist/types/IRoute.js +0 -1
- package/dist/types/ISelect.js +0 -1
- package/dist/types/ISideBar.js +0 -1
- package/dist/types/ITable.js +0 -1
- package/dist/types/ITabs.js +0 -1
- package/dist/types/ITitle.js +0 -1
- package/dist/types/ITooltip.js +0 -1
- package/dist/types/assets/tokens/json/index.d.ts +0 -18
- package/dist/types/components/elements/McBottomLoader/McBottomLoader.vue.d.ts +0 -14
- package/dist/types/components/elements/McCropper/McCropper.vue.d.ts +0 -2
- package/dist/types/components/elements/McNodata/McNoData.vue.d.ts +0 -110
- package/dist/types/components/elements/McNotification/McNotification.vue.d.ts +0 -124
- package/dist/types/components/index.d.ts +0 -70
- package/dist/types/components/patterns/McDropdown/McDropdownPanel.vue.d.ts +0 -22
- package/dist/types/components/patterns/McSideBar/McSideBar.vue.d.ts +0 -292
- package/dist/types/components/patterns/McSideBar/McSideBarTop/McSideBarTop.vue.d.ts +0 -123
- package/dist/types/components/patterns/McTab/McTab.vue.d.ts +0 -224
- package/dist/types/components/templates/McDrawer/McDrawer.vue.d.ts +0 -104
- package/dist/types/components/templates/McTable/McTable/McTable.vue.d.ts +0 -295
- package/dist/types/components/templates/McTable/McTableSkeletonLoading/McTableSkeletonLoading.vue.d.ts +0 -18
- package/dist/types/composables/useFieldErrors.d.ts +0 -5
- package/dist/types/index.js +0 -38
- package/dist/types/main.d.ts +0 -2
- package/dist/types/styles/Alignment.js +0 -1
- package/dist/types/styles/AvatarSizes.js +0 -3
- package/dist/types/styles/Colors.js +0 -3
- package/dist/types/styles/Durations.js +0 -3
- package/dist/types/styles/FontSizes.js +0 -3
- package/dist/types/styles/FontWeights.js +0 -3
- package/dist/types/styles/Grid.js +0 -1
- package/dist/types/styles/Icons.js +0 -2
- package/dist/types/styles/LineHeights.js +0 -3
- package/dist/types/styles/MediaQueries.js +0 -3
- package/dist/types/styles/Radiuses.js +0 -3
- package/dist/types/styles/Sizes.js +0 -3
- package/dist/types/styles/Spaces.js +0 -3
- package/dist/types/styles/Weights.js +0 -1
- package/dist/types/types/index.d.ts +0 -36
- package/dist/utils/dayjs.js +0 -18
- package/dist/utils/mcGridColAdaptiveProps.js +0 -10
- package/dist/utils/mcTitleAdaptiveProps.js +0 -10
- /package/dist/{types/composables → composables}/useEncodeDecode.d.ts +0 -0
- /package/dist/{types/composables → composables}/useHelper.d.ts +0 -0
- /package/dist/{types/composables → composables}/useModal.d.ts +0 -0
- /package/dist/{types/composables → composables}/useRandomNumber.d.ts +0 -0
- /package/dist/{types/consts → consts}/table.d.ts +0 -0
- /package/dist/{types/enums → enums}/Cell.d.ts +0 -0
- /package/dist/{types/enums → enums}/Chip.d.ts +0 -0
- /package/dist/{types/enums → enums}/Datepicker.d.ts +0 -0
- /package/dist/{types/enums → enums}/Drawer.d.ts +0 -0
- /package/dist/{types/enums → enums}/Dropdown.d.ts +0 -0
- /package/dist/{types/enums → enums}/Filter.d.ts +0 -0
- /package/dist/{types/enums → enums}/Grid.d.ts +0 -0
- /package/dist/{types/enums → enums}/Input.d.ts +0 -0
- /package/dist/{types/enums → enums}/Modal.d.ts +0 -0
- /package/dist/{types/enums → enums}/Preview.d.ts +0 -0
- /package/dist/{types/enums → enums}/Radio.d.ts +0 -0
- /package/dist/{types/enums → enums}/RadioGroup.d.ts +0 -0
- /package/dist/{types/enums → enums}/Select.d.ts +0 -0
- /package/dist/{types/enums → enums}/Sidebar.d.ts +0 -0
- /package/dist/{types/enums → enums}/Tab.d.ts +0 -0
- /package/dist/{types/enums → enums}/Title.d.ts +0 -0
- /package/dist/{types/enums → enums}/Tooltip.d.ts +0 -0
- /package/dist/{types/enums → enums}/index.d.ts +0 -0
- /package/dist/{types/enums → enums}/ui/Alignment.d.ts +0 -0
- /package/dist/{types/enums → enums}/ui/Button.d.ts +0 -0
- /package/dist/{types/enums → enums}/ui/Directions.d.ts +0 -0
- /package/dist/{types/enums → enums}/ui/Weights.d.ts +0 -0
- /package/dist/{types/mocks → mocks}/authUser.d.ts +0 -0
- /package/dist/{types/mocks → mocks}/categories.d.ts +0 -0
- /package/dist/{types/mocks → mocks}/menuLangs.d.ts +0 -0
- /package/dist/types/{types/ICollapse.d.ts → ICollapse.d.ts} +0 -0
- /package/dist/types/{types/IGrid.d.ts → IGrid.d.ts} +0 -0
- /package/dist/types/{types/IRoute.d.ts → IRoute.d.ts} +0 -0
- /package/dist/types/{types/styles → styles}/AvatarSizes.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/Colors.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/Durations.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/FontSizes.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/FontWeights.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/Icons.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/LineHeights.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/MediaQueries.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/Radiuses.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/Sizes.d.ts +0 -0
- /package/dist/types/{types/styles → styles}/Spaces.d.ts +0 -0
|
@@ -1,1068 +0,0 @@
|
|
|
1
|
-
import { Teleport } from 'vue';
|
|
2
|
-
import McSvgIcon from '@/components/elements/McSvgIcon/McSvgIcon.vue';
|
|
3
|
-
import McButton from '@/components/elements/McButton/McButton.vue';
|
|
4
|
-
import McTitle from '@/components/elements/McTitle/McTitle.vue';
|
|
5
|
-
import McFieldSelect from '@/components/elements/McFieldSelect/McFieldSelect.vue';
|
|
6
|
-
import McFieldText from '@/components/elements/McFieldText/McFieldText.vue';
|
|
7
|
-
import McTooltip from '@/components/elements/McTooltip/McTooltip.vue';
|
|
8
|
-
import McFilterTags from '@/components/patterns/McFilter/McFilterTags/McFilterTags.vue';
|
|
9
|
-
import McFilterTypeRange from '@/components/patterns/McFilter/McFilterTypeRange/McFilterTypeRange.vue';
|
|
10
|
-
import McFilterTypeDate from '@/components/patterns/McFilter/McFilterTypeDate/McFilterTypeDate.vue';
|
|
11
|
-
import McFilterTypeText from '@/components/patterns/McFilter/McFilterTypeText/McFilterTypeText.vue';
|
|
12
|
-
import McFilterTypeRelation from '@/components/patterns/McFilter/McFilterTypeRelation/McFilterTypeRelation.vue';
|
|
13
|
-
import McChip from '@/components/elements/McChip/McChip.vue';
|
|
14
|
-
import { defaultPlaceholders } from '@/mocks/filterMocks';
|
|
15
|
-
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch, nextTick } from 'vue';
|
|
16
|
-
import { useHelper } from '@/composables/useHelper';
|
|
17
|
-
import { ButtonSize, ChipSize, FilterRelations, FilterTypes, TooltipPositions, TooltipSizes } from '@/enums';
|
|
18
|
-
import { useLocalStorage } from '@vueuse/core';
|
|
19
|
-
import { UseEncodeDecode } from '@/composables/useEncodeDecode';
|
|
20
|
-
const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
|
|
21
|
-
const helper = useHelper();
|
|
22
|
-
const emit = defineEmits();
|
|
23
|
-
const props = defineProps({
|
|
24
|
-
/**
|
|
25
|
-
* Имя фильтра
|
|
26
|
-
* (для записи данных в стор)
|
|
27
|
-
*/
|
|
28
|
-
name: {
|
|
29
|
-
type: String,
|
|
30
|
-
required: true
|
|
31
|
-
},
|
|
32
|
-
/**
|
|
33
|
-
* Значение фильтра
|
|
34
|
-
*/
|
|
35
|
-
modelValue: {
|
|
36
|
-
type: Object,
|
|
37
|
-
required: true,
|
|
38
|
-
default: () => ({ filter: null, filter_name: null })
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* Типы фильтров
|
|
42
|
-
*/
|
|
43
|
-
filters: {
|
|
44
|
-
type: Array,
|
|
45
|
-
required: true,
|
|
46
|
-
default: () => []
|
|
47
|
-
},
|
|
48
|
-
/**
|
|
49
|
-
* Лоадинг кнопки применить фильтр
|
|
50
|
-
*/
|
|
51
|
-
buttonConfirmIsLoading: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: false
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* Использовать ли teleport (для рендеринга вне компонента)
|
|
57
|
-
* Если да то необходимо создать блок с id="filterTeleportTarget" в который будет рендериться тело фильтра
|
|
58
|
-
*/
|
|
59
|
-
useTeleport: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: false
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* Доступен ли фильтр для открытия
|
|
65
|
-
*/
|
|
66
|
-
disabledOpen: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: false
|
|
69
|
-
},
|
|
70
|
-
/**
|
|
71
|
-
* Нужно ли учитывать часовой пояс при работе с фильтром типа Date
|
|
72
|
-
* */
|
|
73
|
-
useTimezone: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Переводы плейсхолеров и текстов
|
|
79
|
-
*/
|
|
80
|
-
placeholders: {
|
|
81
|
-
type: Object,
|
|
82
|
-
default: () => ({})
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
const isOpen = ref(false);
|
|
86
|
-
// текущие значения фильтра filter / filter_name
|
|
87
|
-
const currentValues = ref({});
|
|
88
|
-
const currentValuesName = ref({});
|
|
89
|
-
//временные значения, до нажатия на кнопку применить фильтр
|
|
90
|
-
const temporaryFilter = ref({});
|
|
91
|
-
const temporaryFilterName = ref({});
|
|
92
|
-
// текущие выбранные значения в типе фильтра
|
|
93
|
-
const currentCondition = ref({});
|
|
94
|
-
const currentConditionName = ref({});
|
|
95
|
-
// значение выбранного фильтра из списка фильтров
|
|
96
|
-
const selectedOptionFilter = ref(null);
|
|
97
|
-
const activeTag = ref(null);
|
|
98
|
-
const placeholders = reactive(helper.deepMerge(defaultPlaceholders, props.placeholders));
|
|
99
|
-
const isDisableConfirmButton = computed(() => {
|
|
100
|
-
return helper.isEqual(computedModelValue.value.filter, currentValues.value);
|
|
101
|
-
});
|
|
102
|
-
const newPresetName = ref('');
|
|
103
|
-
const activePreset = ref(null);
|
|
104
|
-
const temporaryActivePreset = ref(null);
|
|
105
|
-
const filterLocalStorage = useLocalStorage('mcFilterPresets', {});
|
|
106
|
-
const presets = ref([]);
|
|
107
|
-
const computedModelValue = computed({
|
|
108
|
-
get() {
|
|
109
|
-
const { filter = null, filter_name = null } = props.modelValue || {};
|
|
110
|
-
return {
|
|
111
|
-
filter: filter,
|
|
112
|
-
filter_name: UseEncodeDecode.decode(filter_name)
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
set(val) {
|
|
116
|
-
const { filter = null, filter_name = {} } = val || {};
|
|
117
|
-
const payload = {
|
|
118
|
-
filter: filter,
|
|
119
|
-
filter_name: UseEncodeDecode.encode(filter_name)
|
|
120
|
-
};
|
|
121
|
-
emit('update:modelValue', payload);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
// выбранный фильтр из списка фильтров
|
|
125
|
-
const currentFilter = computed(() => {
|
|
126
|
-
return props.filters.find((f) => String(f.value) === String(selectedOptionFilter.value)) || {};
|
|
127
|
-
});
|
|
128
|
-
const isCurrentComponentIsRelation = computed(() => {
|
|
129
|
-
return currentFilter.value?.type === FilterTypes.Relation;
|
|
130
|
-
});
|
|
131
|
-
const isCurrentComponentIsDate = computed(() => {
|
|
132
|
-
return currentFilter.value?.type === FilterTypes.Date;
|
|
133
|
-
});
|
|
134
|
-
const isCurrentComponentIsText = computed(() => {
|
|
135
|
-
return currentFilter.value?.type === FilterTypes.Text;
|
|
136
|
-
});
|
|
137
|
-
const isCurrentComponentIsRange = computed(() => {
|
|
138
|
-
return currentFilter.value?.type === FilterTypes.Range;
|
|
139
|
-
});
|
|
140
|
-
// отфильтрованные быстрые фильтры
|
|
141
|
-
const fastFilters = computed(() => {
|
|
142
|
-
const selected = (currentValues.value && Object.keys(currentValues.value)) || [];
|
|
143
|
-
return props.filters.filter((f) => f.type === FilterTypes.Fast && !selected.includes(f.value));
|
|
144
|
-
});
|
|
145
|
-
// отфильтрованные фильтры кроме быстрых
|
|
146
|
-
const regularFilters = computed(() => {
|
|
147
|
-
return props.filters.filter((f) => f.type !== FilterTypes.Fast);
|
|
148
|
-
});
|
|
149
|
-
const visibilityToggleVariation = computed(() => {
|
|
150
|
-
return isOpen.value || !isDisableConfirmButton.value ? 'purple-invert' : 'black-flat';
|
|
151
|
-
});
|
|
152
|
-
// видна ли кнопка добавить фильтр
|
|
153
|
-
const hasButtonAdd = computed(() => {
|
|
154
|
-
return (!helper.isEmpty(currentCondition.value) && !!currentFilter.value && currentFilter.value.type !== FilterTypes.Fast);
|
|
155
|
-
});
|
|
156
|
-
// задизэйблена ли кнопка создать, для пресетов
|
|
157
|
-
const buttonCreateIsDisable = computed(() => {
|
|
158
|
-
return !newPresetName.value.trim();
|
|
159
|
-
});
|
|
160
|
-
const init = () => {
|
|
161
|
-
temporaryFilter.value = computedModelValue.value.filter;
|
|
162
|
-
temporaryFilterName.value = computedModelValue.value.filter_name;
|
|
163
|
-
currentValues.value = computedModelValue.value.filter;
|
|
164
|
-
currentValuesName.value = computedModelValue.value.filter_name;
|
|
165
|
-
};
|
|
166
|
-
onMounted(() => {
|
|
167
|
-
updatePresets();
|
|
168
|
-
window.addEventListener('storage', updatePresets);
|
|
169
|
-
init();
|
|
170
|
-
});
|
|
171
|
-
onBeforeUnmount(() => {
|
|
172
|
-
window.removeEventListener('storage', updatePresets);
|
|
173
|
-
});
|
|
174
|
-
const updatePresets = () => {
|
|
175
|
-
presets.value = filterLocalStorage.value[props.name] || [];
|
|
176
|
-
};
|
|
177
|
-
const handlerSetFastFilter = (tag) => {
|
|
178
|
-
const { relation, value } = tag;
|
|
179
|
-
const filterValue = relation ? { [relation]: tag.default } : tag.default;
|
|
180
|
-
selectedOptionFilter.value = value;
|
|
181
|
-
handleConditionChange({ value: filterValue, valueName: tag.name });
|
|
182
|
-
handleStoreTag();
|
|
183
|
-
};
|
|
184
|
-
const handleConditionChange = ({ value, valueName }) => {
|
|
185
|
-
currentCondition.value = value;
|
|
186
|
-
currentConditionName.value = valueName || '';
|
|
187
|
-
};
|
|
188
|
-
const handleStoreTag = () => {
|
|
189
|
-
activeTag.value ? editTag() : addTag();
|
|
190
|
-
};
|
|
191
|
-
const editTag = () => {
|
|
192
|
-
switch (currentFilter.value?.type) {
|
|
193
|
-
case FilterTypes.Relation: {
|
|
194
|
-
editRelationValue();
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
default: {
|
|
198
|
-
addSimpleValue();
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
activeTag.value = null;
|
|
203
|
-
};
|
|
204
|
-
const addTag = () => {
|
|
205
|
-
switch (currentFilter.value?.type) {
|
|
206
|
-
case FilterTypes.Relation: {
|
|
207
|
-
addRelationValue();
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
default: {
|
|
211
|
-
addSimpleValue();
|
|
212
|
-
break;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
activeTag.value = null;
|
|
216
|
-
};
|
|
217
|
-
const editRelationValue = () => {
|
|
218
|
-
if (activeTag.value) {
|
|
219
|
-
const tagRelationValue = activeTag.value.relationKey === FilterRelations.Exists ? [0] : [activeTag.value.value];
|
|
220
|
-
const tagRelation = {
|
|
221
|
-
[activeTag.value.category]: {
|
|
222
|
-
[activeTag.value.relationKey]: tagRelationValue
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
const selectedRelation = {
|
|
226
|
-
[selectedOptionFilter.value]: helper.cloneDeep(currentCondition.value)
|
|
227
|
-
};
|
|
228
|
-
if (helper.isEqual(selectedRelation, tagRelation)) {
|
|
229
|
-
/**
|
|
230
|
-
* Событие по возникшей ошибке
|
|
231
|
-
*/
|
|
232
|
-
emit('error', placeholders.messages.same_filter);
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
const { category, categoryName } = getCategoriesWithNewRelation();
|
|
237
|
-
if (activeTag.value) {
|
|
238
|
-
if (activeTag.value.relationKey === FilterRelations.Exists) {
|
|
239
|
-
delete category[activeTag.value.relationKey];
|
|
240
|
-
delete categoryName[activeTag.value.relationKey];
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
const numerableValues = category[activeTag.value.relationKey];
|
|
244
|
-
const index = numerableValues?.indexOf(String(activeTag.value.value)) ?? -1;
|
|
245
|
-
if (index !== -1) {
|
|
246
|
-
category?.[activeTag.value.relationKey]?.splice(index, 1);
|
|
247
|
-
helper.isEmpty(category[activeTag.value.relationKey]) && delete category[activeTag.value.relationKey];
|
|
248
|
-
delete categoryName?.[activeTag.value.relationKey]?.[activeTag.value.value];
|
|
249
|
-
helper.isEmpty(categoryName[activeTag.value.relationKey]) && delete categoryName[activeTag.value.relationKey];
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
setFilterValues(category, categoryName);
|
|
254
|
-
};
|
|
255
|
-
const addRelationValue = () => {
|
|
256
|
-
const { category, categoryName } = getCategoriesWithNewRelation();
|
|
257
|
-
setFilterValues(category, categoryName);
|
|
258
|
-
};
|
|
259
|
-
const getCategoriesWithNewRelation = () => {
|
|
260
|
-
const relationKeys = Object.keys(currentCondition.value);
|
|
261
|
-
const values = helper.cloneDeep(currentValues.value);
|
|
262
|
-
const valuesName = helper.cloneDeep(currentValuesName.value);
|
|
263
|
-
const selectedCategory = values[selectedOptionFilter.value];
|
|
264
|
-
const selectedCategoryName = valuesName[selectedOptionFilter.value];
|
|
265
|
-
selectedCategory &&
|
|
266
|
-
relationKeys.forEach((k) => {
|
|
267
|
-
if (k === FilterRelations.Exists) {
|
|
268
|
-
selectedCategory[FilterRelations.Exists] = 0;
|
|
269
|
-
selectedCategoryName[FilterRelations.Exists] = null;
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
//@ts-ignore
|
|
273
|
-
const conditionValue = currentCondition.value[k];
|
|
274
|
-
//@ts-ignore
|
|
275
|
-
const conditionName = currentConditionName.value[k];
|
|
276
|
-
if (k in selectedCategory) {
|
|
277
|
-
//@ts-ignore
|
|
278
|
-
selectedCategory[k] = helper.uniqWith([...selectedCategory[k], ...conditionValue], helper.isEqual);
|
|
279
|
-
selectedCategoryName[k] = {
|
|
280
|
-
...selectedCategoryName[k],
|
|
281
|
-
...conditionName
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
selectedCategory[k] = conditionValue;
|
|
286
|
-
selectedCategoryName[k] = conditionName;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
return { category: selectedCategory, categoryName: selectedCategoryName };
|
|
291
|
-
};
|
|
292
|
-
const setFilterValues = (val, valName) => {
|
|
293
|
-
const newVal = {
|
|
294
|
-
...currentValues.value,
|
|
295
|
-
[selectedOptionFilter.value]: val || currentCondition.value
|
|
296
|
-
};
|
|
297
|
-
if (helper.isEqual(currentValues.value, newVal)) {
|
|
298
|
-
/**
|
|
299
|
-
* Событие по возникшей ошибке
|
|
300
|
-
*/
|
|
301
|
-
emit('error', placeholders.messages.same_filter);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
currentValues.value = newVal;
|
|
305
|
-
currentValuesName.value = {
|
|
306
|
-
...currentValuesName.value,
|
|
307
|
-
[selectedOptionFilter.value]: valName || currentConditionName.value
|
|
308
|
-
};
|
|
309
|
-
setEmptyCondition();
|
|
310
|
-
};
|
|
311
|
-
const setEmptyCondition = () => {
|
|
312
|
-
switch (currentFilter.value?.type) {
|
|
313
|
-
case FilterTypes.Text:
|
|
314
|
-
case FilterTypes.Relation:
|
|
315
|
-
handleConditionChange({ value: '' });
|
|
316
|
-
break;
|
|
317
|
-
case FilterTypes.Range:
|
|
318
|
-
case FilterTypes.Date:
|
|
319
|
-
handleConditionChange({ value: {} });
|
|
320
|
-
break;
|
|
321
|
-
default:
|
|
322
|
-
break;
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
const addSimpleValue = () => {
|
|
326
|
-
if (currentFilter.value?.type === FilterTypes.Range && Object.keys(currentCondition.value || {}).length === 2) {
|
|
327
|
-
const _currentCondition = currentCondition.value;
|
|
328
|
-
if (_currentCondition.more && _currentCondition.less && _currentCondition.more > _currentCondition.less) {
|
|
329
|
-
/**
|
|
330
|
-
* Событие по возникшей ошибке
|
|
331
|
-
*/
|
|
332
|
-
emit('error', placeholders.messages.more_than);
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
setFilterValues(currentCondition.value, currentCondition.value);
|
|
337
|
-
};
|
|
338
|
-
const onTagsChange = (val) => {
|
|
339
|
-
activeTag.value = null;
|
|
340
|
-
if (helper.isEmpty(val)) {
|
|
341
|
-
currentValues.value = {};
|
|
342
|
-
currentValuesName.value = {};
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
currentValuesName.value = helper.cloneDeep(val);
|
|
346
|
-
setRelationsToArrayFormat(val);
|
|
347
|
-
};
|
|
348
|
-
const handleClearAllTags = () => {
|
|
349
|
-
temporaryFilter.value = {};
|
|
350
|
-
temporaryFilterName.value = {};
|
|
351
|
-
currentValues.value = {};
|
|
352
|
-
currentValuesName.value = {};
|
|
353
|
-
/**
|
|
354
|
-
* Событие по очистке выбранных фильтров из поля
|
|
355
|
-
*/
|
|
356
|
-
emit('clear', placeholders.messages.accidentally_cleared);
|
|
357
|
-
};
|
|
358
|
-
const setRelationsToArrayFormat = (obj) => {
|
|
359
|
-
const newObj = helper.cloneDeep(obj);
|
|
360
|
-
const relationKeys = [FilterRelations.Is, FilterRelations.IsNot];
|
|
361
|
-
for (let [categoryKey, categoryVal] of Object.entries(obj)) {
|
|
362
|
-
if (categoryVal.constructor === Object) {
|
|
363
|
-
for (let [key, val] of Object.entries(categoryVal)) {
|
|
364
|
-
if (relationKeys.includes(key) && val?.constructor === Object) {
|
|
365
|
-
newObj[categoryKey][key] = [...Object.keys(val)];
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
currentValues.value = newObj;
|
|
371
|
-
};
|
|
372
|
-
const onTagClick = (tag) => {
|
|
373
|
-
activeTag.value = (helper.isEqual(activeTag.value, tag) ? null : tag);
|
|
374
|
-
if (!activeTag.value) {
|
|
375
|
-
setEmptyCondition();
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
let condition = null;
|
|
379
|
-
let conditionName = null;
|
|
380
|
-
if (tag.relationKey) {
|
|
381
|
-
condition = {
|
|
382
|
-
[tag.relationKey]: tag.relationKey === FilterRelations.Exists ? [0] : [String(tag.value)]
|
|
383
|
-
};
|
|
384
|
-
conditionName = {
|
|
385
|
-
[tag.relationKey]: tag.relationKey === FilterRelations.Exists ? [0] : { [tag.value]: tag.title }
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
else {
|
|
389
|
-
condition = tag.value?.constructor === Object ? tag.value : String(tag.value);
|
|
390
|
-
conditionName = tag.value;
|
|
391
|
-
}
|
|
392
|
-
selectedOptionFilter.value = tag.category;
|
|
393
|
-
nextTick(() => {
|
|
394
|
-
currentCondition.value = condition;
|
|
395
|
-
currentConditionName.value = conditionName;
|
|
396
|
-
});
|
|
397
|
-
};
|
|
398
|
-
const handleConfirm = () => {
|
|
399
|
-
/**
|
|
400
|
-
* Событие по изменению значения фильтра
|
|
401
|
-
*/
|
|
402
|
-
computedModelValue.value = {
|
|
403
|
-
filter: currentValues.value,
|
|
404
|
-
filter_name: currentValuesName.value
|
|
405
|
-
};
|
|
406
|
-
const payload = {
|
|
407
|
-
filter: currentValues.value,
|
|
408
|
-
filter_name: UseEncodeDecode.encode(currentValuesName.value)
|
|
409
|
-
};
|
|
410
|
-
emit('confirm', payload);
|
|
411
|
-
};
|
|
412
|
-
/**
|
|
413
|
-
* PRESETS BELOW
|
|
414
|
-
* */
|
|
415
|
-
const handlePresetMouseUp = (preset) => {
|
|
416
|
-
if (activePreset.value && activePreset.value.name === preset.name) {
|
|
417
|
-
activePreset.value = null;
|
|
418
|
-
currentValues.value = {};
|
|
419
|
-
currentValuesName.value = {};
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
activePreset.value = preset;
|
|
423
|
-
currentValues.value = helper.cloneDeep(preset.filter);
|
|
424
|
-
currentValuesName.value = helper.cloneDeep(preset.filter_name);
|
|
425
|
-
}
|
|
426
|
-
if (!isOpen.value) {
|
|
427
|
-
handleConfirm();
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
const handleDeletePreset = (preset) => {
|
|
431
|
-
const filteredPresets = filterLocalStorage.value[props.name]?.filter((p) => preset && p.name !== preset.name);
|
|
432
|
-
filterLocalStorage.value[props.name] = [...filteredPresets];
|
|
433
|
-
temporaryActivePreset.value = helper.cloneDeep(activePreset.value);
|
|
434
|
-
activePreset.value = null;
|
|
435
|
-
currentValues.value = {};
|
|
436
|
-
currentValuesName.value = {};
|
|
437
|
-
/**
|
|
438
|
-
* Событие по удалению пресета
|
|
439
|
-
*/
|
|
440
|
-
emit('delete-preset', placeholders.messages.accidentally_deleted);
|
|
441
|
-
};
|
|
442
|
-
const handleCreatePreset = () => {
|
|
443
|
-
if (filterLocalStorage.value[props.name] &&
|
|
444
|
-
filterLocalStorage.value[props.name].find((p) => p.name?.trim() === newPresetName.value?.trim())) {
|
|
445
|
-
emit('error', placeholders.messages.same_preset_name);
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
const preset = {
|
|
449
|
-
name: newPresetName.value?.trim(),
|
|
450
|
-
filter: helper.cloneDeep(currentValues.value),
|
|
451
|
-
filter_name: helper.cloneDeep(currentValuesName.value)
|
|
452
|
-
};
|
|
453
|
-
const currentPreset = filterLocalStorage.value[props.name];
|
|
454
|
-
if (currentPreset) {
|
|
455
|
-
filterLocalStorage.value[props.name] = [preset, ...currentPreset];
|
|
456
|
-
}
|
|
457
|
-
else {
|
|
458
|
-
filterLocalStorage.value[props.name] = [preset];
|
|
459
|
-
}
|
|
460
|
-
newPresetName.value = '';
|
|
461
|
-
activePreset.value = { ...preset };
|
|
462
|
-
};
|
|
463
|
-
const getPresetButtonVariation = (preset) => {
|
|
464
|
-
return activePreset.value && activePreset.value.name === preset.name ? 'purple-invert' : 'gray-outline';
|
|
465
|
-
};
|
|
466
|
-
watch(() => props.modelValue, (val) => {
|
|
467
|
-
const filter_value = val || {
|
|
468
|
-
filter: null,
|
|
469
|
-
filter_name: null
|
|
470
|
-
};
|
|
471
|
-
currentValues.value = { ...filter_value.filter };
|
|
472
|
-
if (filter_value.filter_name) {
|
|
473
|
-
try {
|
|
474
|
-
currentValuesName.value = UseEncodeDecode.decode(filter_value.filter_name);
|
|
475
|
-
}
|
|
476
|
-
catch (e) {
|
|
477
|
-
console.error(`Can't parse filters`);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}, { deep: true });
|
|
481
|
-
watch(() => currentFilter.value, () => {
|
|
482
|
-
handleConditionChange({ value: '' });
|
|
483
|
-
}, { deep: true });
|
|
484
|
-
watch(() => currentValues.value, () => {
|
|
485
|
-
if (activePreset.value) {
|
|
486
|
-
const mappedPresets = filterLocalStorage.value[props.name].map((p) => {
|
|
487
|
-
if (activePreset.value && p.name === activePreset.value.name) {
|
|
488
|
-
return {
|
|
489
|
-
name: p.name,
|
|
490
|
-
filter: helper.cloneDeep(currentValues.value),
|
|
491
|
-
filter_name: helper.cloneDeep(currentValuesName.value)
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
return p;
|
|
495
|
-
});
|
|
496
|
-
filterLocalStorage.value[props.name] = [...mappedPresets];
|
|
497
|
-
}
|
|
498
|
-
}); /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
499
|
-
const __VLS_fnComponent = (await import('vue')).defineComponent({
|
|
500
|
-
props: {
|
|
501
|
-
/**
|
|
502
|
-
* Имя фильтра
|
|
503
|
-
* (для записи данных в стор)
|
|
504
|
-
*/
|
|
505
|
-
name: {
|
|
506
|
-
type: String,
|
|
507
|
-
required: true
|
|
508
|
-
},
|
|
509
|
-
/**
|
|
510
|
-
* Значение фильтра
|
|
511
|
-
*/
|
|
512
|
-
modelValue: {
|
|
513
|
-
type: Object,
|
|
514
|
-
required: true,
|
|
515
|
-
default: () => ({ filter: null, filter_name: null })
|
|
516
|
-
},
|
|
517
|
-
/**
|
|
518
|
-
* Типы фильтров
|
|
519
|
-
*/
|
|
520
|
-
filters: {
|
|
521
|
-
type: Array,
|
|
522
|
-
required: true,
|
|
523
|
-
default: () => []
|
|
524
|
-
},
|
|
525
|
-
/**
|
|
526
|
-
* Лоадинг кнопки применить фильтр
|
|
527
|
-
*/
|
|
528
|
-
buttonConfirmIsLoading: {
|
|
529
|
-
type: Boolean,
|
|
530
|
-
default: false
|
|
531
|
-
},
|
|
532
|
-
/**
|
|
533
|
-
* Использовать ли teleport (для рендеринга вне компонента)
|
|
534
|
-
* Если да то необходимо создать блок с id="filterTeleportTarget" в который будет рендериться тело фильтра
|
|
535
|
-
*/
|
|
536
|
-
useTeleport: {
|
|
537
|
-
type: Boolean,
|
|
538
|
-
default: false
|
|
539
|
-
},
|
|
540
|
-
/**
|
|
541
|
-
* Доступен ли фильтр для открытия
|
|
542
|
-
*/
|
|
543
|
-
disabledOpen: {
|
|
544
|
-
type: Boolean,
|
|
545
|
-
default: false
|
|
546
|
-
},
|
|
547
|
-
/**
|
|
548
|
-
* Нужно ли учитывать часовой пояс при работе с фильтром типа Date
|
|
549
|
-
* */
|
|
550
|
-
useTimezone: {
|
|
551
|
-
type: Boolean,
|
|
552
|
-
default: false
|
|
553
|
-
},
|
|
554
|
-
/**
|
|
555
|
-
* Переводы плейсхолеров и текстов
|
|
556
|
-
*/
|
|
557
|
-
placeholders: {
|
|
558
|
-
type: Object,
|
|
559
|
-
default: () => ({})
|
|
560
|
-
}
|
|
561
|
-
},
|
|
562
|
-
__typeEmits: {},
|
|
563
|
-
});
|
|
564
|
-
;
|
|
565
|
-
let __VLS_functionalComponentProps;
|
|
566
|
-
function __VLS_template() {
|
|
567
|
-
const __VLS_ctx = {};
|
|
568
|
-
const __VLS_localComponents = {
|
|
569
|
-
...{},
|
|
570
|
-
...{},
|
|
571
|
-
...__VLS_ctx,
|
|
572
|
-
};
|
|
573
|
-
let __VLS_components;
|
|
574
|
-
const __VLS_localDirectives = {
|
|
575
|
-
...{},
|
|
576
|
-
...__VLS_ctx,
|
|
577
|
-
};
|
|
578
|
-
let __VLS_directives;
|
|
579
|
-
let __VLS_styleScopedClasses;
|
|
580
|
-
// CSS variable injection
|
|
581
|
-
// CSS variable injection end
|
|
582
|
-
let __VLS_resolvedLocalAndGlobalComponents;
|
|
583
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter") }, });
|
|
584
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__header") }, });
|
|
585
|
-
// @ts-ignore
|
|
586
|
-
[McTooltip, McTooltip,];
|
|
587
|
-
// @ts-ignore
|
|
588
|
-
const __VLS_0 = __VLS_asFunctionalComponent(McTooltip, new McTooltip({ content: ((__VLS_ctx.placeholders.main_tooltip)), placement: ((__VLS_ctx.TooltipPositions.Top)), size: ((__VLS_ctx.TooltipSizes.S)), }));
|
|
589
|
-
const __VLS_1 = __VLS_0({ content: ((__VLS_ctx.placeholders.main_tooltip)), placement: ((__VLS_ctx.TooltipPositions.Top)), size: ((__VLS_ctx.TooltipSizes.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
590
|
-
// @ts-ignore
|
|
591
|
-
[McButton, McButton,];
|
|
592
|
-
// @ts-ignore
|
|
593
|
-
const __VLS_5 = __VLS_asFunctionalComponent(McButton, new McButton({ ...{ 'onClick': {} }, variation: ((__VLS_ctx.visibilityToggleVariation)), disabled: ((__VLS_ctx.disabledOpen)), bgFlat: ((__VLS_ctx.isOpen)), size: ((__VLS_ctx.ButtonSize.MCompact)), }));
|
|
594
|
-
const __VLS_6 = __VLS_5({ ...{ 'onClick': {} }, variation: ((__VLS_ctx.visibilityToggleVariation)), disabled: ((__VLS_ctx.disabledOpen)), bgFlat: ((__VLS_ctx.isOpen)), size: ((__VLS_ctx.ButtonSize.MCompact)), }, ...__VLS_functionalComponentArgsRest(__VLS_5));
|
|
595
|
-
let __VLS_10;
|
|
596
|
-
const __VLS_11 = {
|
|
597
|
-
onClick: (...[$event]) => {
|
|
598
|
-
__VLS_ctx.isOpen = !__VLS_ctx.isOpen;
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
let __VLS_7;
|
|
602
|
-
let __VLS_8;
|
|
603
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
|
|
604
|
-
{
|
|
605
|
-
const { "icon-prepend": __VLS_thisSlot } = __VLS_nonNullable(__VLS_9.slots);
|
|
606
|
-
// @ts-ignore
|
|
607
|
-
[McSvgIcon,];
|
|
608
|
-
// @ts-ignore
|
|
609
|
-
const __VLS_12 = __VLS_asFunctionalComponent(McSvgIcon, new McSvgIcon({ name: ("filter_list"), }));
|
|
610
|
-
const __VLS_13 = __VLS_12({ name: ("filter_list"), }, ...__VLS_functionalComponentArgsRest(__VLS_12));
|
|
611
|
-
}
|
|
612
|
-
var __VLS_9;
|
|
613
|
-
__VLS_nonNullable(__VLS_4.slots).default;
|
|
614
|
-
var __VLS_4;
|
|
615
|
-
if (__VLS_ctx.presets) {
|
|
616
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__presets") }, });
|
|
617
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__presets-inner") }, });
|
|
618
|
-
for (const [preset] of __VLS_getVForSourceType((__VLS_ctx.presets))) {
|
|
619
|
-
// @ts-ignore
|
|
620
|
-
[McButton, McButton,];
|
|
621
|
-
// @ts-ignore
|
|
622
|
-
const __VLS_17 = __VLS_asFunctionalComponent(McButton, new McButton({ ...{ 'onMouseup': {} }, key: ((preset.name)), variation: ((__VLS_ctx.getPresetButtonVariation(preset))), secondaryColor: ("purple"), }));
|
|
623
|
-
const __VLS_18 = __VLS_17({ ...{ 'onMouseup': {} }, key: ((preset.name)), variation: ((__VLS_ctx.getPresetButtonVariation(preset))), secondaryColor: ("purple"), }, ...__VLS_functionalComponentArgsRest(__VLS_17));
|
|
624
|
-
let __VLS_22;
|
|
625
|
-
const __VLS_23 = {
|
|
626
|
-
onMouseup: (() => __VLS_ctx.handlePresetMouseUp(preset))
|
|
627
|
-
};
|
|
628
|
-
let __VLS_19;
|
|
629
|
-
let __VLS_20;
|
|
630
|
-
(preset.name);
|
|
631
|
-
__VLS_nonNullable(__VLS_21.slots).default;
|
|
632
|
-
var __VLS_21;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
if (__VLS_ctx.isOpen) {
|
|
636
|
-
const __VLS_24 = ((__VLS_ctx.useTeleport ? __VLS_ctx.Teleport : 'div'));
|
|
637
|
-
// @ts-ignore
|
|
638
|
-
const __VLS_25 = __VLS_asFunctionalComponent(__VLS_24, new __VLS_24({ to: ("#filterTeleportTarget"), }));
|
|
639
|
-
const __VLS_26 = __VLS_25({ to: ("#filterTeleportTarget"), }, ...__VLS_functionalComponentArgsRest(__VLS_25));
|
|
640
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__body") }, });
|
|
641
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__body-top") }, });
|
|
642
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__body-top-left") }, });
|
|
643
|
-
// @ts-ignore
|
|
644
|
-
[McFieldSelect,];
|
|
645
|
-
// @ts-ignore
|
|
646
|
-
const __VLS_30 = __VLS_asFunctionalComponent(McFieldSelect, new McFieldSelect({ modelValue: ((__VLS_ctx.selectedOptionFilter)), title: ((__VLS_ctx.placeholders.value)), options: ((__VLS_ctx.regularFilters)), placeholder: ((__VLS_ctx.placeholders.choose)), hideSelected: ((false)), ...{ class: ("mc-filter__main-select") }, name: ("filter_value_name"), }));
|
|
647
|
-
const __VLS_31 = __VLS_30({ modelValue: ((__VLS_ctx.selectedOptionFilter)), title: ((__VLS_ctx.placeholders.value)), options: ((__VLS_ctx.regularFilters)), placeholder: ((__VLS_ctx.placeholders.choose)), hideSelected: ((false)), ...{ class: ("mc-filter__main-select") }, name: ("filter_value_name"), }, ...__VLS_functionalComponentArgsRest(__VLS_30));
|
|
648
|
-
if (__VLS_ctx.currentFilter) {
|
|
649
|
-
if (__VLS_ctx.isCurrentComponentIsRelation) {
|
|
650
|
-
// @ts-ignore
|
|
651
|
-
[McFilterTypeRelation,];
|
|
652
|
-
// @ts-ignore
|
|
653
|
-
const __VLS_35 = __VLS_asFunctionalComponent(McFilterTypeRelation, new McFilterTypeRelation({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }));
|
|
654
|
-
const __VLS_36 = __VLS_35({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }, ...__VLS_functionalComponentArgsRest(__VLS_35));
|
|
655
|
-
let __VLS_40;
|
|
656
|
-
const __VLS_41 = {
|
|
657
|
-
'onUpdate:modelValue': (__VLS_ctx.handleConditionChange)
|
|
658
|
-
};
|
|
659
|
-
let __VLS_37;
|
|
660
|
-
let __VLS_38;
|
|
661
|
-
var __VLS_39;
|
|
662
|
-
}
|
|
663
|
-
else if (__VLS_ctx.isCurrentComponentIsDate) {
|
|
664
|
-
// @ts-ignore
|
|
665
|
-
[McFilterTypeDate,];
|
|
666
|
-
// @ts-ignore
|
|
667
|
-
const __VLS_42 = __VLS_asFunctionalComponent(McFilterTypeDate, new McFilterTypeDate({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }));
|
|
668
|
-
const __VLS_43 = __VLS_42({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }, ...__VLS_functionalComponentArgsRest(__VLS_42));
|
|
669
|
-
let __VLS_47;
|
|
670
|
-
const __VLS_48 = {
|
|
671
|
-
'onUpdate:modelValue': (__VLS_ctx.handleConditionChange)
|
|
672
|
-
};
|
|
673
|
-
let __VLS_44;
|
|
674
|
-
let __VLS_45;
|
|
675
|
-
var __VLS_46;
|
|
676
|
-
}
|
|
677
|
-
else if (__VLS_ctx.isCurrentComponentIsText) {
|
|
678
|
-
// @ts-ignore
|
|
679
|
-
[McFilterTypeText,];
|
|
680
|
-
// @ts-ignore
|
|
681
|
-
const __VLS_49 = __VLS_asFunctionalComponent(McFilterTypeText, new McFilterTypeText({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }));
|
|
682
|
-
const __VLS_50 = __VLS_49({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }, ...__VLS_functionalComponentArgsRest(__VLS_49));
|
|
683
|
-
let __VLS_54;
|
|
684
|
-
const __VLS_55 = {
|
|
685
|
-
'onUpdate:modelValue': (__VLS_ctx.handleConditionChange)
|
|
686
|
-
};
|
|
687
|
-
let __VLS_51;
|
|
688
|
-
let __VLS_52;
|
|
689
|
-
var __VLS_53;
|
|
690
|
-
}
|
|
691
|
-
else if (__VLS_ctx.isCurrentComponentIsRange) {
|
|
692
|
-
// @ts-ignore
|
|
693
|
-
[McFilterTypeRange,];
|
|
694
|
-
// @ts-ignore
|
|
695
|
-
const __VLS_56 = __VLS_asFunctionalComponent(McFilterTypeRange, new McFilterTypeRange({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }));
|
|
696
|
-
const __VLS_57 = __VLS_56({ ...{ 'onUpdate:modelValue': {} }, modelValue: __VLS_ctx.currentCondition, filter: __VLS_ctx.currentFilter, placeholders: ((__VLS_ctx.placeholders)), currentValues: ((!__VLS_ctx.activeTag ? __VLS_ctx.currentValues : {})), useTimezone: ((props.useTimezone)), }, ...__VLS_functionalComponentArgsRest(__VLS_56));
|
|
697
|
-
let __VLS_61;
|
|
698
|
-
const __VLS_62 = {
|
|
699
|
-
'onUpdate:modelValue': (__VLS_ctx.handleConditionChange)
|
|
700
|
-
};
|
|
701
|
-
let __VLS_58;
|
|
702
|
-
let __VLS_59;
|
|
703
|
-
var __VLS_60;
|
|
704
|
-
}
|
|
705
|
-
if (__VLS_ctx.hasButtonAdd) {
|
|
706
|
-
// @ts-ignore
|
|
707
|
-
[McButton, McButton,];
|
|
708
|
-
// @ts-ignore
|
|
709
|
-
const __VLS_63 = __VLS_asFunctionalComponent(McButton, new McButton({ ...{ 'onClick': {} }, variation: ("purple-outline"), }));
|
|
710
|
-
const __VLS_64 = __VLS_63({ ...{ 'onClick': {} }, variation: ("purple-outline"), }, ...__VLS_functionalComponentArgsRest(__VLS_63));
|
|
711
|
-
let __VLS_68;
|
|
712
|
-
const __VLS_69 = {
|
|
713
|
-
onClick: (__VLS_ctx.handleStoreTag)
|
|
714
|
-
};
|
|
715
|
-
let __VLS_65;
|
|
716
|
-
let __VLS_66;
|
|
717
|
-
(__VLS_ctx.placeholders.actions[__VLS_ctx.activeTag ? 'save' : 'add']);
|
|
718
|
-
__VLS_nonNullable(__VLS_67.slots).default;
|
|
719
|
-
var __VLS_67;
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
// @ts-ignore
|
|
723
|
-
[McFilterTags,];
|
|
724
|
-
// @ts-ignore
|
|
725
|
-
const __VLS_70 = __VLS_asFunctionalComponent(McFilterTags, new McFilterTags({ ...{ 'onTagChange': {} }, ...{ 'onTagClick': {} }, ...{ 'onClear': {} }, modelValue: ((__VLS_ctx.currentValuesName)), filters: ((__VLS_ctx.filters)), placeholders: ((__VLS_ctx.placeholders)), activeTag: ((__VLS_ctx.activeTag)), useTimezone: ((props.useTimezone)), }));
|
|
726
|
-
const __VLS_71 = __VLS_70({ ...{ 'onTagChange': {} }, ...{ 'onTagClick': {} }, ...{ 'onClear': {} }, modelValue: ((__VLS_ctx.currentValuesName)), filters: ((__VLS_ctx.filters)), placeholders: ((__VLS_ctx.placeholders)), activeTag: ((__VLS_ctx.activeTag)), useTimezone: ((props.useTimezone)), }, ...__VLS_functionalComponentArgsRest(__VLS_70));
|
|
727
|
-
let __VLS_75;
|
|
728
|
-
const __VLS_76 = {
|
|
729
|
-
onTagChange: ((payload) => __VLS_ctx.onTagsChange(payload))
|
|
730
|
-
};
|
|
731
|
-
const __VLS_77 = {
|
|
732
|
-
onTagClick: ((payload) => __VLS_ctx.onTagClick(payload))
|
|
733
|
-
};
|
|
734
|
-
const __VLS_78 = {
|
|
735
|
-
onClear: (__VLS_ctx.handleClearAllTags)
|
|
736
|
-
};
|
|
737
|
-
let __VLS_72;
|
|
738
|
-
let __VLS_73;
|
|
739
|
-
var __VLS_74;
|
|
740
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.section, __VLS_intrinsicElements.section)({ ...{ class: ("mc-filter__body-fast-tags-wrapper") }, });
|
|
741
|
-
for (const [tag, i] of __VLS_getVForSourceType((__VLS_ctx.fastFilters))) {
|
|
742
|
-
// @ts-ignore
|
|
743
|
-
[McTooltip, McTooltip,];
|
|
744
|
-
// @ts-ignore
|
|
745
|
-
const __VLS_79 = __VLS_asFunctionalComponent(McTooltip, new McTooltip({ key: ((i)), content: ((tag.description || '')), placement: ((__VLS_ctx.TooltipPositions.Top)), size: ((__VLS_ctx.TooltipSizes.S)), }));
|
|
746
|
-
const __VLS_80 = __VLS_79({ key: ((i)), content: ((tag.description || '')), placement: ((__VLS_ctx.TooltipPositions.Top)), size: ((__VLS_ctx.TooltipSizes.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_79));
|
|
747
|
-
// @ts-ignore
|
|
748
|
-
[McChip, McChip,];
|
|
749
|
-
// @ts-ignore
|
|
750
|
-
const __VLS_84 = __VLS_asFunctionalComponent(McChip, new McChip({ ...{ 'onClick': {} }, variation: ("gray-outline"), textColor: ("black"), size: ((__VLS_ctx.ChipSize.S)), }));
|
|
751
|
-
const __VLS_85 = __VLS_84({ ...{ 'onClick': {} }, variation: ("gray-outline"), textColor: ("black"), size: ((__VLS_ctx.ChipSize.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_84));
|
|
752
|
-
let __VLS_89;
|
|
753
|
-
const __VLS_90 = {
|
|
754
|
-
onClick: (...[$event]) => {
|
|
755
|
-
if (!((__VLS_ctx.isOpen)))
|
|
756
|
-
return;
|
|
757
|
-
__VLS_ctx.handlerSetFastFilter(tag);
|
|
758
|
-
}
|
|
759
|
-
};
|
|
760
|
-
let __VLS_86;
|
|
761
|
-
let __VLS_87;
|
|
762
|
-
(tag.name);
|
|
763
|
-
__VLS_nonNullable(__VLS_88.slots).default;
|
|
764
|
-
var __VLS_88;
|
|
765
|
-
__VLS_nonNullable(__VLS_83.slots).default;
|
|
766
|
-
var __VLS_83;
|
|
767
|
-
}
|
|
768
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__body-bottom") }, });
|
|
769
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__body-bottom-left") }, });
|
|
770
|
-
// @ts-ignore
|
|
771
|
-
[McButton, McButton,];
|
|
772
|
-
// @ts-ignore
|
|
773
|
-
const __VLS_91 = __VLS_asFunctionalComponent(McButton, new McButton({ ...{ 'onClick': {} }, disabled: ((__VLS_ctx.isDisableConfirmButton)), loading: ((__VLS_ctx.buttonConfirmIsLoading)), size: ((__VLS_ctx.ButtonSize.S)), }));
|
|
774
|
-
const __VLS_92 = __VLS_91({ ...{ 'onClick': {} }, disabled: ((__VLS_ctx.isDisableConfirmButton)), loading: ((__VLS_ctx.buttonConfirmIsLoading)), size: ((__VLS_ctx.ButtonSize.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_91));
|
|
775
|
-
let __VLS_96;
|
|
776
|
-
const __VLS_97 = {
|
|
777
|
-
onClick: (__VLS_ctx.handleConfirm)
|
|
778
|
-
};
|
|
779
|
-
let __VLS_93;
|
|
780
|
-
let __VLS_94;
|
|
781
|
-
(__VLS_ctx.placeholders.actions.confirm);
|
|
782
|
-
__VLS_nonNullable(__VLS_95.slots).default;
|
|
783
|
-
var __VLS_95;
|
|
784
|
-
if (__VLS_ctx.activePreset) {
|
|
785
|
-
// @ts-ignore
|
|
786
|
-
[McButton, McButton,];
|
|
787
|
-
// @ts-ignore
|
|
788
|
-
const __VLS_98 = __VLS_asFunctionalComponent(McButton, new McButton({ ...{ 'onClick': {} }, variation: ("red-outline"), size: ((__VLS_ctx.ButtonSize.S)), }));
|
|
789
|
-
const __VLS_99 = __VLS_98({ ...{ 'onClick': {} }, variation: ("red-outline"), size: ((__VLS_ctx.ButtonSize.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_98));
|
|
790
|
-
let __VLS_103;
|
|
791
|
-
const __VLS_104 = {
|
|
792
|
-
onClick: (() => __VLS_ctx.handleDeletePreset(__VLS_ctx.activePreset))
|
|
793
|
-
};
|
|
794
|
-
let __VLS_100;
|
|
795
|
-
let __VLS_101;
|
|
796
|
-
(__VLS_ctx.placeholders.actions.delete_preset);
|
|
797
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
|
|
798
|
-
{
|
|
799
|
-
const { "icon-append": __VLS_thisSlot } = __VLS_nonNullable(__VLS_102.slots);
|
|
800
|
-
// @ts-ignore
|
|
801
|
-
[McSvgIcon,];
|
|
802
|
-
// @ts-ignore
|
|
803
|
-
const __VLS_105 = __VLS_asFunctionalComponent(McSvgIcon, new McSvgIcon({ name: ("delete"), size: ("250"), color: ("red"), }));
|
|
804
|
-
const __VLS_106 = __VLS_105({ name: ("delete"), size: ("250"), color: ("red"), }, ...__VLS_functionalComponentArgsRest(__VLS_105));
|
|
805
|
-
}
|
|
806
|
-
var __VLS_102;
|
|
807
|
-
}
|
|
808
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.div, __VLS_intrinsicElements.div)({ ...{ class: ("mc-filter__body-bottom-right") }, });
|
|
809
|
-
// @ts-ignore
|
|
810
|
-
[McTitle, McTitle,];
|
|
811
|
-
// @ts-ignore
|
|
812
|
-
const __VLS_110 = __VLS_asFunctionalComponent(McTitle, new McTitle({ ...{ class: ("mc-filter__preset-input-title") }, }));
|
|
813
|
-
const __VLS_111 = __VLS_110({ ...{ class: ("mc-filter__preset-input-title") }, }, ...__VLS_functionalComponentArgsRest(__VLS_110));
|
|
814
|
-
(__VLS_ctx.placeholders.create_preset);
|
|
815
|
-
__VLS_elementAsFunction(__VLS_intrinsicElements.template, __VLS_intrinsicElements.template)({});
|
|
816
|
-
{
|
|
817
|
-
const { "icon-append": __VLS_thisSlot } = __VLS_nonNullable(__VLS_114.slots);
|
|
818
|
-
// @ts-ignore
|
|
819
|
-
[McTooltip, McTooltip,];
|
|
820
|
-
// @ts-ignore
|
|
821
|
-
const __VLS_115 = __VLS_asFunctionalComponent(McTooltip, new McTooltip({ content: ((__VLS_ctx.placeholders.enter_preset_tooltip)), placement: ((__VLS_ctx.TooltipPositions.Top)), size: ((__VLS_ctx.TooltipSizes.S)), }));
|
|
822
|
-
const __VLS_116 = __VLS_115({ content: ((__VLS_ctx.placeholders.enter_preset_tooltip)), placement: ((__VLS_ctx.TooltipPositions.Top)), size: ((__VLS_ctx.TooltipSizes.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_115));
|
|
823
|
-
// @ts-ignore
|
|
824
|
-
[McSvgIcon,];
|
|
825
|
-
// @ts-ignore
|
|
826
|
-
const __VLS_120 = __VLS_asFunctionalComponent(McSvgIcon, new McSvgIcon({ name: ("help_solid"), size: ("250"), color: ("outline-gray"), }));
|
|
827
|
-
const __VLS_121 = __VLS_120({ name: ("help_solid"), size: ("250"), color: ("outline-gray"), }, ...__VLS_functionalComponentArgsRest(__VLS_120));
|
|
828
|
-
__VLS_nonNullable(__VLS_119.slots).default;
|
|
829
|
-
var __VLS_119;
|
|
830
|
-
}
|
|
831
|
-
var __VLS_114;
|
|
832
|
-
// @ts-ignore
|
|
833
|
-
[McFieldText,];
|
|
834
|
-
// @ts-ignore
|
|
835
|
-
const __VLS_125 = __VLS_asFunctionalComponent(McFieldText, new McFieldText({ modelValue: ((__VLS_ctx.newPresetName)), placeholder: ((__VLS_ctx.placeholders.enter_preset_name)), maxLength: ((20)), ...{ class: ("mc-filter__preset-input") }, name: ("preset_name"), }));
|
|
836
|
-
const __VLS_126 = __VLS_125({ modelValue: ((__VLS_ctx.newPresetName)), placeholder: ((__VLS_ctx.placeholders.enter_preset_name)), maxLength: ((20)), ...{ class: ("mc-filter__preset-input") }, name: ("preset_name"), }, ...__VLS_functionalComponentArgsRest(__VLS_125));
|
|
837
|
-
// @ts-ignore
|
|
838
|
-
[McButton, McButton,];
|
|
839
|
-
// @ts-ignore
|
|
840
|
-
const __VLS_130 = __VLS_asFunctionalComponent(McButton, new McButton({ ...{ 'onClick': {} }, disabled: ((__VLS_ctx.buttonCreateIsDisable)), variation: ("purple-outline"), size: ((__VLS_ctx.ButtonSize.S)), }));
|
|
841
|
-
const __VLS_131 = __VLS_130({ ...{ 'onClick': {} }, disabled: ((__VLS_ctx.buttonCreateIsDisable)), variation: ("purple-outline"), size: ((__VLS_ctx.ButtonSize.S)), }, ...__VLS_functionalComponentArgsRest(__VLS_130));
|
|
842
|
-
let __VLS_135;
|
|
843
|
-
const __VLS_136 = {
|
|
844
|
-
onClick: (__VLS_ctx.handleCreatePreset)
|
|
845
|
-
};
|
|
846
|
-
let __VLS_132;
|
|
847
|
-
let __VLS_133;
|
|
848
|
-
(__VLS_ctx.placeholders.actions.create);
|
|
849
|
-
__VLS_nonNullable(__VLS_134.slots).default;
|
|
850
|
-
var __VLS_134;
|
|
851
|
-
__VLS_nonNullable(__VLS_29.slots).default;
|
|
852
|
-
var __VLS_29;
|
|
853
|
-
}
|
|
854
|
-
__VLS_styleScopedClasses['mc-filter'];
|
|
855
|
-
__VLS_styleScopedClasses['mc-filter__header'];
|
|
856
|
-
__VLS_styleScopedClasses['mc-filter__presets'];
|
|
857
|
-
__VLS_styleScopedClasses['mc-filter__presets-inner'];
|
|
858
|
-
__VLS_styleScopedClasses['mc-filter__body'];
|
|
859
|
-
__VLS_styleScopedClasses['mc-filter__body-top'];
|
|
860
|
-
__VLS_styleScopedClasses['mc-filter__body-top-left'];
|
|
861
|
-
__VLS_styleScopedClasses['mc-filter__main-select'];
|
|
862
|
-
__VLS_styleScopedClasses['mc-filter__body-fast-tags-wrapper'];
|
|
863
|
-
__VLS_styleScopedClasses['mc-filter__body-bottom'];
|
|
864
|
-
__VLS_styleScopedClasses['mc-filter__body-bottom-left'];
|
|
865
|
-
__VLS_styleScopedClasses['mc-filter__body-bottom-right'];
|
|
866
|
-
__VLS_styleScopedClasses['mc-filter__preset-input-title'];
|
|
867
|
-
__VLS_styleScopedClasses['mc-filter__preset-input'];
|
|
868
|
-
var __VLS_slots;
|
|
869
|
-
var __VLS_inheritedAttrs;
|
|
870
|
-
const __VLS_refs = {};
|
|
871
|
-
var $refs;
|
|
872
|
-
var $el;
|
|
873
|
-
return {
|
|
874
|
-
attrs: {},
|
|
875
|
-
slots: __VLS_slots,
|
|
876
|
-
refs: $refs,
|
|
877
|
-
rootEl: $el,
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
;
|
|
881
|
-
const __VLS_self = (await import('vue')).defineComponent({
|
|
882
|
-
setup() {
|
|
883
|
-
return {
|
|
884
|
-
Teleport: Teleport,
|
|
885
|
-
McSvgIcon: McSvgIcon,
|
|
886
|
-
McButton: McButton,
|
|
887
|
-
McTitle: McTitle,
|
|
888
|
-
McFieldSelect: McFieldSelect,
|
|
889
|
-
McFieldText: McFieldText,
|
|
890
|
-
McTooltip: McTooltip,
|
|
891
|
-
McFilterTags: McFilterTags,
|
|
892
|
-
McFilterTypeRange: McFilterTypeRange,
|
|
893
|
-
McFilterTypeDate: McFilterTypeDate,
|
|
894
|
-
McFilterTypeText: McFilterTypeText,
|
|
895
|
-
McFilterTypeRelation: McFilterTypeRelation,
|
|
896
|
-
McChip: McChip,
|
|
897
|
-
ButtonSize: ButtonSize,
|
|
898
|
-
ChipSize: ChipSize,
|
|
899
|
-
TooltipPositions: TooltipPositions,
|
|
900
|
-
TooltipSizes: TooltipSizes,
|
|
901
|
-
isOpen: isOpen,
|
|
902
|
-
currentValues: currentValues,
|
|
903
|
-
currentValuesName: currentValuesName,
|
|
904
|
-
currentCondition: currentCondition,
|
|
905
|
-
selectedOptionFilter: selectedOptionFilter,
|
|
906
|
-
activeTag: activeTag,
|
|
907
|
-
placeholders: placeholders,
|
|
908
|
-
isDisableConfirmButton: isDisableConfirmButton,
|
|
909
|
-
newPresetName: newPresetName,
|
|
910
|
-
activePreset: activePreset,
|
|
911
|
-
presets: presets,
|
|
912
|
-
currentFilter: currentFilter,
|
|
913
|
-
isCurrentComponentIsRelation: isCurrentComponentIsRelation,
|
|
914
|
-
isCurrentComponentIsDate: isCurrentComponentIsDate,
|
|
915
|
-
isCurrentComponentIsText: isCurrentComponentIsText,
|
|
916
|
-
isCurrentComponentIsRange: isCurrentComponentIsRange,
|
|
917
|
-
fastFilters: fastFilters,
|
|
918
|
-
regularFilters: regularFilters,
|
|
919
|
-
visibilityToggleVariation: visibilityToggleVariation,
|
|
920
|
-
hasButtonAdd: hasButtonAdd,
|
|
921
|
-
buttonCreateIsDisable: buttonCreateIsDisable,
|
|
922
|
-
handlerSetFastFilter: handlerSetFastFilter,
|
|
923
|
-
handleConditionChange: handleConditionChange,
|
|
924
|
-
handleStoreTag: handleStoreTag,
|
|
925
|
-
onTagsChange: onTagsChange,
|
|
926
|
-
handleClearAllTags: handleClearAllTags,
|
|
927
|
-
onTagClick: onTagClick,
|
|
928
|
-
handleConfirm: handleConfirm,
|
|
929
|
-
handlePresetMouseUp: handlePresetMouseUp,
|
|
930
|
-
handleDeletePreset: handleDeletePreset,
|
|
931
|
-
handleCreatePreset: handleCreatePreset,
|
|
932
|
-
getPresetButtonVariation: getPresetButtonVariation,
|
|
933
|
-
};
|
|
934
|
-
},
|
|
935
|
-
__typeEmits: {},
|
|
936
|
-
props: {
|
|
937
|
-
/**
|
|
938
|
-
* Имя фильтра
|
|
939
|
-
* (для записи данных в стор)
|
|
940
|
-
*/
|
|
941
|
-
name: {
|
|
942
|
-
type: String,
|
|
943
|
-
required: true
|
|
944
|
-
},
|
|
945
|
-
/**
|
|
946
|
-
* Значение фильтра
|
|
947
|
-
*/
|
|
948
|
-
modelValue: {
|
|
949
|
-
type: Object,
|
|
950
|
-
required: true,
|
|
951
|
-
default: () => ({ filter: null, filter_name: null })
|
|
952
|
-
},
|
|
953
|
-
/**
|
|
954
|
-
* Типы фильтров
|
|
955
|
-
*/
|
|
956
|
-
filters: {
|
|
957
|
-
type: Array,
|
|
958
|
-
required: true,
|
|
959
|
-
default: () => []
|
|
960
|
-
},
|
|
961
|
-
/**
|
|
962
|
-
* Лоадинг кнопки применить фильтр
|
|
963
|
-
*/
|
|
964
|
-
buttonConfirmIsLoading: {
|
|
965
|
-
type: Boolean,
|
|
966
|
-
default: false
|
|
967
|
-
},
|
|
968
|
-
/**
|
|
969
|
-
* Использовать ли teleport (для рендеринга вне компонента)
|
|
970
|
-
* Если да то необходимо создать блок с id="filterTeleportTarget" в который будет рендериться тело фильтра
|
|
971
|
-
*/
|
|
972
|
-
useTeleport: {
|
|
973
|
-
type: Boolean,
|
|
974
|
-
default: false
|
|
975
|
-
},
|
|
976
|
-
/**
|
|
977
|
-
* Доступен ли фильтр для открытия
|
|
978
|
-
*/
|
|
979
|
-
disabledOpen: {
|
|
980
|
-
type: Boolean,
|
|
981
|
-
default: false
|
|
982
|
-
},
|
|
983
|
-
/**
|
|
984
|
-
* Нужно ли учитывать часовой пояс при работе с фильтром типа Date
|
|
985
|
-
* */
|
|
986
|
-
useTimezone: {
|
|
987
|
-
type: Boolean,
|
|
988
|
-
default: false
|
|
989
|
-
},
|
|
990
|
-
/**
|
|
991
|
-
* Переводы плейсхолеров и текстов
|
|
992
|
-
*/
|
|
993
|
-
placeholders: {
|
|
994
|
-
type: Object,
|
|
995
|
-
default: () => ({})
|
|
996
|
-
}
|
|
997
|
-
},
|
|
998
|
-
});
|
|
999
|
-
export default (await import('vue')).defineComponent({
|
|
1000
|
-
setup() {
|
|
1001
|
-
return {};
|
|
1002
|
-
},
|
|
1003
|
-
__typeEmits: {},
|
|
1004
|
-
props: {
|
|
1005
|
-
/**
|
|
1006
|
-
* Имя фильтра
|
|
1007
|
-
* (для записи данных в стор)
|
|
1008
|
-
*/
|
|
1009
|
-
name: {
|
|
1010
|
-
type: String,
|
|
1011
|
-
required: true
|
|
1012
|
-
},
|
|
1013
|
-
/**
|
|
1014
|
-
* Значение фильтра
|
|
1015
|
-
*/
|
|
1016
|
-
modelValue: {
|
|
1017
|
-
type: Object,
|
|
1018
|
-
required: true,
|
|
1019
|
-
default: () => ({ filter: null, filter_name: null })
|
|
1020
|
-
},
|
|
1021
|
-
/**
|
|
1022
|
-
* Типы фильтров
|
|
1023
|
-
*/
|
|
1024
|
-
filters: {
|
|
1025
|
-
type: Array,
|
|
1026
|
-
required: true,
|
|
1027
|
-
default: () => []
|
|
1028
|
-
},
|
|
1029
|
-
/**
|
|
1030
|
-
* Лоадинг кнопки применить фильтр
|
|
1031
|
-
*/
|
|
1032
|
-
buttonConfirmIsLoading: {
|
|
1033
|
-
type: Boolean,
|
|
1034
|
-
default: false
|
|
1035
|
-
},
|
|
1036
|
-
/**
|
|
1037
|
-
* Использовать ли teleport (для рендеринга вне компонента)
|
|
1038
|
-
* Если да то необходимо создать блок с id="filterTeleportTarget" в который будет рендериться тело фильтра
|
|
1039
|
-
*/
|
|
1040
|
-
useTeleport: {
|
|
1041
|
-
type: Boolean,
|
|
1042
|
-
default: false
|
|
1043
|
-
},
|
|
1044
|
-
/**
|
|
1045
|
-
* Доступен ли фильтр для открытия
|
|
1046
|
-
*/
|
|
1047
|
-
disabledOpen: {
|
|
1048
|
-
type: Boolean,
|
|
1049
|
-
default: false
|
|
1050
|
-
},
|
|
1051
|
-
/**
|
|
1052
|
-
* Нужно ли учитывать часовой пояс при работе с фильтром типа Date
|
|
1053
|
-
* */
|
|
1054
|
-
useTimezone: {
|
|
1055
|
-
type: Boolean,
|
|
1056
|
-
default: false
|
|
1057
|
-
},
|
|
1058
|
-
/**
|
|
1059
|
-
* Переводы плейсхолеров и текстов
|
|
1060
|
-
*/
|
|
1061
|
-
placeholders: {
|
|
1062
|
-
type: Object,
|
|
1063
|
-
default: () => ({})
|
|
1064
|
-
}
|
|
1065
|
-
},
|
|
1066
|
-
__typeEl: {},
|
|
1067
|
-
});
|
|
1068
|
-
; /* PartiallyEnd: #4569/main.vue */
|