@startdownnotez404/ui 1.3.5 → 1.3.6
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/AutocompleteField-653233JU.mjs +203 -0
- package/dist/AutocompleteField-653233JU.mjs.map +1 -0
- package/dist/AvatarField-KFASMVZU.mjs +378 -0
- package/dist/AvatarField-KFASMVZU.mjs.map +1 -0
- package/dist/{DateField-ZYMZFHL4.mjs → DateField-CDJ6W6XF.mjs} +19 -7
- package/dist/DateField-CDJ6W6XF.mjs.map +1 -0
- package/dist/DateRangeField-ZWSFT5KV.mjs +118 -0
- package/dist/DateRangeField-ZWSFT5KV.mjs.map +1 -0
- package/dist/{DateTimeField-TPTJ7YIZ.mjs → DateTimeField-SFAF4I6A.mjs} +36 -11
- package/dist/DateTimeField-SFAF4I6A.mjs.map +1 -0
- package/dist/FileUploadField-TSNCSLXX.mjs +101 -0
- package/dist/FileUploadField-TSNCSLXX.mjs.map +1 -0
- package/dist/{JSONEditorField-TMRWGXVR.mjs → JSONEditorField-3KXC2GOG.mjs} +7 -6
- package/dist/{JSONEditorField-TMRWGXVR.mjs.map → JSONEditorField-3KXC2GOG.mjs.map} +1 -1
- package/dist/{PopperMenu-LJ36RPBW.mjs → PopperMenu-PSHLKIEZ.mjs} +26 -12
- package/dist/{PopperMenu-LJ36RPBW.mjs.map → PopperMenu-PSHLKIEZ.mjs.map} +1 -1
- package/dist/{TelField-LOGRVZ4I.mjs → TelField-FRQT2UBJ.mjs} +8 -7
- package/dist/{TelField-LOGRVZ4I.mjs.map → TelField-FRQT2UBJ.mjs.map} +1 -1
- package/dist/TimeField-XVWXBJID.mjs +94 -0
- package/dist/TimeField-XVWXBJID.mjs.map +1 -0
- package/dist/alert.d.mts +148 -18
- package/dist/alert.d.ts +148 -18
- package/dist/alert.js +698 -254
- package/dist/alert.js.map +1 -1
- package/dist/alert.mjs +46 -10
- package/dist/autocomplete.d.mts +438 -4
- package/dist/autocomplete.d.ts +438 -4
- package/dist/autocomplete.js +632 -21
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.mjs +26 -7
- package/dist/avatar.js +2 -1
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.mjs +12 -11
- package/dist/box.mjs +2 -1
- package/dist/button.mjs +3 -2
- package/dist/chart.mjs +3 -2
- package/dist/checkbox.mjs +3 -2
- package/dist/chunk-2FK24ZPJ.mjs +78 -0
- package/dist/chunk-2FK24ZPJ.mjs.map +1 -0
- package/dist/{chunk-V26V2S3W.mjs → chunk-3O3N6X6D.mjs} +3 -3
- package/dist/{chunk-Y74ALKBL.mjs → chunk-4MSPA7U7.mjs} +11 -9
- package/dist/{chunk-Y74ALKBL.mjs.map → chunk-4MSPA7U7.mjs.map} +1 -1
- package/dist/{chunk-24XDGNJ6.mjs → chunk-4P45Z5LR.mjs} +63 -41
- package/dist/chunk-4P45Z5LR.mjs.map +1 -0
- package/dist/chunk-4SSJY32J.mjs +1182 -0
- package/dist/chunk-4SSJY32J.mjs.map +1 -0
- package/dist/{chunk-XJ2SXC2Q.mjs → chunk-6B6I27TT.mjs} +18 -16
- package/dist/{chunk-XJ2SXC2Q.mjs.map → chunk-6B6I27TT.mjs.map} +1 -1
- package/dist/chunk-6JKMEH2L.mjs +205 -0
- package/dist/chunk-6JKMEH2L.mjs.map +1 -0
- package/dist/{chunk-IN3O4R7Q.mjs → chunk-7O526A2D.mjs} +6 -4
- package/dist/{chunk-IN3O4R7Q.mjs.map → chunk-7O526A2D.mjs.map} +1 -1
- package/dist/chunk-AFLEG5ZC.mjs +28 -0
- package/dist/chunk-AFLEG5ZC.mjs.map +1 -0
- package/dist/{chunk-UGMRJMFZ.mjs → chunk-BO5CU4ZM.mjs} +4 -4
- package/dist/{chunk-JIU5GVM7.mjs → chunk-D4XPNSSI.mjs} +5 -3
- package/dist/{chunk-JIU5GVM7.mjs.map → chunk-D4XPNSSI.mjs.map} +1 -1
- package/dist/chunk-DPIMA5IO.mjs +72 -0
- package/dist/chunk-DPIMA5IO.mjs.map +1 -0
- package/dist/chunk-F2CGFVIZ.mjs +83 -0
- package/dist/chunk-F2CGFVIZ.mjs.map +1 -0
- package/dist/{chunk-R5MKQN6D.mjs → chunk-FBLSJQWK.mjs} +3 -3
- package/dist/{chunk-BGB7JHIU.mjs → chunk-FMGZCOJC.mjs} +5 -3
- package/dist/{chunk-BGB7JHIU.mjs.map → chunk-FMGZCOJC.mjs.map} +1 -1
- package/dist/{chunk-UTVSYS6S.mjs → chunk-FNSIQ2B7.mjs} +18 -6
- package/dist/chunk-FNSIQ2B7.mjs.map +1 -0
- package/dist/{chunk-JWANK42G.mjs → chunk-FUZ2JNTZ.mjs} +3 -3
- package/dist/{chunk-CRYIEYZZ.mjs → chunk-HAJWE62X.mjs} +66 -42
- package/dist/chunk-HAJWE62X.mjs.map +1 -0
- package/dist/{chunk-CWFWRZWU.mjs → chunk-KSN33A6I.mjs} +3 -2
- package/dist/{chunk-CWFWRZWU.mjs.map → chunk-KSN33A6I.mjs.map} +1 -1
- package/dist/chunk-KYTHGFFY.mjs +866 -0
- package/dist/chunk-KYTHGFFY.mjs.map +1 -0
- package/dist/{chunk-QKGCW37O.mjs → chunk-LDFM46LV.mjs} +5 -3
- package/dist/{chunk-QKGCW37O.mjs.map → chunk-LDFM46LV.mjs.map} +1 -1
- package/dist/chunk-LQNDBPHU.mjs +142 -0
- package/dist/chunk-LQNDBPHU.mjs.map +1 -0
- package/dist/{chunk-E3I2VDHZ.mjs → chunk-M2PYXSAF.mjs} +6 -4
- package/dist/{chunk-E3I2VDHZ.mjs.map → chunk-M2PYXSAF.mjs.map} +1 -1
- package/dist/{chunk-DELCADNF.mjs → chunk-ODVKRIVN.mjs} +30 -30
- package/dist/{chunk-HR3A4H4E.mjs → chunk-PEJL2T2K.mjs} +13 -11
- package/dist/{chunk-HR3A4H4E.mjs.map → chunk-PEJL2T2K.mjs.map} +1 -1
- package/dist/{chunk-OGNGPI3M.mjs → chunk-PL55YKT4.mjs} +2 -2
- package/dist/{chunk-S6EZVRZC.mjs → chunk-PNSJC6PC.mjs} +5 -28
- package/dist/chunk-PNSJC6PC.mjs.map +1 -0
- package/dist/{chunk-TDRA5EZI.mjs → chunk-PUREEN2J.mjs} +7 -7
- package/dist/chunk-QFS5CENY.mjs +659 -0
- package/dist/chunk-QFS5CENY.mjs.map +1 -0
- package/dist/chunk-RSN7NH2J.mjs +250 -0
- package/dist/chunk-RSN7NH2J.mjs.map +1 -0
- package/dist/{chunk-UDREPVEY.mjs → chunk-RVSMEZE3.mjs} +12 -78
- package/dist/chunk-RVSMEZE3.mjs.map +1 -0
- package/dist/{chunk-SRWPHN2N.mjs → chunk-S64IYJ6Y.mjs} +2 -2
- package/dist/{chunk-ZG3NQI77.mjs → chunk-SMD7OEUW.mjs} +6 -4
- package/dist/{chunk-ZG3NQI77.mjs.map → chunk-SMD7OEUW.mjs.map} +1 -1
- package/dist/{chunk-NJYNJLT7.mjs → chunk-SWFB3A3G.mjs} +2 -2
- package/dist/{chunk-RXBQ7KXF.mjs → chunk-USXGNKWJ.mjs} +98 -44
- package/dist/chunk-USXGNKWJ.mjs.map +1 -0
- package/dist/{chunk-OJV6V7YZ.mjs → chunk-VL7V52YD.mjs} +27 -20
- package/dist/chunk-VL7V52YD.mjs.map +1 -0
- package/dist/{chunk-2ZZJTBTE.mjs → chunk-WJZ3IYET.mjs} +2 -2
- package/dist/chunk-XAJAMVAG.mjs +1720 -0
- package/dist/chunk-XAJAMVAG.mjs.map +1 -0
- package/dist/chunk-YIJ5QVJ6.mjs +277 -0
- package/dist/chunk-YIJ5QVJ6.mjs.map +1 -0
- package/dist/{chunk-T6AMRENK.mjs → chunk-YRW5NKD7.mjs} +148 -112
- package/dist/chunk-YRW5NKD7.mjs.map +1 -0
- package/dist/chunk-ZMJKG2UI.mjs +71 -0
- package/dist/chunk-ZMJKG2UI.mjs.map +1 -0
- package/dist/confirm.d.mts +48 -0
- package/dist/confirm.d.ts +48 -0
- package/dist/confirm.js +334 -0
- package/dist/confirm.js.map +1 -0
- package/dist/confirm.mjs +20 -0
- package/dist/datePicker.d.mts +256 -14
- package/dist/datePicker.d.ts +256 -14
- package/dist/datePicker.js +1624 -145
- package/dist/datePicker.js.map +1 -1
- package/dist/datePicker.mjs +19 -6
- package/dist/dialog.d.mts +166 -0
- package/dist/dialog.d.ts +166 -0
- package/dist/dialog.js +362 -0
- package/dist/dialog.js.map +1 -0
- package/dist/dialog.mjs +45 -0
- package/dist/emptyState.d.mts +17 -0
- package/dist/emptyState.d.ts +17 -0
- package/dist/emptyState.js +253 -0
- package/dist/emptyState.js.map +1 -0
- package/dist/emptyState.mjs +12 -0
- package/dist/emptyState.mjs.map +1 -0
- package/dist/errorState.d.mts +18 -0
- package/dist/errorState.d.ts +18 -0
- package/dist/{displayFile.js → errorState.js} +107 -156
- package/dist/errorState.js.map +1 -0
- package/dist/errorState.mjs +15 -0
- package/dist/errorState.mjs.map +1 -0
- package/dist/fileUpload.d.mts +197 -0
- package/dist/fileUpload.d.ts +197 -0
- package/dist/fileUpload.js +1483 -0
- package/dist/fileUpload.js.map +1 -0
- package/dist/fileUpload.mjs +65 -0
- package/dist/fileUpload.mjs.map +1 -0
- package/dist/flowMap.mjs +7 -6
- package/dist/flowMap.mjs.map +1 -1
- package/dist/image.js +1195 -429
- package/dist/image.js.map +1 -1
- package/dist/image.mjs +8 -6
- package/dist/index.d.ts +7 -2
- package/dist/index.js +8606 -4087
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +314 -152
- package/dist/inlineError.d.mts +16 -0
- package/dist/inlineError.d.ts +16 -0
- package/dist/inlineError.js +297 -0
- package/dist/inlineError.js.map +1 -0
- package/dist/inlineError.mjs +15 -0
- package/dist/inlineError.mjs.map +1 -0
- package/dist/input.mjs +8 -7
- package/dist/jsonEditor.mjs +3 -2
- package/dist/list.mjs +7 -6
- package/dist/loading.mjs +8 -6
- package/dist/markdown.mjs +7 -6
- package/dist/markdown.mjs.map +1 -1
- package/dist/menu.mjs +9 -8
- package/dist/modal.js +2 -1
- package/dist/modal.js.map +1 -1
- package/dist/modal.mjs +7 -5
- package/dist/process.d.mts +33 -75
- package/dist/process.d.ts +33 -75
- package/dist/process.js +1275 -203
- package/dist/process.js.map +1 -1
- package/dist/process.mjs +12 -9
- package/dist/scrollToLoad.mjs +4 -3
- package/dist/select.mjs +10 -9
- package/dist/skeleton.d.mts +15 -1
- package/dist/skeleton.d.ts +15 -1
- package/dist/skeleton.js +114 -2
- package/dist/skeleton.js.map +1 -1
- package/dist/skeleton.mjs +6 -3
- package/dist/stepper.mjs +4 -3
- package/dist/tab.mjs +10 -9
- package/dist/table.d.mts +269 -85
- package/dist/table.d.ts +269 -85
- package/dist/table.js +5102 -3153
- package/dist/table.js.map +1 -1
- package/dist/table.mjs +21 -19
- package/dist/theme.js +1766 -432
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +32 -25
- package/dist/timeline.mjs +4 -3
- package/dist/toast.d.mts +49 -0
- package/dist/toast.d.ts +49 -0
- package/dist/toast.js +175 -0
- package/dist/toast.js.map +1 -0
- package/dist/toast.mjs +9 -0
- package/dist/toast.mjs.map +1 -0
- package/dist/toggleButtonGroup.mjs +3 -2
- package/dist/useForm.d.mts +270 -86
- package/dist/useForm.d.ts +270 -86
- package/dist/useForm.js +4672 -2727
- package/dist/useForm.js.map +1 -1
- package/dist/useForm.mjs +18 -16
- package/dist/useSearch.mjs +13 -12
- package/dist/variablesRenderer.mjs +8 -7
- package/package.json +3 -3
- package/dist/AutocompleteField-ZKNU2IRR.mjs +0 -181
- package/dist/AutocompleteField-ZKNU2IRR.mjs.map +0 -1
- package/dist/AvatarField-SAODT3CZ.mjs +0 -275
- package/dist/AvatarField-SAODT3CZ.mjs.map +0 -1
- package/dist/DateField-ZYMZFHL4.mjs.map +0 -1
- package/dist/DateTimeField-TPTJ7YIZ.mjs.map +0 -1
- package/dist/FileUploadField-NTMWBJER.mjs +0 -78
- package/dist/FileUploadField-NTMWBJER.mjs.map +0 -1
- package/dist/chunk-24XDGNJ6.mjs.map +0 -1
- package/dist/chunk-27KYFU7R.mjs +0 -30
- package/dist/chunk-27KYFU7R.mjs.map +0 -1
- package/dist/chunk-AAH2O24U.mjs +0 -325
- package/dist/chunk-AAH2O24U.mjs.map +0 -1
- package/dist/chunk-CRYIEYZZ.mjs.map +0 -1
- package/dist/chunk-EEH7HACG.mjs +0 -249
- package/dist/chunk-EEH7HACG.mjs.map +0 -1
- package/dist/chunk-EKPULYPU.mjs +0 -497
- package/dist/chunk-EKPULYPU.mjs.map +0 -1
- package/dist/chunk-OJV6V7YZ.mjs.map +0 -1
- package/dist/chunk-RXBQ7KXF.mjs.map +0 -1
- package/dist/chunk-S6EZVRZC.mjs.map +0 -1
- package/dist/chunk-SGCUDWO3.mjs +0 -396
- package/dist/chunk-SGCUDWO3.mjs.map +0 -1
- package/dist/chunk-T6AMRENK.mjs.map +0 -1
- package/dist/chunk-UDREPVEY.mjs.map +0 -1
- package/dist/chunk-UTVSYS6S.mjs.map +0 -1
- package/dist/chunk-XIMFP6RB.mjs +0 -161
- package/dist/chunk-XIMFP6RB.mjs.map +0 -1
- package/dist/displayFile.d.mts +0 -95
- package/dist/displayFile.d.ts +0 -95
- package/dist/displayFile.js.map +0 -1
- package/dist/displayFile.mjs +0 -19
- package/dist/fileUploader.d.mts +0 -86
- package/dist/fileUploader.d.ts +0 -86
- package/dist/fileUploader.js +0 -722
- package/dist/fileUploader.js.map +0 -1
- package/dist/fileUploader.mjs +0 -16
- /package/dist/{chunk-V26V2S3W.mjs.map → chunk-3O3N6X6D.mjs.map} +0 -0
- /package/dist/{chunk-UGMRJMFZ.mjs.map → chunk-BO5CU4ZM.mjs.map} +0 -0
- /package/dist/{chunk-R5MKQN6D.mjs.map → chunk-FBLSJQWK.mjs.map} +0 -0
- /package/dist/{chunk-JWANK42G.mjs.map → chunk-FUZ2JNTZ.mjs.map} +0 -0
- /package/dist/{chunk-DELCADNF.mjs.map → chunk-ODVKRIVN.mjs.map} +0 -0
- /package/dist/{chunk-OGNGPI3M.mjs.map → chunk-PL55YKT4.mjs.map} +0 -0
- /package/dist/{chunk-TDRA5EZI.mjs.map → chunk-PUREEN2J.mjs.map} +0 -0
- /package/dist/{chunk-SRWPHN2N.mjs.map → chunk-S64IYJ6Y.mjs.map} +0 -0
- /package/dist/{chunk-NJYNJLT7.mjs.map → chunk-SWFB3A3G.mjs.map} +0 -0
- /package/dist/{chunk-2ZZJTBTE.mjs.map → chunk-WJZ3IYET.mjs.map} +0 -0
- /package/dist/{displayFile.mjs.map → confirm.mjs.map} +0 -0
- /package/dist/{fileUploader.mjs.map → dialog.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/elemental/Autocomplete/src/GitHubPicker/PopperMenu.tsx","../src/components/elemental/Autocomplete/src/GitHubPicker/popperTheme.ts"],"sourcesContent":["\"use client\"\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport { Popper } from '@/ele/Overlay'\nimport type { PopperProps } from '@mui/material/Popper'\nimport Autocomplete, { autocompleteClasses, AutocompletePopperSlotPropsOverrides } from '@mui/material/Autocomplete'\nimport InputBase from '@mui/material/InputBase'\nimport { Box } from '@/ele/Box'\nimport { Typography } from '@/ele/Typography'\nimport { Button } from '@/ele/Button'\n\nimport { SearchIcon, DisabledSelectionIcon, AddIcon } from '@/icons/MuiIcon'\n\nimport OptionRenderer from './OptionRenderer'\nimport { PickerPopper, PickerOptionLi, PickerPaper, pickerSearchSx, pickerGroupLabelSx } from './popperTheme'\nimport { \n\tOptionClass, type MinimalOption, \n\tMY_LOCAL_DISABLE_GROUP, DISABLED_GROUP,\n} from './_utils'\nimport {\n\tuseLocalSelectedContext,\n\tuseLocalSelectedSelector,\n} from './states'\nimport type { StateType } from './states'\n\n/**\n * A popper menu for the GitHubPicker only\n */\nexport default function MyPopper({\n\tid,\n\tlistboxId,\n\tanchorEl,\n\tallMinimalOptions,\n\toptions,\n\tcloseHandler,\n\ttitle,\n\tplacement = 'bottom-start',\n\tmultiple = true,\n\tdisabled = false,\n\tuseGroup,\n\tisAddOptionEnabled,\n\taddOptionHandler,\n\tisPopperFreezed,\n}: {\n\tid: string;\n\tlistboxId: string;\n\tanchorEl: HTMLElement | null;\n\tallMinimalOptions: MinimalOption[];\n\toptions: OptionClass[];\n\tcloseHandler?: (newState?: StateType) => void;\n\ttitle?: React.ReactNode;\n\tplacement?: React.ComponentProps<typeof Popper>['placement'];\n\tmultiple?: React.ComponentProps<typeof Autocomplete>['multiple'];\n\tdisabled?: React.ComponentProps<typeof Autocomplete>['disabled'];\n\tuseGroup?: boolean;\n\tisAddOptionEnabled?: boolean;\n\taddOptionHandler?: () => void;\n\tisPopperFreezed?: boolean;\n}) {\n\tconst minimal = useLocalSelectedSelector()(\"minimal\")\n\tconst { select } = useLocalSelectedContext()\n\tconst [query, setQuery] = useState('')\n\tconst open = Boolean(anchorEl)\n\tconst listboxRef = useRef<HTMLUListElement | null>(null)\n\tconst pinnedScrollTop = useRef<number | null>(null)\n\n\tuseEffect(() => {\n\t\tif (open) setQuery('')\n\t}, [open])\n\n\tuseLayoutEffect(() => {\n\t\tif (!open) {\n\t\t\tpinnedScrollTop.current = null\n\t\t\treturn\n\t\t}\n\t\tconst list = listboxRef.current\n\t\tconst top = pinnedScrollTop.current\n\t\tif (list == null || top == null) return\n\t\tlist.scrollTop = top\n\t\tconst id = window.requestAnimationFrame(() => {\n\t\t\tif (listboxRef.current) listboxRef.current.scrollTop = top\n\t\t\tpinnedScrollTop.current = null\n\t\t})\n\t\treturn () => window.cancelAnimationFrame(id)\n\t}, [open, minimal])\n\n\tuseEffect(() => {\n\t\tif (!open) return\n\t\tconst id = window.setTimeout(() => {\n\t\t\tif (listboxRef.current) listboxRef.current.scrollTop = 0\n\t\t}, 30)\n\t\treturn () => window.clearTimeout(id)\n\t}, [open])\n\n\t// handle change for autocomplete -> local change\n\tconst handleChange:React.ComponentProps<typeof Autocomplete>[\"onChange\"] = (event, newValue, reason) => {\n\t\tif(\n\t\t\tevent.type === 'keydown' &&\n\t\t\treason === 'removeOption'\n\t\t) {\n\t\t\t// avoid the default behavior\n\t\t\treturn\n\t\t}\n\n\t\t\tif (listboxRef.current) {\n\t\t\t\tpinnedScrollTop.current = listboxRef.current.scrollTop\n\t\t\t}\n\n\t\t\tif (!multiple && (newValue == null || newValue === '')) {\n\t\t\t\tconst cleared = select(null)\n\t\t\t\tif (!isPopperFreezed) closeHandler?.(cleared)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst currentId = !multiple && minimal && !Array.isArray(minimal) ? minimal.id : null\n\t\t\tconst nextOption = Array.isArray(newValue) ? newValue[0] : newValue\n\t\t\tif (!multiple && currentId && nextOption && nextOption.id === currentId) {\n\t\t\t\tconst cleared = select(null)\n\t\t\t\tif (!isPopperFreezed) closeHandler?.(cleared)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// update the local state and get the new state synchronously\n\t\t\tconst newState = select(newValue as (MinimalOption|MinimalOption[]))\n\t\t\t// close the popper if not multiple and pass the updated state\n\t\t\tif(!multiple && !isPopperFreezed){\n\t\t\t\tcloseHandler?.(newState)\n\t\t\t}\n\t}\n\n\tconst popperId = open ? id : undefined\n\tconst popperWidth = Math.max(anchorEl?.offsetWidth ?? 320, 320)\n\n\treturn (\n\t\t<PickerPopper\n\t\t\tid={popperId}\n\t\t\topen={open}\n\t\t\tanchorEl={anchorEl}\n\t\t\tdisablePortal\n\t\t\tplacement={placement}\n\t\t\tstyle={{ '--w': `${popperWidth}px` } as React.CSSProperties}\n\t\t\tmodifiers={[\n\t\t\t\t{ name: 'offset', options: { offset: [0, 8] } },\n\t\t\t\t{ name: 'preventOverflow', options: { padding: 8 } },\n\t\t\t]}\n\t\t>\n\t\t\t\t<PickerPaper elevation={0} variant=\"outlined\">\n\t\t\t\t{title ? (\n\t\t\t\t\t<Box sx={{ px: 1.75, pt: 1.5, pb: 0.5 }}>\n\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tfontSize: '0.78rem',\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t\tletterSpacing: '0.02em',\n\t\t\t\t\t\t\t\tcolor: 'var(--picker-text-secondary)',\n\t\t\t\t\t\t\t\tm: 0,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t) : null}\n <Autocomplete\n open={open}\n disabled={disabled}\n multiple={multiple}\n\t\t\t\t\tonClose={(_event, reason) => {\n\t\t\t\t\t\tif (reason === 'escape' && !isPopperFreezed) {\n\t\t\t\t\t\t\tcloseHandler?.()\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n value={multiple\n ? (Array.isArray(minimal) ? minimal : [])\n : (minimal && !Array.isArray(minimal) ? minimal : null)\n }\n inputValue={query}\n onInputChange={(_, value, reason) => {\n if (reason === 'reset') return\n setQuery(value)\n }}\n onChange={handleChange}\n disableCloseOnSelect={Boolean(multiple)}\n selectOnFocus={false}\n clearOnBlur={false}\n slots={{\n popper: PopperComponent,\n paper: ListSurface,\n }}\n slotProps={{\n listbox:{\n id: listboxId,\n sx:{\n\t\t\t\t\t\t\t\tmaxHeight: 320,\n\t\t\t\t\t\t\t\tpy: 0.5,\n\t\t\t\t\t\t\t\toverflowX: 'hidden',\n\t\t\t\t\t\t\t\toverflowAnchor: 'none',\n\t\t\t\t\t\t\t},\n ref: listboxRef,\n },\n }}\n noOptionsText=\"No matches\"\n\n renderOption={(liProps, option, { selected }, ownerState )=>{\n const { key, onClick, ...optionProps } = liProps\n // find the option with full data from the minimal option\n // including the icon\n const fullOption = options.find(o => o.id === option.id)\n\n return (\n <PickerOptionLi\n key={key}\n {...optionProps}\n onClick={(event) => {\n if (!multiple && selected) {\n event.preventDefault()\n event.stopPropagation()\n if (listboxRef.current) {\n pinnedScrollTop.current = listboxRef.current.scrollTop\n }\n const cleared = select(null)\n if (!isPopperFreezed) closeHandler?.(cleared)\n return\n }\n onClick?.(event)\n }}\n >\n <OptionRenderer \n disableBR\n option={fullOption??null}\n selected={selected}\n disabled={ownerState.disabled || option.disabled}\n slotProps={{\n DM:{\n isShowEndIcon:true,\n isShowDescription:true,\n },\n }}\n />\n </PickerOptionLi>)\n }}\n options={allMinimalOptions}\n \n groupBy={useGroup?\n ((option:MinimalOption) => option.disabled? MY_LOCAL_DISABLE_GROUP : option.group)\n :undefined\n }\n getOptionLabel={(option:MinimalOption) => option.label} // display the label\n getOptionKey={(option:MinimalOption) => option.id}\n getOptionDisabled={(option:MinimalOption) => option.disabled??false}\n isOptionEqualToValue={(option:MinimalOption, value) => option.id === value?.id}\n filterOptions={(options, { inputValue }) => { // filter the options\n return options.filter(option => {\n // use the filter key to search\n const filterKey = option.filterKey.toLowerCase()\n // split the input value by space and check if all the words are in the filter key\n const inputVal = inputValue.toLowerCase().split(\" \")\n // if all the words are in the filter key, return true\n return inputVal.every(val => filterKey.includes(val))\n })\n }}\n\n renderInput={(params) => {\n return(\n <Box ref={params.InputProps.ref} sx={pickerSearchSx}>\n\t\t\t\t\t\t\t<SearchIcon sx={{ fontSize: 18, color: 'var(--picker-text-secondary)', flexShrink: 0 }} />\n <InputBase\n\t\t\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\t\t\tplaceholder=\"Search\"\n\t\t\t\t\t\t\t\tvalue={query}\n\t\t\t\t\t\t\t\tonChange={(event) => setQuery(event.target.value)}\n\t\t\t\t\t\t\t\tinputProps={{\n\t\t\t\t\t\t\t\t\t...params.inputProps,\n\t\t\t\t\t\t\t\t\tvalue: query,\n\t\t\t\t\t\t\t\t\tonBlur:(e: React.FocusEvent<HTMLInputElement>)=>{\n\t\t\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n />\n </Box>\n )}} \n \n renderGroup={(p)=>{\n\n return <li key={p.key}>\n <Box className={`${autocompleteClasses.groupLabel}`} sx={pickerGroupLabelSx}>\n\t\t\t\t\t\t\t\t{p.group === MY_LOCAL_DISABLE_GROUP?\n <Box component=\"span\" sx={{display:\"flex\",alignItems:\"center\",gap:1}}><DisabledSelectionIcon sx={{ fontSize: 14 }} />{DISABLED_GROUP}</Box>\n :p.group}\n </Box>\n\n <Box component=\"ul\" sx={{padding:0, margin: 0}} className={`${autocompleteClasses.groupUl}`}>{p.children}</Box>\n </li>\n }}\n />\n\t\t\t\t{isAddOptionEnabled ? (\n\t\t\t\t\t<Box\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tborderTop: '1px solid var(--picker-divider)',\n\t\t\t\t\t\t\tpx: 0.75,\n\t\t\t\t\t\t\tpy: 0.5,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"text\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tstartIcon={<AddIcon />}\n\t\t\t\t\t\t\tonClick={addOptionHandler}\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\tjustifyContent: 'flex-start',\n\t\t\t\t\t\t\t\tpx: 1,\n\t\t\t\t\t\t\t\tcolor: 'var(--picker-text-secondary)',\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t\tletterSpacing: '0.02em',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tNew option\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Box>\n\t\t\t\t) : null}\n </PickerPaper>\n\t\t</PickerPopper>\n\t)\n}\n\n/**\n * A popper component for the Autocomplete\n * \n * must be a separate component to avoid re-rendering the popper\n */\nfunction ListSurface({\n children,\n ...other\n}: {\n children?: React.ReactNode\n} & React.HTMLAttributes<HTMLDivElement>) {\n return (\n <Box {...other} sx={{ boxShadow: 'none', backgroundColor: 'transparent' }}>\n {children}\n </Box>\n )\n}\n\nfunction PopperComponent(props: PopperProps & AutocompletePopperSlotPropsOverrides) {\n const { children, sx, ...other } = props;\n\n // Render a simple container instead of a Popper so the consumer can\n // wrap the Autocomplete in an external Popper. If `sx` is a function we\n // don't evaluate it here (keep behavior simple and type-safe).\n const evaluatedSx = typeof sx === 'function' ? {} : sx;\n const content = typeof children === 'function' ? (children as () => React.ReactNode)() : children;\n\n return (\n <Box {...other} sx={evaluatedSx}>\n {content}\n </Box>\n );\n}\n","import type { SxProps, Theme } from '@mui/material/styles'\nimport { styled } from '@mui/material/styles'\nimport { Popper } from '@/ele/Overlay'\nimport { autocompleteClasses } from '@mui/material/Autocomplete'\nimport { Paper } from '@/ele/Paper'\nimport { gitHubPickerRootStyle } from './theme'\n\nexport const PickerPopper = styled(Popper)(({ theme }) => ({\n\t...gitHubPickerRootStyle,\n\twidth: 'var(--w)',\n\tminWidth: 280,\n\tzIndex: theme.zIndex.modal,\n\tfontSize: 13,\n\toverflow: 'hidden',\n\tborderRadius: 14,\n\tborder: '1px solid var(--picker-border)',\n\tbackgroundColor: 'var(--mui-palette-background-paper)',\n\tbackgroundImage: 'none',\n\tboxShadow: 'var(--picker-shadow)',\n\tbackdropFilter: 'none',\n\tWebkitBackdropFilter: 'none',\n\t'--picker-blur': '0px',\n\t'--picker-glass': 'none',\n}))\n\nexport const PickerOptionLi = styled('li')(() => ({\n\t...gitHubPickerRootStyle,\n\t[`.${autocompleteClasses.listbox} &.${autocompleteClasses.option}`]: {\n\t\tpadding: 0,\n\t\tmargin: '2px 6px',\n\t\tborderRadius: 10,\n\t\tminHeight: 0,\n\t},\n\t[`\n\t\t&.${autocompleteClasses.option},\n\t\t&.${autocompleteClasses.option}[aria-selected=\"true\"],\n\t`]: {\n\t\tbackgroundColor: 'transparent',\n\t},\n\t[`\n\t\t&.${autocompleteClasses.option}:hover,\n\t\t&.${autocompleteClasses.option}[aria-selected=\"true\"]:hover,\n\t`]: {\n\t\tbackgroundColor: 'var(--picker-hover-bg)',\n\t},\n\t[`\n\t\t&.${autocompleteClasses.option}.${autocompleteClasses.focused},\n\t\t&.${autocompleteClasses.option}.${autocompleteClasses.focused}[aria-selected=\"true\"]\n\t`]: {\n\t\tbackgroundColor: 'var(--picker-focus-soft)',\n\t},\n\t[`&.${autocompleteClasses.option}[aria-selected=\"true\"]`]: {\n\t\tbackgroundColor: 'var(--picker-focus-soft)',\n\t\tboxShadow: 'inset 0 1px 0 var(--picker-highlight)',\n\t},\n}))\n\nexport const PickerPaper = styled(Paper)({\n\t...gitHubPickerRootStyle,\n\tborderRadius: 14,\n\tborder: 'none',\n\t'--paper-bg': 'transparent',\n\tbackgroundColor: 'transparent',\n\tbackgroundImage: 'none',\n\tboxShadow: 'none',\n\t'&.MuiPaper-root': {\n\t\t'--paper-bg': 'transparent',\n\t\tbackgroundColor: 'transparent',\n\t\tbackgroundImage: 'none',\n\t\tboxShadow: 'none',\n\t\tborder: 'none',\n\t},\n})\n\nexport const pickerSearchSx = {\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: 1,\n\tmx: 1,\n\tmt: 0.5,\n\tmb: 0.75,\n\tpx: 1.25,\n\tpy: 0.5,\n\tborderRadius: 2,\n\tbackgroundColor: 'var(--picker-search-bg)',\n\tborder: '1px solid var(--picker-search-border)',\n\tboxShadow: 'var(--picker-search-shadow)',\n\t'& .MuiInputBase-root': {\n\t\tfontSize: '0.875rem',\n\t\tcolor: 'var(--picker-text)',\n\t},\n\t'& .MuiInputBase-input': {\n\t\tpy: 0.6,\n\t\t'&::placeholder': {\n\t\t\tcolor: 'var(--picker-text-secondary)',\n\t\t\topacity: 0.8,\n\t\t},\n\t},\n} as const satisfies SxProps<Theme>\n\nexport const pickerGroupLabelSx = {\n\tpx: 1.75,\n\tpt: 1.25,\n\tpb: 0.5,\n\tfontSize: '0.66rem',\n\tfontWeight: 700,\n\tletterSpacing: '0.08em',\n\ttextTransform: 'uppercase',\n\tline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gBAAgB,OAA2D;AAClF,QAAM,EAAE,UAAU,IAAI,GAAG,MAAM,IAAI;AAKnC,QAAM,cAAc,OAAO,OAAO,aAAa,CAAC,IAAI;AACpD,QAAM,UAAU,OAAO,aAAa,aAAc,SAAmC,IAAI;AAEzF,SACE,oBAACA,UAAA,EAAK,GAAG,OAAO,IAAI,aACjB,mBACH;AAEJ;","names":["autocompleteClasses","default","id","default","options","autocompleteClasses"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/elemental/Autocomplete/src/GitHubPicker/PopperMenu.tsx","../src/components/elemental/Autocomplete/src/GitHubPicker/popperTheme.ts"],"sourcesContent":["\"use client\"\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport { Popper } from '@/ele/Overlay'\nimport type { PopperProps } from '@mui/material/Popper'\nimport Autocomplete, { autocompleteClasses, AutocompletePopperSlotPropsOverrides } from '@mui/material/Autocomplete'\nimport InputBase from '@mui/material/InputBase'\nimport { Box } from '@/ele/Box'\nimport { Typography } from '@/ele/Typography'\nimport { Button } from '@/ele/Button'\n\nimport { SearchIcon, DisabledSelectionIcon, AddIcon } from '@/icons/MuiIcon'\n\nimport OptionRenderer from './OptionRenderer'\nimport { PickerPopper, PickerOptionLi, PickerPaper, pickerSearchSx, pickerGroupLabelSx } from './popperTheme'\nimport { \n\tOptionClass, type MinimalOption, \n\tMY_LOCAL_DISABLE_GROUP, DISABLED_GROUP,\n} from './_utils'\nimport {\n\tuseLocalSelectedContext,\n\tuseLocalSelectedSelector,\n} from './states'\nimport type { StateType } from './states'\n\n/**\n * A popper menu for the GitHubPicker only\n */\nexport default function MyPopper({\n\tid,\n\tlistboxId,\n\tanchorEl,\n\tallMinimalOptions,\n\toptions,\n\tcloseHandler,\n\ttitle,\n\tplacement = 'bottom-start',\n\tmultiple = true,\n\tdisabled = false,\n\tuseGroup,\n\tisAddOptionEnabled,\n\taddOptionHandler,\n\tisPopperFreezed,\n}: {\n\tid: string;\n\tlistboxId: string;\n\tanchorEl: HTMLElement | null;\n\tallMinimalOptions: MinimalOption[];\n\toptions: OptionClass[];\n\tcloseHandler?: (newState?: StateType) => void;\n\ttitle?: React.ReactNode;\n\tplacement?: React.ComponentProps<typeof Popper>['placement'];\n\tmultiple?: React.ComponentProps<typeof Autocomplete>['multiple'];\n\tdisabled?: React.ComponentProps<typeof Autocomplete>['disabled'];\n\tuseGroup?: boolean;\n\tisAddOptionEnabled?: boolean;\n\taddOptionHandler?: () => void;\n\tisPopperFreezed?: boolean;\n}) {\n\tconst minimal = useLocalSelectedSelector()(\"minimal\")\n\tconst { select } = useLocalSelectedContext()\n\tconst [query, setQuery] = useState('')\n\tconst open = Boolean(anchorEl)\n\tconst listboxRef = useRef<HTMLUListElement | null>(null)\n\tconst pinnedScrollTop = useRef<number | null>(null)\n\n\tuseEffect(() => {\n\t\tif (open) setQuery('')\n\t}, [open])\n\n\tuseLayoutEffect(() => {\n\t\tif (!open) {\n\t\t\tpinnedScrollTop.current = null\n\t\t\treturn\n\t\t}\n\t\tconst list = listboxRef.current\n\t\tconst top = pinnedScrollTop.current\n\t\tif (list == null || top == null) return\n\t\tlist.scrollTop = top\n\t\tconst id = window.requestAnimationFrame(() => {\n\t\t\tif (listboxRef.current) listboxRef.current.scrollTop = top\n\t\t\tpinnedScrollTop.current = null\n\t\t})\n\t\treturn () => window.cancelAnimationFrame(id)\n\t}, [open, minimal])\n\n\tuseEffect(() => {\n\t\tif (!open) return\n\t\tconst id = window.setTimeout(() => {\n\t\t\tif (listboxRef.current) listboxRef.current.scrollTop = 0\n\t\t}, 30)\n\t\treturn () => window.clearTimeout(id)\n\t}, [open])\n\n\t// handle change for autocomplete -> local change\n\tconst handleChange:React.ComponentProps<typeof Autocomplete>[\"onChange\"] = (event, newValue, reason) => {\n\t\tif(\n\t\t\tevent.type === 'keydown' &&\n\t\t\treason === 'removeOption'\n\t\t) {\n\t\t\t// avoid the default behavior\n\t\t\treturn\n\t\t}\n\n\t\t\tif (listboxRef.current) {\n\t\t\t\tpinnedScrollTop.current = listboxRef.current.scrollTop\n\t\t\t}\n\n\t\t\tif (!multiple && (newValue == null || newValue === '')) {\n\t\t\t\tconst cleared = select(null)\n\t\t\t\tif (!isPopperFreezed) closeHandler?.(cleared)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst currentId = !multiple && minimal && !Array.isArray(minimal) ? minimal.id : null\n\t\t\tconst nextOption = Array.isArray(newValue) ? newValue[0] : newValue\n\t\t\tif (!multiple && currentId && nextOption && nextOption.id === currentId) {\n\t\t\t\tconst cleared = select(null)\n\t\t\t\tif (!isPopperFreezed) closeHandler?.(cleared)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// update the local state and get the new state synchronously\n\t\t\tconst newState = select(newValue as (MinimalOption|MinimalOption[]))\n\t\t\t// close the popper if not multiple and pass the updated state\n\t\t\tif(!multiple && !isPopperFreezed){\n\t\t\t\tcloseHandler?.(newState)\n\t\t\t}\n\t}\n\n\tconst popperId = open ? id : undefined\n\tconst popperWidth = Math.max(anchorEl?.offsetWidth ?? 320, 320)\n\n\treturn (\n\t\t<PickerPopper\n\t\t\tid={popperId}\n\t\t\topen={open}\n\t\t\tanchorEl={anchorEl}\n\t\t\tdisablePortal\n\t\t\tplacement={placement}\n\t\t\tstyle={{ '--w': `${popperWidth}px` } as React.CSSProperties}\n\t\t\tmodifiers={[\n\t\t\t\t{ name: 'offset', options: { offset: [0, 8] } },\n\t\t\t\t{ name: 'preventOverflow', options: { padding: 8 } },\n\t\t\t]}\n\t\t>\n\t\t\t\t<PickerPaper elevation={0} variant=\"outlined\">\n\t\t\t\t{title ? (\n\t\t\t\t\t<Box sx={{ px: 1.75, pt: 1.5, pb: 0.5 }}>\n\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\tfontSize: '0.78rem',\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t\tletterSpacing: '0.02em',\n\t\t\t\t\t\t\t\tcolor: 'var(--picker-text-secondary)',\n\t\t\t\t\t\t\t\tm: 0,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t) : null}\n <Autocomplete\n open={open}\n disabled={disabled}\n multiple={multiple}\n\t\t\t\t\tonClose={(_event, reason) => {\n\t\t\t\t\t\tif (reason === 'escape' && !isPopperFreezed) {\n\t\t\t\t\t\t\tcloseHandler?.()\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n value={multiple\n ? (Array.isArray(minimal) ? minimal : [])\n : (minimal && !Array.isArray(minimal) ? minimal : null)\n }\n inputValue={query}\n onInputChange={(_, value, reason) => {\n if (reason === 'reset') return\n setQuery(value)\n }}\n onChange={handleChange}\n disableCloseOnSelect={Boolean(multiple)}\n selectOnFocus={false}\n clearOnBlur={false}\n slots={{\n popper: PopperComponent,\n paper: ListSurface,\n }}\n slotProps={{\n listbox:{\n id: listboxId,\n sx:{\n\t\t\t\t\t\t\t\tmaxHeight: 320,\n\t\t\t\t\t\t\t\tpy: 0.5,\n\t\t\t\t\t\t\t\toverflowX: 'hidden',\n\t\t\t\t\t\t\t\toverflowAnchor: 'none',\n\t\t\t\t\t\t\t},\n ref: listboxRef,\n },\n }}\n noOptionsText=\"No matches\"\n\n renderOption={(liProps, option, { selected }, ownerState )=>{\n const { key, onClick, ...optionProps } = liProps\n // find the option with full data from the minimal option\n // including the icon\n const fullOption = options.find(o => o.id === option.id)\n\n return (\n <PickerOptionLi\n key={key}\n {...optionProps}\n onClick={(event) => {\n if (!multiple && selected) {\n event.preventDefault()\n event.stopPropagation()\n if (listboxRef.current) {\n pinnedScrollTop.current = listboxRef.current.scrollTop\n }\n const cleared = select(null)\n if (!isPopperFreezed) closeHandler?.(cleared)\n return\n }\n onClick?.(event)\n }}\n >\n <OptionRenderer \n disableBR\n option={fullOption??null}\n selected={selected}\n disabled={ownerState.disabled || option.disabled}\n slotProps={{\n DM:{\n isShowEndIcon:true,\n isShowDescription:true,\n },\n }}\n />\n </PickerOptionLi>)\n }}\n options={allMinimalOptions}\n \n groupBy={useGroup?\n ((option:MinimalOption) => option.disabled? MY_LOCAL_DISABLE_GROUP : option.group)\n :undefined\n }\n getOptionLabel={(option:MinimalOption) => option.label} // display the label\n getOptionKey={(option:MinimalOption) => option.id}\n getOptionDisabled={(option:MinimalOption) => option.disabled??false}\n isOptionEqualToValue={(option:MinimalOption, value) => option.id === value?.id}\n filterOptions={(options, { inputValue }) => { // filter the options\n return options.filter(option => {\n // use the filter key to search\n const filterKey = option.filterKey.toLowerCase()\n // split the input value by space and check if all the words are in the filter key\n const inputVal = inputValue.toLowerCase().split(\" \")\n // if all the words are in the filter key, return true\n return inputVal.every(val => filterKey.includes(val))\n })\n }}\n\n renderInput={(params) => {\n return(\n <Box ref={params.InputProps.ref} sx={pickerSearchSx}>\n\t\t\t\t\t\t\t<SearchIcon sx={{ fontSize: 18, color: 'var(--picker-text-secondary)', flexShrink: 0 }} />\n <InputBase\n\t\t\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\t\t\tplaceholder=\"Search\"\n\t\t\t\t\t\t\t\tvalue={query}\n\t\t\t\t\t\t\t\tonChange={(event) => setQuery(event.target.value)}\n\t\t\t\t\t\t\t\tinputProps={{\n\t\t\t\t\t\t\t\t\t...params.inputProps,\n\t\t\t\t\t\t\t\t\tvalue: query,\n\t\t\t\t\t\t\t\t\tonBlur:(e: React.FocusEvent<HTMLInputElement>)=>{\n\t\t\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n />\n </Box>\n )}} \n \n renderGroup={(p)=>{\n\n return <li key={p.key}>\n <Box className={`${autocompleteClasses.groupLabel}`} sx={pickerGroupLabelSx}>\n\t\t\t\t\t\t\t\t{p.group === MY_LOCAL_DISABLE_GROUP?\n <Box component=\"span\" sx={{display:\"flex\",alignItems:\"center\",gap:1}}><DisabledSelectionIcon sx={{ fontSize: 14 }} />{DISABLED_GROUP}</Box>\n :p.group}\n </Box>\n\n <Box component=\"ul\" sx={{padding:0, margin: 0}} className={`${autocompleteClasses.groupUl}`}>{p.children}</Box>\n </li>\n }}\n />\n\t\t\t\t{isAddOptionEnabled ? (\n\t\t\t\t\t<Box\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tborderTop: '1px solid var(--picker-divider)',\n\t\t\t\t\t\t\tpx: 0.75,\n\t\t\t\t\t\t\tpy: 0.5,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"text\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tstartIcon={<AddIcon />}\n\t\t\t\t\t\t\tonClick={addOptionHandler}\n\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\tjustifyContent: 'flex-start',\n\t\t\t\t\t\t\t\tpx: 1,\n\t\t\t\t\t\t\t\tcolor: 'var(--picker-text-secondary)',\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t\tletterSpacing: '0.02em',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tNew option\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Box>\n\t\t\t\t) : null}\n </PickerPaper>\n\t\t</PickerPopper>\n\t)\n}\n\n/**\n * A popper component for the Autocomplete\n * \n * must be a separate component to avoid re-rendering the popper\n */\nfunction ListSurface({\n children,\n ...other\n}: {\n children?: React.ReactNode\n} & React.HTMLAttributes<HTMLDivElement>) {\n return (\n <Box {...other} sx={{ boxShadow: 'none', backgroundColor: 'transparent' }}>\n {children}\n </Box>\n )\n}\n\nfunction PopperComponent(props: PopperProps & AutocompletePopperSlotPropsOverrides) {\n const { children, sx, ...other } = props;\n\n // Render a simple container instead of a Popper so the consumer can\n // wrap the Autocomplete in an external Popper. If `sx` is a function we\n // don't evaluate it here (keep behavior simple and type-safe).\n const evaluatedSx = typeof sx === 'function' ? {} : sx;\n const content = typeof children === 'function' ? (children as () => React.ReactNode)() : children;\n\n return (\n <Box {...other} sx={evaluatedSx}>\n {content}\n </Box>\n );\n}\n","import type { SxProps, Theme } from '@mui/material/styles'\nimport { styled } from '@mui/material/styles'\nimport { Popper } from '@/ele/Overlay'\nimport { autocompleteClasses } from '@mui/material/Autocomplete'\nimport { Paper } from '@/ele/Paper'\nimport { gitHubPickerRootStyle } from './theme'\n\nexport const PickerPopper = styled(Popper)(({ theme }) => ({\n\t...gitHubPickerRootStyle,\n\twidth: 'var(--w)',\n\tminWidth: 280,\n\tzIndex: theme.zIndex.modal,\n\tfontSize: 13,\n\toverflow: 'hidden',\n\tborderRadius: 14,\n\tborder: '1px solid var(--picker-border)',\n\tbackgroundColor: 'var(--mui-palette-background-paper)',\n\tbackgroundImage: 'none',\n\tboxShadow: 'var(--picker-shadow)',\n\tbackdropFilter: 'none',\n\tWebkitBackdropFilter: 'none',\n\t'--picker-blur': '0px',\n\t'--picker-glass': 'none',\n}))\n\nexport const PickerOptionLi = styled('li')(() => ({\n\t...gitHubPickerRootStyle,\n\t[`.${autocompleteClasses.listbox} &.${autocompleteClasses.option}`]: {\n\t\tpadding: 0,\n\t\tmargin: '2px 6px',\n\t\tborderRadius: 10,\n\t\tminHeight: 0,\n\t},\n\t[`\n\t\t&.${autocompleteClasses.option},\n\t\t&.${autocompleteClasses.option}[aria-selected=\"true\"],\n\t`]: {\n\t\tbackgroundColor: 'transparent',\n\t},\n\t[`\n\t\t&.${autocompleteClasses.option}:hover,\n\t\t&.${autocompleteClasses.option}[aria-selected=\"true\"]:hover,\n\t`]: {\n\t\tbackgroundColor: 'var(--picker-hover-bg)',\n\t},\n\t[`\n\t\t&.${autocompleteClasses.option}.${autocompleteClasses.focused},\n\t\t&.${autocompleteClasses.option}.${autocompleteClasses.focused}[aria-selected=\"true\"]\n\t`]: {\n\t\tbackgroundColor: 'var(--picker-focus-soft)',\n\t},\n\t[`&.${autocompleteClasses.option}[aria-selected=\"true\"]`]: {\n\t\tbackgroundColor: 'var(--picker-focus-soft)',\n\t\tboxShadow: 'inset 0 1px 0 var(--picker-highlight)',\n\t},\n}))\n\nexport const PickerPaper = styled(Paper)({\n\t...gitHubPickerRootStyle,\n\tborderRadius: 14,\n\tborder: 'none',\n\t'--paper-bg': 'transparent',\n\tbackgroundColor: 'transparent',\n\tbackgroundImage: 'none',\n\tboxShadow: 'none',\n\t'&.MuiPaper-root': {\n\t\t'--paper-bg': 'transparent',\n\t\tbackgroundColor: 'transparent',\n\t\tbackgroundImage: 'none',\n\t\tboxShadow: 'none',\n\t\tborder: 'none',\n\t},\n})\n\nexport const pickerSearchSx = {\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: 1,\n\tmx: 1,\n\tmt: 0.5,\n\tmb: 0.75,\n\tpx: 1.25,\n\tpy: 0.5,\n\tborderRadius: 2,\n\tbackgroundColor: 'var(--picker-search-bg)',\n\tborder: '1px solid var(--picker-search-border)',\n\tboxShadow: 'var(--picker-search-shadow)',\n\t'& .MuiInputBase-root': {\n\t\tfontSize: '0.875rem',\n\t\tcolor: 'var(--picker-text)',\n\t},\n\t'& .MuiInputBase-input': {\n\t\tpy: 0.6,\n\t\t'&::placeholder': {\n\t\t\tcolor: 'var(--picker-text-secondary)',\n\t\t\topacity: 0.8,\n\t\t},\n\t},\n} as const satisfies SxProps<Theme>\n\nexport const pickerGroupLabelSx = {\n\tposition: 'sticky',\n\t// Align with Autocomplete: quiet solid fill, Paper top radius, no backdrop-filter.\n\ttop: -8,\n\tzIndex: 2,\n\tpx: 1.75,\n\tpt: 1.25,\n\tpb: 0.5,\n\tfontSize: '0.66rem',\n\tfontWeight: 700,\n\tletterSpacing: '0.08em',\n\ttextTransform: 'uppercase',\n\tlineHeight: 1.4,\n\tcolor: 'var(--picker-text-secondary)',\n\t// Quieter than opaque paper — closer to glass paper; still covers scroll. No blur.\n\tbackground: 'color-mix(in lab, var(--mui-palette-background-paper), var(--picker-paper-bg) 36%)',\n\tbackgroundColor: 'color-mix(in lab, var(--mui-palette-background-paper), var(--picker-paper-bg) 36%)',\n\tbackdropFilter: 'none',\n\tWebkitBackdropFilter: 'none',\n\tborderTopLeftRadius: 14,\n\tborderTopRightRadius: 14,\n\tborderBottom: '1px solid color-mix(in lab, var(--picker-border), transparent 28%)',\n\tboxShadow: 'none',\n} as const satisfies SxProps<Theme>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAgB,WAAW,iBAAiB,QAAQ,gBAAgB;AAGpE,OAAO,gBAAgB,uBAAAA,4BAAiE;AACxF,OAAO,eAAe;;;ACJtB,SAAS,cAAc;AAEvB,SAAS,2BAA2B;AAI7B,IAAM,eAAe,OAAOC,QAAM,EAAE,CAAC,EAAE,MAAM,OAAO;AAAA,EAC1D,GAAG;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,MAAM,OAAO;AAAA,EACrB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,kBAAkB;AACnB,EAAE;AAEK,IAAM,iBAAiB,OAAO,IAAI,EAAE,OAAO;AAAA,EACjD,GAAG;AAAA,EACH,CAAC,IAAI,oBAAoB,OAAO,MAAM,oBAAoB,MAAM,EAAE,GAAG;AAAA,IACpE,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,WAAW;AAAA,EACZ;AAAA,EACA,CAAC;AAAA,MACI,oBAAoB,MAAM;AAAA,MAC1B,oBAAoB,MAAM;AAAA,EAC9B,GAAG;AAAA,IACH,iBAAiB;AAAA,EAClB;AAAA,EACA,CAAC;AA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;AAAA,gBACR,MAAK;AAAA,gBACL,WAAW,oBAACA,UAAA,EAAQ;AAAA,gBACpB,SAAS;AAAA,gBACT,IAAI;AAAA,kBACH,OAAO;AAAA,kBACP,gBAAgB;AAAA,kBAChB,IAAI;AAAA,kBACJ,OAAO;AAAA,kBACP,YAAY;AAAA,kBACZ,eAAe;AAAA,gBAChB;AAAA,gBACA;AAAA;AAAA,YAED;AAAA;AAAA,QACD,IACG;AAAA,SACF;AAAA;AAAA,EACJ;AAEF;AAOA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAE0C;AACxC,SACE,oBAACA,UAAA,EAAK,GAAG,OAAO,IAAI,EAAE,WAAW,QAAQ,iBAAiB,cAAc,GACrE,UACH;AAEJ;AAEA,SAAS,gBAAgB,OAA2D;AAClF,QAAM,EAAE,UAAU,IAAI,GAAG,MAAM,IAAI;AAKnC,QAAM,cAAc,OAAO,OAAO,aAAa,CAAC,IAAI;AACpD,QAAM,UAAU,OAAO,aAAa,aAAc,SAAmC,IAAI;AAEzF,SACE,oBAACA,UAAA,EAAK,GAAG,OAAO,IAAI,aACjB,mBACH;AAEJ;","names":["autocompleteClasses","default","id","default","options","autocompleteClasses"]}
|
|
@@ -5,23 +5,24 @@ import {
|
|
|
5
5
|
Explanation_default,
|
|
6
6
|
getFieldExplanation,
|
|
7
7
|
mergeFieldSx
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FNSIQ2B7.mjs";
|
|
9
9
|
import {
|
|
10
10
|
TelPhoneInput
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-VYD3PDBB.mjs";
|
|
11
|
+
} from "./chunk-PL55YKT4.mjs";
|
|
13
12
|
import {
|
|
14
13
|
MuiFormLabel,
|
|
15
14
|
default as default3
|
|
16
15
|
} from "./chunk-T4X375IG.mjs";
|
|
16
|
+
import "./chunk-VYD3PDBB.mjs";
|
|
17
17
|
import "./chunk-MDAUF7IL.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-ZVFYOXDE.mjs";
|
|
19
|
+
import "./chunk-D4XPNSSI.mjs";
|
|
19
20
|
import "./chunk-4Q54P737.mjs";
|
|
20
21
|
import "./chunk-OP6LKXPA.mjs";
|
|
21
|
-
import "./chunk-ZVFYOXDE.mjs";
|
|
22
22
|
import {
|
|
23
23
|
default as default2
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-PNSJC6PC.mjs";
|
|
25
|
+
import "./chunk-AFLEG5ZC.mjs";
|
|
25
26
|
import "./chunk-FJ6ZGZIA.mjs";
|
|
26
27
|
|
|
27
28
|
// src/components/compound/UseForm/src/Fields/TelField.tsx
|
|
@@ -85,4 +86,4 @@ var TelField = ({ field }) => {
|
|
|
85
86
|
export {
|
|
86
87
|
TelField
|
|
87
88
|
};
|
|
88
|
-
//# sourceMappingURL=TelField-
|
|
89
|
+
//# sourceMappingURL=TelField-FRQT2UBJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/compound/UseForm/src/Fields/TelField.tsx"],"sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\nimport { Box } from '@/ele/Box';\nimport { FormControl, FormLabel } from '@/ele/Form';\nimport { FieldHelperText } from '../_utils/helperText';\nimport { FieldConfig, FormTypeMap, InferFormDataType } from '../_utils';\nimport Explanation from './Explanation';\nimport { FIELD_TYPEs } from '../_utils/constants';\nimport type { TelSlotProps } from '../_utils/slotProps';\nimport { TelPhoneInput } from '@/ele/Input/src/TelPhoneInput';\nimport { getFieldExplanation, mergeFieldSx } from '../_utils/helpers';\n\ninterface TelFieldProps<T extends FormTypeMap = FormTypeMap> {\n field: Extract<FieldConfig<T>, { type: typeof FIELD_TYPEs.tel }>;\n}\n\nexport const TelField = <T extends FormTypeMap = FormTypeMap>({ field }: TelFieldProps<T>) => {\n const { control, getValues } = useFormContext();\n const { name, label, required, disabled, sx, size, slotProps, errorMsg, defaultValue } = field;\n\n const telSlot = slotProps as TelSlotProps | undefined;\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultValue ?? ''}\n render={({ field: controllerField, fieldState: { error } }) => {\n const { onChange, value } = controllerField;\n const helperTextNode = <FieldHelperText error={error} errorMsg={errorMsg} helpers={[field.helperText]} />;\n\n return (\n <FormControl\n disabled={disabled}\n required={required}\n error={!!error}\n fullWidth\n size=\"small\"\n sx={mergeFieldSx(size, sx)}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start', mb: 0.5 }}>\n <FormLabel component=\"legend\" sx={{ mr: 1 }}>{label}</FormLabel>\n <Box sx={{ display: 'inline-flex' }}>\n <Explanation explanation={getFieldExplanation(field)} />\n </Box>\n </Box>\n\n <Box sx={{ py: 1, width: '100%' }}>\n <TelPhoneInput\n {...telSlot}\n value={value ?? ''}\n onChange={(v) => {\n const next = v ?? '';\n onChange(next);\n (field).onChange?.(next, getValues() as InferFormDataType<T>);\n }}\n defaultCountry={telSlot?.defaultCountry}\n placeholder={telSlot?.placeholder}\n inputProps={{\n ...telSlot?.inputProps,\n }}\n iconComponent={telSlot?.iconComponent}\n disabled={disabled}\n error={!!error}\n />\n </Box>\n\n {helperTextNode}\n </FormControl>\n );\n }}\n />\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/compound/UseForm/src/Fields/TelField.tsx"],"sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\nimport { Box } from '@/ele/Box';\nimport { FormControl, FormLabel } from '@/ele/Form';\nimport { FieldHelperText } from '../_utils/helperText';\nimport { FieldConfig, FormTypeMap, InferFormDataType } from '../_utils';\nimport Explanation from './Explanation';\nimport { FIELD_TYPEs } from '../_utils/constants';\nimport type { TelSlotProps } from '../_utils/slotProps';\nimport { TelPhoneInput } from '@/ele/Input/src/TelPhoneInput';\nimport { getFieldExplanation, mergeFieldSx } from '../_utils/helpers';\n\ninterface TelFieldProps<T extends FormTypeMap = FormTypeMap> {\n field: Extract<FieldConfig<T>, { type: typeof FIELD_TYPEs.tel }>;\n}\n\nexport const TelField = <T extends FormTypeMap = FormTypeMap>({ field }: TelFieldProps<T>) => {\n const { control, getValues } = useFormContext();\n const { name, label, required, disabled, sx, size, slotProps, errorMsg, defaultValue } = field;\n\n const telSlot = slotProps as TelSlotProps | undefined;\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultValue ?? ''}\n render={({ field: controllerField, fieldState: { error } }) => {\n const { onChange, value } = controllerField;\n const helperTextNode = <FieldHelperText error={error} errorMsg={errorMsg} helpers={[field.helperText]} />;\n\n return (\n <FormControl\n disabled={disabled}\n required={required}\n error={!!error}\n fullWidth\n size=\"small\"\n sx={mergeFieldSx(size, sx)}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start', mb: 0.5 }}>\n <FormLabel component=\"legend\" sx={{ mr: 1 }}>{label}</FormLabel>\n <Box sx={{ display: 'inline-flex' }}>\n <Explanation explanation={getFieldExplanation(field)} />\n </Box>\n </Box>\n\n <Box sx={{ py: 1, width: '100%' }}>\n <TelPhoneInput\n {...telSlot}\n value={value ?? ''}\n onChange={(v) => {\n const next = v ?? '';\n onChange(next);\n (field).onChange?.(next, getValues() as InferFormDataType<T>);\n }}\n defaultCountry={telSlot?.defaultCountry}\n placeholder={telSlot?.placeholder}\n inputProps={{\n ...telSlot?.inputProps,\n }}\n iconComponent={telSlot?.iconComponent}\n disabled={disabled}\n error={!!error}\n />\n </Box>\n\n {helperTextNode}\n </FormControl>\n );\n }}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,sBAAsB;AA4BZ,cAWnB,YAXmB;AAbxB,IAAM,WAAW,CAAsC,EAAE,MAAM,MAAwB;AAC5F,QAAM,EAAE,SAAS,UAAU,IAAI,eAAe;AAC9C,QAAM,EAAE,MAAM,OAAO,UAAU,UAAU,IAAI,MAAM,WAAW,UAAU,aAAa,IAAI;AAEzF,QAAM,UAAU;AAEhB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;AAAA;AAAA,EACF;AAEJ;","names":["default"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MuiXTimePicker_default
|
|
3
|
+
} from "./chunk-XAJAMVAG.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Explanation_default,
|
|
6
|
+
getFieldExplanation,
|
|
7
|
+
mergeFieldSx
|
|
8
|
+
} from "./chunk-FNSIQ2B7.mjs";
|
|
9
|
+
import "./chunk-SMD7OEUW.mjs";
|
|
10
|
+
import "./chunk-PL55YKT4.mjs";
|
|
11
|
+
import "./chunk-3DQINB57.mjs";
|
|
12
|
+
import "./chunk-3VUAM2GY.mjs";
|
|
13
|
+
import "./chunk-VYD3PDBB.mjs";
|
|
14
|
+
import "./chunk-MDAUF7IL.mjs";
|
|
15
|
+
import "./chunk-ZVFYOXDE.mjs";
|
|
16
|
+
import "./chunk-D4XPNSSI.mjs";
|
|
17
|
+
import "./chunk-4Q54P737.mjs";
|
|
18
|
+
import "./chunk-OP6LKXPA.mjs";
|
|
19
|
+
import {
|
|
20
|
+
default as default2
|
|
21
|
+
} from "./chunk-PNSJC6PC.mjs";
|
|
22
|
+
import {
|
|
23
|
+
mergeSx
|
|
24
|
+
} from "./chunk-AFLEG5ZC.mjs";
|
|
25
|
+
import "./chunk-FJ6ZGZIA.mjs";
|
|
26
|
+
|
|
27
|
+
// src/components/compound/UseForm/src/Fields/TimeField.tsx
|
|
28
|
+
import { Controller, useFormContext } from "react-hook-form";
|
|
29
|
+
import dayjs from "dayjs";
|
|
30
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var TimeField = ({ field }) => {
|
|
32
|
+
const { control, getValues } = useFormContext();
|
|
33
|
+
const {
|
|
34
|
+
name,
|
|
35
|
+
label,
|
|
36
|
+
required,
|
|
37
|
+
disabled,
|
|
38
|
+
sx,
|
|
39
|
+
size,
|
|
40
|
+
slotProps,
|
|
41
|
+
errorMsg,
|
|
42
|
+
defaultValue
|
|
43
|
+
} = field;
|
|
44
|
+
const defaultVal = defaultValue;
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
Controller,
|
|
47
|
+
{
|
|
48
|
+
control,
|
|
49
|
+
name,
|
|
50
|
+
defaultValue: defaultVal ?? null,
|
|
51
|
+
render: ({ field: { onChange, value }, fieldState: { error } }) => /* @__PURE__ */ jsxs(default2, { sx: mergeSx({ display: "flex", alignItems: "flex-start", gap: 1 }, mergeFieldSx(size, sx)), children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
MuiXTimePicker_default,
|
|
54
|
+
{
|
|
55
|
+
...slotProps,
|
|
56
|
+
label,
|
|
57
|
+
disabled,
|
|
58
|
+
value: value ? dayjs(value) : null,
|
|
59
|
+
onChange: (d) => {
|
|
60
|
+
if (!d) {
|
|
61
|
+
onChange(null);
|
|
62
|
+
field.onChange?.(null, getValues());
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const maybeDate = typeof d.toDate === "function" ? d.toDate() : d;
|
|
66
|
+
onChange(maybeDate);
|
|
67
|
+
field.onChange?.(maybeDate, getValues());
|
|
68
|
+
},
|
|
69
|
+
slotProps: {
|
|
70
|
+
...slotProps?.slotProps,
|
|
71
|
+
textField: {
|
|
72
|
+
...slotProps?.slotProps?.textField,
|
|
73
|
+
required,
|
|
74
|
+
disabled,
|
|
75
|
+
error: !!error,
|
|
76
|
+
helperText: error ? errorMsg || error.message : void 0
|
|
77
|
+
},
|
|
78
|
+
openPickerIcon: {
|
|
79
|
+
sx: { fontSize: "1.25rem" }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsx(Explanation_default, { alignToInput: true, explanation: getFieldExplanation(field) })
|
|
85
|
+
] })
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
var TimeField_default = TimeField;
|
|
90
|
+
export {
|
|
91
|
+
TimeField,
|
|
92
|
+
TimeField_default as default
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=TimeField-XVWXBJID.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/compound/UseForm/src/Fields/TimeField.tsx"],"sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\nimport dayjs from 'dayjs';\nimport { Box } from '@/ele/Box';\nimport { MuiXTimePicker } from '@/ele/DatePicker';\nimport { FieldConfig, FormTypeMap, InferFormDataType } from '../_utils';\nimport { FIELD_TYPEs } from '../_utils/constants';\nimport Explanation from './Explanation';\nimport { getFieldExplanation, mergeFieldSx } from '../_utils/helpers';\nimport { mergeSx } from '@/_utils/_func';\n\ninterface TimeFieldProps<T extends FormTypeMap = FormTypeMap> {\n field: Extract<FieldConfig<T>, { type: typeof FIELD_TYPEs.time }>;\n}\n\nexport const TimeField = <T extends FormTypeMap = FormTypeMap>({ field }: TimeFieldProps<T>) => {\n const { control, getValues } = useFormContext();\n const {\n name,\n label,\n required,\n disabled,\n sx,\n size,\n slotProps,\n errorMsg,\n defaultValue,\n } = field;\n\n const defaultVal = defaultValue as string | Date | undefined;\n\n return (\n <Controller\n control={control}\n name={name}\n defaultValue={defaultVal ?? null}\n render={({ field: { onChange, value }, fieldState: { error } }) => (\n <Box sx={mergeSx({ display: 'flex', alignItems: 'flex-start', gap: 1 }, mergeFieldSx(size, sx))}>\n <MuiXTimePicker\n {...slotProps}\n label={label}\n disabled={disabled}\n value={value ? dayjs(value) : null}\n onChange={(d) => {\n if (!d) {\n onChange(null);\n field.onChange?.(null, getValues() as InferFormDataType<T>);\n return;\n }\n const maybeDate = typeof d.toDate === 'function' ? d.toDate() : (d);\n onChange(maybeDate as Date);\n field.onChange?.(maybeDate as Date, getValues() as InferFormDataType<T>);\n }}\n slotProps={{\n ...(slotProps?.slotProps),\n textField: {\n ...(slotProps?.slotProps?.textField),\n required,\n disabled,\n error: !!error,\n helperText: error ? (errorMsg || error.message) : undefined,\n },\n openPickerIcon: {\n sx: { fontSize: '1.25rem' },\n },\n }}\n />\n <Explanation alignToInput explanation={getFieldExplanation(field)} />\n </Box>\n )}\n />\n );\n};\n\nexport default TimeField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,sBAAsB;AAC3C,OAAO,WAAW;AAmCV,SACE,KADF;AAtBD,IAAM,YAAY,CAAsC,EAAE,MAAM,MAAyB;AAC9F,QAAM,EAAE,SAAS,UAAU,IAAI,eAAe;AAC9C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,aAAa;AAEnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,cAAc,cAAc;AAAA,MAC5B,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,MAAM,GAAG,YAAY,EAAE,MAAM,EAAE,MAC3D,qBAACA,UAAA,EAAI,IAAI,QAAQ,EAAE,SAAS,QAAQ,YAAY,cAAc,KAAK,EAAE,GAAG,aAAa,MAAM,EAAE,CAAC,GAC5F;AAAA;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACJ;AAAA,YACA;AAAA,YACA,OAAO,QAAQ,MAAM,KAAK,IAAI;AAAA,YAC9B,UAAU,CAAC,MAAM;AACf,kBAAI,CAAC,GAAG;AACN,yBAAS,IAAI;AACb,sBAAM,WAAW,MAAM,UAAU,CAAyB;AAC1D;AAAA,cACF;AACA,oBAAM,YAAY,OAAO,EAAE,WAAW,aAAa,EAAE,OAAO,IAAK;AACjE,uBAAS,SAAiB;AAC1B,oBAAM,WAAW,WAAmB,UAAU,CAAyB;AAAA,YACzE;AAAA,YACA,WAAW;AAAA,cACT,GAAI,WAAW;AAAA,cACf,WAAW;AAAA,gBACT,GAAI,WAAW,WAAW;AAAA,gBAC1B;AAAA,gBACA;AAAA,gBACA,OAAO,CAAC,CAAC;AAAA,gBACT,YAAY,QAAS,YAAY,MAAM,UAAW;AAAA,cACpD;AAAA,cACA,gBAAgB;AAAA,gBACd,IAAI,EAAE,UAAU,UAAU;AAAA,cAC5B;AAAA,YACF;AAAA;AAAA,QACF;AAAA,QACA,oBAAC,uBAAY,cAAY,MAAC,aAAa,oBAAoB,KAAK,GAAG;AAAA,SACrE;AAAA;AAAA,EAEJ;AAEJ;AAEA,IAAO,oBAAQ;","names":["default"]}
|
package/dist/alert.d.mts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ReactNode } from 'react';
|
|
3
3
|
import * as notistack from 'notistack';
|
|
4
4
|
import { SnackbarKey, CustomContentProps } from 'notistack';
|
|
5
5
|
import * as _mui_material_styles from '@mui/material/styles';
|
|
6
6
|
import { Theme, SxProps } from '@mui/material/styles';
|
|
7
7
|
import * as _mui_material_Alert from '@mui/material/Alert';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* AlertProvider - Context provider for the alert system
|
|
11
|
-
* Sets up notistack with all custom alert variant components
|
|
12
|
-
* Should wrap the entire application or specific sections that need alerts
|
|
13
|
-
*/
|
|
14
|
-
declare const AlertProvider: React__default.NamedExoticComponent<{
|
|
15
|
-
children: React__default.ReactNode;
|
|
16
|
-
}>;
|
|
8
|
+
import * as _mui_system from '@mui/system';
|
|
17
9
|
|
|
18
10
|
declare const ALERT_VARIANTs: {
|
|
19
11
|
readonly info: "myInfo";
|
|
@@ -24,8 +16,14 @@ declare const ALERT_VARIANTs: {
|
|
|
24
16
|
readonly insight: "myInsight";
|
|
25
17
|
readonly collapsable: "myCollapsable";
|
|
26
18
|
};
|
|
19
|
+
declare const ALERT_STYLE_VARIANTs: {
|
|
20
|
+
readonly soft: "soft";
|
|
21
|
+
readonly classic: "classic";
|
|
22
|
+
};
|
|
27
23
|
declare const DEFAULTs: {
|
|
28
24
|
readonly AUTO_HIDE_DURATION: 3000;
|
|
25
|
+
/** Quiet glass toast look is the default snackbar chrome. */
|
|
26
|
+
readonly STYLE_VARIANT: "soft";
|
|
29
27
|
readonly ANCHOR_ORIGIN: {
|
|
30
28
|
readonly horizontal: "right";
|
|
31
29
|
readonly vertical: "top";
|
|
@@ -47,6 +45,12 @@ declare const ERRORs: {
|
|
|
47
45
|
type ValueOf<T> = T[keyof T];
|
|
48
46
|
|
|
49
47
|
type AlertVariant = ValueOf<typeof ALERT_VARIANTs>;
|
|
48
|
+
/** Visual style for snackbar alerts. Soft = quiet glass (Toast look); classic = filled MUI Alert. */
|
|
49
|
+
type AlertStyleVariant = 'soft' | 'classic';
|
|
50
|
+
type AlertAction = {
|
|
51
|
+
label: string;
|
|
52
|
+
onClick: () => void;
|
|
53
|
+
};
|
|
50
54
|
interface AlertOptions {
|
|
51
55
|
message: string | React.ReactNode;
|
|
52
56
|
variant: AlertVariant;
|
|
@@ -57,6 +61,13 @@ interface AlertOptions {
|
|
|
57
61
|
vertical: "top" | "bottom";
|
|
58
62
|
};
|
|
59
63
|
icon?: React.ReactNode | null;
|
|
64
|
+
/**
|
|
65
|
+
* Soft = quiet glass + accent bar (default, former Toast look).
|
|
66
|
+
* Classic = severity fill + colored border (legacy MUI Alert / notistack).
|
|
67
|
+
*/
|
|
68
|
+
styleVariant?: AlertStyleVariant;
|
|
69
|
+
/** Optional action button (primarily for soft style; also rendered on classic). */
|
|
70
|
+
action?: AlertAction;
|
|
60
71
|
}
|
|
61
72
|
/**
|
|
62
73
|
* Props forwarded to the `Renderer` component inside a collapsable alert.
|
|
@@ -75,6 +86,11 @@ interface CollapsableAlertOptions {
|
|
|
75
86
|
horizontal: "left" | "center" | "right";
|
|
76
87
|
vertical: "top" | "bottom";
|
|
77
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Soft = quiet glass collapsable (default). Classic = denser Card chrome.
|
|
91
|
+
* Falls back to AlertProvider `defaultStyleVariant`.
|
|
92
|
+
*/
|
|
93
|
+
styleVariant?: AlertStyleVariant;
|
|
78
94
|
componentProps?: CollapsableAlertComponentProps;
|
|
79
95
|
componentWrapperProps?: {
|
|
80
96
|
Renderer?: React.FC<CollapsableAlertComponentProps>;
|
|
@@ -102,8 +118,8 @@ declare function useAlert(): {
|
|
|
102
118
|
enqueueInsight: (message: string | React.ReactNode, options?: Omit<AlertOptions, "message" | "variant">) => AlertOperationResult<string>;
|
|
103
119
|
closeSnackbar: (key?: notistack.SnackbarKey) => void;
|
|
104
120
|
};
|
|
105
|
-
declare function enqueueAlert({ message, variant, id, autoHideDuration, anchorOrigin, icon, ...rest }: AlertOptions): AlertOperationResult<string>;
|
|
106
|
-
declare function enqueueCollapsable({ id, autoHideDuration, anchorOrigin, componentProps, componentWrapperProps, ...rest }: CollapsableAlertOptions): AlertOperationResult<string>;
|
|
121
|
+
declare function enqueueAlert({ message, variant, id, autoHideDuration, anchorOrigin, icon, styleVariant, action, ...rest }: AlertOptions): AlertOperationResult<string>;
|
|
122
|
+
declare function enqueueCollapsable({ id, autoHideDuration, anchorOrigin, styleVariant, componentProps, componentWrapperProps, ...rest }: CollapsableAlertOptions): AlertOperationResult<string>;
|
|
107
123
|
declare function enqueueError(message: string | React.ReactNode, options?: Omit<AlertOptions, 'message' | 'variant'>): AlertOperationResult<string>;
|
|
108
124
|
declare function enqueueSuccess(message: string | React.ReactNode, options?: Omit<AlertOptions, 'message' | 'variant'>): AlertOperationResult<string>;
|
|
109
125
|
declare function enqueueWarning(message: string | React.ReactNode, options?: Omit<AlertOptions, 'message' | 'variant'>): AlertOperationResult<string>;
|
|
@@ -111,13 +127,127 @@ declare function enqueueInfo(message: string | React.ReactNode, options?: Omit<A
|
|
|
111
127
|
declare function enqueueSystem(message: string | React.ReactNode, options?: Omit<AlertOptions, 'message' | 'variant'>): AlertOperationResult<string>;
|
|
112
128
|
declare function enqueueInsight(message: string | React.ReactNode, options?: Omit<AlertOptions, 'message' | 'variant'>): AlertOperationResult<string>;
|
|
113
129
|
|
|
114
|
-
|
|
130
|
+
type AlertProviderProps = {
|
|
131
|
+
children: react__default.ReactNode;
|
|
132
|
+
/**
|
|
133
|
+
* Default chrome for enqueued alerts when `styleVariant` is omitted.
|
|
134
|
+
* Soft = quiet glass (default); classic = filled MUI Alert.
|
|
135
|
+
* Per-call `styleVariant` always wins.
|
|
136
|
+
*/
|
|
137
|
+
defaultStyleVariant?: AlertStyleVariant;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* AlertProvider - Context provider for the alert system
|
|
141
|
+
* Sets up notistack with all custom alert variant components
|
|
142
|
+
* Should wrap the entire application or specific sections that need alerts
|
|
143
|
+
*/
|
|
144
|
+
declare const AlertProvider: react__default.NamedExoticComponent<AlertProviderProps>;
|
|
145
|
+
|
|
146
|
+
declare const AlertStyleVariantContext: react__default.Context<AlertStyleVariant>;
|
|
147
|
+
declare function useAlertStyleVariantDefault(): AlertStyleVariant;
|
|
148
|
+
|
|
149
|
+
declare const CollapsableAlert: react.ForwardRefExoticComponent<CustomContentProps & CollapsableAlertOptions & react.RefAttributes<HTMLDivElement>>;
|
|
150
|
+
|
|
151
|
+
type SoftAlertContentProps = CustomContentProps & Pick<AlertOptions, 'icon'> & {
|
|
152
|
+
/** Wired from AlertOptions.action via enqueue (lertAction avoids notistack SharedProps.action clash). */
|
|
153
|
+
alertAction?: AlertAction;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Soft/quiet glass snackbar content — former Toast look, owned by Alert/notistack.
|
|
157
|
+
*/
|
|
158
|
+
declare const SoftAlertContent: react.ForwardRefExoticComponent<CustomContentProps & Pick<AlertOptions, "icon"> & {
|
|
159
|
+
/** Wired from AlertOptions.action via enqueue (lertAction avoids notistack SharedProps.action clash). */
|
|
160
|
+
alertAction?: AlertAction;
|
|
161
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
162
|
+
|
|
163
|
+
/** @deprecated Prefer AlertVariant / enqueue* with styleVariant soft. */
|
|
164
|
+
type ToastVariant = 'success' | 'error' | 'info' | 'warning';
|
|
165
|
+
/** @deprecated Prefer AlertAction. */
|
|
166
|
+
type ToastAction = AlertAction;
|
|
167
|
+
/** @deprecated Prefer AlertOptions (styleVariant soft). */
|
|
168
|
+
type ToastOptions = {
|
|
169
|
+
id?: string;
|
|
170
|
+
/** Auto-dismiss ms. `null` keeps until closed. Default 4000. */
|
|
171
|
+
duration?: number | null;
|
|
172
|
+
action?: ToastAction;
|
|
173
|
+
onClose?: () => void;
|
|
174
|
+
};
|
|
175
|
+
type ToastShowOptions = ToastOptions & {
|
|
176
|
+
variant?: ToastVariant;
|
|
177
|
+
};
|
|
178
|
+
declare function show(message: ReactNode, options?: ToastShowOptions): string;
|
|
179
|
+
declare function success(message: ReactNode, options?: ToastOptions): string;
|
|
180
|
+
declare function error(message: ReactNode, options?: ToastOptions): string;
|
|
181
|
+
declare function info(message: ReactNode, options?: ToastOptions): string;
|
|
182
|
+
declare function warning(message: ReactNode, options?: ToastOptions): string;
|
|
183
|
+
declare function dismiss(id?: string): void;
|
|
184
|
+
declare function dismissAll(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Convenience alias that enqueues soft Alert (`styleVariant: 'soft'`).
|
|
187
|
+
* Requires AlertProvider (ThemeProvider mounts it). Prefer `useAlert` /
|
|
188
|
+
* `enqueueSuccess` for new code — there is no separate Toast compound.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* toast.success('Saved')
|
|
192
|
+
* toast.error('Failed', { action: { label: 'Undo', onClick: restore } })
|
|
193
|
+
*/
|
|
194
|
+
declare const toast: typeof show & {
|
|
195
|
+
success: typeof success;
|
|
196
|
+
error: typeof error;
|
|
197
|
+
info: typeof info;
|
|
198
|
+
warning: typeof warning;
|
|
199
|
+
dismiss: typeof dismiss;
|
|
200
|
+
dismissAll: typeof dismissAll;
|
|
201
|
+
show: typeof show;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Hook mirror of the imperative `toast` soft-Alert alias.
|
|
206
|
+
* @deprecated Prefer `useAlert` with default soft styleVariant.
|
|
207
|
+
*/
|
|
208
|
+
declare function useToast(): {
|
|
209
|
+
show: (message: ReactNode, options?: ToastShowOptions) => string;
|
|
210
|
+
success: (message: ReactNode, options?: ToastOptions) => string;
|
|
211
|
+
error: (message: ReactNode, options?: ToastOptions) => string;
|
|
212
|
+
info: (message: ReactNode, options?: ToastOptions) => string;
|
|
213
|
+
warning: (message: ReactNode, options?: ToastOptions) => string;
|
|
214
|
+
dismiss: (id?: string) => void;
|
|
215
|
+
dismissAll: () => void;
|
|
216
|
+
};
|
|
115
217
|
|
|
116
218
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
219
|
+
* Classic denser collapsable — solid paper sibling to soft glass.
|
|
220
|
+
* Quiet border-1, subtle elevation, no harsh gray icon squares.
|
|
221
|
+
*/
|
|
222
|
+
declare const collapsableAlertClassicRootSx: SxProps<Theme>;
|
|
223
|
+
/** @deprecated Use collapsableAlertClassicRootSx / collapsableAlertSoftRootSx. */
|
|
224
|
+
declare const collapsableAlertRootSx: _mui_system.CSSSelectorObjectOrCssVariables<Theme>;
|
|
225
|
+
/**
|
|
226
|
+
* Soft/quiet glass collapsable — matches SoftAlertContent language:
|
|
227
|
+
* border-1, glass blur, soft night shadow, 12px radius. No harsh Paper squares.
|
|
228
|
+
*/
|
|
229
|
+
declare const collapsableAlertSoftRootSx: SxProps<Theme>;
|
|
230
|
+
declare const collapsableSoftHeaderSx: SxProps<Theme>;
|
|
231
|
+
/** Classic denser header — solid, slightly taller hit area than soft. */
|
|
232
|
+
declare const collapsableClassicHeaderSx: SxProps<Theme>;
|
|
233
|
+
/** Ghost icon buttons — no gray square hit targets. */
|
|
234
|
+
declare const collapsableSoftIconButtonSx: SxProps<Theme>;
|
|
235
|
+
/**
|
|
236
|
+
* Classic denser ghost icons — still no harsh gray squares;
|
|
237
|
+
* slightly stronger hover wash than soft.
|
|
238
|
+
*/
|
|
239
|
+
declare const collapsableClassicIconButtonSx: SxProps<Theme>;
|
|
240
|
+
declare const collapsableSoftPanelSx: SxProps<Theme>;
|
|
241
|
+
/** Classic expand panel — quiet divider, denser tinted content area. */
|
|
242
|
+
declare const collapsableClassicPanelSx: SxProps<Theme>;
|
|
243
|
+
/**
|
|
244
|
+
* Soft/quiet glass alert — matches former Toast chrome:
|
|
245
|
+
* quiet border-1, glass blur, accent bar, soft night shadow. No thick severity outlines.
|
|
119
246
|
*/
|
|
120
|
-
declare const
|
|
247
|
+
declare const softAlertItemRootSx: SxProps<Theme>;
|
|
248
|
+
declare const softAlertAccentBarSx: SxProps<Theme>;
|
|
249
|
+
declare const softAlertIconSx: SxProps<Theme>;
|
|
250
|
+
/** Classic MUI Alert severity fill + colored border (legacy notistack look). */
|
|
121
251
|
declare const alertTheme: {
|
|
122
252
|
readonly styleOverrides: {
|
|
123
253
|
readonly root: ({ theme }: _mui_material_Alert.AlertProps & Record<string, unknown> & {
|
|
@@ -199,4 +329,4 @@ declare const alertTheme: {
|
|
|
199
329
|
};
|
|
200
330
|
};
|
|
201
331
|
|
|
202
|
-
export { ALERT_VARIANTs, type AlertOperationResult, type AlertOptions, AlertProvider, type AlertVariant, CollapsableAlert, type CollapsableAlertComponentProps, type CollapsableAlertOptions, DEFAULTs, ERRORs, alertTheme, collapsableAlertRootSx, enqueueAlert, enqueueCollapsable, enqueueError, enqueueInfo, enqueueInsight, enqueueSuccess, enqueueSystem, enqueueWarning, useAlert };
|
|
332
|
+
export { ALERT_STYLE_VARIANTs, ALERT_VARIANTs, type AlertAction, type AlertOperationResult, type AlertOptions, AlertProvider, type AlertProviderProps, type AlertStyleVariant, AlertStyleVariantContext, type AlertVariant, CollapsableAlert, type CollapsableAlertComponentProps, type CollapsableAlertOptions, DEFAULTs, ERRORs, SoftAlertContent, type SoftAlertContentProps, type ToastAction, type ToastOptions, type ToastShowOptions, type ToastVariant, alertTheme, collapsableAlertClassicRootSx, collapsableAlertRootSx, collapsableAlertSoftRootSx, collapsableClassicHeaderSx, collapsableClassicIconButtonSx, collapsableClassicPanelSx, collapsableSoftHeaderSx, collapsableSoftIconButtonSx, collapsableSoftPanelSx, enqueueAlert, enqueueCollapsable, enqueueError, enqueueInfo, enqueueInsight, enqueueSuccess, enqueueSystem, enqueueWarning, softAlertAccentBarSx, softAlertIconSx, softAlertItemRootSx, toast, useAlert, useAlertStyleVariantDefault, useToast };
|