Merge remote-tracking branch 'origin/master' into feature/filter-bindings
This commit is contained in:
commit
2997da8687
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.23.12",
|
||||
"version": "2.24.0",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
"dayjs": "^1.10.8",
|
||||
"easymde": "^2.16.1",
|
||||
"svelte-dnd-action": "^0.9.8",
|
||||
"svelte-flatpickr": "3.2.3",
|
||||
"svelte-portal": "^1.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const ignoredClasses = [
|
||||
".download-js-link",
|
||||
".flatpickr-calendar",
|
||||
".spectrum-Menu",
|
||||
".date-time-popover",
|
||||
]
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
export let narrower = false
|
||||
export let noPadding = false
|
||||
|
||||
let sidePanelVisble = false
|
||||
let sidePanelVisible = false
|
||||
|
||||
setContext("side-panel", {
|
||||
open: () => (sidePanelVisble = true),
|
||||
close: () => (sidePanelVisble = false),
|
||||
open: () => (sidePanelVisible = true),
|
||||
close: () => (sidePanelVisible = false),
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -24,9 +24,9 @@
|
|||
</div>
|
||||
<div
|
||||
id="side-panel"
|
||||
class:visible={sidePanelVisble}
|
||||
class:visible={sidePanelVisible}
|
||||
use:clickOutside={() => {
|
||||
sidePanelVisble = false
|
||||
sidePanelVisible = false
|
||||
}}
|
||||
>
|
||||
<slot name="side-panel" />
|
||||
|
|
|
@ -154,7 +154,7 @@ export const parseDate = (value, { enableTime = true }) => {
|
|||
// schema flags
|
||||
export const stringifyDate = (
|
||||
value,
|
||||
{ enableTime = true, timeOnly = false, ignoreTimezones = false }
|
||||
{ enableTime = true, timeOnly = false, ignoreTimezones = false } = {}
|
||||
) => {
|
||||
if (!value) {
|
||||
return null
|
||||
|
@ -210,7 +210,7 @@ const localeDateFormat = new Intl.DateTimeFormat()
|
|||
// Formats a dayjs date according to schema flags
|
||||
export const getDateDisplayValue = (
|
||||
value,
|
||||
{ enableTime = true, timeOnly = false }
|
||||
{ enableTime = true, timeOnly = false } = {}
|
||||
) => {
|
||||
if (!value?.isValid()) {
|
||||
return ""
|
||||
|
|
|
@ -6717,7 +6717,20 @@
|
|||
"illegalChildren": ["section", "sidepanel"],
|
||||
"showEmptyState": false,
|
||||
"draggable": false,
|
||||
"info": "Side panels are hidden by default. They will only be revealed when triggered by the 'Open Side Panel' action."
|
||||
"info": "Side panels are hidden by default. They will only be revealed when triggered by the 'Open Side Panel' action.",
|
||||
"settings": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "ignoreClicksOutside",
|
||||
"label": "Ignore clicks outside",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"type": "event",
|
||||
"key": "onClose",
|
||||
"label": "On close"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rowexplorer": {
|
||||
"block": true,
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
"screenfull": "^6.0.1",
|
||||
"shortid": "^2.2.15",
|
||||
"svelte-apexcharts": "^1.0.2",
|
||||
"svelte-flatpickr": "^3.3.4",
|
||||
"svelte-spa-router": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -206,13 +206,6 @@
|
|||
/>
|
||||
{/key}
|
||||
|
||||
<!--
|
||||
Flatpickr needs to be inside the theme wrapper.
|
||||
It also needs its own container because otherwise it hijacks
|
||||
key events on the whole page. It is painful to work with.
|
||||
-->
|
||||
<div id="flatpickr-root" />
|
||||
|
||||
<!-- Modal container to ensure they sit on top -->
|
||||
<div class="modal-container" />
|
||||
|
||||
|
|
|
@ -60,16 +60,6 @@
|
|||
--spectrum-link-primary-m-text-color-hover: var(--primaryColorHover);
|
||||
}
|
||||
|
||||
/* Theme flatpickr */
|
||||
:global(.flatpickr-day.selected) {
|
||||
background: var(--primaryColor);
|
||||
border-color: var(--primaryColor);
|
||||
}
|
||||
:global(.flatpickr-day.selected:hover) {
|
||||
background: var(--primaryColorHover);
|
||||
border-color: var(--primaryColorHover);
|
||||
}
|
||||
|
||||
/* Custom scrollbars */
|
||||
:global(::-webkit-scrollbar) {
|
||||
width: 8px;
|
||||
|
|
|
@ -73,7 +73,10 @@
|
|||
$context.device.width,
|
||||
$context.device.height
|
||||
)
|
||||
$: autoCloseSidePanel = !$builderStore.inBuilder && $sidePanelStore.open
|
||||
$: autoCloseSidePanel =
|
||||
!$builderStore.inBuilder &&
|
||||
$sidePanelStore.open &&
|
||||
!$sidePanelStore.ignoreClicksOutside
|
||||
$: screenId = $builderStore.inBuilder
|
||||
? `${$builderStore.screen?._id}-screen`
|
||||
: "screen"
|
||||
|
@ -191,6 +194,11 @@
|
|||
}
|
||||
return url
|
||||
}
|
||||
|
||||
const handleClickLink = () => {
|
||||
mobileOpen = false
|
||||
sidePanelStore.actions.close()
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
|
@ -281,7 +289,7 @@
|
|||
url={navItem.url}
|
||||
subLinks={navItem.subLinks}
|
||||
internalLink={navItem.internalLink}
|
||||
on:clickLink={() => (mobileOpen = false)}
|
||||
on:clickLink={handleClickLink}
|
||||
leftNav={navigation === "Left"}
|
||||
{mobile}
|
||||
{navStateStore}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
const { styleable, sidePanelStore, builderStore, dndIsDragging } =
|
||||
getContext("sdk")
|
||||
|
||||
export let onClose
|
||||
export let ignoreClicksOutside
|
||||
|
||||
// Automatically show and hide the side panel when inside the builder.
|
||||
// For some unknown reason, svelte reactivity breaks if we reference the
|
||||
// reactive variable "open" inside the following expression, or if we define
|
||||
|
@ -26,6 +29,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
// $: {
|
||||
|
||||
// }
|
||||
|
||||
// Derive visibility
|
||||
$: open = $sidePanelStore.contentId === $component.id
|
||||
|
||||
|
@ -36,10 +43,17 @@
|
|||
let renderKey = null
|
||||
$: {
|
||||
if (open) {
|
||||
sidePanelStore.actions.setIgnoreClicksOutside(ignoreClicksOutside)
|
||||
renderKey = Math.random()
|
||||
}
|
||||
}
|
||||
|
||||
const handleSidePanelClose = async () => {
|
||||
if (onClose) {
|
||||
await onClose()
|
||||
}
|
||||
}
|
||||
|
||||
const showInSidePanel = (el, visible) => {
|
||||
const update = visible => {
|
||||
const target = document.getElementById("side-panel-container")
|
||||
|
@ -51,6 +65,7 @@
|
|||
} else {
|
||||
if (target.contains(node)) {
|
||||
target.removeChild(node)
|
||||
handleSidePanelClose()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
readonly={fieldState.readonly}
|
||||
error={fieldState.error}
|
||||
id={fieldState.fieldId}
|
||||
appendTo={document.getElementById("flatpickr-root")}
|
||||
{enableTime}
|
||||
{timeOnly}
|
||||
{time24hr}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import flatpickr from "flatpickr"
|
||||
import dayjs from "dayjs"
|
||||
import { FieldTypes } from "../../../constants"
|
||||
import { Helpers } from "@budibase/bbui"
|
||||
|
||||
/**
|
||||
* Creates a validation function from a combination of schema-level constraints
|
||||
|
@ -81,7 +82,7 @@ export const createValidatorFromConstraints = (
|
|||
// Date constraint
|
||||
if (exists(schemaConstraints.datetime?.earliest)) {
|
||||
const limit = schemaConstraints.datetime.earliest
|
||||
const limitString = flatpickr.formatDate(new Date(limit), "F j Y, H:i")
|
||||
const limitString = Helpers.getDateDisplayValue(dayjs(limit))
|
||||
rules.push({
|
||||
type: "datetime",
|
||||
constraint: "minValue",
|
||||
|
@ -91,7 +92,7 @@ export const createValidatorFromConstraints = (
|
|||
}
|
||||
if (exists(schemaConstraints.datetime?.latest)) {
|
||||
const limit = schemaConstraints.datetime.latest
|
||||
const limitString = flatpickr.formatDate(new Date(limit), "F j Y, H:i")
|
||||
const limitString = Helpers.getDateDisplayValue(dayjs(limit))
|
||||
rules.push({
|
||||
type: "datetime",
|
||||
constraint: "maxValue",
|
||||
|
|
|
@ -3,6 +3,7 @@ import { writable, derived } from "svelte/store"
|
|||
export const createSidePanelStore = () => {
|
||||
const initialState = {
|
||||
contentId: null,
|
||||
ignoreClicksOutside: true,
|
||||
}
|
||||
const store = writable(initialState)
|
||||
const derivedStore = derived(store, $store => {
|
||||
|
@ -32,11 +33,18 @@ export const createSidePanelStore = () => {
|
|||
}, 50)
|
||||
}
|
||||
|
||||
const setIgnoreClicksOutside = bool => {
|
||||
store.update(state => {
|
||||
state.ignoreClicksOutside = bool
|
||||
return state
|
||||
})
|
||||
}
|
||||
return {
|
||||
subscribe: derivedStore.subscribe,
|
||||
actions: {
|
||||
open,
|
||||
close,
|
||||
setIgnoreClicksOutside,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,6 +240,7 @@ const triggerAutomationHandler = async action => {
|
|||
const navigationHandler = action => {
|
||||
const { url, peek, externalNewTab } = action.parameters
|
||||
routeStore.actions.navigate(url, peek, externalNewTab)
|
||||
closeSidePanelHandler()
|
||||
}
|
||||
|
||||
const queryExecutionHandler = async action => {
|
||||
|
|
|
@ -128,6 +128,7 @@ export async function importToRows(
|
|||
for (let i = 0; i < data.length; i++) {
|
||||
let row = data[i]
|
||||
row._id = generateRowID(table._id!)
|
||||
row.type = "row"
|
||||
row.tableId = table._id
|
||||
|
||||
// We use a reference to table here and update it after input processing,
|
||||
|
|
|
@ -76,9 +76,7 @@ describe.each([
|
|||
}
|
||||
|
||||
async function createRows(rows: Record<string, any>[]) {
|
||||
for (const row of rows) {
|
||||
await config.api.row.save(table._id!, row)
|
||||
}
|
||||
await config.api.row.bulkImport(table._id!, { rows })
|
||||
}
|
||||
|
||||
class SearchAssertion {
|
||||
|
|
|
@ -131,11 +131,6 @@ export async function search(
|
|||
},
|
||||
relationships,
|
||||
}
|
||||
// make sure only rows returned
|
||||
request.filters!.equal = {
|
||||
...request.filters?.equal,
|
||||
type: "row",
|
||||
}
|
||||
|
||||
if (params.sort) {
|
||||
const sortField = table.schema[params.sort]
|
||||
|
|
28
yarn.lock
28
yarn.lock
|
@ -11441,11 +11441,6 @@ flat@^5.0.2:
|
|||
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
|
||||
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==
|
||||
|
||||
flatpickr@^4.5.2:
|
||||
version "4.6.13"
|
||||
resolved "https://registry.yarnpkg.com/flatpickr/-/flatpickr-4.6.13.tgz#8a029548187fd6e0d670908471e43abe9ad18d94"
|
||||
integrity sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==
|
||||
|
||||
flatted@^3.1.0:
|
||||
version "3.2.5"
|
||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
|
||||
|
@ -11612,7 +11607,7 @@ fs.realpath@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
||||
|
||||
fsevents@^2.3.2, fsevents@~2.3.1, fsevents@~2.3.2:
|
||||
fsevents@^2.3.2, fsevents@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||
|
@ -19761,13 +19756,6 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1,
|
|||
dependencies:
|
||||
estree-walker "^0.6.1"
|
||||
|
||||
rollup@2.45.2:
|
||||
version "2.45.2"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.45.2.tgz#8fb85917c9f35605720e92328f3ccbfba6f78b48"
|
||||
integrity sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==
|
||||
optionalDependencies:
|
||||
fsevents "~2.3.1"
|
||||
|
||||
rollup@^2.36.2, rollup@^2.45.2:
|
||||
version "2.79.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"
|
||||
|
@ -21105,20 +21093,6 @@ svelte-dnd-action@^0.9.8:
|
|||
postcss "^8.4.29"
|
||||
postcss-scss "^4.0.8"
|
||||
|
||||
svelte-flatpickr@3.2.3:
|
||||
version "3.2.3"
|
||||
resolved "https://registry.yarnpkg.com/svelte-flatpickr/-/svelte-flatpickr-3.2.3.tgz#db5dd7ad832ef83262b45e09737955ad3d591fc8"
|
||||
integrity sha512-PNkqK4Napx8nTvCwkaUXdnKo8dISThaxEOK+szTUXcY6H0dQM0TSyuoMaVWY2yX7pM+PN5cpCQCcVe8YvTRFSw==
|
||||
dependencies:
|
||||
flatpickr "^4.5.2"
|
||||
|
||||
svelte-flatpickr@^3.3.4:
|
||||
version "3.3.4"
|
||||
resolved "https://registry.yarnpkg.com/svelte-flatpickr/-/svelte-flatpickr-3.3.4.tgz#80b1ed2d6bc37df78b1660404e9326bfc0a206f4"
|
||||
integrity sha512-i+QqJRs8zPRKsxv8r2GIk1fsb8cI3ozn3/aHXtViAoNKLy0j4PV7OSWavgEZC1wlAa34qi2hMkUh+vg6qt2DRA==
|
||||
dependencies:
|
||||
flatpickr "^4.5.2"
|
||||
|
||||
svelte-hmr@^0.15.1:
|
||||
version "0.15.3"
|
||||
resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.15.3.tgz#df54ccde9be3f091bf5f18fc4ef7b8eb6405fbe6"
|
||||
|
|
Loading…
Reference in New Issue