@firstnoodle-ui/bui 0.0.27 → 0.0.28
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/LICENSE +21 -21
- package/dist/bui.css +1 -1
- package/dist/components/calendar-view/CalendarView.vue.d.ts +21 -0
- package/dist/components/calendar-view/components/DateButton.vue.d.ts +10 -0
- package/dist/components/calendar-view/components/DecadeView.vue.d.ts +12 -0
- package/dist/components/calendar-view/components/MonthView.vue.d.ts +17 -0
- package/dist/components/calendar-view/components/YearView.vue.d.ts +13 -0
- package/dist/components/calendar-view/composables/useCalendar.d.ts +44 -0
- package/dist/components/calendar-view/index.d.ts +1 -0
- package/dist/components/calendar-view/utils/enums.d.ts +29 -0
- package/dist/components/calendar-view/utils/index.d.ts +23 -0
- package/dist/components/calendar-view/utils/types.d.ts +12 -0
- package/dist/components/calendar-view/utils/utils/calendar.d.ts +22 -0
- package/dist/components/calendar-view/utils/utils/date.d.ts +15 -0
- package/dist/components/calendar-view/utils/utils/format.d.ts +18 -0
- package/dist/components/calendar-view/utils/utils/time.d.ts +35 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/notification-badge/NotificationBadge.vue.d.ts +5 -0
- package/dist/components/notification-badge/index.d.ts +1 -0
- package/dist/components/select-list/components/option-group/OptionGroup.vue.d.ts +1 -0
- package/dist/components/select-list/components/select-list-option/SelectListOption.vue.d.ts +1 -0
- package/dist/components/select-list/types.d.ts +1 -0
- package/dist/components/types.d.ts +1 -1
- package/dist/index.mjs +7056 -6465
- package/dist/utils/capitalizeFirstLetter.d.ts +1 -0
- package/package.json +4 -3
- package/src/components/application-wrapper/ApplicationWrapper.vue +8 -0
- package/src/components/application-wrapper/index.ts +1 -0
- package/src/components/aside-section-label/AsideSectionLabel.vue +16 -0
- package/src/components/aside-section-label/index.ts +1 -0
- package/src/components/button/Button.vue +246 -0
- package/src/components/button/NotificationBadge.vue +15 -0
- package/src/components/button/components/button-label/ButtonLabel.vue +9 -0
- package/src/components/button/components/button-label/index.ts +1 -0
- package/src/components/button/components/index.ts +3 -0
- package/src/components/button/components/left-group/LeftGroup.vue +5 -0
- package/src/components/button/components/left-group/index.ts +1 -0
- package/src/components/button/components/notification-badge/NotificationBadge.vue +17 -0
- package/src/components/button/components/notification-badge/index.ts +1 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/ButtonGroup.vue +97 -0
- package/src/components/button-group/index.ts +1 -0
- package/src/components/calendar-view/CalendarView.vue +106 -0
- package/src/components/calendar-view/components/DateButton.vue +23 -0
- package/src/components/calendar-view/components/DecadeView.vue +50 -0
- package/src/components/calendar-view/components/MonthView.vue +72 -0
- package/src/components/calendar-view/components/NavButton.vue +16 -0
- package/src/components/calendar-view/components/YearView.vue +52 -0
- package/src/components/calendar-view/composables/useCalendar.ts +138 -0
- package/src/components/calendar-view/index.ts +1 -0
- package/src/components/calendar-view/utils/enums.ts +31 -0
- package/src/components/calendar-view/utils/index.ts +240 -0
- package/src/components/calendar-view/utils/types.ts +13 -0
- package/src/components/calendar-view/utils/utils/calendar.ts +70 -0
- package/src/components/calendar-view/utils/utils/date.ts +130 -0
- package/src/components/calendar-view/utils/utils/format.ts +61 -0
- package/src/components/calendar-view/utils/utils/time.ts +70 -0
- package/src/components/checkbox/Checkbox.vue +51 -0
- package/src/components/checkbox/CircleIndicator.vue +26 -0
- package/src/components/checkbox/DefaultIndicator.vue +19 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/collapse/Collapse.vue +114 -0
- package/src/components/collapse/index.ts +1 -0
- package/src/components/confirm-cancel/ConfirmCancel.vue +66 -0
- package/src/components/confirm-cancel/index.ts +1 -0
- package/src/components/confirm-cancel/types.ts +18 -0
- package/src/components/content-slider/ContentSlider.vue +79 -0
- package/src/components/content-slider/index.ts +1 -0
- package/src/components/data-point/DataPoint.vue +5 -0
- package/src/components/data-point/index.ts +1 -0
- package/src/components/delete-button/DeleteButton.vue +19 -0
- package/src/components/delete-button/index.ts +1 -0
- package/src/components/dialog/Dialog.vue +70 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/fade-in-up/FadeInUp.vue +17 -0
- package/src/components/fade-in-up/index.ts +1 -0
- package/src/components/filter-chip/FilterChip.vue +28 -0
- package/src/components/filter-chip/index.ts +1 -0
- package/src/components/first-paint/FirstPaint.vue +21 -0
- package/src/components/first-paint/index.ts +1 -0
- package/src/components/first-paint/style.scss +23 -0
- package/src/components/flexbox/Flexbox.vue +51 -0
- package/src/components/flexbox/index.ts +1 -0
- package/src/components/horizontal-layout/Aside.vue +114 -0
- package/src/components/horizontal-layout/HorizontalLayout.vue +118 -0
- package/src/components/horizontal-layout/index.ts +2 -0
- package/src/components/icon/Icon.vue +1263 -0
- package/src/components/icon/index.ts +1 -0
- package/src/components/icon/utils/combine-svgs.cjs +55 -0
- package/src/components/icon/utils/combined-svgs.txt +1150 -0
- package/src/components/icon/utils/svgs/admin.svg +16 -0
- package/src/components/icon/utils/svgs/arrow-deviate.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-down-plus.svg +4 -0
- package/src/components/icon/utils/svgs/arrow-down.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-from.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-left.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-move.svg +15 -0
- package/src/components/icon/utils/svgs/arrow-right.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-sub.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-trend.svg +15 -0
- package/src/components/icon/utils/svgs/arrow-up-plus.svg +4 -0
- package/src/components/icon/utils/svgs/arrow-up.svg +3 -0
- package/src/components/icon/utils/svgs/authority.svg +5 -0
- package/src/components/icon/utils/svgs/beams.svg +5 -0
- package/src/components/icon/utils/svgs/bell.svg +15 -0
- package/src/components/icon/utils/svgs/bold.svg +3 -0
- package/src/components/icon/utils/svgs/box.svg +5 -0
- package/src/components/icon/utils/svgs/building.svg +15 -0
- package/src/components/icon/utils/svgs/bullet-list.svg +8 -0
- package/src/components/icon/utils/svgs/calendar.svg +21 -0
- package/src/components/icon/utils/svgs/camera.svg +5 -0
- package/src/components/icon/utils/svgs/categories.svg +3 -0
- package/src/components/icon/utils/svgs/check-circled.svg +16 -0
- package/src/components/icon/utils/svgs/check-outline.svg +15 -0
- package/src/components/icon/utils/svgs/check.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-down.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-left-double.svg +4 -0
- package/src/components/icon/utils/svgs/chevron-left.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-right-double.svg +4 -0
- package/src/components/icon/utils/svgs/chevron-right.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-up.svg +3 -0
- package/src/components/icon/utils/svgs/clock.svg +4 -0
- package/src/components/icon/utils/svgs/close-outline.svg +3 -0
- package/src/components/icon/utils/svgs/close.svg +3 -0
- package/src/components/icon/utils/svgs/columns.svg +3 -0
- package/src/components/icon/utils/svgs/conclusion.svg +17 -0
- package/src/components/icon/utils/svgs/copy.svg +16 -0
- package/src/components/icon/utils/svgs/crosshair.svg +15 -0
- package/src/components/icon/utils/svgs/dash.svg +3 -0
- package/src/components/icon/utils/svgs/dashboard.svg +3 -0
- package/src/components/icon/utils/svgs/delete.svg +4 -0
- package/src/components/icon/utils/svgs/delta.svg +3 -0
- package/src/components/icon/utils/svgs/download.svg +3 -0
- package/src/components/icon/utils/svgs/drag.svg +8 -0
- package/src/components/icon/utils/svgs/drilldown.svg +8 -0
- package/src/components/icon/utils/svgs/edit.svg +16 -0
- package/src/components/icon/utils/svgs/envelope.svg +3 -0
- package/src/components/icon/utils/svgs/error.svg +3 -0
- package/src/components/icon/utils/svgs/export-document.svg +16 -0
- package/src/components/icon/utils/svgs/filter.svg +6 -0
- package/src/components/icon/utils/svgs/filters.svg +4 -0
- package/src/components/icon/utils/svgs/flag.svg +3 -0
- package/src/components/icon/utils/svgs/folder.svg +15 -0
- package/src/components/icon/utils/svgs/frequency.svg +3 -0
- package/src/components/icon/utils/svgs/fullscreen-off.svg +3 -0
- package/src/components/icon/utils/svgs/fullscreen-on.svg +3 -0
- package/src/components/icon/utils/svgs/graduate.svg +3 -0
- package/src/components/icon/utils/svgs/hamburger.svg +5 -0
- package/src/components/icon/utils/svgs/handshake.svg +15 -0
- package/src/components/icon/utils/svgs/heading-1.svg +4 -0
- package/src/components/icon/utils/svgs/heading-2.svg +4 -0
- package/src/components/icon/utils/svgs/heading.svg +3 -0
- package/src/components/icon/utils/svgs/home.svg +3 -0
- package/src/components/icon/utils/svgs/id-card.svg +6 -0
- package/src/components/icon/utils/svgs/id.svg +4 -0
- package/src/components/icon/utils/svgs/indent-left.svg +7 -0
- package/src/components/icon/utils/svgs/indent-right.svg +7 -0
- package/src/components/icon/utils/svgs/information.svg +17 -0
- package/src/components/icon/utils/svgs/italics.svg +3 -0
- package/src/components/icon/utils/svgs/itenary.svg +11 -0
- package/src/components/icon/utils/svgs/keyboard.svg +11 -0
- package/src/components/icon/utils/svgs/lightning.svg +15 -0
- package/src/components/icon/utils/svgs/link.svg +4 -0
- package/src/components/icon/utils/svgs/list-collapse.svg +6 -0
- package/src/components/icon/utils/svgs/list-expand.svg +6 -0
- package/src/components/icon/utils/svgs/location.svg +4 -0
- package/src/components/icon/utils/svgs/lock-locked.svg +4 -0
- package/src/components/icon/utils/svgs/lock-unlocked.svg +4 -0
- package/src/components/icon/utils/svgs/magnifying-glass.svg +15 -0
- package/src/components/icon/utils/svgs/map.svg +3 -0
- package/src/components/icon/utils/svgs/megaphone.svg +3 -0
- package/src/components/icon/utils/svgs/message.svg +15 -0
- package/src/components/icon/utils/svgs/microscope.svg +3 -0
- package/src/components/icon/utils/svgs/moon.svg +3 -0
- package/src/components/icon/utils/svgs/new-document.svg +4 -0
- package/src/components/icon/utils/svgs/news.svg +15 -0
- package/src/components/icon/utils/svgs/numbered-list.svg +7 -0
- package/src/components/icon/utils/svgs/open-link.svg +16 -0
- package/src/components/icon/utils/svgs/options.svg +5 -0
- package/src/components/icon/utils/svgs/page.svg +7 -0
- package/src/components/icon/utils/svgs/paper-plane.svg +15 -0
- package/src/components/icon/utils/svgs/paper.svg +3 -0
- package/src/components/icon/utils/svgs/pen-and-paper.svg +4 -0
- package/src/components/icon/utils/svgs/phase.svg +15 -0
- package/src/components/icon/utils/svgs/photo.svg +4 -0
- package/src/components/icon/utils/svgs/pie-chart.svg +3 -0
- package/src/components/icon/utils/svgs/plus.svg +3 -0
- package/src/components/icon/utils/svgs/point-left.svg +3 -0
- package/src/components/icon/utils/svgs/point-up.svg +3 -0
- package/src/components/icon/utils/svgs/popup.svg +16 -0
- package/src/components/icon/utils/svgs/question.svg +17 -0
- package/src/components/icon/utils/svgs/radio-tower.svg +3 -0
- package/src/components/icon/utils/svgs/recycle.svg +3 -0
- package/src/components/icon/utils/svgs/redo.svg +3 -0
- package/src/components/icon/utils/svgs/refresh.svg +3 -0
- package/src/components/icon/utils/svgs/route.svg +3 -0
- package/src/components/icon/utils/svgs/rows.svg +3 -0
- package/src/components/icon/utils/svgs/scope.svg +7 -0
- package/src/components/icon/utils/svgs/settings.svg +16 -0
- package/src/components/icon/utils/svgs/share.svg +11 -0
- package/src/components/icon/utils/svgs/sign-in.svg +4 -0
- package/src/components/icon/utils/svgs/sign-up.svg +3 -0
- package/src/components/icon/utils/svgs/sort-down.svg +20 -0
- package/src/components/icon/utils/svgs/sort-up.svg +20 -0
- package/src/components/icon/utils/svgs/sort.svg +7 -0
- package/src/components/icon/utils/svgs/square-solid.svg +3 -0
- package/src/components/icon/utils/svgs/star-solid.svg +15 -0
- package/src/components/icon/utils/svgs/star.svg +15 -0
- package/src/components/icon/utils/svgs/stop-watch.svg +5 -0
- package/src/components/icon/utils/svgs/structure.svg +3 -0
- package/src/components/icon/utils/svgs/sun.svg +23 -0
- package/src/components/icon/utils/svgs/table.svg +3 -0
- package/src/components/icon/utils/svgs/tag.svg +15 -0
- package/src/components/icon/utils/svgs/team.svg +15 -0
- package/src/components/icon/utils/svgs/telescope.svg +15 -0
- package/src/components/icon/utils/svgs/trash.svg +6 -0
- package/src/components/icon/utils/svgs/triangle-angle.svg +3 -0
- package/src/components/icon/utils/svgs/triangle-side.svg +3 -0
- package/src/components/icon/utils/svgs/underline.svg +4 -0
- package/src/components/icon/utils/svgs/undo.svg +3 -0
- package/src/components/icon/utils/svgs/user.svg +16 -0
- package/src/components/icon/utils/svgs/venn.svg +3 -0
- package/src/components/icon/utils/svgs/video.svg +3 -0
- package/src/components/icon/utils/svgs/visibility-off-alt.svg +19 -0
- package/src/components/icon/utils/svgs/visibility-off.svg +3 -0
- package/src/components/icon/utils/svgs/visibility-on.svg +16 -0
- package/src/components/icon/utils/svgs/warning.svg +5 -0
- package/src/components/index.ts +45 -0
- package/src/components/input/Input.vue +118 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input-number/InputNumber.vue +112 -0
- package/src/components/input-number/StepButton.vue +23 -0
- package/src/components/input-number/index.ts +1 -0
- package/src/components/load-spinner/LoadSpinner.vue +13 -0
- package/src/components/load-spinner/index.ts +1 -0
- package/src/components/modal/Modal.vue +111 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/nav-item/NavItem.vue +62 -0
- package/src/components/nav-item/index.ts +1 -0
- package/src/components/notification/Notification.vue +53 -0
- package/src/components/notification/index.ts +1 -0
- package/src/components/notification-badge/NotificationBadge.vue +7 -0
- package/src/components/notification-badge/index.ts +1 -0
- package/src/components/pagination/Pagination.vue +65 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pop-confirm/PopConfirm.vue +90 -0
- package/src/components/pop-confirm/index.ts +1 -0
- package/src/components/pop-select/FooterButton.vue +5 -0
- package/src/components/pop-select/PopSelect.vue +346 -0
- package/src/components/pop-select/ResultFilters.vue +28 -0
- package/src/components/pop-select/enums.ts +7 -0
- package/src/components/pop-select/index.ts +2 -0
- package/src/components/pop-select/option.vue +51 -0
- package/src/components/popper/Popper.vue +239 -0
- package/src/components/popper/PopperContent.vue +5 -0
- package/src/components/popper/index.ts +2 -0
- package/src/components/popper/middleware.ts +19 -0
- package/src/components/screen-overlay/ScreenOverlay.vue +53 -0
- package/src/components/screen-overlay/index.ts +1 -0
- package/src/components/scrollbar/Bar.vue +106 -0
- package/src/components/scrollbar/ScrollBottomLoader.vue +25 -0
- package/src/components/scrollbar/Scrollbar.vue +219 -0
- package/src/components/scrollbar/enums.ts +23 -0
- package/src/components/scrollbar/index.ts +3 -0
- package/src/components/scrollbar/style.scss +77 -0
- package/src/components/scrollbar/types.ts +32 -0
- package/src/components/select-list/SelectList.vue +476 -0
- package/src/components/select-list/components/SelectListFilterChip.vue +34 -0
- package/src/components/select-list/components/index.ts +3 -0
- package/src/components/select-list/components/option-group/OptionGroup.vue +20 -0
- package/src/components/select-list/components/option-group/index.ts +1 -0
- package/src/components/select-list/components/select-list-option/SelectListOption.vue +83 -0
- package/src/components/select-list/components/select-list-option/index.ts +1 -0
- package/src/components/select-list/components/status-cards/error-card/ErrorCard.vue +17 -0
- package/src/components/select-list/components/status-cards/error-card/index.ts +1 -0
- package/src/components/select-list/components/status-cards/idle-card/IdleCard.vue +11 -0
- package/src/components/select-list/components/status-cards/idle-card/index.ts +1 -0
- package/src/components/select-list/components/status-cards/index.ts +4 -0
- package/src/components/select-list/components/status-cards/loading-card/LoadingCard.vue +10 -0
- package/src/components/select-list/components/status-cards/loading-card/index.ts +1 -0
- package/src/components/select-list/components/status-cards/no-match-card/NoMatchCard.vue +15 -0
- package/src/components/select-list/components/status-cards/no-match-card/index.ts +1 -0
- package/src/components/select-list/components/status-cards/status-card/StatusCard.vue +25 -0
- package/src/components/select-list/components/status-cards/status-card/index.ts +1 -0
- package/src/components/select-list/index.ts +5 -0
- package/src/components/select-list/types.ts +49 -0
- package/src/components/side-over/SideOver.vue +87 -0
- package/src/components/side-over/index.ts +1 -0
- package/src/components/status-select/StatusIndicator.vue +78 -0
- package/src/components/status-select/StatusSelect.vue +62 -0
- package/src/components/status-select/index.ts +1 -0
- package/src/components/switch/Switch.vue +52 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/tab/Tab.vue +65 -0
- package/src/components/tab/index.ts +1 -0
- package/src/components/tag/Tag.vue +34 -0
- package/src/components/tag/index.ts +1 -0
- package/src/components/text-editor/TextEditor.vue +399 -0
- package/src/components/text-editor/components/Dialog.vue +11 -0
- package/src/components/text-editor/components/FormattingButton.vue +46 -0
- package/src/components/text-editor/components/InsertLinkDialog.vue +81 -0
- package/src/components/text-editor/components/InsertTextDialog.vue +36 -0
- package/src/components/text-editor/components/index.ts +3 -0
- package/src/components/text-editor/index.ts +1 -0
- package/src/components/text-highlight/TextHighlight.vue +113 -0
- package/src/components/text-highlight/index.ts +1 -0
- package/src/components/text-viewer/TextViewer.vue +5 -0
- package/src/components/text-viewer/index.ts +1 -0
- package/src/components/toggle-button/ToggleButton.vue +105 -0
- package/src/components/toggle-button/index.ts +1 -0
- package/src/components/tooltip/Tooltip.vue +54 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/types.ts +232 -0
- package/src/components/vertical-layout/RunningSection.vue +54 -0
- package/src/components/vertical-layout/VerticalLayout.vue +37 -0
- package/src/components/vertical-layout/index.ts +3 -0
- package/src/components/vertical-layout/types.ts +2 -0
- package/src/components/window-frame/WindowFrame.vue +20 -0
- package/src/components/window-frame/index.ts +1 -0
- package/src/composables/index.ts +5 -0
- package/src/composables/useClickOutside.ts +48 -0
- package/src/composables/useEscapeKey.ts +12 -0
- package/src/composables/useMounted.ts +7 -0
- package/src/composables/useNextFrame.ts +10 -0
- package/src/composables/useTrapFocus.ts +61 -0
- package/src/index.ts +5 -0
- package/src/main.css +140 -0
- package/src/utils/array.ts +11 -0
- package/src/utils/capitalizeFirstLetter.ts +4 -0
- package/src/utils/clamp.ts +9 -0
- package/src/utils/debounce.ts +8 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/scrollIntoView.ts +25 -0
- package/src/utils/scrollbarWidth.ts +27 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Slots } from "vue";
|
|
3
|
+
import type { TOverlayType } from "../types";
|
|
4
|
+
import { onMounted, ref, useSlots } from "vue";
|
|
5
|
+
import { BButton, BFadeInUp, BScreenOverlay, BVerticalLayout, BWindowFrame } from "../";
|
|
6
|
+
import { useEscapeKey } from "../../composables";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
closeable?: boolean;
|
|
11
|
+
expandVertically?: boolean;
|
|
12
|
+
overlayType?: TOverlayType;
|
|
13
|
+
target?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
widthClass?:
|
|
16
|
+
| "max-w-xs"
|
|
17
|
+
| "max-w-sm"
|
|
18
|
+
| "max-w-md"
|
|
19
|
+
| "max-w-lg"
|
|
20
|
+
| "max-w-xl"
|
|
21
|
+
| "max-w-2xl"
|
|
22
|
+
| "max-w-3xl"
|
|
23
|
+
| "max-w-4xl"
|
|
24
|
+
| "max-w-5xl"
|
|
25
|
+
| "max-w-6xl"
|
|
26
|
+
| "max-w-7xl"
|
|
27
|
+
| "max-w-8xl"
|
|
28
|
+
| "max-w-full";
|
|
29
|
+
}>(),
|
|
30
|
+
{
|
|
31
|
+
closeable: true,
|
|
32
|
+
expandVertically: false,
|
|
33
|
+
overlayType: "default",
|
|
34
|
+
target: "#modals",
|
|
35
|
+
widthClass: "max-w-2xl",
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const emit = defineEmits(["close", "ready"]);
|
|
40
|
+
|
|
41
|
+
const slots: Slots = useSlots();
|
|
42
|
+
const windowRef = ref<typeof BWindowFrame>();
|
|
43
|
+
const show = ref(false);
|
|
44
|
+
|
|
45
|
+
onMounted(() => {
|
|
46
|
+
if (slots.default && (props.title || slots.header || slots.main || slots.footer)) {
|
|
47
|
+
console.warn(
|
|
48
|
+
"You are using named slots (or props.title) and default slot at the same time. This is not supported. Please use either named slots (and props.title) or the default slot.",
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
// when component is mounted start the transition
|
|
52
|
+
show.value = true;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const close = () => (show.value = false);
|
|
56
|
+
const onClose = () => props.closeable && close();
|
|
57
|
+
props.closeable && useEscapeKey(onClose);
|
|
58
|
+
|
|
59
|
+
const onTransitionAfterEnter = () => {
|
|
60
|
+
// windowRef.value!.trapFocus();
|
|
61
|
+
emit("ready");
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
defineExpose({ close });
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<Teleport :to="target">
|
|
69
|
+
<BScreenOverlay
|
|
70
|
+
:show="show"
|
|
71
|
+
:type="overlayType"
|
|
72
|
+
:class="props.expandVertically ? 'p-2 md:p-12' : 'p-2 md:pt-32'"
|
|
73
|
+
@click="onClose"
|
|
74
|
+
@close="emit('close')"
|
|
75
|
+
>
|
|
76
|
+
<BFadeInUp @transition-after-enter="onTransitionAfterEnter">
|
|
77
|
+
<BWindowFrame
|
|
78
|
+
v-show="show"
|
|
79
|
+
ref="windowRef"
|
|
80
|
+
class="h-full"
|
|
81
|
+
:class="[
|
|
82
|
+
props.widthClass,
|
|
83
|
+
{
|
|
84
|
+
'px-8 py-6': !slots.default,
|
|
85
|
+
'md:h-auto': !props.expandVertically,
|
|
86
|
+
},
|
|
87
|
+
]"
|
|
88
|
+
>
|
|
89
|
+
<slot v-if="$slots.default" />
|
|
90
|
+
<BVerticalLayout v-else>
|
|
91
|
+
<template v-if="props.title || $slots.header" #header>
|
|
92
|
+
<header v-if="props.title" class="flex items-center justify-between h-12 w-full mb-4">
|
|
93
|
+
<h4>{{ props.title }}</h4>
|
|
94
|
+
<BButton v-if="closeable" icon="close" variant="textSubtle" @click="onClose" />
|
|
95
|
+
</header>
|
|
96
|
+
<slot name="header" />
|
|
97
|
+
</template>
|
|
98
|
+
<template #main>
|
|
99
|
+
<slot name="main" />
|
|
100
|
+
</template>
|
|
101
|
+
<template v-if="$slots.footer" #footer>
|
|
102
|
+
<footer class="flex items-center h-full">
|
|
103
|
+
<slot name="footer" />
|
|
104
|
+
</footer>
|
|
105
|
+
</template>
|
|
106
|
+
</BVerticalLayout>
|
|
107
|
+
</BWindowFrame>
|
|
108
|
+
</BFadeInUp>
|
|
109
|
+
</BScreenOverlay>
|
|
110
|
+
</Teleport>
|
|
111
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BModal } from "./Modal.vue";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TIcon } from "../types";
|
|
3
|
+
import { BIcon } from "../";
|
|
4
|
+
|
|
5
|
+
withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
exact?: boolean;
|
|
8
|
+
icon?: TIcon;
|
|
9
|
+
orientation?: "horizontal" | "vertical";
|
|
10
|
+
to: string | { name?: string; path?: string; params?: Record<string, number | string | null>; query?: Record<string, number | string | null> };
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
isExactActive?: boolean;
|
|
13
|
+
href?: string;
|
|
14
|
+
}>(),
|
|
15
|
+
{
|
|
16
|
+
exact: false,
|
|
17
|
+
orientation: "horizontal",
|
|
18
|
+
isActive: false,
|
|
19
|
+
isExactActive: false,
|
|
20
|
+
href: "/",
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
(e: "navigate", to: string): void;
|
|
26
|
+
}>();
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<template v-if="orientation === 'horizontal'">
|
|
31
|
+
<a class="group h-full cursor-pointer py-2" @click="emit('navigate', href)">
|
|
32
|
+
<div
|
|
33
|
+
class="h-full flex items-center space-x-2 px-4 rounded-lg group-hover:opacity-100"
|
|
34
|
+
:class="{
|
|
35
|
+
'bg-secondary text-primary opacity-100': isActive || isExactActive,
|
|
36
|
+
'bg-primary text-secondary opacity-50 hover:bg-secondary': !(isActive || isExactActive),
|
|
37
|
+
}"
|
|
38
|
+
>
|
|
39
|
+
<BIcon v-if="icon" :name="icon" />
|
|
40
|
+
<span class="text-sm tracking-wide">
|
|
41
|
+
<slot />
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
</a>
|
|
45
|
+
</template>
|
|
46
|
+
<template v-else>
|
|
47
|
+
<a class="group h-full cursor-pointer py-2" @click="emit('navigate', href)">
|
|
48
|
+
<div
|
|
49
|
+
class="h-10 flex items-center space-x-2 px-4 rounded-lg group-hover:opacity-100"
|
|
50
|
+
:class="{
|
|
51
|
+
'bg-action text-white font-medium opacity-100': isActive || isExactActive,
|
|
52
|
+
'bg-primary text-secondary opacity-50 hover:bg-secondary active:bg-tertiary': !(isActive || isExactActive),
|
|
53
|
+
}"
|
|
54
|
+
>
|
|
55
|
+
<BIcon v-if="icon" :name="icon" />
|
|
56
|
+
<span class="text-sm tracking-wide">
|
|
57
|
+
<slot />
|
|
58
|
+
</span>
|
|
59
|
+
</div>
|
|
60
|
+
</a>
|
|
61
|
+
</template>
|
|
62
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BNavItem } from "./NavItem.vue";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { BButton, BFlexbox, BIcon } from "../";
|
|
4
|
+
|
|
5
|
+
const { type = "default" } = defineProps<{
|
|
6
|
+
showDetailsButton?: boolean;
|
|
7
|
+
text: string;
|
|
8
|
+
type?: "default" | "error" | "warning" | "success";
|
|
9
|
+
}>();
|
|
10
|
+
|
|
11
|
+
const emit = defineEmits(["close", "show-details"]);
|
|
12
|
+
|
|
13
|
+
const icon = computed(() => {
|
|
14
|
+
if (type === "default") return "information";
|
|
15
|
+
if (type === "error") return "error";
|
|
16
|
+
if (type === "warning") return "warning";
|
|
17
|
+
return "check-circled";
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div data-theme="dark" class="inline-flex items-stretch h-10 px-1 rounded-xl bg-black shadow-xl pointer-events-auto">
|
|
23
|
+
<BFlexbox
|
|
24
|
+
class="gap-2 px-3 rounded-l-lg"
|
|
25
|
+
:class="{
|
|
26
|
+
'text-stone-300': type === 'default',
|
|
27
|
+
'text-amber-300': type === 'warning',
|
|
28
|
+
'text-red-300': type === 'error',
|
|
29
|
+
'text-emerald-300': type === 'success',
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<BIcon :name="icon" />
|
|
33
|
+
<span class="text-sm cursor-default">{{ text }}</span>
|
|
34
|
+
</BFlexbox>
|
|
35
|
+
<BFlexbox class="px-2">
|
|
36
|
+
<BButton
|
|
37
|
+
v-if="showDetailsButton"
|
|
38
|
+
small
|
|
39
|
+
variant="outline"
|
|
40
|
+
label="Details"
|
|
41
|
+
@click="emit('show-details')"
|
|
42
|
+
/>
|
|
43
|
+
</BFlexbox>
|
|
44
|
+
<BFlexbox class="px-1">
|
|
45
|
+
<BButton
|
|
46
|
+
small
|
|
47
|
+
variant="textSubtle"
|
|
48
|
+
icon="close"
|
|
49
|
+
@click="emit('close')"
|
|
50
|
+
/>
|
|
51
|
+
</BFlexbox>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BNotification } from "./Notification.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BNotificationBadge } from "./NotificationBadge.vue";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TPopSelectOption } from "../types";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { BButton, BPopSelect } from "../";
|
|
5
|
+
import { range } from "../../utils";
|
|
6
|
+
|
|
7
|
+
const { borders = false, currentPage, lastPage, orientation = "horizontal" } = defineProps<{
|
|
8
|
+
borders?: boolean;
|
|
9
|
+
currentPage: number;
|
|
10
|
+
lastPage: number;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(["change"]);
|
|
15
|
+
const navRef = ref<HTMLElement>();
|
|
16
|
+
|
|
17
|
+
const pageOptions = computed((): TPopSelectOption[] => {
|
|
18
|
+
return range(0, lastPage).map((num: number) => ({ label: `${num + 1}` }));
|
|
19
|
+
});
|
|
20
|
+
const prevStyle = borders ? { borderRadius: "8px 0 0 8px" } : undefined;
|
|
21
|
+
const nextStyle = borders ? { borderRadius: "0px 8px 8px 0px" } : undefined;
|
|
22
|
+
const midStyle = borders ? { borderRadius: "0" } : undefined;
|
|
23
|
+
const variant = borders ? "outlineSubtle" : "textSubtle";
|
|
24
|
+
|
|
25
|
+
const onChange = (direction: -1 | 1) => {
|
|
26
|
+
let targetPage = currentPage + direction;
|
|
27
|
+
if (targetPage > lastPage) targetPage = 1;
|
|
28
|
+
if (targetPage < 1) targetPage = lastPage;
|
|
29
|
+
emit("change", targetPage);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const onPageSelect = (pageOption: TPopSelectOption) => {
|
|
33
|
+
emit("change", pageOption.label);
|
|
34
|
+
};
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<nav ref="navRef" class="relative z-0 inline-flex">
|
|
39
|
+
<BButton
|
|
40
|
+
:variant="variant"
|
|
41
|
+
:icon="orientation === 'horizontal' ? 'chevron-left' : 'chevron-up'"
|
|
42
|
+
:style="prevStyle"
|
|
43
|
+
class="z-0 hover:z-10 focus:z-10 active:z-10"
|
|
44
|
+
@click="onChange(-1)"
|
|
45
|
+
/>
|
|
46
|
+
<BPopSelect :same-width-as-element="navRef" placement="bottom" :value="currentPage" :options="pageOptions" @select="onPageSelect">
|
|
47
|
+
<template #trigger="slotProps">
|
|
48
|
+
<BButton
|
|
49
|
+
:variant="variant"
|
|
50
|
+
:label="`${currentPage} / ${lastPage}`"
|
|
51
|
+
:style="midStyle"
|
|
52
|
+
:focus="slotProps && slotProps.visible"
|
|
53
|
+
class="z-0 hover:z-10 focus:z-10 active:z-10 -ml-px"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
56
|
+
</BPopSelect>
|
|
57
|
+
<BButton
|
|
58
|
+
:variant="variant"
|
|
59
|
+
:icon="orientation === 'horizontal' ? 'chevron-right' : 'chevron-down'"
|
|
60
|
+
:style="nextStyle"
|
|
61
|
+
class="z-0 hover:z-10 focus:z-10 active:z-10 -ml-px"
|
|
62
|
+
@click="onChange(1)"
|
|
63
|
+
/>
|
|
64
|
+
</nav>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BPagination } from "./Pagination.vue";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Placement } from "@floating-ui/dom";
|
|
3
|
+
import type { ConfirmCancelProps } from "../confirm-cancel/types";
|
|
4
|
+
import type { ButtonVariant, TIcon } from "../types";
|
|
5
|
+
import { nextTick, ref } from "vue";
|
|
6
|
+
import { BConfirmCancel, BPopper, BPopperContent } from "../";
|
|
7
|
+
import { useTrapFocus } from "../../";
|
|
8
|
+
|
|
9
|
+
withDefaults(
|
|
10
|
+
defineProps<ConfirmCancelProps & {
|
|
11
|
+
title?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
placement?: Placement;
|
|
14
|
+
tagName?: string;
|
|
15
|
+
}>(),
|
|
16
|
+
{
|
|
17
|
+
placement: "bottom",
|
|
18
|
+
tagName: "span",
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const emit = defineEmits(["cancel", "close", "confirm"]);
|
|
23
|
+
|
|
24
|
+
const popperRef = ref<typeof BPopper>();
|
|
25
|
+
const contentRef = ref<HTMLDivElement>();
|
|
26
|
+
const { trapFocus } = useTrapFocus(contentRef);
|
|
27
|
+
|
|
28
|
+
const close = () => {
|
|
29
|
+
emit("close");
|
|
30
|
+
popperRef.value && popperRef.value.close();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const onOpen = () => nextTick(trapFocus);
|
|
34
|
+
|
|
35
|
+
const onCancel = () => {
|
|
36
|
+
close();
|
|
37
|
+
emit("cancel");
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const onConfirm = () => {
|
|
41
|
+
close();
|
|
42
|
+
emit("confirm");
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<BPopper ref="popperRef" trigger="click" :placement="placement" @open="onOpen" @close="close">
|
|
48
|
+
<template #default="slotProps">
|
|
49
|
+
<div class="inline-flex">
|
|
50
|
+
<slot name="trigger" :visible="slotProps && slotProps.visible" />
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
<template #content>
|
|
54
|
+
<BPopperContent>
|
|
55
|
+
<div
|
|
56
|
+
ref="contentRef"
|
|
57
|
+
class="flex flex-col max-w-72"
|
|
58
|
+
:class="{
|
|
59
|
+
'p-4 gap-4': title || description,
|
|
60
|
+
'p-2': !(title || description),
|
|
61
|
+
}"
|
|
62
|
+
>
|
|
63
|
+
<section v-if="title || description" class="flex flex-col gap-0">
|
|
64
|
+
<h5>{{ title }}</h5>
|
|
65
|
+
<p class="text-sm text-secondary">
|
|
66
|
+
{{ description }}
|
|
67
|
+
</p>
|
|
68
|
+
</section>
|
|
69
|
+
<BConfirmCancel
|
|
70
|
+
:vertical="!(title || description)"
|
|
71
|
+
:small="small"
|
|
72
|
+
:cancel-variant="(cancelVariant as ButtonVariant)"
|
|
73
|
+
:confirm-variant="(confirmVariant as ButtonVariant)"
|
|
74
|
+
:confirm-icon="(confirmIcon as TIcon)"
|
|
75
|
+
:cancel-icon="(cancelIcon as TIcon)"
|
|
76
|
+
:confirm-label="confirmLabel"
|
|
77
|
+
:cancel-label="cancelLabel"
|
|
78
|
+
:confirm-disabled="confirmDisabled"
|
|
79
|
+
:cancel-disabled="cancelDisabled"
|
|
80
|
+
:fill-container="fillContainer || Boolean(title || description)"
|
|
81
|
+
:loading="loading"
|
|
82
|
+
order="confirm-last"
|
|
83
|
+
@cancel="onCancel"
|
|
84
|
+
@confirm="onConfirm"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</BPopperContent>
|
|
88
|
+
</template>
|
|
89
|
+
</BPopper>
|
|
90
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BPopConfirm } from "./PopConfirm.vue";
|