@activecollab/components 2.0.575 → 2.0.577
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/cjs/components/Popper/Popper.js +14 -0
- package/dist/cjs/components/Popper/Popper.js.map +1 -1
- package/dist/cjs/components/Popper/anchorMove.js +42 -0
- package/dist/cjs/components/Popper/anchorMove.js.map +1 -0
- package/dist/cjs/components/ViewSettings/Styles.js +8 -3
- package/dist/cjs/components/ViewSettings/Styles.js.map +1 -1
- package/dist/cjs/components/ViewSettings/ViewSettings.js +64 -3
- package/dist/cjs/components/ViewSettings/ViewSettings.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/ApplyToAllTab.js +199 -0
- package/dist/cjs/components/ViewSwitcher/ApplyToAllTab.js.map +1 -0
- package/dist/cjs/components/ViewSwitcher/Styles.js +73 -61
- package/dist/cjs/components/ViewSwitcher/Styles.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/{ViewSwitcherMenu.js → SubViewSwitcher.js} +70 -22
- package/dist/cjs/components/ViewSwitcher/SubViewSwitcher.js.map +1 -0
- package/dist/cjs/components/ViewSwitcher/ViewSwitcher.js +46 -184
- package/dist/cjs/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/index.js +4 -4
- package/dist/cjs/components/ViewSwitcher/index.js.map +1 -1
- package/dist/cjs/components/ViewSwitcher/useApplyToAllOffer.js +179 -0
- package/dist/cjs/components/ViewSwitcher/useApplyToAllOffer.js.map +1 -0
- package/dist/cjs/presentation/reports/allReports.js +6 -0
- package/dist/cjs/presentation/reports/allReports.js.map +1 -1
- package/dist/cjs/presentation/reports/controls.js +6 -3
- package/dist/cjs/presentation/reports/controls.js.map +1 -1
- package/dist/cjs/presentation/reports/expenses.js +946 -0
- package/dist/cjs/presentation/reports/expenses.js.map +1 -0
- package/dist/cjs/presentation/shared/ActivityFeed.js +1 -2
- package/dist/cjs/presentation/shared/ActivityFeed.js.map +1 -1
- package/dist/esm/components/Popper/Popper.d.ts.map +1 -1
- package/dist/esm/components/Popper/Popper.js +12 -0
- package/dist/esm/components/Popper/Popper.js.map +1 -1
- package/dist/esm/components/Popper/anchorMove.d.ts +4 -0
- package/dist/esm/components/Popper/anchorMove.d.ts.map +1 -0
- package/dist/esm/components/Popper/anchorMove.js +33 -0
- package/dist/esm/components/Popper/anchorMove.js.map +1 -0
- package/dist/esm/components/ViewSettings/Styles.d.ts +1 -0
- package/dist/esm/components/ViewSettings/Styles.d.ts.map +1 -1
- package/dist/esm/components/ViewSettings/Styles.js +7 -2
- package/dist/esm/components/ViewSettings/Styles.js.map +1 -1
- package/dist/esm/components/ViewSettings/ViewSettings.d.ts +12 -0
- package/dist/esm/components/ViewSettings/ViewSettings.d.ts.map +1 -1
- package/dist/esm/components/ViewSettings/ViewSettings.js +66 -5
- package/dist/esm/components/ViewSettings/ViewSettings.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/ApplyToAllTab.d.ts +24 -0
- package/dist/esm/components/ViewSwitcher/ApplyToAllTab.d.ts.map +1 -0
- package/dist/esm/components/ViewSwitcher/ApplyToAllTab.js +179 -0
- package/dist/esm/components/ViewSwitcher/ApplyToAllTab.js.map +1 -0
- package/dist/esm/components/ViewSwitcher/Styles.d.ts +15 -15
- package/dist/esm/components/ViewSwitcher/Styles.d.ts.map +1 -1
- package/dist/esm/components/ViewSwitcher/Styles.js +72 -60
- package/dist/esm/components/ViewSwitcher/Styles.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/SubViewSwitcher.d.ts +50 -0
- package/dist/esm/components/ViewSwitcher/SubViewSwitcher.d.ts.map +1 -0
- package/dist/esm/components/ViewSwitcher/SubViewSwitcher.js +149 -0
- package/dist/esm/components/ViewSwitcher/SubViewSwitcher.js.map +1 -0
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.d.ts +8 -8
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.d.ts.map +1 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.js +48 -163
- package/dist/esm/components/ViewSwitcher/ViewSwitcher.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/index.d.ts +1 -1
- package/dist/esm/components/ViewSwitcher/index.d.ts.map +1 -1
- package/dist/esm/components/ViewSwitcher/index.js +1 -1
- package/dist/esm/components/ViewSwitcher/index.js.map +1 -1
- package/dist/esm/components/ViewSwitcher/useApplyToAllOffer.d.ts +27 -0
- package/dist/esm/components/ViewSwitcher/useApplyToAllOffer.d.ts.map +1 -0
- package/dist/esm/components/ViewSwitcher/useApplyToAllOffer.js +159 -0
- package/dist/esm/components/ViewSwitcher/useApplyToAllOffer.js.map +1 -0
- package/dist/esm/presentation/reports/allReports.d.ts.map +1 -1
- package/dist/esm/presentation/reports/allReports.js +6 -0
- package/dist/esm/presentation/reports/allReports.js.map +1 -1
- package/dist/esm/presentation/reports/controls.d.ts +3 -1
- package/dist/esm/presentation/reports/controls.d.ts.map +1 -1
- package/dist/esm/presentation/reports/controls.js +6 -3
- package/dist/esm/presentation/reports/controls.js.map +1 -1
- package/dist/esm/presentation/reports/expenses.d.ts +62 -0
- package/dist/esm/presentation/reports/expenses.d.ts.map +1 -0
- package/dist/esm/presentation/reports/expenses.js +849 -0
- package/dist/esm/presentation/reports/expenses.js.map +1 -0
- package/dist/esm/presentation/shared/ActivityFeed.d.ts.map +1 -1
- package/dist/esm/presentation/shared/ActivityFeed.js +1 -2
- package/dist/esm/presentation/shared/ActivityFeed.js.map +1 -1
- package/dist/index.js +656 -280
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/ViewSwitcher/ViewSwitcherMenu.js.map +0 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.d.ts +0 -39
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.d.ts.map +0 -1
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.js +0 -101
- package/dist/esm/components/ViewSwitcher/ViewSwitcherMenu.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.js","names":["React","forwardRef","useCallback","useRef","useEffect","useState","createPopper","StyledPopper","useForkRef","Popper","_ref","ref","children","anchorEl","_ref$open","open","style","_ref$transition","transition","_ref$placement","placement","initialPlacement","_ref$strategy","strategy","afterWrite","_ref$followAnchor","followAnchor","extraModifiers","modifiers","rest","_objectWithoutPropertiesLoose","_excluded","_useState","exited","setExited","_useState2","setPlacement","ownRef","popperRef","handleInnerRef","handlePopperUpdate","data","handleOpen","current","destroy","name","enabled","phase","fn","referenceElement","currentElement","isHidden","computedStyle","getComputedStyle","display","visibility","parentElement","_ownRef$current","setAttribute","_ownRef$current2","removeAttribute","push","onFirstUpdate","handleClose","handleRef","node","handleEnter","handleExited","ResizeObserver","undefined","observer","_popperRef$current","update","observe","disconnect","childProps","transitionProps","in","onEnter","onExited","createElement","_extends","displayName"],"sources":["../../../../src/components/Popper/Popper.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useRef,\n useEffect,\n useState,\n CSSProperties,\n ReactNode,\n HTMLAttributes,\n} from \"react\";\n\nimport {\n createPopper,\n Instance,\n Modifier,\n Options as PopperOptions,\n PositioningStrategy,\n State,\n} from \"@popperjs/core\";\n\nimport { Placement } from \".\";\nimport { StyledPopper } from \"./Styles\";\nimport useForkRef from \"../../utils/useForkRef\";\ntype CustomModifier = Modifier<string, PopperOptions>;\nexport type PopperModifier = Partial<\n Modifier<string, { [key: string]: unknown }>\n>;\n\ninterface TransitionProps {\n in: boolean;\n onEnter: () => void;\n onExited: () => void;\n}\ninterface IChildProps {\n placement: Placement;\n transitionProps: Partial<TransitionProps>;\n}\n\ninterface PopperProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Anchor Element. */\n anchorEl?: Element | null;\n /** Open */\n open?: boolean;\n /** Inline style */\n style?: CSSProperties;\n /** Child with transition */\n transition?: boolean;\n /** Placement */\n placement?: Placement;\n /** Strategy */\n strategy?: PositioningStrategy;\n /** After Write callback */\n afterWrite?: (...args) => void;\n /** Follow the anchor when it changes size while the popper is open. Off by default. */\n followAnchor?: boolean;\n /** Extra Popper.js modifiers, merged with the built-in ones */\n modifiers?: PopperModifier[];\n\n /** Component children */\n children?: ReactNode | React.FC<Partial<IChildProps>>;\n}\n\nexport const Popper = forwardRef<HTMLDivElement, PopperProps>(\n (\n {\n children,\n anchorEl,\n open = false,\n style,\n transition = false,\n placement: initialPlacement = \"bottom\",\n strategy = \"absolute\",\n afterWrite,\n followAnchor = false,\n modifiers: extraModifiers,\n ...rest\n },\n ref\n ) => {\n const [exited, setExited] = useState(true);\n const [placement, setPlacement] = useState(initialPlacement);\n const ownRef = useRef<HTMLDivElement | null>(null);\n const popperRef = useRef<Instance>();\n\n const handleInnerRef = useForkRef(ownRef, ref);\n\n const handlePopperUpdate = (data: Partial<State>): void => {\n setPlacement(data.placement || \"bottom\");\n };\n\n const handleOpen = useCallback(() => {\n if (!ownRef.current || !anchorEl || !open) {\n return;\n }\n\n if (popperRef.current) {\n popperRef.current.destroy();\n }\n\n const modifiers: (CustomModifier | PopperModifier)[] = [\n ...(extraModifiers || []),\n {\n name: \"hide\",\n enabled: true,\n phase: \"main\",\n fn: () => {\n const referenceElement = anchorEl as HTMLElement;\n\n let currentElement: HTMLElement | null = referenceElement;\n let isHidden = false;\n while (currentElement) {\n const computedStyle = getComputedStyle(currentElement);\n if (\n computedStyle.display === \"none\" ||\n computedStyle.visibility === \"hidden\"\n ) {\n isHidden = true;\n break;\n }\n currentElement = currentElement.parentElement;\n }\n\n if (isHidden) {\n ownRef.current?.setAttribute(\"data-popper-reference-hidden\", \"\");\n } else {\n ownRef.current?.removeAttribute(\"data-popper-reference-hidden\");\n }\n },\n },\n ];\n\n if (typeof afterWrite === \"function\") {\n modifiers.push({\n phase: \"afterWrite\",\n enabled: true,\n name: \"popper-after-write\",\n fn: afterWrite,\n });\n }\n\n popperRef.current = createPopper(anchorEl, ownRef.current, {\n placement,\n onFirstUpdate: handlePopperUpdate,\n strategy,\n modifiers,\n });\n }, [afterWrite, anchorEl, extraModifiers, open, placement, strategy]);\n\n const handleClose = (): void => {\n if (!popperRef.current) {\n return;\n }\n\n popperRef.current.destroy();\n };\n\n const handleRef = useCallback(\n (node: HTMLDivElement) => {\n handleInnerRef(node);\n handleOpen();\n },\n [handleOpen, handleInnerRef]\n );\n\n const handleEnter = (): void => {\n setExited(false);\n };\n\n const handleExited = (): void => {\n setExited(true);\n handleClose();\n };\n\n useEffect(() => {\n return (): void => {\n handleClose();\n };\n }, []);\n\n useEffect(() => {\n if (!open && !transition) {\n handleClose();\n }\n }, [open, transition]);\n\n useEffect(() => {\n if (\n !followAnchor ||\n !open ||\n !anchorEl ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return undefined;\n }\n\n // eslint-disable-next-line compat/compat -- guarded above\n const observer = new ResizeObserver(() => {\n popperRef.current?.update();\n });\n\n observer.observe(anchorEl);\n\n return () => observer.disconnect();\n }, [anchorEl, followAnchor, open]);\n\n useEffect(() => {\n if (popperRef.current) {\n popperRef.current.update();\n }\n });\n\n if (!open && (!transition || exited)) {\n return null;\n }\n\n const childProps: Partial<IChildProps> = { placement };\n\n if (transition) {\n childProps.transitionProps = {\n in: open,\n onEnter: handleEnter,\n onExited: handleExited,\n };\n }\n\n return (\n <StyledPopper\n ref={handleRef}\n {...rest}\n style={{\n ...style,\n }}\n >\n {typeof children === \"function\" ? children(childProps) : children}\n </StyledPopper>\n );\n }\n);\n\nPopper.displayName = \"Popper\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,SAAS,EACTC,QAAQ,QAIH,OAAO;AAEd,SACEC,YAAY,QAMP,gBAAgB;AAGvB,SAASC,YAAY,QAAQ,UAAU;AACvC,OAAOC,UAAU,MAAM,wBAAwB;AAwC/C,OAAO,MAAMC,MAAM,gBAAGR,UAAU,CAC9B,CAA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D,cAAc,KAAK,WAAW,EACrC;MACA,OAAOC,SAAS;IAClB;;IAEA;IACA,MAAMC,QAAQ,GAAG,IAAIF,cAAc,CAAC,MAAM;MAAA,IAAAG,kBAAA;MACxC,CAAAA,kBAAA,GAAAjC,SAAS,CAACK,OAAO,aAAjB4B,kBAAA,CAAmBC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEFF,QAAQ,CAACG,OAAO,CAAC5D,QAAQ,CAAC;IAE1B,OAAO,MAAMyD,QAAQ,CAACI,UAAU,CAAC,CAAC;EACpC,CAAC,EAAE,CAAC7D,QAAQ,EAAEa,YAAY,EAAEX,IAAI,CAAC,CAAC;EAElCX,SAAS,CAAC,MAAM;IACd,IAAIkC,SAAS,CAACK,OAAO,EAAE;MACrBL,SAAS,CAACK,OAAO,CAAC6B,MAAM,CAAC,CAAC;IAC5B;EACF,CAAC,CAAC;EAEF,IAAI,CAACzD,IAAI,KAAK,CAACG,UAAU,IAAIe,MAAM,CAAC,EAAE;IACpC,OAAO,IAAI;EACb;EAEA,MAAM0C,UAAgC,GAAG;IAAEvD;EAAU,CAAC;EAEtD,IAAIF,UAAU,EAAE;IACdyD,UAAU,CAACC,eAAe,GAAG;MAC3BC,EAAE,EAAE9D,IAAI;MACR+D,OAAO,EAAEZ,WAAW;MACpBa,QAAQ,EAAEZ;IACZ,CAAC;EACH;EAEA,oBACEnE,KAAA,CAAAgF,aAAA,CAACzE,YAAY,EAAA0E,QAAA;IACXtE,GAAG,EAAEqD;EAAU,GACXnC,IAAI;IACRb,KAAK,EAAAiE,QAAA,KACAjE,KAAK;EACR,IAED,OAAOJ,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAAC+D,UAAU,CAAC,GAAG/D,QAC7C,CAAC;AAEnB,CACF,CAAC;AAEDH,MAAM,CAACyE,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Popper.js","names":["React","forwardRef","useCallback","useRef","useEffect","useState","createPopper","ANCHOR_MOVE_EVENT","StyledPopper","useForkRef","Popper","_ref","ref","children","anchorEl","_ref$open","open","style","_ref$transition","transition","_ref$placement","placement","initialPlacement","_ref$strategy","strategy","afterWrite","_ref$followAnchor","followAnchor","extraModifiers","modifiers","rest","_objectWithoutPropertiesLoose","_excluded","_useState","exited","setExited","_useState2","setPlacement","ownRef","popperRef","handleInnerRef","handlePopperUpdate","data","handleOpen","current","destroy","name","enabled","phase","fn","referenceElement","currentElement","isHidden","computedStyle","getComputedStyle","display","visibility","parentElement","_ownRef$current","setAttribute","_ownRef$current2","removeAttribute","push","onFirstUpdate","handleClose","handleRef","node","handleEnter","handleExited","ResizeObserver","undefined","observer","_popperRef$current","update","observe","disconnect","_popperRef$current2","window","addEventListener","removeEventListener","childProps","transitionProps","in","onEnter","onExited","createElement","_extends","displayName"],"sources":["../../../../src/components/Popper/Popper.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useRef,\n useEffect,\n useState,\n CSSProperties,\n ReactNode,\n HTMLAttributes,\n} from \"react\";\n\nimport {\n createPopper,\n Instance,\n Modifier,\n Options as PopperOptions,\n PositioningStrategy,\n State,\n} from \"@popperjs/core\";\n\nimport { Placement } from \".\";\nimport { ANCHOR_MOVE_EVENT } from \"./anchorMove\";\nimport { StyledPopper } from \"./Styles\";\nimport useForkRef from \"../../utils/useForkRef\";\ntype CustomModifier = Modifier<string, PopperOptions>;\nexport type PopperModifier = Partial<\n Modifier<string, { [key: string]: unknown }>\n>;\n\ninterface TransitionProps {\n in: boolean;\n onEnter: () => void;\n onExited: () => void;\n}\ninterface IChildProps {\n placement: Placement;\n transitionProps: Partial<TransitionProps>;\n}\n\ninterface PopperProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Anchor Element. */\n anchorEl?: Element | null;\n /** Open */\n open?: boolean;\n /** Inline style */\n style?: CSSProperties;\n /** Child with transition */\n transition?: boolean;\n /** Placement */\n placement?: Placement;\n /** Strategy */\n strategy?: PositioningStrategy;\n /** After Write callback */\n afterWrite?: (...args) => void;\n /** Follow the anchor when it changes size while the popper is open. Off by default. */\n followAnchor?: boolean;\n /** Extra Popper.js modifiers, merged with the built-in ones */\n modifiers?: PopperModifier[];\n\n /** Component children */\n children?: ReactNode | React.FC<Partial<IChildProps>>;\n}\n\nexport const Popper = forwardRef<HTMLDivElement, PopperProps>(\n (\n {\n children,\n anchorEl,\n open = false,\n style,\n transition = false,\n placement: initialPlacement = \"bottom\",\n strategy = \"absolute\",\n afterWrite,\n followAnchor = false,\n modifiers: extraModifiers,\n ...rest\n },\n ref\n ) => {\n const [exited, setExited] = useState(true);\n const [placement, setPlacement] = useState(initialPlacement);\n const ownRef = useRef<HTMLDivElement | null>(null);\n const popperRef = useRef<Instance>();\n\n const handleInnerRef = useForkRef(ownRef, ref);\n\n const handlePopperUpdate = (data: Partial<State>): void => {\n setPlacement(data.placement || \"bottom\");\n };\n\n const handleOpen = useCallback(() => {\n if (!ownRef.current || !anchorEl || !open) {\n return;\n }\n\n if (popperRef.current) {\n popperRef.current.destroy();\n }\n\n const modifiers: (CustomModifier | PopperModifier)[] = [\n ...(extraModifiers || []),\n {\n name: \"hide\",\n enabled: true,\n phase: \"main\",\n fn: () => {\n const referenceElement = anchorEl as HTMLElement;\n\n let currentElement: HTMLElement | null = referenceElement;\n let isHidden = false;\n while (currentElement) {\n const computedStyle = getComputedStyle(currentElement);\n if (\n computedStyle.display === \"none\" ||\n computedStyle.visibility === \"hidden\"\n ) {\n isHidden = true;\n break;\n }\n currentElement = currentElement.parentElement;\n }\n\n if (isHidden) {\n ownRef.current?.setAttribute(\"data-popper-reference-hidden\", \"\");\n } else {\n ownRef.current?.removeAttribute(\"data-popper-reference-hidden\");\n }\n },\n },\n ];\n\n if (typeof afterWrite === \"function\") {\n modifiers.push({\n phase: \"afterWrite\",\n enabled: true,\n name: \"popper-after-write\",\n fn: afterWrite,\n });\n }\n\n popperRef.current = createPopper(anchorEl, ownRef.current, {\n placement,\n onFirstUpdate: handlePopperUpdate,\n strategy,\n modifiers,\n });\n }, [afterWrite, anchorEl, extraModifiers, open, placement, strategy]);\n\n const handleClose = (): void => {\n if (!popperRef.current) {\n return;\n }\n\n popperRef.current.destroy();\n };\n\n const handleRef = useCallback(\n (node: HTMLDivElement) => {\n handleInnerRef(node);\n handleOpen();\n },\n [handleOpen, handleInnerRef]\n );\n\n const handleEnter = (): void => {\n setExited(false);\n };\n\n const handleExited = (): void => {\n setExited(true);\n handleClose();\n };\n\n useEffect(() => {\n return (): void => {\n handleClose();\n };\n }, []);\n\n useEffect(() => {\n if (!open && !transition) {\n handleClose();\n }\n }, [open, transition]);\n\n useEffect(() => {\n if (\n !followAnchor ||\n !open ||\n !anchorEl ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return undefined;\n }\n\n // eslint-disable-next-line compat/compat -- guarded above\n const observer = new ResizeObserver(() => {\n popperRef.current?.update();\n });\n\n observer.observe(anchorEl);\n\n return () => observer.disconnect();\n }, [anchorEl, followAnchor, open]);\n\n useEffect(() => {\n if (!open) {\n return undefined;\n }\n\n const update = () => popperRef.current?.update();\n\n window.addEventListener(ANCHOR_MOVE_EVENT, update);\n\n return () => window.removeEventListener(ANCHOR_MOVE_EVENT, update);\n }, [open]);\n\n useEffect(() => {\n if (popperRef.current) {\n popperRef.current.update();\n }\n });\n\n if (!open && (!transition || exited)) {\n return null;\n }\n\n const childProps: Partial<IChildProps> = { placement };\n\n if (transition) {\n childProps.transitionProps = {\n in: open,\n onEnter: handleEnter,\n onExited: handleExited,\n };\n }\n\n return (\n <StyledPopper\n ref={handleRef}\n {...rest}\n style={{\n ...style,\n }}\n >\n {typeof children === \"function\" ? children(childProps) : children}\n </StyledPopper>\n );\n }\n);\n\nPopper.displayName = \"Popper\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,SAAS,EACTC,QAAQ,QAIH,OAAO;AAEd,SACEC,YAAY,QAMP,gBAAgB;AAGvB,SAASC,iBAAi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,CAAC;EAEtD,IAAIF,UAAU,EAAE;IACd6D,UAAU,CAACC,eAAe,GAAG;MAC3BC,EAAE,EAAElE,IAAI;MACRmE,OAAO,EAAEhB,WAAW;MACpBiB,QAAQ,EAAEhB;IACZ,CAAC;EACH;EAEA,oBACEpE,KAAA,CAAAqF,aAAA,CAAC7E,YAAY,EAAA8E,QAAA;IACX1E,GAAG,EAAEqD;EAAU,GACXnC,IAAI;IACRb,KAAK,EAAAqE,QAAA,KACArE,KAAK;EACR,IAED,OAAOJ,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACmE,UAAU,CAAC,GAAGnE,QAC7C,CAAC;AAEnB,CACF,CAAC;AAEDH,MAAM,CAAC6E,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A control that moves its neighbors announces each frame of the move, so an open popper stays at its anchor. */
|
|
2
|
+
export declare const ANCHOR_MOVE_EVENT = "ac-anchor-move";
|
|
3
|
+
export declare const useAnnounceAnchorMove: (deps: unknown[]) => void;
|
|
4
|
+
//# sourceMappingURL=anchorMove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchorMove.d.ts","sourceRoot":"","sources":["../../../../src/components/Popper/anchorMove.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AASlD,eAAO,MAAM,qBAAqB,GAAI,MAAM,OAAO,EAAE,KAAG,IAyBvD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
/** A control that moves its neighbors announces each frame of the move, so an open popper stays at its anchor. */
|
|
4
|
+
export const ANCHOR_MOVE_EVENT = "ac-anchor-move";
|
|
5
|
+
const MOVE_MS = 320;
|
|
6
|
+
const announce = () => {
|
|
7
|
+
window.dispatchEvent(new Event(ANCHOR_MOVE_EVENT));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// Each frame keeps the popper with its anchor, and a last call after the move settles it where frames come late.
|
|
11
|
+
export const useAnnounceAnchorMove = deps => {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const end = performance.now() + MOVE_MS;
|
|
14
|
+
let frame = 0;
|
|
15
|
+
const tick = () => {
|
|
16
|
+
announce();
|
|
17
|
+
if (performance.now() < end) {
|
|
18
|
+
frame = requestAnimationFrame(tick);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
frame = requestAnimationFrame(tick);
|
|
22
|
+
const settle = setTimeout(announce, MOVE_MS);
|
|
23
|
+
return () => {
|
|
24
|
+
cancelAnimationFrame(frame);
|
|
25
|
+
clearTimeout(settle);
|
|
26
|
+
};
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- the caller names the changes that move it
|
|
28
|
+
}, deps);
|
|
29
|
+
|
|
30
|
+
// The last move ends when the control goes.
|
|
31
|
+
useEffect(() => () => void setTimeout(announce, 0), []);
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=anchorMove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchorMove.js","names":["useEffect","ANCHOR_MOVE_EVENT","MOVE_MS","announce","window","dispatchEvent","Event","useAnnounceAnchorMove","deps","end","performance","now","frame","tick","requestAnimationFrame","settle","setTimeout","cancelAnimationFrame","clearTimeout"],"sources":["../../../../src/components/Popper/anchorMove.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\n/** A control that moves its neighbors announces each frame of the move, so an open popper stays at its anchor. */\nexport const ANCHOR_MOVE_EVENT = \"ac-anchor-move\";\n\nconst MOVE_MS = 320;\n\nconst announce = (): void => {\n window.dispatchEvent(new Event(ANCHOR_MOVE_EVENT));\n};\n\n// Each frame keeps the popper with its anchor, and a last call after the move settles it where frames come late.\nexport const useAnnounceAnchorMove = (deps: unknown[]): void => {\n useEffect(() => {\n const end = performance.now() + MOVE_MS;\n let frame = 0;\n\n const tick = (): void => {\n announce();\n\n if (performance.now() < end) {\n frame = requestAnimationFrame(tick);\n }\n };\n\n frame = requestAnimationFrame(tick);\n const settle = setTimeout(announce, MOVE_MS);\n\n return () => {\n cancelAnimationFrame(frame);\n clearTimeout(settle);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the caller names the changes that move it\n }, deps);\n\n // The last move ends when the control goes.\n useEffect(() => () => void setTimeout(announce, 0), []);\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;;AAEjC;AACA,OAAO,MAAMC,iBAAiB,GAAG,gBAAgB;AAEjD,MAAMC,OAAO,GAAG,GAAG;AAEnB,MAAMC,QAAQ,GAAGA,CAAA,KAAY;EAC3BC,MAAM,CAACC,aAAa,CAAC,IAAIC,KAAK,CAACL,iBAAiB,CAAC,CAAC;AACpD,CAAC;;AAED;AACA,OAAO,MAAMM,qBAAqB,GAAIC,IAAe,IAAW;EAC9DR,SAAS,CAAC,MAAM;IACd,MAAMS,GAAG,GAAGC,WAAW,CAACC,GAAG,CAAC,CAAC,GAAGT,OAAO;IACvC,IAAIU,KAAK,GAAG,CAAC;IAEb,MAAMC,IAAI,GAAGA,CAAA,KAAY;MACvBV,QAAQ,CAAC,CAAC;MAEV,IAAIO,WAAW,CAACC,GAAG,CAAC,CAAC,GAAGF,GAAG,EAAE;QAC3BG,KAAK,GAAGE,qBAAqB,CAACD,IAAI,CAAC;MACrC;IACF,CAAC;IAEDD,KAAK,GAAGE,qBAAqB,CAACD,IAAI,CAAC;IACnC,MAAME,MAAM,GAAGC,UAAU,CAACb,QAAQ,EAAED,OAAO,CAAC;IAE5C,OAAO,MAAM;MACXe,oBAAoB,CAACL,KAAK,CAAC;MAC3BM,YAAY,CAACH,MAAM,CAAC;IACtB,CAAC;IACD;EACF,CAAC,EAAEP,IAAI,CAAC;;EAER;EACAR,SAAS,CAAC,MAAM,MAAM,KAAKgB,UAAU,CAACb,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;AACzD,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const StyledViewSettings: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
2
|
+
export declare const StyledViewSettingsHost: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
2
3
|
export declare const StyledViewSettingsButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
3
4
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSettings/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSettings/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,qEAW9B,CAAC;AAIF,eAAO,MAAM,sBAAsB,qEAKlC,CAAC;AAIF,eAAO,MAAM,wBAAwB,uEA2CpC,CAAC"}
|
|
@@ -5,11 +5,16 @@ import { BoxSizingStyle } from "../BoxSizingStyle";
|
|
|
5
5
|
export const StyledViewSettings = styled.span.withConfig({
|
|
6
6
|
displayName: "Styles__StyledViewSettings",
|
|
7
7
|
componentId: "sc-r1diu9-0"
|
|
8
|
-
})(["", " display:inline-flex;flex-shrink:0;align-items:center;height:32px;padding:3px;border-radius:var(--ac-br-rounded);background-color:var(--color-theme-300);"], BoxSizingStyle);
|
|
8
|
+
})(["", " display:inline-flex;flex-shrink:0;align-items:center;height:32px;padding:3px;border-radius:var(--ac-br-rounded);background-color:var(--color-theme-300);position:relative;z-index:1;"], BoxSizingStyle);
|
|
9
9
|
StyledViewSettings.displayName = "StyledViewSettings";
|
|
10
|
+
export const StyledViewSettingsHost = styled.span.withConfig({
|
|
11
|
+
displayName: "Styles__StyledViewSettingsHost",
|
|
12
|
+
componentId: "sc-r1diu9-1"
|
|
13
|
+
})(["", " display:inline-flex;flex-shrink:0;isolation:isolate;"], BoxSizingStyle);
|
|
14
|
+
StyledViewSettingsHost.displayName = "StyledViewSettingsHost";
|
|
10
15
|
export const StyledViewSettingsButton = styled.button.withConfig({
|
|
11
16
|
displayName: "Styles__StyledViewSettingsButton",
|
|
12
|
-
componentId: "sc-r1diu9-
|
|
17
|
+
componentId: "sc-r1diu9-2"
|
|
13
18
|
})(["", " display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:34px;height:26px;margin:0;padding:0;border:0;border-radius:var(--ac-br-rounded);background-color:transparent;cursor:pointer;outline:none;transition:background-color 150ms ease,box-shadow 150ms ease;svg{width:20px;height:20px;fill:var(--color-theme-700);}&:hover{background-color:color-mix( in srgb,var(--color-theme-900) 16%,transparent );}&[aria-expanded=\"true\"]{background-color:var(--page-paper-main);box-shadow:var(--shadow-float);svg{fill:var(--color-theme-900);}}&:focus-visible{box-shadow:0 0 0 2px var(--color-primary);}"], BoxSizingStyle);
|
|
14
19
|
StyledViewSettingsButton.displayName = "StyledViewSettingsButton";
|
|
15
20
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","BoxSizingStyle","StyledViewSettings","span","withConfig","displayName","componentId","StyledViewSettingsButton","button"],"sources":["../../../../src/components/ViewSettings/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\n/* The track and the button take the measures of ViewSwitcher, so the two sit side by side as one family. */\nexport const StyledViewSettings = styled.span`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n height: 32px;\n padding: 3px;\n border-radius: var(--ac-br-rounded);\n background-color: var(--color-theme-300);\n`;\n\nStyledViewSettings.displayName = \"StyledViewSettings\";\n\nexport const StyledViewSettingsButton = styled.button`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 26px;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: var(--ac-br-rounded);\n background-color: transparent;\n cursor: pointer;\n outline: none;\n transition: background-color 150ms ease, box-shadow 150ms ease;\n\n svg {\n width: 20px;\n height: 20px;\n fill: var(--color-theme-700);\n }\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-theme-900) 16%,\n transparent\n );\n }\n\n &[aria-expanded=\"true\"] {\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-float);\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px var(--color-primary);\n }\n`;\n\nStyledViewSettingsButton.displayName = \"StyledViewSettingsButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,SAASC,cAAc,QAAQ,mBAAmB;;AAElD;AACA,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","BoxSizingStyle","StyledViewSettings","span","withConfig","displayName","componentId","StyledViewSettingsHost","StyledViewSettingsButton","button"],"sources":["../../../../src/components/ViewSettings/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\n\n/* The track and the button take the measures of ViewSwitcher, so the two sit side by side as one family. */\nexport const StyledViewSettings = styled.span`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n height: 32px;\n padding: 3px;\n border-radius: var(--ac-br-rounded);\n background-color: var(--color-theme-300);\n position: relative;\n z-index: 1;\n`;\n\nStyledViewSettings.displayName = \"StyledViewSettings\";\n\nexport const StyledViewSettingsHost = styled.span`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n isolation: isolate;\n`;\n\nStyledViewSettingsHost.displayName = \"StyledViewSettingsHost\";\n\nexport const StyledViewSettingsButton = styled.button`\n ${BoxSizingStyle}\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 26px;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: var(--ac-br-rounded);\n background-color: transparent;\n cursor: pointer;\n outline: none;\n transition: background-color 150ms ease, box-shadow 150ms ease;\n\n svg {\n width: 20px;\n height: 20px;\n fill: var(--color-theme-700);\n }\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-theme-900) 16%,\n transparent\n );\n }\n\n &[aria-expanded=\"true\"] {\n background-color: var(--page-paper-main);\n box-shadow: var(--shadow-float);\n\n svg {\n fill: var(--color-theme-900);\n }\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 2px var(--color-primary);\n }\n`;\n\nStyledViewSettingsButton.displayName = \"StyledViewSettingsButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,SAASC,cAAc,QAAQ,mBAAmB;;AAElD;AACA,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACG,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kMACzCL,cAAc,CAUjB;AAEDC,kBAAkB,CAACG,WAAW,GAAG,oBAAoB;AAErD,OAAO,MAAME,sBAAsB,GAAGP,MAAM,CAACG,IAAI,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kEAC7CL,cAAc,CAIjB;AAEDM,sBAAsB,CAACF,WAAW,GAAG,wBAAwB;AAE7D,OAAO,MAAMG,wBAAwB,GAAGR,MAAM,CAACS,MAAM,CAAAL,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,knBACjDL,cAAc,CA0CjB;AAEDO,wBAAwB,CAACH,WAAW,GAAG,0BAA0B","ignoreList":[]}
|
|
@@ -2,6 +2,18 @@ import React, { ButtonHTMLAttributes } from "react";
|
|
|
2
2
|
export interface ViewSettingsProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
3
|
/** The tooltip and the accessible name of the button. */
|
|
4
4
|
label: string;
|
|
5
|
+
/** Turns on the check button that slides out after a change. A result of false shows no confirmation. */
|
|
6
|
+
onApplyToAll?: () => unknown;
|
|
7
|
+
/** A new value opens the check button, for a change made in the settings. */
|
|
8
|
+
offerKey?: string | number;
|
|
9
|
+
/** Tooltip and accessible name of the check button. */
|
|
10
|
+
applyToAllTitle?: string;
|
|
11
|
+
/** Text that a screen reader reads after the apply. */
|
|
12
|
+
appliedLabel?: string;
|
|
13
|
+
/** Tooltip and accessible name of the button that closes the extra action. */
|
|
14
|
+
/** Visible text of the apply button, shown where it has room. */
|
|
15
|
+
applyToAllLabel?: string;
|
|
16
|
+
dismissLabel?: string;
|
|
5
17
|
}
|
|
6
18
|
/** The settings button of a page view, with the look of ViewSwitcher and one icon. It sits left of the view switcher. */
|
|
7
19
|
export declare const ViewSettings: React.ForwardRefExoticComponent<ViewSettingsProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSettings/ViewSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ViewSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSettings/ViewSettings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,oBAAoB,EAKrB,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,iBACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC/C,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,yHAAyH;AACzH,eAAO,MAAM,YAAY,6FAyFxB,CAAC"}
|
|
@@ -1,26 +1,87 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["label", "className"];
|
|
4
|
-
import React, { forwardRef } from "react";
|
|
3
|
+
const _excluded = ["label", "className", "onApplyToAll", "offerKey", "applyToAllTitle", "appliedLabel", "applyToAllLabel", "dismissLabel"];
|
|
4
|
+
import React, { forwardRef, useCallback, useEffect, useRef } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
|
-
import { StyledViewSettings, StyledViewSettingsButton } from "./Styles";
|
|
6
|
+
import { StyledViewSettings, StyledViewSettingsButton, StyledViewSettingsHost } from "./Styles";
|
|
7
|
+
import useForkRef from "../../utils/useForkRef";
|
|
7
8
|
import { SettingsIcon } from "../Icons";
|
|
8
9
|
import { Tooltip } from "../Tooltip";
|
|
10
|
+
import { ApplyToAllTab } from "../ViewSwitcher/ApplyToAllTab";
|
|
11
|
+
import { useApplyToAllOffer } from "../ViewSwitcher/useApplyToAllOffer";
|
|
9
12
|
/** The settings button of a page view, with the look of ViewSwitcher and one icon. It sits left of the view switcher. */
|
|
10
13
|
export const ViewSettings = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
11
14
|
let label = _ref.label,
|
|
12
15
|
className = _ref.className,
|
|
16
|
+
onApplyToAll = _ref.onApplyToAll,
|
|
17
|
+
offerKey = _ref.offerKey,
|
|
18
|
+
_ref$applyToAllTitle = _ref.applyToAllTitle,
|
|
19
|
+
applyToAllTitle = _ref$applyToAllTitle === void 0 ? "Apply to All Projects" : _ref$applyToAllTitle,
|
|
20
|
+
_ref$appliedLabel = _ref.appliedLabel,
|
|
21
|
+
appliedLabel = _ref$appliedLabel === void 0 ? "Applied" : _ref$appliedLabel,
|
|
22
|
+
_ref$applyToAllLabel = _ref.applyToAllLabel,
|
|
23
|
+
applyToAllLabel = _ref$applyToAllLabel === void 0 ? "All Projects?" : _ref$applyToAllLabel,
|
|
24
|
+
_ref$dismissLabel = _ref.dismissLabel,
|
|
25
|
+
dismissLabel = _ref$dismissLabel === void 0 ? "Dismiss" : _ref$dismissLabel,
|
|
13
26
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
14
|
-
|
|
27
|
+
const hostRef = useRef(null);
|
|
28
|
+
const buttonRef = useRef(null);
|
|
29
|
+
const handleButtonRef = useForkRef(buttonRef, ref);
|
|
30
|
+
const focusButton = useCallback(() => {
|
|
31
|
+
var _buttonRef$current;
|
|
32
|
+
return (_buttonRef$current = buttonRef.current) == null ? void 0 : _buttonRef$current.focus();
|
|
33
|
+
}, []);
|
|
34
|
+
const offer = useApplyToAllOffer({
|
|
35
|
+
rootRef: hostRef,
|
|
36
|
+
onApplyToAll,
|
|
37
|
+
onRestoreFocus: focusButton
|
|
38
|
+
});
|
|
39
|
+
const show = offer.show;
|
|
40
|
+
const seenOfferKeyRef = useRef(offerKey);
|
|
41
|
+
const hasChangeRef = useRef(false);
|
|
42
|
+
const expanded = rest["aria-expanded"];
|
|
43
|
+
const isMenuOpen = expanded === true || expanded === "true";
|
|
44
|
+
|
|
45
|
+
// A change made in the open menu offers the apply once the menu closes.
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (seenOfferKeyRef.current !== offerKey) {
|
|
48
|
+
seenOfferKeyRef.current = offerKey;
|
|
49
|
+
hasChangeRef.current = true;
|
|
50
|
+
}
|
|
51
|
+
if (hasChangeRef.current && !isMenuOpen) {
|
|
52
|
+
hasChangeRef.current = false;
|
|
53
|
+
show(true);
|
|
54
|
+
}
|
|
55
|
+
}, [isMenuOpen, offerKey, show]);
|
|
56
|
+
const track = /*#__PURE__*/React.createElement(StyledViewSettings, {
|
|
15
57
|
className: classnames("c-view-settings", className),
|
|
16
58
|
"data-testid": "view-settings"
|
|
17
59
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
18
60
|
title: label
|
|
19
61
|
}, /*#__PURE__*/React.createElement(StyledViewSettingsButton, _extends({}, rest, {
|
|
20
|
-
ref:
|
|
62
|
+
ref: handleButtonRef,
|
|
21
63
|
type: "button",
|
|
22
64
|
"aria-label": label
|
|
23
65
|
}), /*#__PURE__*/React.createElement(SettingsIcon, null))));
|
|
66
|
+
if (!onApplyToAll) {
|
|
67
|
+
return track;
|
|
68
|
+
}
|
|
69
|
+
return /*#__PURE__*/React.createElement(StyledViewSettingsHost, {
|
|
70
|
+
ref: hostRef,
|
|
71
|
+
onKeyDown: offer.handleKeyDown,
|
|
72
|
+
onBlur: offer.handleBlur
|
|
73
|
+
}, track, offer.isShown ? /*#__PURE__*/React.createElement(ApplyToAllTab, {
|
|
74
|
+
ref: offer.tabRef,
|
|
75
|
+
phase: offer.phase,
|
|
76
|
+
isConfirmed: offer.isConfirmed,
|
|
77
|
+
title: applyToAllTitle,
|
|
78
|
+
appliedLabel: appliedLabel,
|
|
79
|
+
onApply: offer.apply,
|
|
80
|
+
onDismiss: offer.leave,
|
|
81
|
+
onHold: offer.hold,
|
|
82
|
+
dismissLabel: dismissLabel,
|
|
83
|
+
applyToAllLabel: applyToAllLabel
|
|
84
|
+
}) : null);
|
|
24
85
|
});
|
|
25
86
|
ViewSettings.displayName = "ViewSettings";
|
|
26
87
|
//# sourceMappingURL=ViewSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewSettings.js","names":["React","forwardRef","classnames","StyledViewSettings","StyledViewSettingsButton","SettingsIcon","Tooltip","ViewSettings","_ref","ref","label","className","rest","_objectWithoutPropertiesLoose","_excluded","createElement","title","_extends","type","displayName"],"sources":["../../../../src/components/ViewSettings/ViewSettings.tsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"ViewSettings.js","names":["React","forwardRef","useCallback","useEffect","useRef","classnames","StyledViewSettings","StyledViewSettingsButton","StyledViewSettingsHost","useForkRef","SettingsIcon","Tooltip","ApplyToAllTab","useApplyToAllOffer","ViewSettings","_ref","ref","label","className","onApplyToAll","offerKey","_ref$applyToAllTitle","applyToAllTitle","_ref$appliedLabel","appliedLabel","_ref$applyToAllLabel","applyToAllLabel","_ref$dismissLabel","dismissLabel","rest","_objectWithoutPropertiesLoose","_excluded","hostRef","buttonRef","handleButtonRef","focusButton","_buttonRef$current","current","focus","offer","rootRef","onRestoreFocus","show","seenOfferKeyRef","hasChangeRef","expanded","isMenuOpen","track","createElement","title","_extends","type","onKeyDown","handleKeyDown","onBlur","handleBlur","isShown","tabRef","phase","isConfirmed","onApply","apply","onDismiss","leave","onHold","hold","displayName"],"sources":["../../../../src/components/ViewSettings/ViewSettings.tsx"],"sourcesContent":["import React, {\n ButtonHTMLAttributes,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledViewSettings,\n StyledViewSettingsButton,\n StyledViewSettingsHost,\n} from \"./Styles\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { SettingsIcon } from \"../Icons\";\nimport { Tooltip } from \"../Tooltip\";\nimport { ApplyToAllTab } from \"../ViewSwitcher/ApplyToAllTab\";\nimport { useApplyToAllOffer } from \"../ViewSwitcher/useApplyToAllOffer\";\n\nexport interface ViewSettingsProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** The tooltip and the accessible name of the button. */\n label: string;\n /** Turns on the check button that slides out after a change. A result of false shows no confirmation. */\n onApplyToAll?: () => unknown;\n /** A new value opens the check button, for a change made in the settings. */\n offerKey?: string | number;\n /** Tooltip and accessible name of the check button. */\n applyToAllTitle?: string;\n /** Text that a screen reader reads after the apply. */\n appliedLabel?: string;\n /** Tooltip and accessible name of the button that closes the extra action. */\n /** Visible text of the apply button, shown where it has room. */\n applyToAllLabel?: string;\n dismissLabel?: string;\n}\n\n/** The settings button of a page view, with the look of ViewSwitcher and one icon. It sits left of the view switcher. */\nexport const ViewSettings = forwardRef<HTMLButtonElement, ViewSettingsProps>(\n (\n {\n label,\n className,\n onApplyToAll,\n offerKey,\n applyToAllTitle = \"Apply to All Projects\",\n appliedLabel = \"Applied\",\n applyToAllLabel = \"All Projects?\",\n dismissLabel = \"Dismiss\",\n ...rest\n },\n ref\n ) => {\n const hostRef = useRef<HTMLSpanElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const handleButtonRef = useForkRef(buttonRef, ref);\n const focusButton = useCallback(() => buttonRef.current?.focus(), []);\n const offer = useApplyToAllOffer<true>({\n rootRef: hostRef,\n onApplyToAll,\n onRestoreFocus: focusButton,\n });\n const { show } = offer;\n const seenOfferKeyRef = useRef(offerKey);\n const hasChangeRef = useRef(false);\n const expanded = rest[\"aria-expanded\"];\n const isMenuOpen = expanded === true || expanded === \"true\";\n\n // A change made in the open menu offers the apply once the menu closes.\n useEffect(() => {\n if (seenOfferKeyRef.current !== offerKey) {\n seenOfferKeyRef.current = offerKey;\n hasChangeRef.current = true;\n }\n\n if (hasChangeRef.current && !isMenuOpen) {\n hasChangeRef.current = false;\n show(true);\n }\n }, [isMenuOpen, offerKey, show]);\n\n const track = (\n <StyledViewSettings\n className={classnames(\"c-view-settings\", className)}\n data-testid=\"view-settings\"\n >\n <Tooltip title={label}>\n <StyledViewSettingsButton\n {...rest}\n ref={handleButtonRef}\n type=\"button\"\n aria-label={label}\n >\n <SettingsIcon />\n </StyledViewSettingsButton>\n </Tooltip>\n </StyledViewSettings>\n );\n\n if (!onApplyToAll) {\n return track;\n }\n\n return (\n <StyledViewSettingsHost\n ref={hostRef}\n onKeyDown={offer.handleKeyDown}\n onBlur={offer.handleBlur}\n >\n {track}\n {offer.isShown ? (\n <ApplyToAllTab\n ref={offer.tabRef}\n phase={offer.phase}\n isConfirmed={offer.isConfirmed}\n title={applyToAllTitle}\n appliedLabel={appliedLabel}\n onApply={offer.apply}\n onDismiss={offer.leave}\n onHold={offer.hold}\n dismissLabel={dismissLabel}\n applyToAllLabel={applyToAllLabel}\n />\n ) : null}\n </StyledViewSettingsHost>\n );\n }\n);\n\nViewSettings.displayName = \"ViewSettings\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAEVC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,MAAM,QACD,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kBAAkB,EAClBC,wBAAwB,EACxBC,sBAAsB,QACjB,UAAU;AACjB,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,kBAAkB,QAAQ,oCAAoC;AAoBvE;AACA,OAAO,MAAMC,YAAY,gBAAGb,UAAU,CACpC,CAAAc,IAAA,EAYEC,GAAG,KACA;EAAA,IAXDC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAAC,oBAAA,GAAAN,IAAA,CACRO,eAAe;IAAfA,eAAe,GAAAD,oBAAA,cAAG,uBAAuB,GAAAA,oBAAA;IAAAE,iBAAA,GAAAR,IAAA,CACzCS,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,SAAS,GAAAA,iBAAA;IAAAE,oBAAA,GAAAV,IAAA,CACxBW,eAAe;IAAfA,eAAe,GAAAD,oBAAA,cAAG,eAAe,GAAAA,oBAAA;IAAAE,iBAAA,GAAAZ,IAAA,CACjCa,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,SAAS,GAAAA,iBAAA;IACrBE,IAAI,GAAAC,6BAAA,CAAAf,IAAA,EAAAgB,SAAA;EAIT,MAAMC,OAAO,GAAG5B,MAAM,CAAyB,IAAI,CAAC;EACpD,MAAM6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aAAA,CAACrC,OAAO;IAACsC,KAAK,EAAEhC;EAAM,gBACpBjB,KAAA,CAAAgD,aAAA,CAACzC,wBAAwB,EAAA2C,QAAA,KACnBrB,IAAI;IACRb,GAAG,EAAEkB,eAAgB;IACrBiB,IAAI,EAAC,QAAQ;IACb,cAAYlC;EAAM,iBAElBjB,KAAA,CAAAgD,aAAA,CAACtC,YAAY,MAAE,CACS,CACnB,CACS,CACrB;EAED,IAAI,CAACS,YAAY,EAAE;IACjB,OAAO4B,KAAK;EACd;EAEA,oBACE/C,KAAA,CAAAgD,aAAA,CAACxC,sBAAsB;IACrBQ,GAAG,EAAEgB,OAAQ;IACboB,SAAS,EAAEb,KAAK,CAACc,aAAc;IAC/BC,MAAM,EAAEf,KAAK,CAACgB;EAAW,GAExBR,KAAK,EACLR,KAAK,CAACiB,OAAO,gBACZxD,KAAA,CAAAgD,aAAA,CAACpC,aAAa;IACZI,GAAG,EAAEuB,KAAK,CAACkB,MAAO;IAClBC,KAAK,EAAEnB,KAAK,CAACmB,KAAM;IACnBC,WAAW,EAAEpB,KAAK,CAACoB,WAAY;IAC/BV,KAAK,EAAE3B,eAAgB;IACvBE,YAAY,EAAEA,YAAa;IAC3BoC,OAAO,EAAErB,KAAK,CAACsB,KAAM;IACrBC,SAAS,EAAEvB,KAAK,CAACwB,KAAM;IACvBC,MAAM,EAAEzB,KAAK,CAAC0B,IAAK;IACnBrC,YAAY,EAAEA,YAAa;IAC3BF,eAAe,EAAEA;EAAgB,CAClC,CAAC,GACA,IACkB,CAAC;AAE7B,CACF,CAAC;AAEDZ,YAAY,CAACoD,WAAW,GAAG,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { ApplyToAllPhase } from "./useApplyToAllOffer";
|
|
3
|
+
interface ApplyToAllTabProps {
|
|
4
|
+
phase: ApplyToAllPhase;
|
|
5
|
+
isConfirmed: boolean;
|
|
6
|
+
/** Tooltip and accessible name of the button. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Accessible name of the group. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** Text that confirms the apply. */
|
|
11
|
+
appliedLabel: string;
|
|
12
|
+
onApply: () => void;
|
|
13
|
+
/** Visible text of the apply button, shown where the button has room for it. */
|
|
14
|
+
applyToAllLabel?: string;
|
|
15
|
+
/** Tooltip and accessible name of the button that closes the tab. */
|
|
16
|
+
dismissLabel?: string;
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
/** Called with true while the pointer is over the tab, so the tab does not go away under it. */
|
|
19
|
+
onHold?: (isHeld: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
/** The extension that comes out from under a view control and applies its value to all projects. */
|
|
22
|
+
export declare const ApplyToAllTab: React.ForwardRefExoticComponent<ApplyToAllTabProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=ApplyToAllTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplyToAllTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ViewSwitcher/ApplyToAllTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAYf,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA6GvD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,eAAe,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,gGAAgG;IAChG,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED,oGAAoG;AACpG,eAAO,MAAM,aAAa,2FA4GzB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React, { forwardRef, useId, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { StyledApplyToAllButton, StyledApplyToAllDismiss, StyledApplyToAllDone, StyledApplyToAllLine, StyledApplyToAllSlide, StyledApplyToAllTab, StyledViewSwitcherPromptTitle, TAB_RING } from "./Styles";
|
|
3
|
+
import { Portal } from "../../helpers";
|
|
4
|
+
import useForkRef from "../../utils/useForkRef";
|
|
5
|
+
import { CheckIcon, CloseIcon } from "../Icons";
|
|
6
|
+
import { ANCHOR_MOVE_EVENT, useAnnounceAnchorMove } from "../Popper/anchorMove";
|
|
7
|
+
import { Tooltip } from "../Tooltip";
|
|
8
|
+
|
|
9
|
+
// A control at least this wide gives the apply button room for its text.
|
|
10
|
+
const LABEL_ROOM = 120;
|
|
11
|
+
// The outline of the tab with a hole in the shape of the control, so the control shows on top of it.
|
|
12
|
+
const controlHole = (width, height, hole) => {
|
|
13
|
+
const r = Math.min(hole.height, hole.width) / 2;
|
|
14
|
+
const left = hole.x + r;
|
|
15
|
+
const right = hole.x + hole.width - r;
|
|
16
|
+
const bottom = hole.y + hole.height;
|
|
17
|
+
return "path(evenodd, \"M0 0H" + width + "V" + height + "H0Z M" + left + " " + hole.y + "H" + right + "A" + r + " " + r + " 0 0 1 " + right + " " + bottom + "H" + left + "A" + r + " " + r + " 0 0 1 " + left + " " + hole.y + "Z\")";
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// The tab draws on top of the page, so neither the titlebar nor the paper under it cut it. It wraps the control with a
|
|
21
|
+
// thin ring, and a hole in the shape of the control keeps the control in front. A tab is wider only when its buttons
|
|
22
|
+
// need the room.
|
|
23
|
+
const usePlace = isConfirmed => {
|
|
24
|
+
var _keptRef$current;
|
|
25
|
+
const markerRef = useRef(null);
|
|
26
|
+
const tabRef = useRef(null);
|
|
27
|
+
const _useState = useState(null),
|
|
28
|
+
place = _useState[0],
|
|
29
|
+
setPlace = _useState[1];
|
|
30
|
+
// The confirmation keeps the size and the shape of the tab it replaces.
|
|
31
|
+
const keptRef = useRef(null);
|
|
32
|
+
const isConfirmedRef = useRef(isConfirmed);
|
|
33
|
+
isConfirmedRef.current = isConfirmed;
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
var _markerRef$current;
|
|
36
|
+
const control = (_markerRef$current = markerRef.current) == null ? void 0 : _markerRef$current.parentElement;
|
|
37
|
+
if (!control) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const measure = () => {
|
|
41
|
+
var _ref, _kept$width, _tabRef$current, _tabRef$current$offse, _tabRef$current2, _kept$isWrapping;
|
|
42
|
+
const rect = control.getBoundingClientRect();
|
|
43
|
+
const kept = isConfirmedRef.current ? keptRef.current : null;
|
|
44
|
+
const width = (_ref = (_kept$width = kept == null ? void 0 : kept.width) != null ? _kept$width : (_tabRef$current = tabRef.current) == null ? void 0 : _tabRef$current.offsetWidth) != null ? _ref : 0;
|
|
45
|
+
const height = (_tabRef$current$offse = (_tabRef$current2 = tabRef.current) == null ? void 0 : _tabRef$current2.offsetHeight) != null ? _tabRef$current$offse : 0;
|
|
46
|
+
const isWrapping = (_kept$isWrapping = kept == null ? void 0 : kept.isWrapping) != null ? _kept$isWrapping : width > rect.width + 2 * TAB_RING + 0.5;
|
|
47
|
+
if (!isConfirmedRef.current) {
|
|
48
|
+
keptRef.current = {
|
|
49
|
+
width,
|
|
50
|
+
isWrapping
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const tuck = rect.height + TAB_RING;
|
|
54
|
+
setPlace({
|
|
55
|
+
top: rect.bottom - tuck,
|
|
56
|
+
left: rect.left + rect.width / 2,
|
|
57
|
+
minWidth: kept ? width : rect.width + 2 * TAB_RING,
|
|
58
|
+
width: kept ? width : undefined,
|
|
59
|
+
isLabeled: !isWrapping && rect.width >= LABEL_ROOM,
|
|
60
|
+
tuck,
|
|
61
|
+
clipPath: width && height ? controlHole(width, height, {
|
|
62
|
+
x: (width - rect.width) / 2,
|
|
63
|
+
y: TAB_RING,
|
|
64
|
+
width: rect.width,
|
|
65
|
+
height: rect.height
|
|
66
|
+
}) : undefined
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
measure();
|
|
70
|
+
// The width of the tab is known after its first draw.
|
|
71
|
+
const frame = requestAnimationFrame(measure);
|
|
72
|
+
window.addEventListener("resize", measure);
|
|
73
|
+
window.addEventListener("scroll", measure, true);
|
|
74
|
+
window.addEventListener(ANCHOR_MOVE_EVENT, measure);
|
|
75
|
+
return () => {
|
|
76
|
+
cancelAnimationFrame(frame);
|
|
77
|
+
window.removeEventListener("resize", measure);
|
|
78
|
+
window.removeEventListener("scroll", measure, true);
|
|
79
|
+
window.removeEventListener(ANCHOR_MOVE_EVENT, measure);
|
|
80
|
+
};
|
|
81
|
+
}, []);
|
|
82
|
+
|
|
83
|
+
// The kept width applies in the same draw as the confirmation, before a new measure.
|
|
84
|
+
const keptWidth = isConfirmed ? (_keptRef$current = keptRef.current) == null ? void 0 : _keptRef$current.width : undefined;
|
|
85
|
+
return {
|
|
86
|
+
markerRef,
|
|
87
|
+
tabRef,
|
|
88
|
+
place,
|
|
89
|
+
keptWidth
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/** The extension that comes out from under a view control and applies its value to all projects. */
|
|
93
|
+
export const ApplyToAllTab = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
94
|
+
var _place$tuck;
|
|
95
|
+
let phase = _ref2.phase,
|
|
96
|
+
isConfirmed = _ref2.isConfirmed,
|
|
97
|
+
title = _ref2.title,
|
|
98
|
+
label = _ref2.label,
|
|
99
|
+
appliedLabel = _ref2.appliedLabel,
|
|
100
|
+
onApply = _ref2.onApply,
|
|
101
|
+
_ref2$applyToAllLabel = _ref2.applyToAllLabel,
|
|
102
|
+
applyToAllLabel = _ref2$applyToAllLabel === void 0 ? "All Projects?" : _ref2$applyToAllLabel,
|
|
103
|
+
_ref2$dismissLabel = _ref2.dismissLabel,
|
|
104
|
+
dismissLabel = _ref2$dismissLabel === void 0 ? "Dismiss" : _ref2$dismissLabel,
|
|
105
|
+
onDismiss = _ref2.onDismiss,
|
|
106
|
+
onHold = _ref2.onHold;
|
|
107
|
+
const labelId = useId();
|
|
108
|
+
const _usePlace = usePlace(isConfirmed),
|
|
109
|
+
markerRef = _usePlace.markerRef,
|
|
110
|
+
tabRef = _usePlace.tabRef,
|
|
111
|
+
place = _usePlace.place,
|
|
112
|
+
keptWidth = _usePlace.keptWidth;
|
|
113
|
+
const handleRef = useForkRef(tabRef, ref);
|
|
114
|
+
|
|
115
|
+
// The tab grows and shrinks beside the controls, so it moves the ones before it.
|
|
116
|
+
useAnnounceAnchorMove([phase, isConfirmed]);
|
|
117
|
+
const style = {
|
|
118
|
+
top: place == null ? void 0 : place.top,
|
|
119
|
+
left: place == null ? void 0 : place.left,
|
|
120
|
+
minWidth: keptWidth != null ? keptWidth : place == null ? void 0 : place.minWidth,
|
|
121
|
+
width: keptWidth != null ? keptWidth : place == null ? void 0 : place.width,
|
|
122
|
+
clipPath: place == null ? void 0 : place.clipPath,
|
|
123
|
+
position: "fixed",
|
|
124
|
+
translate: "-50% 0",
|
|
125
|
+
visibility: place ? undefined : "hidden",
|
|
126
|
+
"--apply-to-all-tuck": ((_place$tuck = place == null ? void 0 : place.tuck) != null ? _place$tuck : 32 + TAB_RING) + "px"
|
|
127
|
+
};
|
|
128
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
129
|
+
ref: markerRef,
|
|
130
|
+
hidden: true
|
|
131
|
+
}), /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(StyledApplyToAllTab, {
|
|
132
|
+
ref: handleRef,
|
|
133
|
+
style: style,
|
|
134
|
+
role: "group",
|
|
135
|
+
"aria-labelledby": label ? labelId : undefined,
|
|
136
|
+
"aria-label": label ? undefined : title,
|
|
137
|
+
className: "c-apply-to-all",
|
|
138
|
+
"data-phase": phase,
|
|
139
|
+
"data-confirmed": isConfirmed || undefined,
|
|
140
|
+
"data-labeled": (place == null ? void 0 : place.isLabeled) || undefined
|
|
141
|
+
// A menu that opens on a click around its control must not open from the tab.
|
|
142
|
+
,
|
|
143
|
+
onClick: event => event.stopPropagation(),
|
|
144
|
+
onPointerEnter: () => onHold == null ? void 0 : onHold(true),
|
|
145
|
+
onPointerLeave: () => onHold == null ? void 0 : onHold(false)
|
|
146
|
+
}, label ? /*#__PURE__*/React.createElement(StyledViewSwitcherPromptTitle, {
|
|
147
|
+
id: labelId
|
|
148
|
+
}, label) : null, /*#__PURE__*/React.createElement(StyledApplyToAllSlide, {
|
|
149
|
+
className: "c-apply-to-all__slide"
|
|
150
|
+
}, isConfirmed ? /*#__PURE__*/React.createElement(StyledApplyToAllDone, {
|
|
151
|
+
role: "status",
|
|
152
|
+
className: "c-apply-to-all__done"
|
|
153
|
+
}, /*#__PURE__*/React.createElement(CheckIcon, null), /*#__PURE__*/React.createElement("span", {
|
|
154
|
+
className: "c-apply-to-all__done-text"
|
|
155
|
+
}, appliedLabel)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
156
|
+
title: title,
|
|
157
|
+
placement: "bottom"
|
|
158
|
+
}, /*#__PURE__*/React.createElement(StyledApplyToAllButton, {
|
|
159
|
+
type: "button",
|
|
160
|
+
"aria-label": title,
|
|
161
|
+
className: "c-apply-to-all__button",
|
|
162
|
+
onClick: onApply
|
|
163
|
+
}, /*#__PURE__*/React.createElement(CheckIcon, null), /*#__PURE__*/React.createElement("span", {
|
|
164
|
+
className: "c-apply-to-all__label",
|
|
165
|
+
"aria-hidden": true
|
|
166
|
+
}, applyToAllLabel))), onDismiss ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledApplyToAllLine, {
|
|
167
|
+
className: "c-apply-to-all__line"
|
|
168
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
169
|
+
title: dismissLabel,
|
|
170
|
+
placement: "bottom"
|
|
171
|
+
}, /*#__PURE__*/React.createElement(StyledApplyToAllDismiss, {
|
|
172
|
+
type: "button",
|
|
173
|
+
"aria-label": dismissLabel,
|
|
174
|
+
className: "c-apply-to-all__dismiss",
|
|
175
|
+
onClick: onDismiss
|
|
176
|
+
}, /*#__PURE__*/React.createElement(CloseIcon, null)))) : null)))));
|
|
177
|
+
});
|
|
178
|
+
ApplyToAllTab.displayName = "ApplyToAllTab";
|
|
179
|
+
//# sourceMappingURL=ApplyToAllTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApplyToAllTab.js","names":["React","forwardRef","useId","useLayoutEffect","useRef","useState","StyledApplyToAllButton","StyledApplyToAllDismiss","StyledApplyToAllDone","StyledApplyToAllLine","StyledApplyToAllSlide","StyledApplyToAllTab","StyledViewSwitcherPromptTitle","TAB_RING","Portal","useForkRef","CheckIcon","CloseIcon","ANCHOR_MOVE_EVENT","useAnnounceAnchorMove","Tooltip","LABEL_ROOM","controlHole","width","height","hole","r","Math","min","left","x","right","bottom","y","usePlace","isConfirmed","_keptRef$current","markerRef","tabRef","_useState","place","setPlace","keptRef","isConfirmedRef","current","_markerRef$current","control","parentElement","undefined","measure","_ref","_kept$width","_tabRef$current","_tabRef$current$offse","_tabRef$current2","_kept$isWrapping","rect","getBoundingClientRect","kept","offsetWidth","offsetHeight","isWrapping","tuck","top","minWidth","isLabeled","clipPath","frame","requestAnimationFrame","window","addEventListener","cancelAnimationFrame","removeEventListener","keptWidth","ApplyToAllTab","_ref2","ref","_place$tuck","phase","title","label","appliedLabel","onApply","_ref2$applyToAllLabel","applyToAllLabel","_ref2$dismissLabel","dismissLabel","onDismiss","onHold","labelId","_usePlace","handleRef","style","position","translate","visibility","createElement","Fragment","hidden","role","className","onClick","event","stopPropagation","onPointerEnter","onPointerLeave","id","placement","type","displayName"],"sources":["../../../../src/components/ViewSwitcher/ApplyToAllTab.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n forwardRef,\n ReactNode,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport {\n StyledApplyToAllButton,\n StyledApplyToAllDismiss,\n StyledApplyToAllDone,\n StyledApplyToAllLine,\n StyledApplyToAllSlide,\n StyledApplyToAllTab,\n StyledViewSwitcherPromptTitle,\n TAB_RING,\n} from \"./Styles\";\nimport { ApplyToAllPhase } from \"./useApplyToAllOffer\";\nimport { Portal } from \"../../helpers\";\nimport useForkRef from \"../../utils/useForkRef\";\nimport { CheckIcon, CloseIcon } from \"../Icons\";\nimport { ANCHOR_MOVE_EVENT, useAnnounceAnchorMove } from \"../Popper/anchorMove\";\nimport { Tooltip } from \"../Tooltip\";\n\n// A control at least this wide gives the apply button room for its text.\nconst LABEL_ROOM = 120;\n\ninterface Place {\n top: number;\n left: number;\n minWidth: number;\n width?: number;\n isLabeled: boolean;\n tuck: number;\n clipPath?: string;\n}\n\n// The outline of the tab with a hole in the shape of the control, so the control shows on top of it.\nconst controlHole = (\n width: number,\n height: number,\n hole: { x: number; y: number; width: number; height: number }\n) => {\n const r = Math.min(hole.height, hole.width) / 2;\n const left = hole.x + r;\n const right = hole.x + hole.width - r;\n const bottom = hole.y + hole.height;\n\n return `path(evenodd, \"M0 0H${width}V${height}H0Z M${left} ${hole.y}H${right}A${r} ${r} 0 0 1 ${right} ${bottom}H${left}A${r} ${r} 0 0 1 ${left} ${hole.y}Z\")`;\n};\n\n// The tab draws on top of the page, so neither the titlebar nor the paper under it cut it. It wraps the control with a\n// thin ring, and a hole in the shape of the control keeps the control in front. A tab is wider only when its buttons\n// need the room.\nconst usePlace = (isConfirmed: boolean) => {\n const markerRef = useRef<HTMLSpanElement | null>(null);\n const tabRef = useRef<HTMLDivElement | null>(null);\n const [place, setPlace] = useState<Place | null>(null);\n // The confirmation keeps the size and the shape of the tab it replaces.\n const keptRef = useRef<{ width: number; isWrapping: boolean } | null>(null);\n const isConfirmedRef = useRef(isConfirmed);\n\n isConfirmedRef.current = isConfirmed;\n\n useLayoutEffect(() => {\n const control = markerRef.current?.parentElement;\n\n if (!control) {\n return undefined;\n }\n\n const measure = () => {\n const rect = control.getBoundingClientRect();\n const kept = isConfirmedRef.current ? keptRef.current : null;\n const width = kept?.width ?? tabRef.current?.offsetWidth ?? 0;\n const height = tabRef.current?.offsetHeight ?? 0;\n const isWrapping =\n kept?.isWrapping ?? width > rect.width + 2 * TAB_RING + 0.5;\n\n if (!isConfirmedRef.current) {\n keptRef.current = { width, isWrapping };\n }\n\n const tuck = rect.height + TAB_RING;\n\n setPlace({\n top: rect.bottom - tuck,\n left: rect.left + rect.width / 2,\n minWidth: kept ? width : rect.width + 2 * TAB_RING,\n width: kept ? width : undefined,\n isLabeled: !isWrapping && rect.width >= LABEL_ROOM,\n tuck,\n clipPath:\n width && height\n ? controlHole(width, height, {\n x: (width - rect.width) / 2,\n y: TAB_RING,\n width: rect.width,\n height: rect.height,\n })\n : undefined,\n });\n };\n\n measure();\n // The width of the tab is known after its first draw.\n const frame = requestAnimationFrame(measure);\n\n window.addEventListener(\"resize\", measure);\n window.addEventListener(\"scroll\", measure, true);\n window.addEventListener(ANCHOR_MOVE_EVENT, measure);\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener(\"resize\", measure);\n window.removeEventListener(\"scroll\", measure, true);\n window.removeEventListener(ANCHOR_MOVE_EVENT, measure);\n };\n }, []);\n\n // The kept width applies in the same draw as the confirmation, before a new measure.\n const keptWidth = isConfirmed ? keptRef.current?.width : undefined;\n\n return { markerRef, tabRef, place, keptWidth };\n};\n\ninterface ApplyToAllTabProps {\n phase: ApplyToAllPhase;\n isConfirmed: boolean;\n /** Tooltip and accessible name of the button. */\n title: string;\n /** Accessible name of the group. */\n label?: ReactNode;\n /** Text that confirms the apply. */\n appliedLabel: string;\n onApply: () => void;\n /** Visible text of the apply button, shown where the button has room for it. */\n applyToAllLabel?: string;\n /** Tooltip and accessible name of the button that closes the tab. */\n dismissLabel?: string;\n onDismiss?: () => void;\n /** Called with true while the pointer is over the tab, so the tab does not go away under it. */\n onHold?: (isHeld: boolean) => void;\n}\n\n/** The extension that comes out from under a view control and applies its value to all projects. */\nexport const ApplyToAllTab = forwardRef<HTMLDivElement, ApplyToAllTabProps>(\n (\n {\n phase,\n isConfirmed,\n title,\n label,\n appliedLabel,\n onApply,\n applyToAllLabel = \"All Projects?\",\n dismissLabel = \"Dismiss\",\n onDismiss,\n onHold,\n },\n ref\n ) => {\n const labelId = useId();\n const { markerRef, tabRef, place, keptWidth } = usePlace(isConfirmed);\n const handleRef = useForkRef(tabRef, ref);\n\n // The tab grows and shrinks beside the controls, so it moves the ones before it.\n useAnnounceAnchorMove([phase, isConfirmed]);\n\n const style = {\n top: place?.top,\n left: place?.left,\n minWidth: keptWidth ?? place?.minWidth,\n width: keptWidth ?? place?.width,\n clipPath: place?.clipPath,\n position: \"fixed\",\n translate: \"-50% 0\",\n visibility: place ? undefined : \"hidden\",\n \"--apply-to-all-tuck\": `${place?.tuck ?? 32 + TAB_RING}px`,\n } as CSSProperties;\n\n return (\n <>\n <span ref={markerRef} hidden />\n <Portal>\n <StyledApplyToAllTab\n ref={handleRef}\n style={style}\n role=\"group\"\n aria-labelledby={label ? labelId : undefined}\n aria-label={label ? undefined : title}\n className=\"c-apply-to-all\"\n data-phase={phase}\n data-confirmed={isConfirmed || undefined}\n data-labeled={place?.isLabeled || undefined}\n // A menu that opens on a click around its control must not open from the tab.\n onClick={(event) => event.stopPropagation()}\n onPointerEnter={() => onHold?.(true)}\n onPointerLeave={() => onHold?.(false)}\n >\n {label ? (\n <StyledViewSwitcherPromptTitle id={labelId}>\n {label}\n </StyledViewSwitcherPromptTitle>\n ) : null}\n <StyledApplyToAllSlide className=\"c-apply-to-all__slide\">\n {isConfirmed ? (\n <StyledApplyToAllDone\n role=\"status\"\n className=\"c-apply-to-all__done\"\n >\n <CheckIcon />\n <span className=\"c-apply-to-all__done-text\">\n {appliedLabel}\n </span>\n </StyledApplyToAllDone>\n ) : (\n <>\n <Tooltip title={title} placement=\"bottom\">\n <StyledApplyToAllButton\n type=\"button\"\n aria-label={title}\n className=\"c-apply-to-all__button\"\n onClick={onApply}\n >\n <CheckIcon />\n <span className=\"c-apply-to-all__label\" aria-hidden>\n {applyToAllLabel}\n </span>\n </StyledApplyToAllButton>\n </Tooltip>\n {onDismiss ? (\n <>\n <StyledApplyToAllLine className=\"c-apply-to-all__line\" />\n <Tooltip title={dismissLabel} placement=\"bottom\">\n <StyledApplyToAllDismiss\n type=\"button\"\n aria-label={dismissLabel}\n className=\"c-apply-to-all__dismiss\"\n onClick={onDismiss}\n >\n <CloseIcon />\n </StyledApplyToAllDismiss>\n </Tooltip>\n </>\n ) : null}\n </>\n )}\n </StyledApplyToAllSlide>\n </StyledApplyToAllTab>\n </Portal>\n </>\n );\n }\n);\n\nApplyToAllTab.displayName = \"ApplyToAllTab\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAEVC,UAAU,EAEVC,KAAK,EACLC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SACEC,sBAAsB,EACtBC,uBAAuB,EACvBC,oBAAoB,EACpBC,oBAAoB,EACpBC,qBAAqB,EACrBC,mBAAmB,EACnBC,6BAA6B,EAC7BC,QAAQ,QACH,UAAU;AAEjB,SAASC,MAAM,QAAQ,eAAe;AACtC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAASC,SAAS,EAAEC,SAAS,QAAQ,UAAU;AAC/C,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,sBAAsB;AAC/E,SAASC,OAAO,QAAQ,YAAY;;AAEpC;AACA,MAAMC,UAAU,GAAG,GAAG;AAYtB;AACA,MAAMC,WAAW,GAAGA,CAClBC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