Fix TS exports of enums from BBUI, bump portal version
This commit is contained in:
parent
3bd8becab1
commit
b54a9fb462
|
@ -80,7 +80,7 @@
|
||||||
"dayjs": "^1.10.8",
|
"dayjs": "^1.10.8",
|
||||||
"easymde": "^2.16.1",
|
"easymde": "^2.16.1",
|
||||||
"svelte-dnd-action": "^0.9.8",
|
"svelte-dnd-action": "^0.9.8",
|
||||||
"svelte-portal": "^1.0.0"
|
"svelte-portal": "^2.2.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"loader-utils": "1.4.1"
|
"loader-utils": "1.4.1"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { PopoverAlignment } from "../Popover/Popover.svelte"
|
import { PopoverAlignment } from "../constants"
|
||||||
|
|
||||||
// Strategies are defined as [Popover]To[Anchor].
|
// Strategies are defined as [Popover]To[Anchor].
|
||||||
// They can apply for both horizontal and vertical alignment.
|
// They can apply for both horizontal and vertical alignment.
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import AbsTooltip from "../Tooltip/AbsTooltip.svelte"
|
||||||
default as AbsTooltip,
|
import { TooltipPosition, TooltipType } from "../constants"
|
||||||
TooltipPosition,
|
|
||||||
TooltipType,
|
|
||||||
} from "../Tooltip/AbsTooltip.svelte"
|
|
||||||
|
|
||||||
export let name: string = "Add"
|
export let name: string = "Add"
|
||||||
export let hidden: boolean = false
|
export let hidden: boolean = false
|
||||||
|
|
|
@ -1,14 +1,4 @@
|
||||||
<script context="module" lang="ts">
|
<script context="module" lang="ts">
|
||||||
export enum PopoverAlignment {
|
|
||||||
Left = "left",
|
|
||||||
Right = "right",
|
|
||||||
LeftOutside = "left-outside",
|
|
||||||
RightOutside = "right-outside",
|
|
||||||
Center = "center",
|
|
||||||
RightContextMenu = "right-context-menu",
|
|
||||||
LeftContextMenu = "left-context-menu",
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PopoverAPI {
|
export interface PopoverAPI {
|
||||||
show: () => void
|
show: () => void
|
||||||
hide: () => void
|
hide: () => void
|
||||||
|
@ -23,6 +13,7 @@
|
||||||
import clickOutside from "../Actions/click_outside"
|
import clickOutside from "../Actions/click_outside"
|
||||||
import { fly } from "svelte/transition"
|
import { fly } from "svelte/transition"
|
||||||
import Context from "../context"
|
import Context from "../context"
|
||||||
|
import { PopoverAlignment } from "../constants"
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
|
@ -86,13 +77,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOutsideClick = e => {
|
const handleOutsideClick = (e: MouseEvent) => {
|
||||||
if (clickOutsideOverride) {
|
if (clickOutsideOverride) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (open) {
|
if (open) {
|
||||||
// Stop propagation if the source is the anchor
|
// Stop propagation if the source is the anchor
|
||||||
let node = e.target
|
let node = e.target as Node
|
||||||
let fromAnchor = false
|
let fromAnchor = false
|
||||||
while (!fromAnchor && node && node.parentNode) {
|
while (!fromAnchor && node && node.parentNode) {
|
||||||
fromAnchor = node === anchor
|
fromAnchor = node === anchor
|
||||||
|
@ -107,7 +98,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEscape(e) {
|
function handleEscape(e: KeyboardEvent) {
|
||||||
if (!clickOutsideOverride) {
|
if (!clickOutsideOverride) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,9 @@
|
||||||
<script context="module" lang="ts">
|
|
||||||
export enum TooltipPosition {
|
|
||||||
Top = "top",
|
|
||||||
Right = "right",
|
|
||||||
Bottom = "bottom",
|
|
||||||
Left = "left",
|
|
||||||
}
|
|
||||||
export enum TooltipType {
|
|
||||||
Default = "default",
|
|
||||||
Info = "info",
|
|
||||||
Positive = "positive",
|
|
||||||
Negative = "negative",
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Portal from "svelte-portal"
|
import Portal from "svelte-portal"
|
||||||
import { fade } from "svelte/transition"
|
import { fade } from "svelte/transition"
|
||||||
import "@spectrum-css/tooltip/dist/index-vars.css"
|
import "@spectrum-css/tooltip/dist/index-vars.css"
|
||||||
import { onDestroy } from "svelte"
|
import { onDestroy } from "svelte"
|
||||||
|
import { TooltipPosition, TooltipType } from "../constants"
|
||||||
|
|
||||||
export let position: TooltipPosition = TooltipPosition.Top
|
export let position: TooltipPosition = TooltipPosition.Top
|
||||||
export let type: TooltipType = TooltipType.Default
|
export let type: TooltipType = TooltipType.Default
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
export enum PopoverAlignment {
|
||||||
|
Left = "left",
|
||||||
|
Right = "right",
|
||||||
|
LeftOutside = "left-outside",
|
||||||
|
RightOutside = "right-outside",
|
||||||
|
Center = "center",
|
||||||
|
RightContextMenu = "right-context-menu",
|
||||||
|
LeftContextMenu = "left-context-menu",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TooltipPosition {
|
||||||
|
Top = "top",
|
||||||
|
Right = "right",
|
||||||
|
Bottom = "bottom",
|
||||||
|
Left = "left",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TooltipType {
|
||||||
|
Default = "default",
|
||||||
|
Info = "info",
|
||||||
|
Positive = "positive",
|
||||||
|
Negative = "negative",
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
import "./bbui.css"
|
import "./bbui.css"
|
||||||
|
|
||||||
// Spectrum icons
|
|
||||||
import "@spectrum-css/icon/dist/index-vars.css"
|
import "@spectrum-css/icon/dist/index-vars.css"
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
export * from "./constants"
|
||||||
|
|
||||||
// Form components
|
// Form components
|
||||||
export { default as Input } from "./Form/Input.svelte"
|
export { default as Input } from "./Form/Input.svelte"
|
||||||
export { default as Stepper } from "./Form/Stepper.svelte"
|
export { default as Stepper } from "./Form/Stepper.svelte"
|
||||||
|
@ -45,11 +46,7 @@ export { default as ClearButton } from "./ClearButton/ClearButton.svelte"
|
||||||
export { default as Icon } from "./Icon/Icon.svelte"
|
export { default as Icon } from "./Icon/Icon.svelte"
|
||||||
export { default as IconAvatar } from "./Icon/IconAvatar.svelte"
|
export { default as IconAvatar } from "./Icon/IconAvatar.svelte"
|
||||||
export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte"
|
export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte"
|
||||||
export {
|
export { default as Popover, type PopoverAPI } from "./Popover/Popover.svelte"
|
||||||
default as Popover,
|
|
||||||
PopoverAlignment,
|
|
||||||
type PopoverAPI,
|
|
||||||
} from "./Popover/Popover.svelte"
|
|
||||||
export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte"
|
export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte"
|
||||||
export { default as ProgressCircle } from "./ProgressCircle/ProgressCircle.svelte"
|
export { default as ProgressCircle } from "./ProgressCircle/ProgressCircle.svelte"
|
||||||
export { default as Label } from "./Label/Label.svelte"
|
export { default as Label } from "./Label/Label.svelte"
|
||||||
|
@ -96,7 +93,6 @@ export { default as IconSideNav } from "./IconSideNav/IconSideNav.svelte"
|
||||||
export { default as IconSideNavItem } from "./IconSideNav/IconSideNavItem.svelte"
|
export { default as IconSideNavItem } from "./IconSideNav/IconSideNavItem.svelte"
|
||||||
export { default as Accordion } from "./Accordion/Accordion.svelte"
|
export { default as Accordion } from "./Accordion/Accordion.svelte"
|
||||||
export { default as AbsTooltip } from "./Tooltip/AbsTooltip.svelte"
|
export { default as AbsTooltip } from "./Tooltip/AbsTooltip.svelte"
|
||||||
export { TooltipPosition, TooltipType } from "./Tooltip/AbsTooltip.svelte"
|
|
||||||
|
|
||||||
// Renderers
|
// Renderers
|
||||||
export { default as BoldRenderer } from "./Table/BoldRenderer.svelte"
|
export { default as BoldRenderer } from "./Table/BoldRenderer.svelte"
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
import {
|
import {
|
||||||
Popover,
|
Popover,
|
||||||
PopoverAlignment,
|
PopoverAlignment,
|
||||||
type PopoverAPI,
|
|
||||||
Icon,
|
Icon,
|
||||||
|
type PopoverAPI,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
|
|
||||||
export let title: string = ""
|
export let title: string = ""
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<script context="module" lang="ts">
|
<script context="module" lang="ts">
|
||||||
|
interface JSONViewerClickContext {
|
||||||
|
label: string | undefined
|
||||||
|
value: any
|
||||||
|
path: (string | number)[]
|
||||||
|
}
|
||||||
export interface JSONViewerClickEvent {
|
export interface JSONViewerClickEvent {
|
||||||
detail: {
|
detail: JSONViewerClickContext
|
||||||
label: string | undefined
|
|
||||||
value: any
|
|
||||||
path: (string | number)[]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -18997,11 +18997,16 @@ svelte-loading-spinners@^0.1.1:
|
||||||
resolved "https://registry.yarnpkg.com/svelte-loading-spinners/-/svelte-loading-spinners-0.1.7.tgz#3fa6fa0ef67ab635773bf20b07d0b071debbadaa"
|
resolved "https://registry.yarnpkg.com/svelte-loading-spinners/-/svelte-loading-spinners-0.1.7.tgz#3fa6fa0ef67ab635773bf20b07d0b071debbadaa"
|
||||||
integrity sha512-EKCId1DjVL2RSUVJJsvtNcqQHox03XIgh4xh/4p7r6ST7d8mut6INY9/LqK4A17PFU64+3quZmqiSfOlf480CA==
|
integrity sha512-EKCId1DjVL2RSUVJJsvtNcqQHox03XIgh4xh/4p7r6ST7d8mut6INY9/LqK4A17PFU64+3quZmqiSfOlf480CA==
|
||||||
|
|
||||||
svelte-portal@1.0.0, svelte-portal@^1.0.0:
|
svelte-portal@1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3"
|
resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-1.0.0.tgz#36a47c5578b1a4d9b4dc60fa32a904640ec4cdd3"
|
||||||
integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q==
|
integrity sha512-nHf+DS/jZ6jjnZSleBMSaZua9JlG5rZv9lOGKgJuaZStfevtjIlUJrkLc3vbV8QdBvPPVmvcjTlazAzfKu0v3Q==
|
||||||
|
|
||||||
|
svelte-portal@^2.2.1:
|
||||||
|
version "2.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/svelte-portal/-/svelte-portal-2.2.1.tgz#b1d7bed78e56318db245996beb5483d8de6b9740"
|
||||||
|
integrity sha512-uF7is5sM4aq5iN7QF/67XLnTUvQCf2iiG/B1BHTqLwYVY1dsVmTeXZ/LeEyU6dLjApOQdbEG9lkqHzxiQtOLEQ==
|
||||||
|
|
||||||
svelte-spa-router@^4.0.1:
|
svelte-spa-router@^4.0.1:
|
||||||
version "4.0.1"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-4.0.1.tgz#720ef0cc9a4af33b155812496545c7999483878c"
|
resolved "https://registry.yarnpkg.com/svelte-spa-router/-/svelte-spa-router-4.0.1.tgz#720ef0cc9a4af33b155812496545c7999483878c"
|
||||||
|
|
Loading…
Reference in New Issue