@payloadcms/ui 4.0.0-canary.24 → 4.0.0-canary.26
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/elements/Button/index.css +2 -2
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.js +3 -2
- package/dist/elements/DuplicateDocument/SelectLocalesDrawer/index.js.map +1 -1
- package/dist/elements/Popup/PopupButtonList/index.css +1 -1
- package/dist/elements/Popup/index.js +1 -1
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/QueryPresets/QueryPresetBar/index.js +1 -3
- package/dist/elements/QueryPresets/QueryPresetBar/index.js.map +1 -1
- package/dist/icons/Edit/index.d.ts +0 -1
- package/dist/icons/Edit/index.d.ts.map +1 -1
- package/dist/icons/Edit/index.js +4 -4
- package/dist/icons/Edit/index.js.map +1 -1
- package/dist/providers/Actions/index.d.ts +1 -0
- package/dist/providers/Actions/index.d.ts.map +1 -1
- package/dist/providers/Actions/index.js +43 -11
- package/dist/providers/Actions/index.js.map +1 -1
- package/dist/providers/Locale/index.d.ts.map +1 -1
- package/dist/providers/Locale/index.js +41 -36
- package/dist/providers/Locale/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/templates/Default/index.d.ts +1 -0
- package/dist/templates/Default/index.d.ts.map +1 -1
- package/dist/templates/Default/index.js +2 -0
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js +3 -2
- package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/WidgetEditControl.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/WidgetEditControl.js +7 -7
- package/dist/views/Dashboard/Default/ModularDashboard/WidgetEditControl.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js +104 -66
- package/dist/views/Dashboard/Default/ModularDashboard/index.client.js.map +1 -1
- package/dist/views/Dashboard/Default/ModularDashboard/index.css +33 -140
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +1 -0
- package/dist/views/Root/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
border: var(--stroke-width-small) solid var(--special-border-translucent);
|
|
57
57
|
|
|
58
58
|
&:hover:not(.btn--disabled) {
|
|
59
|
-
background-color: var(--color-bg-
|
|
59
|
+
background-color: var(--color-bg-secondary-hover);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&:active:not(.btn--disabled) {
|
|
63
|
-
background-color: var(--color-bg-
|
|
63
|
+
background-color: var(--color-bg-secondary-pressed);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&.btn--disabled {
|
|
@@ -31,6 +31,7 @@ export const SelectLocalesDrawer = ({
|
|
|
31
31
|
t
|
|
32
32
|
} = useTranslation();
|
|
33
33
|
const {
|
|
34
|
+
closeModal,
|
|
34
35
|
toggleModal
|
|
35
36
|
} = useModal();
|
|
36
37
|
const [selectedLocales, setSelectedLocales] = useState([]);
|
|
@@ -50,8 +51,8 @@ export const SelectLocalesDrawer = ({
|
|
|
50
51
|
await onConfirm({
|
|
51
52
|
selectedLocales
|
|
52
53
|
});
|
|
53
|
-
|
|
54
|
-
}, [onConfirm, selectedLocales, slug
|
|
54
|
+
closeModal(slug);
|
|
55
|
+
}, [closeModal, onConfirm, selectedLocales, slug]);
|
|
55
56
|
return /*#__PURE__*/_jsxs(Drawer, {
|
|
56
57
|
className: baseClass,
|
|
57
58
|
Header: /*#__PURE__*/_jsx(DrawerHeader, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useModal","getTranslation","setsAreEqual","React","useCallback","useMemo","useState","CheckboxInput","useTranslation","Button","Drawer","DrawerHeader","getLocaleOptions","i18n","localization","locales","map","locale","label","value","code","baseClass","SelectLocalesDrawer","slug","onConfirm","t","toggleModal","selectedLocales","setSelectedLocales","localeOptions","allLocales","allLocalesSelected","Set","handleSelectAll","handleToggleLocale","localeValue","prev","includes","filter","l","handleConfirm","_jsxs","className","Header","_jsx","onClose","title","buttonStyle","disabled","length","iconPosition","id","onClick","size","checked","count","onToggle"],"sources":["../../../../src/elements/DuplicateDocument/SelectLocalesDrawer/index.tsx"],"sourcesContent":["'use client'\n\nimport type { I18nClient } from '@payloadcms/translations'\nimport type { ClientConfig } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { setsAreEqual } from 'payload/shared'\nimport React, { useCallback, useMemo, useState } from 'react'\n\nimport { CheckboxInput } from '../../../fields/Checkbox/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { Button } from '../../Button/index.js'\nimport { Drawer } from '../../Drawer/index.js'\nimport { DrawerHeader } from '../../DrawerHeader/index.js'\nimport './index.css'\n\nexport type LocaleOption = {\n label: string\n value: string\n}\n\nexport type SelectLocalesDrawerProps = {\n readonly localization: Exclude<ClientConfig['localization'], false>\n readonly onConfirm: (args: { selectedLocales: string[] }) => Promise<void> | void\n readonly slug: string\n}\n\nconst getLocaleOptions = ({\n i18n,\n localization,\n}: {\n i18n: I18nClient\n localization: SelectLocalesDrawerProps['localization']\n}): LocaleOption[] => {\n return localization.locales.map((locale) => ({\n label: getTranslation(locale.label, i18n),\n value: locale.code,\n }))\n}\n\nconst baseClass = 'select-locales-drawer'\n\nexport const SelectLocalesDrawer: React.FC<SelectLocalesDrawerProps> = ({\n slug,\n localization,\n onConfirm,\n}) => {\n const { i18n, t } = useTranslation()\n const { toggleModal } = useModal()\n const [selectedLocales, setSelectedLocales] = useState<string[]>([])\n\n const localeOptions = useMemo(\n () => getLocaleOptions({ i18n, localization }),\n [localization, i18n],\n )\n const allLocales = useMemo(() => localeOptions.map((locale) => locale.value), [localeOptions])\n const allLocalesSelected = useMemo(\n () => setsAreEqual(new Set(selectedLocales), new Set(allLocales)),\n [selectedLocales, allLocales],\n )\n\n const handleSelectAll = useCallback(() => {\n setSelectedLocales(allLocalesSelected ? [] : [...allLocales])\n }, [allLocalesSelected, allLocales])\n\n const handleToggleLocale = useCallback((localeValue: string) => {\n setSelectedLocales((prev) =>\n prev.includes(localeValue) ? prev.filter((l) => l !== localeValue) : [...prev, localeValue],\n )\n }, [])\n\n const handleConfirm = useCallback(async () => {\n await onConfirm({ selectedLocales })\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["useModal","getTranslation","setsAreEqual","React","useCallback","useMemo","useState","CheckboxInput","useTranslation","Button","Drawer","DrawerHeader","getLocaleOptions","i18n","localization","locales","map","locale","label","value","code","baseClass","SelectLocalesDrawer","slug","onConfirm","t","closeModal","toggleModal","selectedLocales","setSelectedLocales","localeOptions","allLocales","allLocalesSelected","Set","handleSelectAll","handleToggleLocale","localeValue","prev","includes","filter","l","handleConfirm","_jsxs","className","Header","_jsx","onClose","title","buttonStyle","disabled","length","iconPosition","id","onClick","size","checked","count","onToggle"],"sources":["../../../../src/elements/DuplicateDocument/SelectLocalesDrawer/index.tsx"],"sourcesContent":["'use client'\n\nimport type { I18nClient } from '@payloadcms/translations'\nimport type { ClientConfig } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { setsAreEqual } from 'payload/shared'\nimport React, { useCallback, useMemo, useState } from 'react'\n\nimport { CheckboxInput } from '../../../fields/Checkbox/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { Button } from '../../Button/index.js'\nimport { Drawer } from '../../Drawer/index.js'\nimport { DrawerHeader } from '../../DrawerHeader/index.js'\nimport './index.css'\n\nexport type LocaleOption = {\n label: string\n value: string\n}\n\nexport type SelectLocalesDrawerProps = {\n readonly localization: Exclude<ClientConfig['localization'], false>\n readonly onConfirm: (args: { selectedLocales: string[] }) => Promise<void> | void\n readonly slug: string\n}\n\nconst getLocaleOptions = ({\n i18n,\n localization,\n}: {\n i18n: I18nClient\n localization: SelectLocalesDrawerProps['localization']\n}): LocaleOption[] => {\n return localization.locales.map((locale) => ({\n label: getTranslation(locale.label, i18n),\n value: locale.code,\n }))\n}\n\nconst baseClass = 'select-locales-drawer'\n\nexport const SelectLocalesDrawer: React.FC<SelectLocalesDrawerProps> = ({\n slug,\n localization,\n onConfirm,\n}) => {\n const { i18n, t } = useTranslation()\n const { closeModal, toggleModal } = useModal()\n const [selectedLocales, setSelectedLocales] = useState<string[]>([])\n\n const localeOptions = useMemo(\n () => getLocaleOptions({ i18n, localization }),\n [localization, i18n],\n )\n const allLocales = useMemo(() => localeOptions.map((locale) => locale.value), [localeOptions])\n const allLocalesSelected = useMemo(\n () => setsAreEqual(new Set(selectedLocales), new Set(allLocales)),\n [selectedLocales, allLocales],\n )\n\n const handleSelectAll = useCallback(() => {\n setSelectedLocales(allLocalesSelected ? [] : [...allLocales])\n }, [allLocalesSelected, allLocales])\n\n const handleToggleLocale = useCallback((localeValue: string) => {\n setSelectedLocales((prev) =>\n prev.includes(localeValue) ? prev.filter((l) => l !== localeValue) : [...prev, localeValue],\n )\n }, [])\n\n const handleConfirm = useCallback(async () => {\n await onConfirm({ selectedLocales })\n closeModal(slug)\n }, [closeModal, onConfirm, selectedLocales, slug])\n\n return (\n <Drawer\n className={baseClass}\n Header={\n <DrawerHeader\n onClose={() => {\n toggleModal(slug)\n }}\n title={`${t('general:duplicate')} ${t('localization:selectedLocales')}`}\n />\n }\n slug={slug}\n >\n <div className={`${baseClass}__sub-header`}>\n <span>{t('localization:selectLocaleToDuplicate')}</span>\n <Button\n buttonStyle=\"primary\"\n disabled={selectedLocales.length === 0}\n iconPosition=\"left\"\n id=\"#action-duplicate-confirm\"\n onClick={handleConfirm}\n size=\"medium\"\n >\n {t('general:duplicate')}\n </Button>\n </div>\n <div className={`${baseClass}__content`}>\n <div className={`${baseClass}__item`}>\n <CheckboxInput\n checked={allLocalesSelected}\n id=\"select-locale-all\"\n label={t('general:selectAll', {\n count: allLocales.length,\n label: t('general:locales'),\n })}\n onToggle={handleSelectAll}\n />\n </div>\n {localeOptions.map((locale) => (\n <div className={`${baseClass}__item`} key={locale.value}>\n <CheckboxInput\n checked={selectedLocales.includes(locale.value)}\n id={`select-locale-${locale.value}`}\n label={locale.label}\n onToggle={() => handleToggleLocale(locale.value)}\n />\n </div>\n ))}\n </div>\n </Drawer>\n )\n}\n"],"mappings":"AAAA;;;AAKA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,YAAY,QAAQ;AAC7B,OAAOC,KAAA,IAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAEtD,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,SAASC,MAAM,QAAQ;AACvB,SAASC,YAAY,QAAQ;AAC7B,OAAO;AAaP,MAAMC,gBAAA,GAAmBA,CAAC;EACxBC,IAAI;EACJC;AAAY,CAIb;EACC,OAAOA,YAAA,CAAaC,OAAO,CAACC,GAAG,CAAEC,MAAA,KAAY;IAC3CC,KAAA,EAAOjB,cAAA,CAAegB,MAAA,CAAOC,KAAK,EAAEL,IAAA;IACpCM,KAAA,EAAOF,MAAA,CAAOG;EAChB;AACF;AAEA,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,mBAAA,GAA0DA,CAAC;EACtEC,IAAI;EACJT,YAAY;EACZU;AAAS,CACV;EACC,MAAM;IAAEX,IAAI;IAAEY;EAAC,CAAE,GAAGjB,cAAA;EACpB,MAAM;IAAEkB,UAAU;IAAEC;EAAW,CAAE,GAAG3B,QAAA;EACpC,MAAM,CAAC4B,eAAA,EAAiBC,kBAAA,CAAmB,GAAGvB,QAAA,CAAmB,EAAE;EAEnE,MAAMwB,aAAA,GAAgBzB,OAAA,CACpB,MAAMO,gBAAA,CAAiB;IAAEC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AGtB,SAAA,cAAuB;8BACxCwB,IAAA,CAAC;kBAAMpB,CAAA,CAAE;uBACToB,IAAA,CAACpC,MAAA;QACCuC,WAAA,EAAY;QACZC,QAAA,EAAUrB,eAAA,CAAgBsB,MAAM,KAAK;QACrCC,YAAA,EAAa;QACbC,EAAA,EAAG;QACHC,OAAA,EAASZ,aAAA;QACTa,IAAA,EAAK;kBAEJ7B,CAAA,CAAE;;qBAGPiB,KAAA,CAAC;MAAIC,SAAA,EAAW,GAAGtB,SAAA,WAAoB;8BACrCwB,IAAA,CAAC;QAAIF,SAAA,EAAW,GAAGtB,SAAA,QAAiB;kBAClC,aAAAwB,IAAA,CAACtC,aAAA;UACCgD,OAAA,EAASvB,kBAAA;UACToB,EAAA,EAAG;UACHlC,KAAA,EAAOO,CAAA,CAAE,qBAAqB;YAC5B+B,KAAA,EAAOzB,UAAA,CAAWmB,MAAM;YACxBhC,KAAA,EAAOO,CAAA,CAAE;UACX;UACAgC,QAAA,EAAUvB;;UAGbJ,aAAA,CAAcd,GAAG,CAAEC,QAAA,iBAClB4B,IAAA,CAAC;QAAIF,SAAA,EAAW,GAAGtB,SAAA,QAAiB;kBAClC,aAAAwB,IAAA,CAACtC,aAAA;UACCgD,OAAA,EAAS3B,eAAA,CAAgBU,QAAQ,CAACrB,QAAA,CAAOE,KAAK;UAC9CiC,EAAA,EAAI,iBAAiBnC,QAAA,CAAOE,KAAK,EAAE;UACnCD,KAAA,EAAOD,QAAA,CAAOC,KAAK;UACnBuC,QAAA,EAAUA,CAAA,KAAMtB,kBAAA,CAAmBlB,QAAA,CAAOE,KAAK;;SALRF,QAAA,CAAOE,KAAK;;;AAYjE","ignoreList":[]}
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
font-weight: var(--text-body-medium-font-weight);
|
|
52
52
|
letter-spacing: var(--text-body-medium-letter-spacing);
|
|
53
53
|
line-height: var(--text-body-medium-line-height);
|
|
54
|
-
padding: var(--spacer-1) var(--spacer-2)
|
|
54
|
+
padding: var(--spacer-1) var(--spacer-2);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.popup-button-list__button:focus-visible {
|
|
@@ -113,7 +113,7 @@ export const Popup = props => {
|
|
|
113
113
|
const scrollY = useFixed ? 0 : window.scrollY;
|
|
114
114
|
const scrollX = useFixed ? 0 : window.scrollX;
|
|
115
115
|
// Gap between the popup and the trigger/viewport edges (in pixels)
|
|
116
|
-
const offset =
|
|
116
|
+
const offset = 8;
|
|
117
117
|
// Additional gap used in side mode so the child popup has breathing room from its parent
|
|
118
118
|
const sideOffset = 4;
|
|
119
119
|
let top;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PopupList","React","createContext","use","useCallback","useEffect","useRef","useState","createPortal","useEffectEvent","ThemeProvider","PopupTrigger","baseClass","PopupContext","TABBABLE_SELECTOR","map","s","join","hasFixedAncestor","element","node","parentElement","document","body","window","getComputedStyle","position","Popup","props","id","button","buttonAriaLabel","buttonClassName","buttonSize","buttonType","caret","children","className","disabled","forceOpen","horizontalAlign","initActive","noBackground","onToggleClose","onToggleOpen","portalClassName","render","renderButton","showOnHover","showScrollbar","side","size","theme","verticalAlign","popupRef","triggerRef","isFixedRef","openedViaKeyboardRef","parentPopup","mounted","setMounted","active","setActiveInternal","isOnTop","setIsOnTop","setActive","isActive","viaKeyboard","current","updatePosition","trigger","popup","triggerRect","getBoundingClientRect","popupRect","useFixed","scrollY","scrollX","offset","sideOffset","top","left","caretLeft","maxTop","innerHeight","height","Math","max","min","anchorRect","width","right","innerWidth","onTop","bottom","topIfAbove","triggerCenter","newTop","round","newLeft","newCaretLeft","newPosition","style","getPropertyValue","setProperty","handleClickOutside","e","target","isOutsidePopup","contains","isOutsideTrigger","clickedPopupContent","closest","isInsideChildPopup","handleKeyDown","key","preventDefault","querySelector","focus","focusable","Array","from","querySelectorAll","length","currentIndex","findIndex","el","activeElement","goBackward","shiftKey","nextIndex","handleActionableClick","actionable","rafId","requestAnimationFrame","firstFocusable","addEventListener","capture","passive","cancelAnimationFrame","removeEventListener","undefined","Trigger","_jsx","_jsxs","filter","Boolean","ref","onMouseEnter","onMouseLeave","role","tabIndex","value","_Fragment","close"],"sources":["../../../src/elements/Popup/index.tsx"],"sourcesContent":["'use client'\nimport type { CSSProperties } from 'react'\n\nexport * as PopupList from './PopupButtonList/index.js'\n\nimport React, { createContext, use, useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEffectEvent } from '../../hooks/useEffectEvent.js'\nimport { ThemeProvider } from '../../providers/Theme/index.js'\nimport './index.css'\nimport { PopupTrigger } from './PopupTrigger/index.js'\n\nconst baseClass = 'popup'\n\ntype PopupContextValue = {\n popupRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst PopupContext = createContext<null | PopupContextValue>(null)\n\n/**\n * Selector for all elements the browser considers tabbable.\n */\nconst TABBABLE_SELECTOR = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'audio[controls]',\n 'video[controls]',\n 'summary',\n]\n .map((s) => `${s}:not([tabindex=\"-1\"])`)\n .join(', ')\n\n/**\n * Returns whether the element has a `position: fixed` ancestor (e.g. an open Drawer).\n * Such popups must be positioned with `fixed` so they don't drift when the background scrolls.\n */\nconst hasFixedAncestor = (element: HTMLElement | null): boolean => {\n let node = element?.parentElement\n while (node && node !== document.body) {\n if (window.getComputedStyle(node).position === 'fixed') {\n return true\n }\n node = node.parentElement\n }\n return false\n}\n\nexport type PopupProps = {\n backgroundColor?: CSSProperties['backgroundColor']\n boundingRef?: React.RefObject<HTMLElement>\n button?: React.ReactNode\n /**\n * Accessible label for the trigger button.\n * Necessary when the button has an icon-only content,\n * so the button has an accessible name for screen readers.\n */\n buttonAriaLabel?: string\n /**\n * The class name to apply to the button that triggers the popup.\n */\n buttonClassName?: string\n buttonSize?: 'large' | 'medium'\n buttonType?: 'custom' | 'default'\n caret?: boolean\n children?: React.ReactNode\n /**\n * The class name to apply to the popup container containing the trigger.\n * This does not wrap the actual popup content, which is rendered in a portal.\n */\n className?: string\n disabled?: boolean\n /**\n * Force control the open state of the popup, regardless of the trigger.\n */\n forceOpen?: boolean\n /**\n * Preferred horizontal alignment of the popup, if there is enough space available.\n *\n * @default 'left'\n */\n horizontalAlign?: 'center' | 'left' | 'right'\n id?: string\n initActive?: boolean\n noBackground?: boolean\n onToggleClose?: () => void\n onToggleOpen?: (active: boolean) => void\n /**\n * Class name to apply to the portal container.\n */\n portalClassName?: string\n render?: (args: { close: () => void }) => React.ReactNode\n /**\n * Render prop for custom trigger button. Receives onClick/onKeyDown/aria props.\n * When provided, `button` and `buttonType` are ignored.\n */\n renderButton?: (props: {\n active: boolean\n 'aria-expanded': boolean\n 'aria-haspopup': true\n onClick: React.MouseEventHandler\n onKeyDown: React.KeyboardEventHandler\n }) => React.ReactNode\n showOnHover?: boolean\n /**\n * By default, the scrollbar is hidden. If you want to show it, set this to true.\n * In both cases, the container is still scrollable.\n *\n * @default false\n */\n showScrollbar?: boolean\n /**\n * Position the popup to the side of the trigger instead of above/below.\n * The popup's top edge aligns with the trigger's top edge (with viewport clamping).\n * Automatically flips to the opposite side if there is not enough space.\n * When set, `verticalAlign`, `horizontalAlign`, and the caret are ignored.\n */\n side?: 'left' | 'right'\n size?: 'fit-content' | 'large' | 'small'\n /**\n * Theme for the popup content. Defaults to 'dark'.\n * Set to 'auto' to inherit the current theme.\n *\n * @default 'dark'\n */\n theme?: 'auto' | 'dark' | 'light'\n /**\n * Preferred vertical alignment of the popup (position below or above the trigger),\n * if there is enough space available.\n *\n * If the popup is too close to the edge of the viewport, it will flip to the opposite side\n * regardless of the preferred vertical alignment.\n *\n * @default 'bottom'\n */\n verticalAlign?: 'bottom' | 'top'\n}\n\n/**\n * Component that renders a popup, as well as a button that triggers the popup.\n *\n * The popup is rendered in a portal, and is automatically positioned above / below the trigger,\n * depending on the verticalAlign prop and the space available.\n */\nexport const Popup: React.FC<PopupProps> = (props) => {\n const {\n id,\n button,\n buttonAriaLabel,\n buttonClassName,\n buttonSize,\n buttonType = 'default',\n caret = true,\n children,\n className,\n disabled,\n forceOpen,\n horizontalAlign = 'left',\n initActive = false,\n noBackground,\n onToggleClose,\n onToggleOpen,\n portalClassName,\n render,\n renderButton,\n showOnHover = false,\n showScrollbar = false,\n side,\n size = 'fit-content',\n theme = 'dark',\n verticalAlign = 'bottom',\n } = props\n\n const popupRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLDivElement>(null)\n\n /**\n * Whether the trigger is inside a `position: fixed` ancestor (e.g. a Drawer),\n * in which case the popup is positioned with `fixed` instead of `absolute`.\n */\n const isFixedRef = useRef(false)\n\n /**\n * Keeps track of whether the popup was opened via keyboard.\n * This is used to determine whether to autofocus the first element in the popup.\n * If the popup was opened via mouse, we do not want to autofocus the first element.\n */\n const openedViaKeyboardRef = useRef(false)\n\n const parentPopup = use(PopupContext)\n\n const [mounted, setMounted] = useState(false)\n const [active, setActiveInternal] = useState(initActive)\n const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top')\n\n // Track when component is mounted to avoid SSR/client hydration mismatch\n useEffect(() => {\n setMounted(true)\n }, [])\n\n const setActive = useCallback(\n (isActive: boolean, viaKeyboard = false) => {\n if (isActive) {\n openedViaKeyboardRef.current = viaKeyboard\n onToggleOpen?.(true)\n } else {\n onToggleClose?.()\n }\n setActiveInternal(isActive)\n },\n [onToggleClose, onToggleOpen],\n )\n\n // /////////////////////////////////////\n // Position Calculation\n //\n // Calculates and applies popup position relative to trigger.\n // Always checks viewport bounds (for flipping), but only updates\n // styles if the calculated position differs from current position.\n // /////////////////////////////////////\n\n const updatePosition = useEffectEvent(() => {\n const trigger = triggerRef.current\n const popup = popupRef.current\n if (!trigger || !popup) {\n return\n }\n\n const triggerRect = trigger.getBoundingClientRect()\n const popupRect = popup.getBoundingClientRect()\n\n // Inside a fixed ancestor, use `fixed` (no scroll offset) so background scrolling\n // doesn't shift the popup. Otherwise use page coordinates (absolute).\n const useFixed = isFixedRef.current\n const scrollY = useFixed ? 0 : window.scrollY\n const scrollX = useFixed ? 0 : window.scrollX\n\n // Gap between the popup and the trigger/viewport edges (in pixels)\n const offset = 10\n // Additional gap used in side mode so the child popup has breathing room from its parent\n const sideOffset = 4\n\n let top: number\n let left: number\n let caretLeft: number\n\n if (side) {\n // /////////////////////////////////////\n // Side Positioning\n // Places the popup to the left or right of the parent popup (not just the trigger),\n // top-aligned with the trigger. Flips to the opposite side if there is not enough\n // viewport space.\n // /////////////////////////////////////\n\n // Top: align with trigger top, clamped to viewport\n top = triggerRect.top + scrollY\n const maxTop = scrollY + window.innerHeight - popupRect.height - offset\n top = Math.max(scrollY + offset, Math.min(top, maxTop))\n\n // Use the parent popup's bounding rect as the reference for left/right positioning\n // so the child appears 4px from the parent popup edge, not just the trigger button.\n const anchorRect = parentPopup?.popupRef.current\n ? parentPopup.popupRef.current.getBoundingClientRect()\n : triggerRect\n\n if (side === 'left') {\n left = anchorRect.left - popupRect.width - sideOffset\n if (left < offset) {\n // flip to right side\n left = anchorRect.right + sideOffset\n }\n } else {\n left = anchorRect.right + sideOffset\n if (left + popupRect.width + offset > window.innerWidth) {\n // flip to left side\n left = anchorRect.left - popupRect.width - sideOffset\n }\n }\n\n left = left + scrollX\n // Caret not used in side mode; set a neutral value\n caretLeft = popupRect.width / 2\n\n setIsOnTop(false)\n } else {\n // /////////////////////////////////////\n // Vertical Positioning\n // Calculates the `top` position in absolute page coordinates.\n // Uses `verticalAlign` prop as the preferred direction, but flips\n // to the opposite side if there's not enough viewport space.\n // /////////////////////////////////////\n\n let onTop = verticalAlign === 'top'\n\n if (verticalAlign === 'bottom') {\n top = triggerRect.bottom + scrollY + offset\n\n if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {\n // Try to flip above — only do so if there's actually enough room\n const topIfAbove = triggerRect.top + scrollY - popupRect.height - offset\n if (topIfAbove >= scrollY) {\n top = topIfAbove\n onTop = true\n }\n // else: not enough room above either — keep below and let it overflow rather than going off-screen\n }\n } else {\n top = triggerRect.top + scrollY - popupRect.height - offset\n\n if (triggerRect.top - popupRect.height - offset < 0) {\n top = triggerRect.bottom + scrollY + offset\n onTop = false\n }\n }\n\n setIsOnTop(onTop)\n\n // /////////////////////////////////////\n // Horizontal Positioning\n // Calculates the `left` position based on `horizontalAlign` prop:\n // - 'left': aligns popup's left edge with trigger's left edge\n // - 'right': aligns popup's right edge with trigger's right edge\n // - 'center': centers popup horizontally relative to trigger\n // Then clamps to keep the popup within viewport bounds.\n // /////////////////////////////////////\n\n left =\n horizontalAlign === 'right'\n ? triggerRect.right - popupRect.width\n : horizontalAlign === 'center'\n ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2\n : triggerRect.left\n\n left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset))\n\n // /////////////////////////////////////\n // Caret Positioning\n // Positions the caret arrow to point at the trigger's horizontal center.\n // Clamps between 12px from edges to prevent caret from overflowing the popup.\n // /////////////////////////////////////\n\n const triggerCenter = triggerRect.left + triggerRect.width / 2\n caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12))\n }\n\n // /////////////////////////////////////\n // Apply Styles (only if changed)\n // Compares calculated position with current styles to avoid unnecessary\n // DOM updates during scroll. This prevents visual lag by relying on the absolute\n // positioning where possible (popup slightly lags behind when scrolling really fast),\n // while still allowing position changes when needed (e.g., sticky parent, viewport flip).\n // Values are rounded to match browser's CSS precision and avoid false updates.\n // /////////////////////////////////////\n\n const newTop = `${Math.round(top)}px`\n const newLeft = `${Math.round(left + scrollX)}px`\n const newCaretLeft = `${Math.round(caretLeft)}px`\n const newPosition = useFixed ? 'fixed' : ''\n\n if (popup.style.position !== newPosition) {\n popup.style.position = newPosition\n }\n if (popup.style.top !== newTop) {\n popup.style.top = newTop\n }\n if (popup.style.left !== newLeft) {\n popup.style.left = newLeft\n }\n if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {\n popup.style.setProperty('--caret-left', newCaretLeft)\n }\n })\n\n // /////////////////////////////////////\n // Click Outside Handler\n // Closes popup when clicking outside both the popup and trigger.\n // Distinguishes between parent and child popups:\n // - Click in child popup: parent stays open\n // - Click in parent popup: child closes\n // /////////////////////////////////////\n\n const handleClickOutside = useEffectEvent((e: MouseEvent) => {\n const target = e.target as Node\n const isOutsidePopup = !popupRef.current?.contains(target)\n const isOutsideTrigger = !triggerRef.current?.contains(target)\n\n // Check if click is inside a popup portal\n const clickedPopupContent = (target as Element).closest?.('.popup__content')\n\n // If the clicked popup contains this popup's trigger, it's a parent popup\n // and we should close. If it doesn't contain our trigger, it's a child popup\n // and we should stay open to avoid closing parent when interacting with child.\n const isInsideChildPopup =\n clickedPopupContent && !clickedPopupContent.contains(triggerRef.current)\n\n if (isOutsidePopup && isOutsideTrigger && !isInsideChildPopup) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Keyboard Navigation\n // Handles keyboard interactions when popup is open:\n // - Escape: closes popup and returns focus to trigger\n // - Tab/Shift+Tab: cycles through focusable items with wrapping\n // - ArrowUp/ArrowDown: same as Shift+Tab/Tab for menu-style navigation\n // Focus is managed manually to support elements the browser might skip.\n // /////////////////////////////////////\n\n const handleKeyDown = useEffectEvent((e: KeyboardEvent) => {\n const popup = popupRef.current\n if (!popup || !active) {\n return\n }\n\n if (e.key === 'Escape') {\n e.preventDefault()\n setActive(false)\n triggerRef.current?.querySelector<HTMLElement>('button, [tabindex=\"0\"]')?.focus()\n return\n }\n\n if (e.key === 'Tab' || e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n const focusable = Array.from(popup.querySelectorAll<HTMLElement>(TABBABLE_SELECTOR))\n if (focusable.length === 0) {\n return\n }\n\n e.preventDefault()\n\n const currentIndex = focusable.findIndex((el) => el === document.activeElement)\n const goBackward = e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)\n\n let nextIndex: number\n if (currentIndex === -1) {\n nextIndex = goBackward ? focusable.length - 1 : 0\n } else if (goBackward) {\n nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1\n } else {\n nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1\n }\n\n focusable[nextIndex].focus()\n }\n })\n\n // /////////////////////////////////////\n // Click Handler for Actionable Elements\n // Closes popup when buttons/links inside are clicked (includes Enter/Space activation).\n // /////////////////////////////////////\n\n const handleActionableClick = useEffectEvent((e: MouseEvent) => {\n const target = e.target as HTMLElement\n\n // Allow opting out with data-popup-prevent-close attribute on element or ancestor\n if (target.closest('[data-popup-prevent-close]')) {\n return\n }\n\n // Check if the clicked element or any ancestor is an actionable element\n const actionable = target.closest('button, a[href], [role=\"button\"], [role=\"menuitem\"]')\n if (actionable && popupRef.current?.contains(actionable)) {\n // Don't close if clicking a nested popup's trigger — it will manage its own open state\n if (actionable.closest(`.${baseClass}__trigger-wrap`)) {\n return\n }\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Effect: Setup/Teardown position and focus management\n // /////////////////////////////////////\n\n useEffect(() => {\n if (!active) {\n const popup = popupRef.current\n if (popup) {\n // Clear inline position styles so the CSS `top: -9999px` rule on\n // `.popup__hidden-content` takes effect. Without this, the inline\n // styles set during positioning would win over the CSS rule, keeping\n // portaled children (e.g. a ReactSelect menu) visually on-screen.\n popup.style.position = ''\n popup.style.top = ''\n popup.style.left = ''\n }\n return\n }\n\n const popup = popupRef.current\n if (!popup) {\n return\n }\n\n // /////////////////////////////////////\n // Initial Position\n // Calculate and apply popup position.\n // getBoundingClientRect() forces synchronous layout.\n //\n // We call updatePosition() twice: once synchronously (so the popup\n // snaps to roughly the right place immediately rather than flashing\n // from -9999px) and once in a requestAnimationFrame, which fires\n // after the browser has finished laying out the newly-visible popup\n // content. The rAF call is the authoritative one — it catches cases\n // where the popup height wasn't stable yet during the first call\n // (e.g. ColumnSelection popup content rendering after hidden → visible\n // class switch), which was causing incorrect flip-to-top decisions.\n // /////////////////////////////////////\n\n // Decide the positioning strategy once per open.\n isFixedRef.current = hasFixedAncestor(triggerRef.current)\n\n updatePosition()\n const rafId = requestAnimationFrame(() => {\n updatePosition()\n })\n\n // /////////////////////////////////////\n // Focus Management\n // When opened via keyboard, autofocus the first focusable button.\n // When opened via mouse, skip autofocus to avoid unwanted highlights.\n // /////////////////////////////////////\n\n if (openedViaKeyboardRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready.\n requestAnimationFrame(() => {\n const firstFocusable = popup.querySelector<HTMLElement>(TABBABLE_SELECTOR)\n firstFocusable?.focus()\n })\n }\n\n // /////////////////////////////////////\n // Event Listeners\n // - resize/scroll: recalculate position (only applies styles if changed)\n // - mousedown: detect clicks outside to close\n // - keydown: handle keyboard navigation\n // /////////////////////////////////////\n\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n document.addEventListener('mousedown', handleClickOutside)\n document.addEventListener('keydown', handleKeyDown)\n popup.addEventListener('click', handleActionableClick)\n\n return () => {\n cancelAnimationFrame(rafId)\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n document.removeEventListener('mousedown', handleClickOutside)\n document.removeEventListener('keydown', handleKeyDown)\n popup.removeEventListener('click', handleActionableClick)\n }\n }, [active])\n\n useEffect(() => {\n if (forceOpen !== undefined) {\n setActive(forceOpen)\n }\n }, [forceOpen, setActive])\n\n const Trigger = (\n <PopupTrigger\n active={active}\n button={button}\n buttonAriaLabel={buttonAriaLabel}\n buttonType={buttonType}\n className={buttonClassName}\n disabled={disabled}\n noBackground={noBackground}\n renderButton={renderButton}\n setActive={setActive}\n size={buttonSize}\n />\n )\n\n return (\n <div className={[baseClass, className].filter(Boolean).join(' ')} id={id}>\n <div className={`${baseClass}__trigger-wrap`} ref={triggerRef}>\n {showOnHover ? (\n <div\n className={`${baseClass}__on-hover-watch`}\n onMouseEnter={() => setActive(true)}\n onMouseLeave={() => setActive(false)}\n role=\"button\"\n tabIndex={0}\n >\n {Trigger}\n </div>\n ) : (\n Trigger\n )}\n </div>\n\n {mounted\n ? // We need to make sure the popup is part of the DOM (although invisible), even if it's not active.\n // This ensures that components within the popup, like modals, do not unmount when the popup closes.\n // Otherwise, modals opened from the popup will close unexpectedly when clicking within the modal, since\n // that closes the popup due to the click outside handler.\n createPortal(\n <PopupContext value={{ popupRef }}>\n <div\n className={\n active\n ? [\n `${baseClass}__content`,\n `${baseClass}--size-${size}`,\n side\n ? `${baseClass}--side-${side}`\n : isOnTop\n ? `${baseClass}--v-top`\n : `${baseClass}--v-bottom`,\n portalClassName,\n ]\n .filter(Boolean)\n .join(' ')\n : // Do not share any class names between active and disabled popups, to make sure\n // tests do not accidentally target inactive popups.\n `${baseClass}__hidden-content`\n }\n data-popup-id={id || undefined}\n data-theme={theme === 'auto' ? undefined : theme}\n ref={popupRef}\n >\n <div\n className={`${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`}\n >\n {theme === 'auto' ? (\n <>\n {render?.({ close: () => setActive(false) })}\n {children}\n </>\n ) : (\n <ThemeProvider theme={theme}>\n {render?.({ close: () => setActive(false) })}\n {children}\n </ThemeProvider>\n )}\n </div>\n {caret && !side && <div className={`${baseClass}__caret`} />}\n </div>\n </PopupContext>,\n document.body,\n )\n : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,SAAS,MAAM;AAE3B,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACpF,SAASC,YAAY,QAAQ;AAE7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAC9B,OAAO;AACP,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAMlB,MAAMC,YAAA,gBAAeX,aAAA,CAAwC;AAE7D;;;AAGA,MAAMY,iBAAA,GAAoB,CACxB,WACA,yB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AAA;gCAELyF,IAAA,CAAC;UACC1G,SAAA,EAAW,GAAGzB,SAAA,qBAA8BqC,aAAA,GAAgB,IAAIrC,SAAA,oCAA6C,GAAG,IAAI;oBAEnHwC,KAAA,KAAU,sBACT4F,KAAA,CAAAS,SAAA;uBACG3G,MAAA,GAAS;cAAE4G,KAAA,EAAOA,CAAA,KAAMzF,SAAA,CAAU;YAAO,IACzC7B,QAAA;4BAGH4G,KAAA,CAACtI,aAAA;YAAc0C,KAAA,EAAOA,KAAA;uBACnBN,MAAA,GAAS;cAAE4G,KAAA,EAAOA,CAAA,KAAMzF,SAAA,CAAU;YAAO,IACzC7B,QAAA;;YAIND,KAAA,IAAS,CAACe,IAAA,iBAAQ6F,IAAA,CAAC;UAAI1G,SAAA,EAAW,GAAGzB,SAAA;;;QAG1CU,QAAA,CAASC,IAAI,IAEf;;AAGV","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["PopupList","React","createContext","use","useCallback","useEffect","useRef","useState","createPortal","useEffectEvent","ThemeProvider","PopupTrigger","baseClass","PopupContext","TABBABLE_SELECTOR","map","s","join","hasFixedAncestor","element","node","parentElement","document","body","window","getComputedStyle","position","Popup","props","id","button","buttonAriaLabel","buttonClassName","buttonSize","buttonType","caret","children","className","disabled","forceOpen","horizontalAlign","initActive","noBackground","onToggleClose","onToggleOpen","portalClassName","render","renderButton","showOnHover","showScrollbar","side","size","theme","verticalAlign","popupRef","triggerRef","isFixedRef","openedViaKeyboardRef","parentPopup","mounted","setMounted","active","setActiveInternal","isOnTop","setIsOnTop","setActive","isActive","viaKeyboard","current","updatePosition","trigger","popup","triggerRect","getBoundingClientRect","popupRect","useFixed","scrollY","scrollX","offset","sideOffset","top","left","caretLeft","maxTop","innerHeight","height","Math","max","min","anchorRect","width","right","innerWidth","onTop","bottom","topIfAbove","triggerCenter","newTop","round","newLeft","newCaretLeft","newPosition","style","getPropertyValue","setProperty","handleClickOutside","e","target","isOutsidePopup","contains","isOutsideTrigger","clickedPopupContent","closest","isInsideChildPopup","handleKeyDown","key","preventDefault","querySelector","focus","focusable","Array","from","querySelectorAll","length","currentIndex","findIndex","el","activeElement","goBackward","shiftKey","nextIndex","handleActionableClick","actionable","rafId","requestAnimationFrame","firstFocusable","addEventListener","capture","passive","cancelAnimationFrame","removeEventListener","undefined","Trigger","_jsx","_jsxs","filter","Boolean","ref","onMouseEnter","onMouseLeave","role","tabIndex","value","_Fragment","close"],"sources":["../../../src/elements/Popup/index.tsx"],"sourcesContent":["'use client'\nimport type { CSSProperties } from 'react'\n\nexport * as PopupList from './PopupButtonList/index.js'\n\nimport React, { createContext, use, useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEffectEvent } from '../../hooks/useEffectEvent.js'\nimport { ThemeProvider } from '../../providers/Theme/index.js'\nimport './index.css'\nimport { PopupTrigger } from './PopupTrigger/index.js'\n\nconst baseClass = 'popup'\n\ntype PopupContextValue = {\n popupRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst PopupContext = createContext<null | PopupContextValue>(null)\n\n/**\n * Selector for all elements the browser considers tabbable.\n */\nconst TABBABLE_SELECTOR = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'audio[controls]',\n 'video[controls]',\n 'summary',\n]\n .map((s) => `${s}:not([tabindex=\"-1\"])`)\n .join(', ')\n\n/**\n * Returns whether the element has a `position: fixed` ancestor (e.g. an open Drawer).\n * Such popups must be positioned with `fixed` so they don't drift when the background scrolls.\n */\nconst hasFixedAncestor = (element: HTMLElement | null): boolean => {\n let node = element?.parentElement\n while (node && node !== document.body) {\n if (window.getComputedStyle(node).position === 'fixed') {\n return true\n }\n node = node.parentElement\n }\n return false\n}\n\nexport type PopupProps = {\n backgroundColor?: CSSProperties['backgroundColor']\n boundingRef?: React.RefObject<HTMLElement>\n button?: React.ReactNode\n /**\n * Accessible label for the trigger button.\n * Necessary when the button has an icon-only content,\n * so the button has an accessible name for screen readers.\n */\n buttonAriaLabel?: string\n /**\n * The class name to apply to the button that triggers the popup.\n */\n buttonClassName?: string\n buttonSize?: 'large' | 'medium'\n buttonType?: 'custom' | 'default'\n caret?: boolean\n children?: React.ReactNode\n /**\n * The class name to apply to the popup container containing the trigger.\n * This does not wrap the actual popup content, which is rendered in a portal.\n */\n className?: string\n disabled?: boolean\n /**\n * Force control the open state of the popup, regardless of the trigger.\n */\n forceOpen?: boolean\n /**\n * Preferred horizontal alignment of the popup, if there is enough space available.\n *\n * @default 'left'\n */\n horizontalAlign?: 'center' | 'left' | 'right'\n id?: string\n initActive?: boolean\n noBackground?: boolean\n onToggleClose?: () => void\n onToggleOpen?: (active: boolean) => void\n /**\n * Class name to apply to the portal container.\n */\n portalClassName?: string\n render?: (args: { close: () => void }) => React.ReactNode\n /**\n * Render prop for custom trigger button. Receives onClick/onKeyDown/aria props.\n * When provided, `button` and `buttonType` are ignored.\n */\n renderButton?: (props: {\n active: boolean\n 'aria-expanded': boolean\n 'aria-haspopup': true\n onClick: React.MouseEventHandler\n onKeyDown: React.KeyboardEventHandler\n }) => React.ReactNode\n showOnHover?: boolean\n /**\n * By default, the scrollbar is hidden. If you want to show it, set this to true.\n * In both cases, the container is still scrollable.\n *\n * @default false\n */\n showScrollbar?: boolean\n /**\n * Position the popup to the side of the trigger instead of above/below.\n * The popup's top edge aligns with the trigger's top edge (with viewport clamping).\n * Automatically flips to the opposite side if there is not enough space.\n * When set, `verticalAlign`, `horizontalAlign`, and the caret are ignored.\n */\n side?: 'left' | 'right'\n size?: 'fit-content' | 'large' | 'small'\n /**\n * Theme for the popup content. Defaults to 'dark'.\n * Set to 'auto' to inherit the current theme.\n *\n * @default 'dark'\n */\n theme?: 'auto' | 'dark' | 'light'\n /**\n * Preferred vertical alignment of the popup (position below or above the trigger),\n * if there is enough space available.\n *\n * If the popup is too close to the edge of the viewport, it will flip to the opposite side\n * regardless of the preferred vertical alignment.\n *\n * @default 'bottom'\n */\n verticalAlign?: 'bottom' | 'top'\n}\n\n/**\n * Component that renders a popup, as well as a button that triggers the popup.\n *\n * The popup is rendered in a portal, and is automatically positioned above / below the trigger,\n * depending on the verticalAlign prop and the space available.\n */\nexport const Popup: React.FC<PopupProps> = (props) => {\n const {\n id,\n button,\n buttonAriaLabel,\n buttonClassName,\n buttonSize,\n buttonType = 'default',\n caret = true,\n children,\n className,\n disabled,\n forceOpen,\n horizontalAlign = 'left',\n initActive = false,\n noBackground,\n onToggleClose,\n onToggleOpen,\n portalClassName,\n render,\n renderButton,\n showOnHover = false,\n showScrollbar = false,\n side,\n size = 'fit-content',\n theme = 'dark',\n verticalAlign = 'bottom',\n } = props\n\n const popupRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLDivElement>(null)\n\n /**\n * Whether the trigger is inside a `position: fixed` ancestor (e.g. a Drawer),\n * in which case the popup is positioned with `fixed` instead of `absolute`.\n */\n const isFixedRef = useRef(false)\n\n /**\n * Keeps track of whether the popup was opened via keyboard.\n * This is used to determine whether to autofocus the first element in the popup.\n * If the popup was opened via mouse, we do not want to autofocus the first element.\n */\n const openedViaKeyboardRef = useRef(false)\n\n const parentPopup = use(PopupContext)\n\n const [mounted, setMounted] = useState(false)\n const [active, setActiveInternal] = useState(initActive)\n const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top')\n\n // Track when component is mounted to avoid SSR/client hydration mismatch\n useEffect(() => {\n setMounted(true)\n }, [])\n\n const setActive = useCallback(\n (isActive: boolean, viaKeyboard = false) => {\n if (isActive) {\n openedViaKeyboardRef.current = viaKeyboard\n onToggleOpen?.(true)\n } else {\n onToggleClose?.()\n }\n setActiveInternal(isActive)\n },\n [onToggleClose, onToggleOpen],\n )\n\n // /////////////////////////////////////\n // Position Calculation\n //\n // Calculates and applies popup position relative to trigger.\n // Always checks viewport bounds (for flipping), but only updates\n // styles if the calculated position differs from current position.\n // /////////////////////////////////////\n\n const updatePosition = useEffectEvent(() => {\n const trigger = triggerRef.current\n const popup = popupRef.current\n if (!trigger || !popup) {\n return\n }\n\n const triggerRect = trigger.getBoundingClientRect()\n const popupRect = popup.getBoundingClientRect()\n\n // Inside a fixed ancestor, use `fixed` (no scroll offset) so background scrolling\n // doesn't shift the popup. Otherwise use page coordinates (absolute).\n const useFixed = isFixedRef.current\n const scrollY = useFixed ? 0 : window.scrollY\n const scrollX = useFixed ? 0 : window.scrollX\n\n // Gap between the popup and the trigger/viewport edges (in pixels)\n const offset = 8\n // Additional gap used in side mode so the child popup has breathing room from its parent\n const sideOffset = 4\n\n let top: number\n let left: number\n let caretLeft: number\n\n if (side) {\n // /////////////////////////////////////\n // Side Positioning\n // Places the popup to the left or right of the parent popup (not just the trigger),\n // top-aligned with the trigger. Flips to the opposite side if there is not enough\n // viewport space.\n // /////////////////////////////////////\n\n // Top: align with trigger top, clamped to viewport\n top = triggerRect.top + scrollY\n const maxTop = scrollY + window.innerHeight - popupRect.height - offset\n top = Math.max(scrollY + offset, Math.min(top, maxTop))\n\n // Use the parent popup's bounding rect as the reference for left/right positioning\n // so the child appears 4px from the parent popup edge, not just the trigger button.\n const anchorRect = parentPopup?.popupRef.current\n ? parentPopup.popupRef.current.getBoundingClientRect()\n : triggerRect\n\n if (side === 'left') {\n left = anchorRect.left - popupRect.width - sideOffset\n if (left < offset) {\n // flip to right side\n left = anchorRect.right + sideOffset\n }\n } else {\n left = anchorRect.right + sideOffset\n if (left + popupRect.width + offset > window.innerWidth) {\n // flip to left side\n left = anchorRect.left - popupRect.width - sideOffset\n }\n }\n\n left = left + scrollX\n // Caret not used in side mode; set a neutral value\n caretLeft = popupRect.width / 2\n\n setIsOnTop(false)\n } else {\n // /////////////////////////////////////\n // Vertical Positioning\n // Calculates the `top` position in absolute page coordinates.\n // Uses `verticalAlign` prop as the preferred direction, but flips\n // to the opposite side if there's not enough viewport space.\n // /////////////////////////////////////\n\n let onTop = verticalAlign === 'top'\n\n if (verticalAlign === 'bottom') {\n top = triggerRect.bottom + scrollY + offset\n\n if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {\n // Try to flip above — only do so if there's actually enough room\n const topIfAbove = triggerRect.top + scrollY - popupRect.height - offset\n if (topIfAbove >= scrollY) {\n top = topIfAbove\n onTop = true\n }\n // else: not enough room above either — keep below and let it overflow rather than going off-screen\n }\n } else {\n top = triggerRect.top + scrollY - popupRect.height - offset\n\n if (triggerRect.top - popupRect.height - offset < 0) {\n top = triggerRect.bottom + scrollY + offset\n onTop = false\n }\n }\n\n setIsOnTop(onTop)\n\n // /////////////////////////////////////\n // Horizontal Positioning\n // Calculates the `left` position based on `horizontalAlign` prop:\n // - 'left': aligns popup's left edge with trigger's left edge\n // - 'right': aligns popup's right edge with trigger's right edge\n // - 'center': centers popup horizontally relative to trigger\n // Then clamps to keep the popup within viewport bounds.\n // /////////////////////////////////////\n\n left =\n horizontalAlign === 'right'\n ? triggerRect.right - popupRect.width\n : horizontalAlign === 'center'\n ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2\n : triggerRect.left\n\n left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset))\n\n // /////////////////////////////////////\n // Caret Positioning\n // Positions the caret arrow to point at the trigger's horizontal center.\n // Clamps between 12px from edges to prevent caret from overflowing the popup.\n // /////////////////////////////////////\n\n const triggerCenter = triggerRect.left + triggerRect.width / 2\n caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12))\n }\n\n // /////////////////////////////////////\n // Apply Styles (only if changed)\n // Compares calculated position with current styles to avoid unnecessary\n // DOM updates during scroll. This prevents visual lag by relying on the absolute\n // positioning where possible (popup slightly lags behind when scrolling really fast),\n // while still allowing position changes when needed (e.g., sticky parent, viewport flip).\n // Values are rounded to match browser's CSS precision and avoid false updates.\n // /////////////////////////////////////\n\n const newTop = `${Math.round(top)}px`\n const newLeft = `${Math.round(left + scrollX)}px`\n const newCaretLeft = `${Math.round(caretLeft)}px`\n const newPosition = useFixed ? 'fixed' : ''\n\n if (popup.style.position !== newPosition) {\n popup.style.position = newPosition\n }\n if (popup.style.top !== newTop) {\n popup.style.top = newTop\n }\n if (popup.style.left !== newLeft) {\n popup.style.left = newLeft\n }\n if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {\n popup.style.setProperty('--caret-left', newCaretLeft)\n }\n })\n\n // /////////////////////////////////////\n // Click Outside Handler\n // Closes popup when clicking outside both the popup and trigger.\n // Distinguishes between parent and child popups:\n // - Click in child popup: parent stays open\n // - Click in parent popup: child closes\n // /////////////////////////////////////\n\n const handleClickOutside = useEffectEvent((e: MouseEvent) => {\n const target = e.target as Node\n const isOutsidePopup = !popupRef.current?.contains(target)\n const isOutsideTrigger = !triggerRef.current?.contains(target)\n\n // Check if click is inside a popup portal\n const clickedPopupContent = (target as Element).closest?.('.popup__content')\n\n // If the clicked popup contains this popup's trigger, it's a parent popup\n // and we should close. If it doesn't contain our trigger, it's a child popup\n // and we should stay open to avoid closing parent when interacting with child.\n const isInsideChildPopup =\n clickedPopupContent && !clickedPopupContent.contains(triggerRef.current)\n\n if (isOutsidePopup && isOutsideTrigger && !isInsideChildPopup) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Keyboard Navigation\n // Handles keyboard interactions when popup is open:\n // - Escape: closes popup and returns focus to trigger\n // - Tab/Shift+Tab: cycles through focusable items with wrapping\n // - ArrowUp/ArrowDown: same as Shift+Tab/Tab for menu-style navigation\n // Focus is managed manually to support elements the browser might skip.\n // /////////////////////////////////////\n\n const handleKeyDown = useEffectEvent((e: KeyboardEvent) => {\n const popup = popupRef.current\n if (!popup || !active) {\n return\n }\n\n if (e.key === 'Escape') {\n e.preventDefault()\n setActive(false)\n triggerRef.current?.querySelector<HTMLElement>('button, [tabindex=\"0\"]')?.focus()\n return\n }\n\n if (e.key === 'Tab' || e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n const focusable = Array.from(popup.querySelectorAll<HTMLElement>(TABBABLE_SELECTOR))\n if (focusable.length === 0) {\n return\n }\n\n e.preventDefault()\n\n const currentIndex = focusable.findIndex((el) => el === document.activeElement)\n const goBackward = e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)\n\n let nextIndex: number\n if (currentIndex === -1) {\n nextIndex = goBackward ? focusable.length - 1 : 0\n } else if (goBackward) {\n nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1\n } else {\n nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1\n }\n\n focusable[nextIndex].focus()\n }\n })\n\n // /////////////////////////////////////\n // Click Handler for Actionable Elements\n // Closes popup when buttons/links inside are clicked (includes Enter/Space activation).\n // /////////////////////////////////////\n\n const handleActionableClick = useEffectEvent((e: MouseEvent) => {\n const target = e.target as HTMLElement\n\n // Allow opting out with data-popup-prevent-close attribute on element or ancestor\n if (target.closest('[data-popup-prevent-close]')) {\n return\n }\n\n // Check if the clicked element or any ancestor is an actionable element\n const actionable = target.closest('button, a[href], [role=\"button\"], [role=\"menuitem\"]')\n if (actionable && popupRef.current?.contains(actionable)) {\n // Don't close if clicking a nested popup's trigger — it will manage its own open state\n if (actionable.closest(`.${baseClass}__trigger-wrap`)) {\n return\n }\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Effect: Setup/Teardown position and focus management\n // /////////////////////////////////////\n\n useEffect(() => {\n if (!active) {\n const popup = popupRef.current\n if (popup) {\n // Clear inline position styles so the CSS `top: -9999px` rule on\n // `.popup__hidden-content` takes effect. Without this, the inline\n // styles set during positioning would win over the CSS rule, keeping\n // portaled children (e.g. a ReactSelect menu) visually on-screen.\n popup.style.position = ''\n popup.style.top = ''\n popup.style.left = ''\n }\n return\n }\n\n const popup = popupRef.current\n if (!popup) {\n return\n }\n\n // /////////////////////////////////////\n // Initial Position\n // Calculate and apply popup position.\n // getBoundingClientRect() forces synchronous layout.\n //\n // We call updatePosition() twice: once synchronously (so the popup\n // snaps to roughly the right place immediately rather than flashing\n // from -9999px) and once in a requestAnimationFrame, which fires\n // after the browser has finished laying out the newly-visible popup\n // content. The rAF call is the authoritative one — it catches cases\n // where the popup height wasn't stable yet during the first call\n // (e.g. ColumnSelection popup content rendering after hidden → visible\n // class switch), which was causing incorrect flip-to-top decisions.\n // /////////////////////////////////////\n\n // Decide the positioning strategy once per open.\n isFixedRef.current = hasFixedAncestor(triggerRef.current)\n\n updatePosition()\n const rafId = requestAnimationFrame(() => {\n updatePosition()\n })\n\n // /////////////////////////////////////\n // Focus Management\n // When opened via keyboard, autofocus the first focusable button.\n // When opened via mouse, skip autofocus to avoid unwanted highlights.\n // /////////////////////////////////////\n\n if (openedViaKeyboardRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready.\n requestAnimationFrame(() => {\n const firstFocusable = popup.querySelector<HTMLElement>(TABBABLE_SELECTOR)\n firstFocusable?.focus()\n })\n }\n\n // /////////////////////////////////////\n // Event Listeners\n // - resize/scroll: recalculate position (only applies styles if changed)\n // - mousedown: detect clicks outside to close\n // - keydown: handle keyboard navigation\n // /////////////////////////////////////\n\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n document.addEventListener('mousedown', handleClickOutside)\n document.addEventListener('keydown', handleKeyDown)\n popup.addEventListener('click', handleActionableClick)\n\n return () => {\n cancelAnimationFrame(rafId)\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n document.removeEventListener('mousedown', handleClickOutside)\n document.removeEventListener('keydown', handleKeyDown)\n popup.removeEventListener('click', handleActionableClick)\n }\n }, [active])\n\n useEffect(() => {\n if (forceOpen !== undefined) {\n setActive(forceOpen)\n }\n }, [forceOpen, setActive])\n\n const Trigger = (\n <PopupTrigger\n active={active}\n button={button}\n buttonAriaLabel={buttonAriaLabel}\n buttonType={buttonType}\n className={buttonClassName}\n disabled={disabled}\n noBackground={noBackground}\n renderButton={renderButton}\n setActive={setActive}\n size={buttonSize}\n />\n )\n\n return (\n <div className={[baseClass, className].filter(Boolean).join(' ')} id={id}>\n <div className={`${baseClass}__trigger-wrap`} ref={triggerRef}>\n {showOnHover ? (\n <div\n className={`${baseClass}__on-hover-watch`}\n onMouseEnter={() => setActive(true)}\n onMouseLeave={() => setActive(false)}\n role=\"button\"\n tabIndex={0}\n >\n {Trigger}\n </div>\n ) : (\n Trigger\n )}\n </div>\n\n {mounted\n ? // We need to make sure the popup is part of the DOM (although invisible), even if it's not active.\n // This ensures that components within the popup, like modals, do not unmount when the popup closes.\n // Otherwise, modals opened from the popup will close unexpectedly when clicking within the modal, since\n // that closes the popup due to the click outside handler.\n createPortal(\n <PopupContext value={{ popupRef }}>\n <div\n className={\n active\n ? [\n `${baseClass}__content`,\n `${baseClass}--size-${size}`,\n side\n ? `${baseClass}--side-${side}`\n : isOnTop\n ? `${baseClass}--v-top`\n : `${baseClass}--v-bottom`,\n portalClassName,\n ]\n .filter(Boolean)\n .join(' ')\n : // Do not share any class names between active and disabled popups, to make sure\n // tests do not accidentally target inactive popups.\n `${baseClass}__hidden-content`\n }\n data-popup-id={id || undefined}\n data-theme={theme === 'auto' ? undefined : theme}\n ref={popupRef}\n >\n <div\n className={`${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`}\n >\n {theme === 'auto' ? (\n <>\n {render?.({ close: () => setActive(false) })}\n {children}\n </>\n ) : (\n <ThemeProvider theme={theme}>\n {render?.({ close: () => setActive(false) })}\n {children}\n </ThemeProvider>\n )}\n </div>\n {caret && !side && <div className={`${baseClass}__caret`} />}\n </div>\n </PopupContext>,\n document.body,\n )\n : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,SAAS,MAAM;AAE3B,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACpF,SAASC,YAAY,QAAQ;AAE7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAC9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AC;QAER;QACA,GAAGL,SAAA,kBAA2B;QAEpC,iBAAeiB,EAAA,IAAMgH,SAAA;QACrB,cAAYzF,KAAA,KAAU,SAASyF,SAAA,GAAYzF,KAAA;QAC3C+F,GAAA,EAAK7F,QAAA;gCAELyF,IAAA,CAAC;UACC1G,SAAA,EAAW,GAAGzB,SAAA,qBAA8BqC,aAAA,GAAgB,IAAIrC,SAAA,oCAA6C,GAAG,IAAI;oBAEnHwC,KAAA,KAAU,sBACT4F,KAAA,CAAAS,SAAA;uBACG3G,MAAA,GAAS;cAAE4G,KAAA,EAAOA,CAAA,KAAMzF,SAAA,CAAU;YAAO,IACzC7B,QAAA;4BAGH4G,KAAA,CAACtI,aAAA;YAAc0C,KAAA,EAAOA,KAAA;uBACnBN,MAAA,GAAS;cAAE4G,KAAA,EAAOA,CAAA,KAAMzF,SAAA,CAAU;YAAO,IACzC7B,QAAA;;YAIND,KAAA,IAAS,CAACe,IAAA,iBAAQ6F,IAAA,CAAC;UAAI1G,SAAA,EAAW,GAAGzB,SAAA;;;QAG1CU,QAAA,CAASC,IAAI,IAEf;;AAGV","ignoreList":[]}
|
|
@@ -285,9 +285,7 @@ export const QueryPresetBar = ({
|
|
|
285
285
|
},
|
|
286
286
|
children: activePreset?.isShared ? t('general:updateForEveryone') : t('fields:saveChanges')
|
|
287
287
|
}), queryPresetPermissions?.update && /*#__PURE__*/_jsx(PopupList.Button, {
|
|
288
|
-
icon: /*#__PURE__*/_jsx(EditIcon, {
|
|
289
|
-
size: 16
|
|
290
|
-
}),
|
|
288
|
+
icon: /*#__PURE__*/_jsx(EditIcon, {}),
|
|
291
289
|
id: "edit-preset",
|
|
292
290
|
onClick: () => {
|
|
293
291
|
close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getTranslation","formatAdminURL","transformColumnsToPreferences","transformColumnsToSearchParams","qs","React","Fragment","useCallback","useEffect","useMemo","useState","CheckIcon","EditIcon","GearIcon","PlusIcon","RefreshIcon","TrashIcon","useConfig","useListQuery","useTranslation","ConfirmationModal","useDocumentDrawer","FilterTrigger","useListDrawer","useModal","Popup","PopupList","Translation","deletePresetModalSlug","queryPresetsSlug","baseClass","QueryPresetBar","activePreset","collectionSlug","queryPresetPermissions","modified","query","refineListData","setModified","setQueryModified","openModal","presets","setPresets","i18n","t","config","routes","api","apiRoute","serverURL","getEntityConfig","presetConfig","PresetDocumentDrawer","openDrawer","openPresetDrawer","id","CreateNewPresetDrawer","closeDrawer","closeCreateNewDrawer","openCreateNewDrawer","filterOptions","isTemp","not_equals","relatedCollection","equals","ListDrawer","openListDrawer","collectionSlugs","selectedCollection","fetchPresets","where","and","queryString","stringify","limit","addQueryPrefix","url","path","response","fetch","credentials","ok","data","json","docs","_error","handlePresetChange","preset","columns","undefined","groupBy","buttonLabel","title","label","labels","singular","handleClearPreset","e","stopPropagation","handleDeletePreset","method","handleResetPreset","saveCurrentChanges","body","JSON","headers","presetColumns","presetWhere","presetGroupBy","queryColumns","parse","columnsMatch","whereMatch","groupByMatch","isModified","hasModifiedPreset","_jsxs","_jsx","className","horizontalAlign","portalClassName","render","close","RadioGroup","map","isActive","RadioGroupItem","active","onClick","Divider","MenuItem","size","Button","icon","update","isShared","delete","length","create","plural","renderButton","onKeyDown","Boolean","onClear","popupActive","showBadge","verticalAlign","initialData","onSave","doc","redirectAfterCreate","onDelete","onDuplicate","allowCreate","disableQueryPresets","onSelect","elements","1","children","i18nKey","variables","confirmLabel","heading","modalSlug","onConfirm"],"sources":["../../../../src/elements/QueryPresets/QueryPresetBar/index.tsx"],"sourcesContent":["'use client'\nimport type { QueryPreset, SanitizedCollectionPermission } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n formatAdminURL,\n transformColumnsToPreferences,\n transformColumnsToSearchParams,\n} from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { CheckIcon } from '../../../icons/Check/index.js'\nimport { EditIcon } from '../../../icons/Edit/index.js'\nimport { GearIcon } from '../../../icons/Gear/index.js'\nimport { PlusIcon } from '../../../icons/Plus/index.js'\nimport { RefreshIcon } from '../../../icons/Refresh/index.js'\nimport { TrashIcon } from '../../../icons/Trash/index.js'\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useListQuery } from '../../../providers/ListQuery/context.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { ConfirmationModal } from '../../ConfirmationModal/index.js'\nimport { useDocumentDrawer } from '../../DocumentDrawer/index.js'\nimport { FilterTrigger } from '../../FilterTrigger/index.js'\nimport { useListDrawer } from '../../ListDrawer/index.js'\nimport { useModal } from '../../Modal/index.js'\nimport { Popup, PopupList } from '../../Popup/index.js'\nimport { Translation } from '../../Translation/index.js'\nimport './index.css'\n\nconst deletePresetModalSlug = 'delete-preset-confirmation'\n\nconst queryPresetsSlug = 'payload-query-presets'\n\nconst baseClass = 'query-preset-bar'\n\nexport const QueryPresetBar: React.FC<{\n activePreset: QueryPreset\n collectionSlug?: string\n queryPresetPermissions: SanitizedCollectionPermission\n}> = ({ activePreset, collectionSlug, queryPresetPermissions }) => {\n const { modified, query, refineListData, setModified: setQueryModified } = useListQuery()\n const { openModal } = useModal()\n const [presets, setPresets] = useState<QueryPreset[]>([])\n\n const { i18n, t } = useTranslation()\n\n const {\n config: {\n routes: { api: apiRoute },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const presetConfig = getEntityConfig({ collectionSlug: queryPresetsSlug })\n\n const [PresetDocumentDrawer, , { openDrawer: openPresetDrawer }] = useDocumentDrawer({\n id: activePreset?.id,\n collectionSlug: queryPresetsSlug,\n })\n\n const [\n CreateNewPresetDrawer,\n ,\n { closeDrawer: closeCreateNewDrawer, openDrawer: openCreateNewDrawer },\n ] = useDocumentDrawer({\n collectionSlug: queryPresetsSlug,\n })\n\n const filterOptions = useMemo(\n () => ({\n 'payload-query-presets': {\n isTemp: {\n not_equals: true,\n },\n relatedCollection: {\n equals: collectionSlug,\n },\n },\n }),\n [collectionSlug],\n )\n\n const [ListDrawer, , { openDrawer: openListDrawer }] = useListDrawer({\n collectionSlugs: [queryPresetsSlug],\n filterOptions,\n selectedCollection: queryPresetsSlug,\n })\n\n // Fetch presets for the popup\n const fetchPresets = useCallback(async () => {\n try {\n const where = {\n and: [{ isTemp: { not_equals: true } }, { relatedCollection: { equals: collectionSlug } }],\n }\n const queryString = qs.stringify({ limit: 50, where }, { addQueryPrefix: true })\n const url = formatAdminURL({\n apiRoute,\n path: `/${queryPresetsSlug}${queryString}`,\n serverURL,\n })\n\n const response = await fetch(url, { credentials: 'include' })\n\n if (response.ok) {\n const data = await response.json()\n setPresets(data.docs || [])\n }\n } catch (_error) {\n // Silently fail - presets will remain empty\n }\n }, [apiRoute, collectionSlug, serverURL])\n\n useEffect(() => {\n void fetchPresets()\n }, [fetchPresets])\n\n const handlePresetChange = useCallback(\n async (preset: QueryPreset) => {\n await refineListData(\n {\n columns: preset.columns ? transformColumnsToSearchParams(preset.columns) : undefined,\n groupBy: preset.groupBy || '',\n preset: preset.id,\n where: preset.where,\n },\n false,\n )\n },\n [refineListData],\n )\n\n const buttonLabel =\n activePreset?.title ||\n t('general:selectLabel', { label: getTranslation(presetConfig?.labels?.singular, i18n) })\n\n const handleClearPreset = useCallback(\n async (e: React.MouseEvent) => {\n e.stopPropagation()\n await refineListData(\n {\n columns: undefined,\n groupBy: '',\n preset: '',\n where: undefined,\n },\n false,\n )\n },\n [refineListData],\n )\n\n const handleDeletePreset = useCallback(async () => {\n if (!activePreset?.id) {\n return\n }\n\n try {\n const url = formatAdminURL({\n apiRoute,\n path: `/${queryPresetsSlug}/${activePreset.id}`,\n serverURL,\n })\n\n const response = await fetch(url, {\n credentials: 'include',\n method: 'DELETE',\n })\n\n if (response.ok) {\n // Clear the active preset and refresh the list\n await refineListData(\n {\n columns: undefined,\n groupBy: '',\n preset: '',\n where: undefined,\n },\n false,\n )\n void fetchPresets()\n }\n } catch (_error) {\n // Silently fail\n }\n }, [activePreset?.id, apiRoute, fetchPresets, refineListData, serverURL])\n\n const handleResetPreset = useCallback(async () => {\n if (!activePreset) {\n return\n }\n // Use the same pattern as handlePresetChange for consistency\n await refineListData(\n {\n columns: activePreset.columns ? transformColumnsToSearchParams(activePreset.columns) : [], // explicitly empty to clear user preferences fallback\n groupBy: activePreset.groupBy || '',\n preset: activePreset.id,\n where: activePreset.where,\n },\n false, // not modified - we're resetting to preset's original state\n )\n }, [activePreset, refineListData])\n\n const saveCurrentChanges = useCallback(async () => {\n if (!activePreset?.id) {\n return\n }\n try {\n const url = formatAdminURL({\n apiRoute,\n path: `/${queryPresetsSlug}/${activePreset.id}`,\n serverURL,\n })\n\n const response = await fetch(url, {\n body: JSON.stringify({\n columns: transformColumnsToPreferences(query.columns),\n groupBy: query.groupBy,\n where: query.where,\n }),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'PATCH',\n })\n\n if (response.ok) {\n setQueryModified(false)\n void fetchPresets()\n }\n } catch (_error) {\n // Silently fail\n }\n }, [\n activePreset?.id,\n apiRoute,\n fetchPresets,\n query.columns,\n query.groupBy,\n query.where,\n serverURL,\n setQueryModified,\n ])\n\n // Detect if current query differs from preset on initial load\n useEffect(() => {\n if (!activePreset) {\n return\n }\n\n const presetColumns = activePreset.columns\n ? transformColumnsToSearchParams(activePreset.columns)\n : []\n const presetWhere = activePreset.where\n const presetGroupBy = activePreset.groupBy || ''\n\n // Normalize query.columns - it may be a JSON string from URL or an array\n let queryColumns = query.columns || []\n if (typeof queryColumns === 'string') {\n try {\n queryColumns = JSON.parse(queryColumns)\n } catch {\n queryColumns = []\n }\n }\n\n // Compare current query with preset values\n const columnsMatch = JSON.stringify(queryColumns) === JSON.stringify(presetColumns)\n const whereMatch = JSON.stringify(query.where) === JSON.stringify(presetWhere)\n const groupByMatch = (query.groupBy || '') === presetGroupBy\n\n const isModified = !columnsMatch || !whereMatch || !groupByMatch\n setQueryModified(isModified)\n }, [activePreset, query.columns, query.where, query.groupBy, setQueryModified])\n\n const hasModifiedPreset = activePreset && modified\n\n return (\n <Fragment>\n <div className={baseClass}>\n <Popup\n className={`${baseClass}__popup`}\n horizontalAlign=\"left\"\n portalClassName={`${baseClass}__popup-content`}\n render={({ close }) => (\n <Fragment>\n <PopupList.RadioGroup>\n {presets.map((preset) => {\n const isActive = activePreset?.id === preset.id\n return (\n <PopupList.RadioGroupItem\n active={isActive}\n key={preset.id}\n onClick={async () => {\n close()\n await handlePresetChange(preset)\n }}\n >\n {preset.title}\n </PopupList.RadioGroupItem>\n )\n })}\n </PopupList.RadioGroup>\n {activePreset && (\n <Fragment>\n <PopupList.Divider />\n <PopupList.MenuItem size=\"small\">\n {hasModifiedPreset && (\n <PopupList.Button\n icon={<RefreshIcon size={16} />}\n id=\"reset-preset\"\n onClick={async () => {\n close()\n await handleResetPreset()\n }}\n >\n {t('general:reset')}\n </PopupList.Button>\n )}\n {hasModifiedPreset && queryPresetPermissions?.update && (\n <PopupList.Button\n icon={<CheckIcon size={16} />}\n id=\"save-preset\"\n onClick={async () => {\n close()\n await saveCurrentChanges()\n }}\n >\n {activePreset?.isShared\n ? t('general:updateForEveryone')\n : t('fields:saveChanges')}\n </PopupList.Button>\n )}\n {queryPresetPermissions?.update && (\n <PopupList.Button\n icon={<EditIcon size={16} />}\n id=\"edit-preset\"\n onClick={() => {\n close()\n openPresetDrawer()\n }}\n >\n {t('general:editLabel', {\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n })}\n </PopupList.Button>\n )}\n {queryPresetPermissions?.delete && (\n <PopupList.Button\n className={`${baseClass}__delete`}\n icon={<TrashIcon size={16} />}\n id=\"delete-preset\"\n onClick={() => {\n close()\n openModal(deletePresetModalSlug)\n }}\n >\n {t('general:deleteLabel', {\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n })}\n </PopupList.Button>\n )}\n </PopupList.MenuItem>\n </Fragment>\n )}\n {(presets.length > 0 || activePreset) && <PopupList.Divider />}\n <PopupList.MenuItem size=\"small\">\n {queryPresetPermissions?.create && (\n <PopupList.Button\n icon={<PlusIcon size={16} />}\n id=\"create-new-preset\"\n onClick={() => {\n close()\n openCreateNewDrawer()\n }}\n >\n {t('general:createNewLabel', {\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n })}\n </PopupList.Button>\n )}\n <PopupList.Button\n icon={<GearIcon size={16} />}\n id=\"manage-presets\"\n onClick={() => {\n close()\n openListDrawer()\n }}\n >\n {t('general:manageLabel', {\n label: getTranslation(presetConfig?.labels?.plural, i18n),\n })}\n </PopupList.Button>\n </PopupList.MenuItem>\n </Fragment>\n )}\n renderButton={({ active, onClick, onKeyDown }) => (\n <FilterTrigger\n className={`${baseClass}__trigger`}\n id=\"select-preset\"\n isActive={Boolean(activePreset)}\n onClear={handleClearPreset}\n onClick={onClick}\n onKeyDown={onKeyDown}\n popupActive={active}\n showBadge={hasModifiedPreset}\n >\n {buttonLabel}\n </FilterTrigger>\n )}\n size=\"large\"\n verticalAlign=\"bottom\"\n />\n </div>\n <CreateNewPresetDrawer\n initialData={{\n columns: transformColumnsToPreferences(query.columns),\n groupBy: query.groupBy,\n relatedCollection: collectionSlug,\n where: query.where,\n }}\n onSave={async ({ doc }) => {\n closeCreateNewDrawer()\n await handlePresetChange(doc as QueryPreset)\n void fetchPresets()\n }}\n redirectAfterCreate={false}\n />\n <PresetDocumentDrawer\n onDelete={() => {\n void fetchPresets()\n }}\n onDuplicate={async ({ doc }) => {\n await handlePresetChange(doc as QueryPreset)\n void fetchPresets()\n }}\n onSave={async ({ doc }) => {\n await handlePresetChange(doc as QueryPreset)\n void fetchPresets()\n }}\n />\n <ListDrawer\n allowCreate={false}\n disableQueryPresets\n onSelect={async ({ doc }) => {\n await handlePresetChange(doc as QueryPreset)\n }}\n />\n <ConfirmationModal\n body={\n <Translation\n elements={{\n '1': ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"general:aboutToDelete\"\n t={t}\n variables={{\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n title: activePreset?.title,\n }}\n />\n }\n confirmLabel={t('general:delete')}\n heading={t('general:confirmDeletion')}\n modalSlug={deletePresetModalSlug}\n onConfirm={handleDeletePreset}\n />\n </Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,SACEC,cAAc,EACdC,6BAA6B,EAC7BC,8BAA8B,QACzB;AACP,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAE3E,SAASC,SAAS,QAAQ;AAC1B,SAASC,QAAQ,QAAQ;AACzB,SAASC,QAAQ,QAAQ;AACzB,SAASC,QAAQ,QAAQ;AACzB,SAASC,WAAW,QAAQ;AAC5B,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,YAAY,QAAQ;AAC7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,QAAQ;AAC9B,SAASC,QAAQ,QAAQ;AACzB,SAASC,KAAK,EAAEC,SAAS,QAAQ;AACjC,SAASC,WAAW,QAAQ;AAC5B,OAAO;AAEP,MAAMC,qBAAA,GAAwB;AAE9B,MAAMC,gBAAA,GAAmB;AAEzB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,cAAA,GAIRA,CAAC;EAAEC,YAAY;EAAEC,cAAc;EAAEC;AAAsB,CAAE;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,cAAc;IAAEC,WAAA,EAAaC;EAAgB,CAAE,GAAGrB,YAAA;EAC3E,MAAM;IAAEsB;EAAS,CAAE,GAAGhB,QAAA;EACtB,MAAM,CAACiB,OAAA,EAASC,UAAA,CAAW,GAAGhC,QAAA,CAAwB,EAAE;EAExD,MAAM;IAAEiC,IAAI;IAAEC;EA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AEFhC,IAAA,CAACjG,iBAAA;MACCmF,IAAA,eACEc,IAAA,CAAC1F,WAAA;QACCiI,QAAA,EAAU;UACR,KAAKC,CAAC;YAAEC;UAAQ,CAAE,kBAAKzC,IAAA,CAAC;sBAAQyC;;QAClC;QACAC,OAAA,EAAQ;QACRnH,CAAA,EAAGA,CAAA;QACHoH,SAAA,EAAW;UACTnE,KAAA,EAAO7F,cAAA,CAAemD,YAAA,EAAc2C,MAAA,EAAQC,QAAA,EAAUpD,IAAA;UACtDiD,KAAA,EAAO5D,YAAA,EAAc4D;QACvB;;MAGJqE,YAAA,EAAcrH,CAAA,CAAE;MAChBsH,OAAA,EAAStH,CAAA,CAAE;MACXuH,SAAA,EAAWvI,qBAAA;MACXwI,SAAA,EAAWjE;;;AAInB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","formatAdminURL","transformColumnsToPreferences","transformColumnsToSearchParams","qs","React","Fragment","useCallback","useEffect","useMemo","useState","CheckIcon","EditIcon","GearIcon","PlusIcon","RefreshIcon","TrashIcon","useConfig","useListQuery","useTranslation","ConfirmationModal","useDocumentDrawer","FilterTrigger","useListDrawer","useModal","Popup","PopupList","Translation","deletePresetModalSlug","queryPresetsSlug","baseClass","QueryPresetBar","activePreset","collectionSlug","queryPresetPermissions","modified","query","refineListData","setModified","setQueryModified","openModal","presets","setPresets","i18n","t","config","routes","api","apiRoute","serverURL","getEntityConfig","presetConfig","PresetDocumentDrawer","openDrawer","openPresetDrawer","id","CreateNewPresetDrawer","closeDrawer","closeCreateNewDrawer","openCreateNewDrawer","filterOptions","isTemp","not_equals","relatedCollection","equals","ListDrawer","openListDrawer","collectionSlugs","selectedCollection","fetchPresets","where","and","queryString","stringify","limit","addQueryPrefix","url","path","response","fetch","credentials","ok","data","json","docs","_error","handlePresetChange","preset","columns","undefined","groupBy","buttonLabel","title","label","labels","singular","handleClearPreset","e","stopPropagation","handleDeletePreset","method","handleResetPreset","saveCurrentChanges","body","JSON","headers","presetColumns","presetWhere","presetGroupBy","queryColumns","parse","columnsMatch","whereMatch","groupByMatch","isModified","hasModifiedPreset","_jsxs","_jsx","className","horizontalAlign","portalClassName","render","close","RadioGroup","map","isActive","RadioGroupItem","active","onClick","Divider","MenuItem","size","Button","icon","update","isShared","delete","length","create","plural","renderButton","onKeyDown","Boolean","onClear","popupActive","showBadge","verticalAlign","initialData","onSave","doc","redirectAfterCreate","onDelete","onDuplicate","allowCreate","disableQueryPresets","onSelect","elements","1","children","i18nKey","variables","confirmLabel","heading","modalSlug","onConfirm"],"sources":["../../../../src/elements/QueryPresets/QueryPresetBar/index.tsx"],"sourcesContent":["'use client'\nimport type { QueryPreset, SanitizedCollectionPermission } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n formatAdminURL,\n transformColumnsToPreferences,\n transformColumnsToSearchParams,\n} from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { CheckIcon } from '../../../icons/Check/index.js'\nimport { EditIcon } from '../../../icons/Edit/index.js'\nimport { GearIcon } from '../../../icons/Gear/index.js'\nimport { PlusIcon } from '../../../icons/Plus/index.js'\nimport { RefreshIcon } from '../../../icons/Refresh/index.js'\nimport { TrashIcon } from '../../../icons/Trash/index.js'\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useListQuery } from '../../../providers/ListQuery/context.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { ConfirmationModal } from '../../ConfirmationModal/index.js'\nimport { useDocumentDrawer } from '../../DocumentDrawer/index.js'\nimport { FilterTrigger } from '../../FilterTrigger/index.js'\nimport { useListDrawer } from '../../ListDrawer/index.js'\nimport { useModal } from '../../Modal/index.js'\nimport { Popup, PopupList } from '../../Popup/index.js'\nimport { Translation } from '../../Translation/index.js'\nimport './index.css'\n\nconst deletePresetModalSlug = 'delete-preset-confirmation'\n\nconst queryPresetsSlug = 'payload-query-presets'\n\nconst baseClass = 'query-preset-bar'\n\nexport const QueryPresetBar: React.FC<{\n activePreset: QueryPreset\n collectionSlug?: string\n queryPresetPermissions: SanitizedCollectionPermission\n}> = ({ activePreset, collectionSlug, queryPresetPermissions }) => {\n const { modified, query, refineListData, setModified: setQueryModified } = useListQuery()\n const { openModal } = useModal()\n const [presets, setPresets] = useState<QueryPreset[]>([])\n\n const { i18n, t } = useTranslation()\n\n const {\n config: {\n routes: { api: apiRoute },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const presetConfig = getEntityConfig({ collectionSlug: queryPresetsSlug })\n\n const [PresetDocumentDrawer, , { openDrawer: openPresetDrawer }] = useDocumentDrawer({\n id: activePreset?.id,\n collectionSlug: queryPresetsSlug,\n })\n\n const [\n CreateNewPresetDrawer,\n ,\n { closeDrawer: closeCreateNewDrawer, openDrawer: openCreateNewDrawer },\n ] = useDocumentDrawer({\n collectionSlug: queryPresetsSlug,\n })\n\n const filterOptions = useMemo(\n () => ({\n 'payload-query-presets': {\n isTemp: {\n not_equals: true,\n },\n relatedCollection: {\n equals: collectionSlug,\n },\n },\n }),\n [collectionSlug],\n )\n\n const [ListDrawer, , { openDrawer: openListDrawer }] = useListDrawer({\n collectionSlugs: [queryPresetsSlug],\n filterOptions,\n selectedCollection: queryPresetsSlug,\n })\n\n // Fetch presets for the popup\n const fetchPresets = useCallback(async () => {\n try {\n const where = {\n and: [{ isTemp: { not_equals: true } }, { relatedCollection: { equals: collectionSlug } }],\n }\n const queryString = qs.stringify({ limit: 50, where }, { addQueryPrefix: true })\n const url = formatAdminURL({\n apiRoute,\n path: `/${queryPresetsSlug}${queryString}`,\n serverURL,\n })\n\n const response = await fetch(url, { credentials: 'include' })\n\n if (response.ok) {\n const data = await response.json()\n setPresets(data.docs || [])\n }\n } catch (_error) {\n // Silently fail - presets will remain empty\n }\n }, [apiRoute, collectionSlug, serverURL])\n\n useEffect(() => {\n void fetchPresets()\n }, [fetchPresets])\n\n const handlePresetChange = useCallback(\n async (preset: QueryPreset) => {\n await refineListData(\n {\n columns: preset.columns ? transformColumnsToSearchParams(preset.columns) : undefined,\n groupBy: preset.groupBy || '',\n preset: preset.id,\n where: preset.where,\n },\n false,\n )\n },\n [refineListData],\n )\n\n const buttonLabel =\n activePreset?.title ||\n t('general:selectLabel', { label: getTranslation(presetConfig?.labels?.singular, i18n) })\n\n const handleClearPreset = useCallback(\n async (e: React.MouseEvent) => {\n e.stopPropagation()\n await refineListData(\n {\n columns: undefined,\n groupBy: '',\n preset: '',\n where: undefined,\n },\n false,\n )\n },\n [refineListData],\n )\n\n const handleDeletePreset = useCallback(async () => {\n if (!activePreset?.id) {\n return\n }\n\n try {\n const url = formatAdminURL({\n apiRoute,\n path: `/${queryPresetsSlug}/${activePreset.id}`,\n serverURL,\n })\n\n const response = await fetch(url, {\n credentials: 'include',\n method: 'DELETE',\n })\n\n if (response.ok) {\n // Clear the active preset and refresh the list\n await refineListData(\n {\n columns: undefined,\n groupBy: '',\n preset: '',\n where: undefined,\n },\n false,\n )\n void fetchPresets()\n }\n } catch (_error) {\n // Silently fail\n }\n }, [activePreset?.id, apiRoute, fetchPresets, refineListData, serverURL])\n\n const handleResetPreset = useCallback(async () => {\n if (!activePreset) {\n return\n }\n // Use the same pattern as handlePresetChange for consistency\n await refineListData(\n {\n columns: activePreset.columns ? transformColumnsToSearchParams(activePreset.columns) : [], // explicitly empty to clear user preferences fallback\n groupBy: activePreset.groupBy || '',\n preset: activePreset.id,\n where: activePreset.where,\n },\n false, // not modified - we're resetting to preset's original state\n )\n }, [activePreset, refineListData])\n\n const saveCurrentChanges = useCallback(async () => {\n if (!activePreset?.id) {\n return\n }\n try {\n const url = formatAdminURL({\n apiRoute,\n path: `/${queryPresetsSlug}/${activePreset.id}`,\n serverURL,\n })\n\n const response = await fetch(url, {\n body: JSON.stringify({\n columns: transformColumnsToPreferences(query.columns),\n groupBy: query.groupBy,\n where: query.where,\n }),\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'PATCH',\n })\n\n if (response.ok) {\n setQueryModified(false)\n void fetchPresets()\n }\n } catch (_error) {\n // Silently fail\n }\n }, [\n activePreset?.id,\n apiRoute,\n fetchPresets,\n query.columns,\n query.groupBy,\n query.where,\n serverURL,\n setQueryModified,\n ])\n\n // Detect if current query differs from preset on initial load\n useEffect(() => {\n if (!activePreset) {\n return\n }\n\n const presetColumns = activePreset.columns\n ? transformColumnsToSearchParams(activePreset.columns)\n : []\n const presetWhere = activePreset.where\n const presetGroupBy = activePreset.groupBy || ''\n\n // Normalize query.columns - it may be a JSON string from URL or an array\n let queryColumns = query.columns || []\n if (typeof queryColumns === 'string') {\n try {\n queryColumns = JSON.parse(queryColumns)\n } catch {\n queryColumns = []\n }\n }\n\n // Compare current query with preset values\n const columnsMatch = JSON.stringify(queryColumns) === JSON.stringify(presetColumns)\n const whereMatch = JSON.stringify(query.where) === JSON.stringify(presetWhere)\n const groupByMatch = (query.groupBy || '') === presetGroupBy\n\n const isModified = !columnsMatch || !whereMatch || !groupByMatch\n setQueryModified(isModified)\n }, [activePreset, query.columns, query.where, query.groupBy, setQueryModified])\n\n const hasModifiedPreset = activePreset && modified\n\n return (\n <Fragment>\n <div className={baseClass}>\n <Popup\n className={`${baseClass}__popup`}\n horizontalAlign=\"left\"\n portalClassName={`${baseClass}__popup-content`}\n render={({ close }) => (\n <Fragment>\n <PopupList.RadioGroup>\n {presets.map((preset) => {\n const isActive = activePreset?.id === preset.id\n return (\n <PopupList.RadioGroupItem\n active={isActive}\n key={preset.id}\n onClick={async () => {\n close()\n await handlePresetChange(preset)\n }}\n >\n {preset.title}\n </PopupList.RadioGroupItem>\n )\n })}\n </PopupList.RadioGroup>\n {activePreset && (\n <Fragment>\n <PopupList.Divider />\n <PopupList.MenuItem size=\"small\">\n {hasModifiedPreset && (\n <PopupList.Button\n icon={<RefreshIcon size={16} />}\n id=\"reset-preset\"\n onClick={async () => {\n close()\n await handleResetPreset()\n }}\n >\n {t('general:reset')}\n </PopupList.Button>\n )}\n {hasModifiedPreset && queryPresetPermissions?.update && (\n <PopupList.Button\n icon={<CheckIcon size={16} />}\n id=\"save-preset\"\n onClick={async () => {\n close()\n await saveCurrentChanges()\n }}\n >\n {activePreset?.isShared\n ? t('general:updateForEveryone')\n : t('fields:saveChanges')}\n </PopupList.Button>\n )}\n {queryPresetPermissions?.update && (\n <PopupList.Button\n icon={<EditIcon />}\n id=\"edit-preset\"\n onClick={() => {\n close()\n openPresetDrawer()\n }}\n >\n {t('general:editLabel', {\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n })}\n </PopupList.Button>\n )}\n {queryPresetPermissions?.delete && (\n <PopupList.Button\n className={`${baseClass}__delete`}\n icon={<TrashIcon size={16} />}\n id=\"delete-preset\"\n onClick={() => {\n close()\n openModal(deletePresetModalSlug)\n }}\n >\n {t('general:deleteLabel', {\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n })}\n </PopupList.Button>\n )}\n </PopupList.MenuItem>\n </Fragment>\n )}\n {(presets.length > 0 || activePreset) && <PopupList.Divider />}\n <PopupList.MenuItem size=\"small\">\n {queryPresetPermissions?.create && (\n <PopupList.Button\n icon={<PlusIcon size={16} />}\n id=\"create-new-preset\"\n onClick={() => {\n close()\n openCreateNewDrawer()\n }}\n >\n {t('general:createNewLabel', {\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n })}\n </PopupList.Button>\n )}\n <PopupList.Button\n icon={<GearIcon size={16} />}\n id=\"manage-presets\"\n onClick={() => {\n close()\n openListDrawer()\n }}\n >\n {t('general:manageLabel', {\n label: getTranslation(presetConfig?.labels?.plural, i18n),\n })}\n </PopupList.Button>\n </PopupList.MenuItem>\n </Fragment>\n )}\n renderButton={({ active, onClick, onKeyDown }) => (\n <FilterTrigger\n className={`${baseClass}__trigger`}\n id=\"select-preset\"\n isActive={Boolean(activePreset)}\n onClear={handleClearPreset}\n onClick={onClick}\n onKeyDown={onKeyDown}\n popupActive={active}\n showBadge={hasModifiedPreset}\n >\n {buttonLabel}\n </FilterTrigger>\n )}\n size=\"large\"\n verticalAlign=\"bottom\"\n />\n </div>\n <CreateNewPresetDrawer\n initialData={{\n columns: transformColumnsToPreferences(query.columns),\n groupBy: query.groupBy,\n relatedCollection: collectionSlug,\n where: query.where,\n }}\n onSave={async ({ doc }) => {\n closeCreateNewDrawer()\n await handlePresetChange(doc as QueryPreset)\n void fetchPresets()\n }}\n redirectAfterCreate={false}\n />\n <PresetDocumentDrawer\n onDelete={() => {\n void fetchPresets()\n }}\n onDuplicate={async ({ doc }) => {\n await handlePresetChange(doc as QueryPreset)\n void fetchPresets()\n }}\n onSave={async ({ doc }) => {\n await handlePresetChange(doc as QueryPreset)\n void fetchPresets()\n }}\n />\n <ListDrawer\n allowCreate={false}\n disableQueryPresets\n onSelect={async ({ doc }) => {\n await handlePresetChange(doc as QueryPreset)\n }}\n />\n <ConfirmationModal\n body={\n <Translation\n elements={{\n '1': ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"general:aboutToDelete\"\n t={t}\n variables={{\n label: getTranslation(presetConfig?.labels?.singular, i18n),\n title: activePreset?.title,\n }}\n />\n }\n confirmLabel={t('general:delete')}\n heading={t('general:confirmDeletion')}\n modalSlug={deletePresetModalSlug}\n onConfirm={handleDeletePreset}\n />\n </Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,SACEC,cAAc,EACdC,6BAA6B,EAC7BC,8BAA8B,QACzB;AACP,YAAYC,EAAA,MAAQ;AACpB,OAAOC,KAAA,IAASC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AAE3E,SAASC,SAAS,QAAQ;AAC1B,SAASC,QAAQ,QAAQ;AACzB,SAASC,QAAQ,QAAQ;AACzB,SAASC,QAAQ,QAAQ;AACzB,SAASC,WAAW,QAAQ;AAC5B,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,YAAY,QAAQ;AAC7B,SAASC,cAAc,QA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AG,CAAE;QACpB3F,oBAAA;QACA,MAAM4B,kBAAA,CAAmB+D,GAAA;QACzB,KAAKhF,YAAA;MACP;MACAiF,mBAAA,EAAqB;qBAEvBjC,IAAA,CAACjE,oBAAA;MACCmG,QAAA,EAAUA,CAAA;QACR,KAAKlF,YAAA;MACP;MACAmF,WAAA,EAAa,MAAAA,CAAO;QAAEH,GAAG,EAAHA;MAAG,CAAE;QACzB,MAAM/D,kBAAA,CAAmB+D,KAAA;QACzB,KAAKhF,YAAA;MACP;MACA+E,MAAA,EAAQ,MAAAA,CAAO;QAAEC,GAAG,EAAHA;MAAG,CAAE;QACpB,MAAM/D,kBAAA,CAAmB+D,KAAA;QACzB,KAAKhF,YAAA;MACP;qBAEFgD,IAAA,CAACpD,UAAA;MACCwF,WAAA,EAAa;MACbC,mBAAmB;MACnBC,QAAA,EAAU,MAAAA,CAAO;QAAEN,GAAG,EAAHA;MAAG,CAAE;QACtB,MAAM/D,kBAAA,CAAmB+D,KAAA;MAC3B;qBAEFhC,IAAA,CAACjG,iBAAA;MACCmF,IAAA,eACEc,IAAA,CAAC1F,WAAA;QACCiI,QAAA,EAAU;UACR,KAAKC,CAAC;YAAEC;UAAQ,CAAE,kBAAKzC,IAAA,CAAC;sBAAQyC;;QAClC;QACAC,OAAA,EAAQ;QACRnH,CAAA,EAAGA,CAAA;QACHoH,SAAA,EAAW;UACTnE,KAAA,EAAO7F,cAAA,CAAemD,YAAA,EAAc2C,MAAA,EAAQC,QAAA,EAAUpD,IAAA;UACtDiD,KAAA,EAAO5D,YAAA,EAAc4D;QACvB;;MAGJqE,YAAA,EAAcrH,CAAA,CAAE;MAChBsH,OAAA,EAAStH,CAAA,CAAE;MACXuH,SAAA,EAAWvI,qBAAA;MACXwI,SAAA,EAAWjE;;;AAInB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/Edit/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/Edit/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,aAAa,CAAA;AAQpB,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAWA,CAAA"}
|
package/dist/icons/Edit/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import './index.css';
|
|
4
4
|
const paths = {
|
|
5
|
-
16
|
|
6
|
-
|
|
5
|
+
// icon-16-edit-object from Figma
|
|
6
|
+
16: 'M9.86914 2.72438C10.2619 2.40402 10.8409 2.42662 11.207 2.79273L13.207 4.79273C13.5974 5.18327 13.5975 5.81631 13.207 6.2068L6.70703 12.7068C6.51951 12.8943 6.26516 12.9998 6 12.9998H4C3.44779 12.9998 3.00013 12.5519 3 11.9998V9.99977C3 9.7346 3.10551 9.48026 3.29297 9.29273L9.79297 2.79273L9.86914 2.72438ZM4 9.99977V11.9998H6L10.6465 7.35328L8.64648 5.35328L4 9.99977ZM9.35352 4.64625L11.3535 6.64625L12.5 5.49977L10.5 3.49977L9.35352 4.64625Z'
|
|
7
7
|
};
|
|
8
|
+
const size = 16;
|
|
8
9
|
export const EditIcon = ({
|
|
9
|
-
className
|
|
10
|
-
size = 16
|
|
10
|
+
className
|
|
11
11
|
}) => /*#__PURE__*/_jsx("svg", {
|
|
12
12
|
className: ['icon', 'icon--edit', className].filter(Boolean).join(' '),
|
|
13
13
|
fill: "none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","paths","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","paths","size","EditIcon","className","_jsx","filter","Boolean","join","fill","height","viewBox","width","xmlns","clipRule","d","fillRule"],"sources":["../../../src/icons/Edit/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.css'\n\nconst paths = {\n // icon-16-edit-object from Figma\n 16: 'M9.86914 2.72438C10.2619 2.40402 10.8409 2.42662 11.207 2.79273L13.207 4.79273C13.5974 5.18327 13.5975 5.81631 13.207 6.2068L6.70703 12.7068C6.51951 12.8943 6.26516 12.9998 6 12.9998H4C3.44779 12.9998 3.00013 12.5519 3 11.9998V9.99977C3 9.7346 3.10551 9.48026 3.29297 9.29273L9.79297 2.79273L9.86914 2.72438ZM4 9.99977V11.9998H6L10.6465 7.35328L8.64648 5.35328L4 9.99977ZM9.35352 4.64625L11.3535 6.64625L12.5 5.49977L10.5 3.49977L9.35352 4.64625Z',\n}\n\nconst size = 16\nexport const EditIcon: React.FC<{\n readonly className?: string\n}> = ({ className }) => (\n <svg\n className={['icon', 'icon--edit', className].filter(Boolean).join(' ')}\n fill=\"none\"\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path clipRule=\"evenodd\" d={paths[size]} fill=\"currentColor\" fillRule=\"evenodd\" />\n </svg>\n)\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,MAAMC,KAAA,GAAQ;EACZ;EACA,IAAI;AACN;AAEA,MAAMC,IAAA,GAAO;AACb,OAAO,MAAMC,QAAA,GAERA,CAAC;EAAEC;AAAS,CAAE,kBACjBC,IAAA,CAAC;EACCD,SAAA,EAAW,CAAC,QAAQ,cAAcA,SAAA,CAAU,CAACE,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;EAClEC,IAAA,EAAK;EACLC,MAAA,EAAQR,IAAA;EACRS,OAAA,EAAS,OAAOT,IAAA,IAAQA,IAAA,EAAM;EAC9BU,KAAA,EAAOV,IAAA;EACPW,KAAA,EAAM;YAEN,aAAAR,IAAA,CAAC;IAAKS,QAAA,EAAS;IAAUC,CAAA,EAAGd,KAAK,CAACC,IAAA,CAAK;IAAEO,IAAA,EAAK;IAAeO,QAAA,EAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/Actions/index.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/Actions/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAItE,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;KAC/B,CAAA;IACD,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAA;CACjE,CAAA;AAOD,eAAO,MAAM,UAAU,0BAA4B,CAAA;AAEnD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;KAC/B,CAAA;IACD,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B,CAuBA,CAAA"}
|