@cp949/mui-react19 2.1.0 → 2.3.0
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/README.md +6 -0
- package/dist/{rolldown-runtime-Chgba0Kb.cjs → _virtual/_rolldown/runtime.cjs} +1 -1
- package/dist/{rolldown-runtime-DK3Fl9T5.js → _virtual/_rolldown/runtime.js} +1 -1
- package/dist/components/Center.cjs +2 -0
- package/dist/components/Center.cjs.map +1 -0
- package/dist/components/Center.d.cts +11 -0
- package/dist/components/Center.d.ts +11 -0
- package/dist/components/Center.js +2 -0
- package/dist/components/Center.js.map +1 -0
- package/dist/components/CooldownButton.cjs +2 -0
- package/dist/components/CooldownButton.cjs.map +1 -0
- package/dist/components/CooldownButton.d.cts +14 -0
- package/dist/components/CooldownButton.d.ts +14 -0
- package/dist/components/CooldownButton.js +2 -0
- package/dist/components/CooldownButton.js.map +1 -0
- package/dist/components/CooldownButtonBase.cjs +2 -0
- package/dist/components/CooldownButtonBase.cjs.map +1 -0
- package/dist/components/CooldownButtonBase.d.cts +14 -0
- package/dist/components/CooldownButtonBase.d.ts +14 -0
- package/dist/components/CooldownButtonBase.js +2 -0
- package/dist/components/CooldownButtonBase.js.map +1 -0
- package/dist/components/CooldownIconButton.cjs +2 -0
- package/dist/components/CooldownIconButton.cjs.map +1 -0
- package/dist/components/CooldownIconButton.d.cts +14 -0
- package/dist/components/CooldownIconButton.d.ts +14 -0
- package/dist/components/CooldownIconButton.js +2 -0
- package/dist/components/CooldownIconButton.js.map +1 -0
- package/dist/components/CopyButtonWrapper.cjs +2 -0
- package/dist/components/CopyButtonWrapper.cjs.map +1 -0
- package/dist/components/CopyButtonWrapper.d.cts +94 -0
- package/dist/components/CopyButtonWrapper.d.ts +94 -0
- package/dist/components/CopyButtonWrapper.js +2 -0
- package/dist/components/CopyButtonWrapper.js.map +1 -0
- package/dist/components/CustomTableBody.cjs +2 -0
- package/dist/components/CustomTableBody.cjs.map +1 -0
- package/dist/components/CustomTableBody.d.cts +9 -0
- package/dist/components/CustomTableBody.d.ts +9 -0
- package/dist/components/CustomTableBody.js +2 -0
- package/dist/components/CustomTableBody.js.map +1 -0
- package/dist/components/DebouncedButton.cjs +2 -0
- package/dist/components/DebouncedButton.cjs.map +1 -0
- package/dist/components/DebouncedButton.d.cts +11 -0
- package/dist/components/DebouncedButton.d.ts +11 -0
- package/dist/components/DebouncedButton.js +2 -0
- package/dist/components/DebouncedButton.js.map +1 -0
- package/dist/components/DebouncedButtonBase.cjs +2 -0
- package/dist/components/DebouncedButtonBase.cjs.map +1 -0
- package/dist/components/DebouncedButtonBase.d.cts +11 -0
- package/dist/components/DebouncedButtonBase.d.ts +11 -0
- package/dist/components/DebouncedButtonBase.js +2 -0
- package/dist/components/DebouncedButtonBase.js.map +1 -0
- package/dist/components/DebouncedIconButton.cjs +2 -0
- package/dist/components/DebouncedIconButton.cjs.map +1 -0
- package/dist/components/DebouncedIconButton.d.cts +11 -0
- package/dist/components/DebouncedIconButton.d.ts +11 -0
- package/dist/components/DebouncedIconButton.js +2 -0
- package/dist/components/DebouncedIconButton.js.map +1 -0
- package/dist/components/DebouncedRender.cjs +2 -0
- package/dist/components/DebouncedRender.cjs.map +1 -0
- package/dist/components/DebouncedRender.d.cts +31 -0
- package/dist/components/DebouncedRender.d.ts +31 -0
- package/dist/components/DebouncedRender.js +2 -0
- package/dist/components/DebouncedRender.js.map +1 -0
- package/dist/components/DelayedRender.cjs +2 -0
- package/dist/components/DelayedRender.cjs.map +1 -0
- package/dist/components/DelayedRender.d.cts +34 -0
- package/dist/components/DelayedRender.d.ts +34 -0
- package/dist/components/DelayedRender.js +2 -0
- package/dist/components/DelayedRender.js.map +1 -0
- package/dist/components/FileButton.cjs +2 -0
- package/dist/components/FileButton.cjs.map +1 -0
- package/dist/components/FileButton.d.cts +88 -0
- package/dist/components/FileButton.d.ts +88 -0
- package/dist/components/FileButton.js +2 -0
- package/dist/components/FileButton.js.map +1 -0
- package/dist/components/FlexItemsContainer.cjs +2 -0
- package/dist/components/FlexItemsContainer.cjs.map +1 -0
- package/dist/components/FlexItemsContainer.d.cts +51 -0
- package/dist/components/FlexItemsContainer.d.ts +51 -0
- package/dist/components/FlexItemsContainer.js +2 -0
- package/dist/components/FlexItemsContainer.js.map +1 -0
- package/dist/components/FloatingIndicator/FloatingIndicator.cjs +2 -0
- package/dist/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -0
- package/dist/components/FloatingIndicator/FloatingIndicator.d.cts +27 -0
- package/dist/components/FloatingIndicator/FloatingIndicator.d.ts +27 -0
- package/dist/components/FloatingIndicator/FloatingIndicator.js +2 -0
- package/dist/components/FloatingIndicator/FloatingIndicator.js.map +1 -0
- package/dist/components/FloatingIndicator/index.cjs +2 -0
- package/dist/components/FloatingIndicator/index.cjs.map +1 -0
- package/dist/components/FloatingIndicator/index.d.cts +2 -0
- package/dist/components/FloatingIndicator/index.d.ts +2 -0
- package/dist/components/FloatingIndicator/index.js +2 -0
- package/dist/components/FloatingIndicator/index.js.map +1 -0
- package/dist/components/FloatingIndicator/useFloatingIndicator.cjs +2 -0
- package/dist/components/FloatingIndicator/useFloatingIndicator.cjs.map +1 -0
- package/dist/components/FloatingIndicator/useFloatingIndicator.js +2 -0
- package/dist/components/FloatingIndicator/useFloatingIndicator.js.map +1 -0
- package/dist/components/Hide.cjs +2 -0
- package/dist/components/Hide.cjs.map +1 -0
- package/dist/components/Hide.d.cts +12 -0
- package/dist/components/Hide.d.ts +12 -0
- package/dist/components/Hide.js +2 -0
- package/dist/components/Hide.js.map +1 -0
- package/dist/components/Highlight/Highlight.cjs +2 -0
- package/dist/components/Highlight/Highlight.cjs.map +1 -0
- package/dist/components/Highlight/Highlight.d.cts +93 -0
- package/dist/components/Highlight/Highlight.d.ts +93 -0
- package/dist/components/Highlight/Highlight.js +2 -0
- package/dist/components/Highlight/Highlight.js.map +1 -0
- package/dist/components/Highlight/highlighter/highlighter.cjs +2 -0
- package/dist/components/Highlight/highlighter/highlighter.cjs.map +1 -0
- package/dist/components/Highlight/highlighter/highlighter.js +2 -0
- package/dist/components/Highlight/highlighter/highlighter.js.map +1 -0
- package/dist/components/Highlight/index.d.cts +2 -0
- package/dist/components/Highlight/index.d.ts +2 -0
- package/dist/components/LengthLimitHelperText.cjs +2 -0
- package/dist/components/LengthLimitHelperText.cjs.map +1 -0
- package/dist/components/LengthLimitHelperText.d.cts +14 -0
- package/dist/components/LengthLimitHelperText.d.ts +14 -0
- package/dist/components/LengthLimitHelperText.js +2 -0
- package/dist/components/LengthLimitHelperText.js.map +1 -0
- package/dist/components/LgOrUp.cjs +2 -0
- package/dist/components/LgOrUp.cjs.map +1 -0
- package/dist/components/LgOrUp.d.cts +8 -0
- package/dist/components/LgOrUp.d.ts +8 -0
- package/dist/components/LgOrUp.js +2 -0
- package/dist/components/LgOrUp.js.map +1 -0
- package/dist/components/ListPagination.cjs +2 -0
- package/dist/components/ListPagination.cjs.map +1 -0
- package/dist/components/ListPagination.d.cts +55 -0
- package/dist/components/ListPagination.d.ts +55 -0
- package/dist/components/ListPagination.js +2 -0
- package/dist/components/ListPagination.js.map +1 -0
- package/dist/components/Mark.cjs +2 -0
- package/dist/components/Mark.cjs.map +1 -0
- package/dist/components/Mark.d.cts +17 -0
- package/dist/components/Mark.d.ts +17 -0
- package/dist/components/Mark.js +2 -0
- package/dist/components/Mark.js.map +1 -0
- package/dist/components/MdOrDown.cjs +2 -0
- package/dist/components/MdOrDown.cjs.map +1 -0
- package/dist/components/MdOrDown.d.cts +8 -0
- package/dist/components/MdOrDown.d.ts +8 -0
- package/dist/components/MdOrDown.js +2 -0
- package/dist/components/MdOrDown.js.map +1 -0
- package/dist/components/MdOrUp.cjs +2 -0
- package/dist/components/MdOrUp.cjs.map +1 -0
- package/dist/components/MdOrUp.d.cts +8 -0
- package/dist/components/MdOrUp.d.ts +8 -0
- package/dist/components/MdOrUp.js +2 -0
- package/dist/components/MdOrUp.js.map +1 -0
- package/dist/components/Paper.cjs +2 -0
- package/dist/components/Paper.cjs.map +1 -0
- package/dist/components/Paper.d.cts +10 -0
- package/dist/components/Paper.d.ts +10 -0
- package/dist/components/Paper.js +2 -0
- package/dist/components/Paper.js.map +1 -0
- package/dist/components/PasswordTextField.cjs +2 -0
- package/dist/components/PasswordTextField.cjs.map +1 -0
- package/dist/components/PasswordTextField.d.cts +25 -0
- package/dist/components/PasswordTextField.d.ts +25 -0
- package/dist/components/PasswordTextField.js +2 -0
- package/dist/components/PasswordTextField.js.map +1 -0
- package/dist/components/SearchBoxDebouncer.cjs +2 -0
- package/dist/components/SearchBoxDebouncer.cjs.map +1 -0
- package/dist/components/SearchBoxDebouncer.d.cts +46 -0
- package/dist/components/SearchBoxDebouncer.d.ts +46 -0
- package/dist/components/SearchBoxDebouncer.js +2 -0
- package/dist/components/SearchBoxDebouncer.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.cjs +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.cts +57 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +57 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/SegmentedControl/components.cjs +2 -0
- package/dist/components/SegmentedControl/components.cjs.map +1 -0
- package/dist/components/SegmentedControl/components.js +2 -0
- package/dist/components/SegmentedControl/components.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.cts +2 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/Show.cjs +2 -0
- package/dist/components/Show.cjs.map +1 -0
- package/dist/components/Show.d.cts +10 -0
- package/dist/components/Show.d.ts +10 -0
- package/dist/components/Show.js +2 -0
- package/dist/components/Show.js.map +1 -0
- package/dist/components/SmOrDown.cjs +2 -0
- package/dist/components/SmOrDown.cjs.map +1 -0
- package/dist/components/SmOrDown.d.cts +8 -0
- package/dist/components/SmOrDown.d.ts +8 -0
- package/dist/components/SmOrDown.js +2 -0
- package/dist/components/SmOrDown.js.map +1 -0
- package/dist/components/SmOrUp.cjs +2 -0
- package/dist/components/SmOrUp.cjs.map +1 -0
- package/dist/components/SmOrUp.d.cts +8 -0
- package/dist/components/SmOrUp.d.ts +8 -0
- package/dist/components/SmOrUp.js +2 -0
- package/dist/components/SmOrUp.js.map +1 -0
- package/dist/components/Space.cjs +2 -0
- package/dist/components/Space.cjs.map +1 -0
- package/dist/components/Space.d.cts +14 -0
- package/dist/components/Space.d.ts +14 -0
- package/dist/components/Space.js +2 -0
- package/dist/components/Space.js.map +1 -0
- package/dist/components/Spoiler.cjs +2 -0
- package/dist/components/Spoiler.cjs.map +1 -0
- package/dist/components/Spoiler.d.cts +33 -0
- package/dist/components/Spoiler.d.ts +33 -0
- package/dist/components/Spoiler.js +2 -0
- package/dist/components/Spoiler.js.map +1 -0
- package/dist/components/XsOrDown.cjs +2 -0
- package/dist/components/XsOrDown.cjs.map +1 -0
- package/dist/components/XsOrDown.d.cts +8 -0
- package/dist/components/XsOrDown.d.ts +8 -0
- package/dist/components/XsOrDown.js +2 -0
- package/dist/components/XsOrDown.js.map +1 -0
- package/dist/components/YmTypography.cjs +2 -0
- package/dist/components/YmTypography.cjs.map +1 -0
- package/dist/components/YmTypography.d.cts +23 -0
- package/dist/components/YmTypography.d.ts +23 -0
- package/dist/components/YmTypography.js +2 -0
- package/dist/components/YmTypography.js.map +1 -0
- package/dist/components/YmdTextField.cjs +2 -0
- package/dist/components/YmdTextField.cjs.map +1 -0
- package/dist/components/YmdTextField.d.cts +48 -0
- package/dist/components/YmdTextField.d.ts +48 -0
- package/dist/components/YmdTextField.js +2 -0
- package/dist/components/YmdTextField.js.map +1 -0
- package/dist/components/YmdTypography.cjs +2 -0
- package/dist/components/YmdTypography.cjs.map +1 -0
- package/dist/components/YmdTypography.d.cts +23 -0
- package/dist/components/YmdTypography.d.ts +23 -0
- package/dist/components/YmdTypography.js +2 -0
- package/dist/components/YmdTypography.js.map +1 -0
- package/dist/components/absolute-box/create-absolute-box.cjs +2 -0
- package/dist/components/absolute-box/create-absolute-box.cjs.map +1 -0
- package/dist/components/absolute-box/create-absolute-box.js +2 -0
- package/dist/components/absolute-box/create-absolute-box.js.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsolute.cjs +2 -0
- package/dist/components/bottom-absolute/BottomAbsolute.cjs.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsolute.d.cts +20 -0
- package/dist/components/bottom-absolute/BottomAbsolute.d.ts +20 -0
- package/dist/components/bottom-absolute/BottomAbsolute.js +2 -0
- package/dist/components/bottom-absolute/BottomAbsolute.js.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.cjs +2 -0
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.cjs.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.d.cts +10 -0
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.d.ts +10 -0
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.js +2 -0
- package/dist/components/bottom-absolute/BottomAbsoluteCenter.js.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.cjs +2 -0
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.cjs.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.d.cts +11 -0
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.d.ts +11 -0
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.js +2 -0
- package/dist/components/bottom-absolute/BottomAbsoluteLeft.js.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsoluteRight.cjs +2 -0
- package/dist/components/bottom-absolute/BottomAbsoluteRight.cjs.map +1 -0
- package/dist/components/bottom-absolute/BottomAbsoluteRight.d.cts +11 -0
- package/dist/components/bottom-absolute/BottomAbsoluteRight.d.ts +11 -0
- package/dist/components/bottom-absolute/BottomAbsoluteRight.js +2 -0
- package/dist/components/bottom-absolute/BottomAbsoluteRight.js.map +1 -0
- package/dist/components/bottom-absolute/index.d.cts +5 -0
- package/dist/components/bottom-absolute/index.d.ts +5 -0
- package/dist/components/center-absolute/CenterAbsolute.cjs +2 -0
- package/dist/components/center-absolute/CenterAbsolute.cjs.map +1 -0
- package/dist/components/center-absolute/CenterAbsolute.d.cts +19 -0
- package/dist/components/center-absolute/CenterAbsolute.d.ts +19 -0
- package/dist/components/center-absolute/CenterAbsolute.js +2 -0
- package/dist/components/center-absolute/CenterAbsolute.js.map +1 -0
- package/dist/components/center-absolute/CenterAbsoluteCenter.cjs +2 -0
- package/dist/components/center-absolute/CenterAbsoluteCenter.cjs.map +1 -0
- package/dist/components/center-absolute/CenterAbsoluteCenter.d.cts +9 -0
- package/dist/components/center-absolute/CenterAbsoluteCenter.d.ts +9 -0
- package/dist/components/center-absolute/CenterAbsoluteCenter.js +2 -0
- package/dist/components/center-absolute/CenterAbsoluteCenter.js.map +1 -0
- package/dist/components/center-absolute/CenterAbsoluteLeft.cjs +2 -0
- package/dist/components/center-absolute/CenterAbsoluteLeft.cjs.map +1 -0
- package/dist/components/center-absolute/CenterAbsoluteLeft.d.cts +10 -0
- package/dist/components/center-absolute/CenterAbsoluteLeft.d.ts +10 -0
- package/dist/components/center-absolute/CenterAbsoluteLeft.js +2 -0
- package/dist/components/center-absolute/CenterAbsoluteLeft.js.map +1 -0
- package/dist/components/center-absolute/CenterAbsoluteRight.cjs +2 -0
- package/dist/components/center-absolute/CenterAbsoluteRight.cjs.map +1 -0
- package/dist/components/center-absolute/CenterAbsoluteRight.d.cts +10 -0
- package/dist/components/center-absolute/CenterAbsoluteRight.d.ts +10 -0
- package/dist/components/center-absolute/CenterAbsoluteRight.js +2 -0
- package/dist/components/center-absolute/CenterAbsoluteRight.js.map +1 -0
- package/dist/components/center-absolute/index.d.cts +5 -0
- package/dist/components/center-absolute/index.d.ts +5 -0
- package/dist/components/flex/FlexColumn.cjs +2 -0
- package/dist/components/flex/FlexColumn.cjs.map +1 -0
- package/dist/components/flex/FlexColumn.d.cts +24 -0
- package/dist/components/flex/FlexColumn.d.ts +24 -0
- package/dist/components/flex/FlexColumn.js +2 -0
- package/dist/components/flex/FlexColumn.js.map +1 -0
- package/dist/components/flex/FlexRow.cjs +2 -0
- package/dist/components/flex/FlexRow.cjs.map +1 -0
- package/dist/components/flex/FlexRow.d.cts +24 -0
- package/dist/components/flex/FlexRow.d.ts +24 -0
- package/dist/components/flex/FlexRow.js +2 -0
- package/dist/components/flex/FlexRow.js.map +1 -0
- package/dist/components/flex/index.d.cts +4 -0
- package/dist/components/flex/index.d.ts +4 -0
- package/dist/components/flex/types.d.cts +11 -0
- package/dist/components/flex/types.d.ts +11 -0
- package/dist/components/index.d.cts +69 -0
- package/dist/components/index.d.ts +69 -0
- package/dist/components/layout/create-layout-component.cjs +2 -0
- package/dist/components/layout/create-layout-component.cjs.map +1 -0
- package/dist/components/layout/create-layout-component.js +2 -0
- package/dist/components/layout/create-layout-component.js.map +1 -0
- package/dist/components/portlet/Portlet.cjs +2 -0
- package/dist/components/portlet/Portlet.cjs.map +1 -0
- package/dist/components/portlet/Portlet.d.cts +40 -0
- package/dist/components/portlet/Portlet.d.ts +40 -0
- package/dist/components/portlet/Portlet.js +2 -0
- package/dist/components/portlet/Portlet.js.map +1 -0
- package/dist/components/portlet/PortletContent.cjs +2 -0
- package/dist/components/portlet/PortletContent.cjs.map +1 -0
- package/dist/components/portlet/PortletContent.d.cts +21 -0
- package/dist/components/portlet/PortletContent.d.ts +21 -0
- package/dist/components/portlet/PortletContent.js +2 -0
- package/dist/components/portlet/PortletContent.js.map +1 -0
- package/dist/components/portlet/PortletFooter.cjs +2 -0
- package/dist/components/portlet/PortletFooter.cjs.map +1 -0
- package/dist/components/portlet/PortletFooter.d.cts +21 -0
- package/dist/components/portlet/PortletFooter.d.ts +21 -0
- package/dist/components/portlet/PortletFooter.js +2 -0
- package/dist/components/portlet/PortletFooter.js.map +1 -0
- package/dist/components/portlet/PortletHeader.cjs +2 -0
- package/dist/components/portlet/PortletHeader.cjs.map +1 -0
- package/dist/components/portlet/PortletHeader.d.cts +25 -0
- package/dist/components/portlet/PortletHeader.d.ts +25 -0
- package/dist/components/portlet/PortletHeader.js +2 -0
- package/dist/components/portlet/PortletHeader.js.map +1 -0
- package/dist/components/portlet/PortletLabel.cjs +2 -0
- package/dist/components/portlet/PortletLabel.cjs.map +1 -0
- package/dist/components/portlet/PortletLabel.d.cts +25 -0
- package/dist/components/portlet/PortletLabel.d.ts +25 -0
- package/dist/components/portlet/PortletLabel.js +2 -0
- package/dist/components/portlet/PortletLabel.js.map +1 -0
- package/dist/components/portlet/PortletTitle.cjs +2 -0
- package/dist/components/portlet/PortletTitle.cjs.map +1 -0
- package/dist/components/portlet/PortletTitle.d.cts +48 -0
- package/dist/components/portlet/PortletTitle.d.ts +48 -0
- package/dist/components/portlet/PortletTitle.js +2 -0
- package/dist/components/portlet/PortletTitle.js.map +1 -0
- package/dist/components/portlet/PortletToolbar.cjs +2 -0
- package/dist/components/portlet/PortletToolbar.cjs.map +1 -0
- package/dist/components/portlet/PortletToolbar.d.cts +19 -0
- package/dist/components/portlet/PortletToolbar.d.ts +19 -0
- package/dist/components/portlet/PortletToolbar.js +2 -0
- package/dist/components/portlet/PortletToolbar.js.map +1 -0
- package/dist/components/portlet/index.d.cts +8 -0
- package/dist/components/portlet/index.d.ts +8 -0
- package/dist/components/stack/StackColumn.cjs +2 -0
- package/dist/components/stack/StackColumn.cjs.map +1 -0
- package/dist/components/stack/StackColumn.d.cts +31 -0
- package/dist/components/stack/StackColumn.d.ts +31 -0
- package/dist/components/stack/StackColumn.js +2 -0
- package/dist/components/stack/StackColumn.js.map +1 -0
- package/dist/components/stack/StackRow.cjs +2 -0
- package/dist/components/stack/StackRow.cjs.map +1 -0
- package/dist/components/stack/StackRow.d.cts +30 -0
- package/dist/components/stack/StackRow.d.ts +30 -0
- package/dist/components/stack/StackRow.js +2 -0
- package/dist/components/stack/StackRow.js.map +1 -0
- package/dist/components/stack/index.d.cts +3 -0
- package/dist/components/stack/index.d.ts +3 -0
- package/dist/components/top-absolute/TopAbsolute.cjs +2 -0
- package/dist/components/top-absolute/TopAbsolute.cjs.map +1 -0
- package/dist/components/top-absolute/TopAbsolute.d.cts +38 -0
- package/dist/components/top-absolute/TopAbsolute.d.ts +38 -0
- package/dist/components/top-absolute/TopAbsolute.js +2 -0
- package/dist/components/top-absolute/TopAbsolute.js.map +1 -0
- package/dist/components/top-absolute/TopAbsoluteCenter.cjs +2 -0
- package/dist/components/top-absolute/TopAbsoluteCenter.cjs.map +1 -0
- package/dist/components/top-absolute/TopAbsoluteCenter.d.cts +40 -0
- package/dist/components/top-absolute/TopAbsoluteCenter.d.ts +40 -0
- package/dist/components/top-absolute/TopAbsoluteCenter.js +2 -0
- package/dist/components/top-absolute/TopAbsoluteCenter.js.map +1 -0
- package/dist/components/top-absolute/TopAbsoluteLeft.cjs +2 -0
- package/dist/components/top-absolute/TopAbsoluteLeft.cjs.map +1 -0
- package/dist/components/top-absolute/TopAbsoluteLeft.d.cts +46 -0
- package/dist/components/top-absolute/TopAbsoluteLeft.d.ts +46 -0
- package/dist/components/top-absolute/TopAbsoluteLeft.js +2 -0
- package/dist/components/top-absolute/TopAbsoluteLeft.js.map +1 -0
- package/dist/components/top-absolute/TopAbsoluteRight.cjs +2 -0
- package/dist/components/top-absolute/TopAbsoluteRight.cjs.map +1 -0
- package/dist/components/top-absolute/TopAbsoluteRight.d.cts +46 -0
- package/dist/components/top-absolute/TopAbsoluteRight.d.ts +46 -0
- package/dist/components/top-absolute/TopAbsoluteRight.js +2 -0
- package/dist/components/top-absolute/TopAbsoluteRight.js.map +1 -0
- package/dist/components/top-absolute/index.d.cts +5 -0
- package/dist/components/top-absolute/index.d.ts +5 -0
- package/dist/eventemitter/eventemitter3.cjs +2 -0
- package/dist/eventemitter/eventemitter3.cjs.map +1 -0
- package/dist/eventemitter/eventemitter3.d.cts +53 -0
- package/dist/eventemitter/eventemitter3.d.ts +53 -0
- package/dist/eventemitter/eventemitter3.js +2 -0
- package/dist/eventemitter/eventemitter3.js.map +1 -0
- package/dist/eventemitter/types.d.cts +17 -0
- package/dist/eventemitter/types.d.ts +17 -0
- package/dist/file-drop/handle-file-tree-drop.cjs +2 -0
- package/dist/file-drop/handle-file-tree-drop.cjs.map +1 -0
- package/dist/file-drop/handle-file-tree-drop.d.cts +46 -0
- package/dist/file-drop/handle-file-tree-drop.d.ts +46 -0
- package/dist/file-drop/handle-file-tree-drop.js +2 -0
- package/dist/file-drop/handle-file-tree-drop.js.map +1 -0
- package/dist/file-drop/index.cjs +1 -2
- package/dist/file-drop/index.d.cts +7 -756
- package/dist/file-drop/index.d.ts +7 -756
- package/dist/file-drop/index.js +1 -2
- package/dist/file-drop/internal/debug-logger.cjs +2 -0
- package/dist/file-drop/internal/debug-logger.cjs.map +1 -0
- package/dist/file-drop/internal/debug-logger.js +2 -0
- package/dist/file-drop/internal/debug-logger.js.map +1 -0
- package/dist/file-drop/internal/path-util.cjs +2 -0
- package/dist/file-drop/internal/path-util.cjs.map +1 -0
- package/dist/file-drop/internal/path-util.d.cts +39 -0
- package/dist/file-drop/internal/path-util.d.ts +39 -0
- package/dist/file-drop/internal/path-util.js +2 -0
- package/dist/file-drop/internal/path-util.js.map +1 -0
- package/dist/file-drop/internal/traverse-tree.cjs +2 -0
- package/dist/file-drop/internal/traverse-tree.cjs.map +1 -0
- package/dist/file-drop/internal/traverse-tree.js +2 -0
- package/dist/file-drop/internal/traverse-tree.js.map +1 -0
- package/dist/file-drop/internal/util.cjs +2 -0
- package/dist/file-drop/internal/util.cjs.map +1 -0
- package/dist/file-drop/internal/util.js +2 -0
- package/dist/file-drop/internal/util.js.map +1 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-entry.cjs +2 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-entry.cjs.map +1 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-entry.js +2 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-entry.js.map +1 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-handle.cjs +2 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-handle.cjs.map +1 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-handle.js +2 -0
- package/dist/file-drop/internal/visit-file-system/visit-file-system-handle.js.map +1 -0
- package/dist/file-drop/process-file-drop.cjs +2 -0
- package/dist/file-drop/process-file-drop.cjs.map +1 -0
- package/dist/file-drop/process-file-drop.d.cts +133 -0
- package/dist/file-drop/process-file-drop.d.ts +133 -0
- package/dist/file-drop/process-file-drop.js +2 -0
- package/dist/file-drop/process-file-drop.js.map +1 -0
- package/dist/file-drop/types.cjs +2 -0
- package/dist/file-drop/types.cjs.map +1 -0
- package/dist/file-drop/types.d.cts +489 -0
- package/dist/file-drop/types.d.ts +489 -0
- package/dist/file-drop/types.js +2 -0
- package/dist/file-drop/types.js.map +1 -0
- package/dist/file-drop/utils/file-utils.cjs +2 -0
- package/dist/file-drop/utils/file-utils.cjs.map +1 -0
- package/dist/file-drop/utils/file-utils.d.cts +31 -0
- package/dist/file-drop/utils/file-utils.d.ts +31 -0
- package/dist/file-drop/utils/file-utils.js +2 -0
- package/dist/file-drop/utils/file-utils.js.map +1 -0
- package/dist/file-drop/utils/filter.cjs +2 -0
- package/dist/file-drop/utils/filter.cjs.map +1 -0
- package/dist/file-drop/utils/filter.d.cts +25 -0
- package/dist/file-drop/utils/filter.d.ts +25 -0
- package/dist/file-drop/utils/filter.js +2 -0
- package/dist/file-drop/utils/filter.js.map +1 -0
- package/dist/{parallel-map-_ZhC5iBn.cjs → file-drop/utils/parallel-map.cjs} +1 -1
- package/dist/file-drop/utils/parallel-map.cjs.map +1 -0
- package/dist/{parallel-map-DyuHvxYY.js → file-drop/utils/parallel-map.js} +1 -1
- package/dist/file-drop/utils/parallel-map.js.map +1 -0
- package/dist/file-drop/utils/progress-tracker.cjs +2 -0
- package/dist/file-drop/utils/progress-tracker.cjs.map +1 -0
- package/dist/file-drop/utils/progress-tracker.js +2 -0
- package/dist/file-drop/utils/progress-tracker.js.map +1 -0
- package/dist/helper/index.cjs +1 -2
- package/dist/helper/index.d.cts +3 -97
- package/dist/helper/index.d.ts +3 -97
- package/dist/helper/index.js +1 -2
- package/dist/helper/mui-css-vars.cjs +2 -0
- package/dist/helper/mui-css-vars.cjs.map +1 -0
- package/dist/helper/mui-css-vars.d.cts +62 -0
- package/dist/helper/mui-css-vars.d.ts +62 -0
- package/dist/helper/mui-css-vars.js +2 -0
- package/dist/helper/mui-css-vars.js.map +1 -0
- package/dist/helper/mui-media-queries.cjs +2 -0
- package/dist/helper/mui-media-queries.cjs.map +1 -0
- package/dist/helper/mui-media-queries.d.cts +38 -0
- package/dist/helper/mui-media-queries.d.ts +38 -0
- package/dist/helper/mui-media-queries.js +2 -0
- package/dist/helper/mui-media-queries.js.map +1 -0
- package/dist/hooks/index.cjs +1 -2
- package/dist/hooks/index.d.cts +69 -1483
- package/dist/hooks/index.d.ts +69 -1483
- package/dist/hooks/index.js +1 -2
- package/dist/hooks/types.d.cts +13 -0
- package/dist/hooks/types.d.ts +13 -0
- package/dist/hooks/useAbsolutePosition.cjs +2 -0
- package/dist/hooks/useAbsolutePosition.cjs.map +1 -0
- package/dist/hooks/useAbsolutePosition.d.cts +13 -0
- package/dist/hooks/useAbsolutePosition.d.ts +13 -0
- package/dist/hooks/useAbsolutePosition.js +2 -0
- package/dist/hooks/useAbsolutePosition.js.map +1 -0
- package/dist/hooks/useAudioUnlocked.cjs +2 -0
- package/dist/hooks/useAudioUnlocked.cjs.map +1 -0
- package/dist/hooks/useAudioUnlocked.d.cts +32 -0
- package/dist/hooks/useAudioUnlocked.d.ts +32 -0
- package/dist/hooks/useAudioUnlocked.js +2 -0
- package/dist/hooks/useAudioUnlocked.js.map +1 -0
- package/dist/hooks/useBehaviorSubject.cjs +2 -0
- package/dist/hooks/useBehaviorSubject.cjs.map +1 -0
- package/dist/hooks/useBehaviorSubject.d.cts +7 -0
- package/dist/hooks/useBehaviorSubject.d.ts +7 -0
- package/dist/hooks/useBehaviorSubject.js +2 -0
- package/dist/hooks/useBehaviorSubject.js.map +1 -0
- package/dist/hooks/useCallbackRef.cjs +2 -0
- package/dist/hooks/useCallbackRef.cjs.map +1 -0
- package/dist/hooks/useCallbackRef.d.cts +33 -0
- package/dist/hooks/useCallbackRef.d.ts +33 -0
- package/dist/hooks/useCallbackRef.js +2 -0
- package/dist/hooks/useCallbackRef.js.map +1 -0
- package/dist/hooks/useCenterInView.cjs +2 -0
- package/dist/hooks/useCenterInView.cjs.map +1 -0
- package/dist/hooks/useCenterInView.d.cts +29 -0
- package/dist/hooks/useCenterInView.d.ts +29 -0
- package/dist/hooks/useCenterInView.js +2 -0
- package/dist/hooks/useCenterInView.js.map +1 -0
- package/dist/hooks/useClipboard.cjs +2 -0
- package/dist/hooks/useClipboard.cjs.map +1 -0
- package/dist/hooks/useClipboard.d.cts +59 -0
- package/dist/hooks/useClipboard.d.ts +59 -0
- package/dist/hooks/useClipboard.js +2 -0
- package/dist/hooks/useClipboard.js.map +1 -0
- package/dist/hooks/useClosableEffect.cjs +2 -0
- package/dist/hooks/useClosableEffect.cjs.map +1 -0
- package/dist/hooks/useClosableEffect.d.cts +7 -0
- package/dist/hooks/useClosableEffect.d.ts +7 -0
- package/dist/hooks/useClosableEffect.js +2 -0
- package/dist/hooks/useClosableEffect.js.map +1 -0
- package/dist/hooks/useComposedRefs.cjs +2 -0
- package/dist/hooks/useComposedRefs.cjs.map +1 -0
- package/dist/hooks/useComposedRefs.d.cts +15 -0
- package/dist/hooks/useComposedRefs.d.ts +15 -0
- package/dist/hooks/useComposedRefs.js +2 -0
- package/dist/hooks/useComposedRefs.js.map +1 -0
- package/dist/hooks/useConstant.cjs +2 -0
- package/dist/hooks/useConstant.cjs.map +1 -0
- package/dist/hooks/useConstant.d.cts +4 -0
- package/dist/hooks/useConstant.d.ts +4 -0
- package/dist/hooks/useConstant.js +2 -0
- package/dist/hooks/useConstant.js.map +1 -0
- package/dist/hooks/useCooldown.cjs +2 -0
- package/dist/hooks/useCooldown.cjs.map +1 -0
- package/dist/hooks/useCooldown.d.cts +26 -0
- package/dist/hooks/useCooldown.d.ts +26 -0
- package/dist/hooks/useCooldown.js +2 -0
- package/dist/hooks/useCooldown.js.map +1 -0
- package/dist/hooks/useCustomCompareEffect.cjs +2 -0
- package/dist/hooks/useCustomCompareEffect.cjs.map +1 -0
- package/dist/hooks/useCustomCompareEffect.d.cts +56 -0
- package/dist/hooks/useCustomCompareEffect.d.ts +56 -0
- package/dist/hooks/useCustomCompareEffect.js +2 -0
- package/dist/hooks/useCustomCompareEffect.js.map +1 -0
- package/dist/hooks/useCustomCompareMemo.cjs +2 -0
- package/dist/hooks/useCustomCompareMemo.cjs.map +1 -0
- package/dist/hooks/useCustomCompareMemo.d.cts +14 -0
- package/dist/hooks/useCustomCompareMemo.d.ts +14 -0
- package/dist/hooks/useCustomCompareMemo.js +2 -0
- package/dist/hooks/useCustomCompareMemo.js.map +1 -0
- package/dist/hooks/useDebounceEffect.cjs +2 -0
- package/dist/hooks/useDebounceEffect.cjs.map +1 -0
- package/dist/hooks/useDebounceEffect.d.cts +56 -0
- package/dist/hooks/useDebounceEffect.d.ts +56 -0
- package/dist/hooks/useDebounceEffect.js +2 -0
- package/dist/hooks/useDebounceEffect.js.map +1 -0
- package/dist/hooks/useDebounceFn.cjs +2 -0
- package/dist/hooks/useDebounceFn.cjs.map +1 -0
- package/dist/hooks/useDebounceFn.d.cts +54 -0
- package/dist/hooks/useDebounceFn.d.ts +54 -0
- package/dist/hooks/useDebounceFn.js +2 -0
- package/dist/hooks/useDebounceFn.js.map +1 -0
- package/dist/hooks/useDebouncedCallback.cjs +2 -0
- package/dist/hooks/useDebouncedCallback.cjs.map +1 -0
- package/dist/hooks/useDebouncedCallback.d.cts +40 -0
- package/dist/hooks/useDebouncedCallback.d.ts +40 -0
- package/dist/hooks/useDebouncedCallback.js +2 -0
- package/dist/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/hooks/useDebouncedParams.cjs +2 -0
- package/dist/hooks/useDebouncedParams.cjs.map +1 -0
- package/dist/hooks/useDebouncedParams.d.cts +43 -0
- package/dist/hooks/useDebouncedParams.d.ts +43 -0
- package/dist/hooks/useDebouncedParams.js +2 -0
- package/dist/hooks/useDebouncedParams.js.map +1 -0
- package/dist/hooks/useDebouncedState.cjs +2 -0
- package/dist/hooks/useDebouncedState.cjs.map +1 -0
- package/dist/hooks/useDebouncedState.d.cts +36 -0
- package/dist/hooks/useDebouncedState.d.ts +36 -0
- package/dist/hooks/useDebouncedState.js +2 -0
- package/dist/hooks/useDebouncedState.js.map +1 -0
- package/dist/hooks/useDebouncedValue.cjs +2 -0
- package/dist/hooks/useDebouncedValue.cjs.map +1 -0
- package/dist/hooks/useDebouncedValue.d.cts +23 -0
- package/dist/hooks/useDebouncedValue.d.ts +23 -0
- package/dist/hooks/useDebouncedValue.js +2 -0
- package/dist/hooks/useDebouncedValue.js.map +1 -0
- package/dist/hooks/useDeepCompareEffect.cjs +2 -0
- package/dist/hooks/useDeepCompareEffect.cjs.map +1 -0
- package/dist/hooks/useDeepCompareEffect.d.cts +50 -0
- package/dist/hooks/useDeepCompareEffect.d.ts +50 -0
- package/dist/hooks/useDeepCompareEffect.js +2 -0
- package/dist/hooks/useDeepCompareEffect.js.map +1 -0
- package/dist/hooks/useDeepCompareMemo.cjs +2 -0
- package/dist/hooks/useDeepCompareMemo.cjs.map +1 -0
- package/dist/hooks/useDeepCompareMemo.d.cts +13 -0
- package/dist/hooks/useDeepCompareMemo.d.ts +13 -0
- package/dist/hooks/useDeepCompareMemo.js +2 -0
- package/dist/hooks/useDeepCompareMemo.js.map +1 -0
- package/dist/hooks/useDidUpdate.cjs +2 -0
- package/dist/hooks/useDidUpdate.cjs.map +1 -0
- package/dist/hooks/useDidUpdate.d.cts +5 -0
- package/dist/hooks/useDidUpdate.d.ts +5 -0
- package/dist/hooks/useDidUpdate.js +2 -0
- package/dist/hooks/useDidUpdate.js.map +1 -0
- package/dist/hooks/useEffectOnce.cjs +2 -0
- package/dist/hooks/useEffectOnce.cjs.map +1 -0
- package/dist/hooks/useEffectOnce.d.cts +28 -0
- package/dist/hooks/useEffectOnce.d.ts +28 -0
- package/dist/hooks/useEffectOnce.js +2 -0
- package/dist/hooks/useEffectOnce.js.map +1 -0
- package/dist/hooks/useElementSize.cjs +2 -0
- package/dist/hooks/useElementSize.cjs.map +1 -0
- package/dist/hooks/useElementSize.d.cts +30 -0
- package/dist/hooks/useElementSize.d.ts +30 -0
- package/dist/hooks/useElementSize.js +2 -0
- package/dist/hooks/useElementSize.js.map +1 -0
- package/dist/hooks/useEventListener.cjs +2 -0
- package/dist/hooks/useEventListener.cjs.map +1 -0
- package/dist/hooks/useEventListener.d.cts +4 -0
- package/dist/hooks/useEventListener.d.ts +4 -0
- package/dist/hooks/useEventListener.js +2 -0
- package/dist/hooks/useEventListener.js.map +1 -0
- package/dist/hooks/useId.cjs +2 -0
- package/dist/hooks/useId.cjs.map +1 -0
- package/dist/hooks/useId.d.cts +13 -0
- package/dist/hooks/useId.d.ts +13 -0
- package/dist/hooks/useId.js +2 -0
- package/dist/hooks/useId.js.map +1 -0
- package/dist/hooks/useIdle.cjs +2 -0
- package/dist/hooks/useIdle.cjs.map +1 -0
- package/dist/hooks/useIdle.d.cts +49 -0
- package/dist/hooks/useIdle.d.ts +49 -0
- package/dist/hooks/useIdle.js +2 -0
- package/dist/hooks/useIdle.js.map +1 -0
- package/dist/hooks/useImageLoadCallback.cjs +2 -0
- package/dist/hooks/useImageLoadCallback.cjs.map +1 -0
- package/dist/hooks/useImageLoadCallback.d.cts +44 -0
- package/dist/hooks/useImageLoadCallback.d.ts +44 -0
- package/dist/hooks/useImageLoadCallback.js +2 -0
- package/dist/hooks/useImageLoadCallback.js.map +1 -0
- package/dist/hooks/useImageUpload.cjs +2 -0
- package/dist/hooks/useImageUpload.cjs.map +1 -0
- package/dist/hooks/useImageUpload.d.cts +92 -0
- package/dist/hooks/useImageUpload.d.ts +92 -0
- package/dist/hooks/useImageUpload.js +2 -0
- package/dist/hooks/useImageUpload.js.map +1 -0
- package/dist/hooks/useInterval.cjs +2 -0
- package/dist/hooks/useInterval.cjs.map +1 -0
- package/dist/hooks/useInterval.d.cts +53 -0
- package/dist/hooks/useInterval.d.ts +53 -0
- package/dist/hooks/useInterval.js +2 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useIsomorphicEffect.cjs +2 -0
- package/dist/hooks/useIsomorphicEffect.cjs.map +1 -0
- package/dist/hooks/useIsomorphicEffect.d.cts +26 -0
- package/dist/hooks/useIsomorphicEffect.d.ts +26 -0
- package/dist/hooks/useIsomorphicEffect.js +2 -0
- package/dist/hooks/useIsomorphicEffect.js.map +1 -0
- package/dist/hooks/useLatest.cjs +2 -0
- package/dist/hooks/useLatest.cjs.map +1 -0
- package/dist/hooks/useLatest.d.cts +4 -0
- package/dist/hooks/useLatest.d.ts +4 -0
- package/dist/hooks/useLatest.js +2 -0
- package/dist/hooks/useLatest.js.map +1 -0
- package/dist/hooks/useLgOrUp.cjs +2 -0
- package/dist/hooks/useLgOrUp.cjs.map +1 -0
- package/dist/hooks/useLgOrUp.d.cts +5 -0
- package/dist/hooks/useLgOrUp.d.ts +5 -0
- package/dist/hooks/useLgOrUp.js +2 -0
- package/dist/hooks/useLgOrUp.js.map +1 -0
- package/dist/hooks/useLifecycleLogger.cjs +2 -0
- package/dist/hooks/useLifecycleLogger.cjs.map +1 -0
- package/dist/hooks/useLifecycleLogger.d.cts +11 -0
- package/dist/hooks/useLifecycleLogger.d.ts +11 -0
- package/dist/hooks/useLifecycleLogger.js +2 -0
- package/dist/hooks/useLifecycleLogger.js.map +1 -0
- package/dist/hooks/useLoadingVisible.cjs +2 -0
- package/dist/hooks/useLoadingVisible.cjs.map +1 -0
- package/dist/hooks/useLoadingVisible.d.cts +33 -0
- package/dist/hooks/useLoadingVisible.d.ts +33 -0
- package/dist/hooks/useLoadingVisible.js +2 -0
- package/dist/hooks/useLoadingVisible.js.map +1 -0
- package/dist/hooks/useLocalStorage.cjs +2 -0
- package/dist/hooks/useLocalStorage.cjs.map +1 -0
- package/dist/hooks/useLocalStorage.d.cts +13 -0
- package/dist/hooks/useLocalStorage.d.ts +13 -0
- package/dist/hooks/useLocalStorage.js +2 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useLocalStorageState.cjs +2 -0
- package/dist/hooks/useLocalStorageState.cjs.map +1 -0
- package/dist/hooks/useLocalStorageState.d.cts +9 -0
- package/dist/hooks/useLocalStorageState.d.ts +9 -0
- package/dist/hooks/useLocalStorageState.js +2 -0
- package/dist/hooks/useLocalStorageState.js.map +1 -0
- package/dist/hooks/useMdOrDown.cjs +2 -0
- package/dist/hooks/useMdOrDown.cjs.map +1 -0
- package/dist/hooks/useMdOrDown.d.cts +5 -0
- package/dist/hooks/useMdOrDown.d.ts +5 -0
- package/dist/hooks/useMdOrDown.js +2 -0
- package/dist/hooks/useMdOrDown.js.map +1 -0
- package/dist/hooks/useMdOrUp.cjs +2 -0
- package/dist/hooks/useMdOrUp.cjs.map +1 -0
- package/dist/hooks/useMdOrUp.d.cts +5 -0
- package/dist/hooks/useMdOrUp.d.ts +5 -0
- package/dist/hooks/useMdOrUp.js +2 -0
- package/dist/hooks/useMdOrUp.js.map +1 -0
- package/dist/hooks/useMount.cjs +2 -0
- package/dist/hooks/useMount.cjs.map +1 -0
- package/dist/hooks/useMount.d.cts +27 -0
- package/dist/hooks/useMount.d.ts +27 -0
- package/dist/hooks/useMount.js +2 -0
- package/dist/hooks/useMount.js.map +1 -0
- package/dist/hooks/useMounted.cjs +2 -0
- package/dist/hooks/useMounted.cjs.map +1 -0
- package/dist/hooks/useMounted.d.cts +24 -0
- package/dist/hooks/useMounted.d.ts +24 -0
- package/dist/hooks/useMounted.js +2 -0
- package/dist/hooks/useMounted.js.map +1 -0
- package/dist/hooks/useMountedState.cjs +2 -0
- package/dist/hooks/useMountedState.cjs.map +1 -0
- package/dist/hooks/useMountedState.d.cts +38 -0
- package/dist/hooks/useMountedState.d.ts +38 -0
- package/dist/hooks/useMountedState.js +2 -0
- package/dist/hooks/useMountedState.js.map +1 -0
- package/dist/hooks/useMutationObserver.cjs +2 -0
- package/dist/hooks/useMutationObserver.cjs.map +1 -0
- package/dist/hooks/useMutationObserver.d.cts +28 -0
- package/dist/hooks/useMutationObserver.d.ts +28 -0
- package/dist/hooks/useMutationObserver.js +2 -0
- package/dist/hooks/useMutationObserver.js.map +1 -0
- package/dist/hooks/useObservable.cjs +2 -0
- package/dist/hooks/useObservable.cjs.map +1 -0
- package/dist/hooks/useObservable.d.cts +6 -0
- package/dist/hooks/useObservable.d.ts +7 -0
- package/dist/hooks/useObservable.js +2 -0
- package/dist/hooks/useObservable.js.map +1 -0
- package/dist/hooks/useObservableLocalStorage.cjs +2 -0
- package/dist/hooks/useObservableLocalStorage.cjs.map +1 -0
- package/dist/hooks/useObservableLocalStorage.d.cts +7 -0
- package/dist/hooks/useObservableLocalStorage.d.ts +7 -0
- package/dist/hooks/useObservableLocalStorage.js +2 -0
- package/dist/hooks/useObservableLocalStorage.js.map +1 -0
- package/dist/hooks/useObservableSessionStorage.cjs +2 -0
- package/dist/hooks/useObservableSessionStorage.cjs.map +1 -0
- package/dist/hooks/useObservableSessionStorage.d.cts +7 -0
- package/dist/hooks/useObservableSessionStorage.d.ts +7 -0
- package/dist/hooks/useObservableSessionStorage.js +2 -0
- package/dist/hooks/useObservableSessionStorage.js.map +1 -0
- package/dist/hooks/useOs.cjs +2 -0
- package/dist/hooks/useOs.cjs.map +1 -0
- package/dist/hooks/useOs.d.cts +9 -0
- package/dist/hooks/useOs.d.ts +9 -0
- package/dist/hooks/useOs.js +2 -0
- package/dist/hooks/useOs.js.map +1 -0
- package/dist/hooks/useRafState.cjs +2 -0
- package/dist/hooks/useRafState.cjs.map +1 -0
- package/dist/hooks/useRafState.d.cts +5 -0
- package/dist/hooks/useRafState.d.ts +5 -0
- package/dist/hooks/useRafState.js +2 -0
- package/dist/hooks/useRafState.js.map +1 -0
- package/dist/hooks/useRefEffect.cjs +2 -0
- package/dist/hooks/useRefEffect.cjs.map +1 -0
- package/dist/hooks/useRefEffect.d.cts +27 -0
- package/dist/hooks/useRefEffect.d.ts +27 -0
- package/dist/hooks/useRefEffect.js +2 -0
- package/dist/hooks/useRefEffect.js.map +1 -0
- package/dist/hooks/useResizeObserver.cjs +2 -0
- package/dist/hooks/useResizeObserver.cjs.map +1 -0
- package/dist/hooks/useResizeObserver.d.cts +27 -0
- package/dist/hooks/useResizeObserver.d.ts +27 -0
- package/dist/hooks/useResizeObserver.js +2 -0
- package/dist/hooks/useResizeObserver.js.map +1 -0
- package/dist/hooks/useScript.cjs +2 -0
- package/dist/hooks/useScript.cjs.map +1 -0
- package/dist/hooks/useScript.d.cts +8 -0
- package/dist/hooks/useScript.d.ts +8 -0
- package/dist/hooks/useScript.js +2 -0
- package/dist/hooks/useScript.js.map +1 -0
- package/dist/hooks/useSessionStorage.cjs +2 -0
- package/dist/hooks/useSessionStorage.cjs.map +1 -0
- package/dist/hooks/useSessionStorage.d.cts +22 -0
- package/dist/hooks/useSessionStorage.d.ts +22 -0
- package/dist/hooks/useSessionStorage.js +2 -0
- package/dist/hooks/useSessionStorage.js.map +1 -0
- package/dist/hooks/useSessionStorageState.cjs +2 -0
- package/dist/hooks/useSessionStorageState.cjs.map +1 -0
- package/dist/hooks/useSessionStorageState.d.cts +9 -0
- package/dist/hooks/useSessionStorageState.d.ts +9 -0
- package/dist/hooks/useSessionStorageState.js +2 -0
- package/dist/hooks/useSessionStorageState.js.map +1 -0
- package/dist/hooks/useSmOrDown.cjs +2 -0
- package/dist/hooks/useSmOrDown.cjs.map +1 -0
- package/dist/hooks/useSmOrDown.d.cts +5 -0
- package/dist/hooks/useSmOrDown.d.ts +5 -0
- package/dist/hooks/useSmOrDown.js +2 -0
- package/dist/hooks/useSmOrDown.js.map +1 -0
- package/dist/hooks/useSmOrUp.cjs +2 -0
- package/dist/hooks/useSmOrUp.cjs.map +1 -0
- package/dist/hooks/useSmOrUp.d.cts +5 -0
- package/dist/hooks/useSmOrUp.d.ts +5 -0
- package/dist/hooks/useSmOrUp.js +2 -0
- package/dist/hooks/useSmOrUp.js.map +1 -0
- package/dist/hooks/useThrottledCallback.cjs +2 -0
- package/dist/hooks/useThrottledCallback.cjs.map +1 -0
- package/dist/hooks/useThrottledCallback.d.cts +24 -0
- package/dist/hooks/useThrottledCallback.d.ts +24 -0
- package/dist/hooks/useThrottledCallback.js +2 -0
- package/dist/hooks/useThrottledCallback.js.map +1 -0
- package/dist/hooks/useThrottledCallbackWithClearTimeout.cjs +2 -0
- package/dist/hooks/useThrottledCallbackWithClearTimeout.cjs.map +1 -0
- package/dist/hooks/useThrottledCallbackWithClearTimeout.d.cts +30 -0
- package/dist/hooks/useThrottledCallbackWithClearTimeout.d.ts +30 -0
- package/dist/hooks/useThrottledCallbackWithClearTimeout.js +2 -0
- package/dist/hooks/useThrottledCallbackWithClearTimeout.js.map +1 -0
- package/dist/hooks/useThrottledState.cjs +2 -0
- package/dist/hooks/useThrottledState.cjs.map +1 -0
- package/dist/hooks/useThrottledState.d.cts +31 -0
- package/dist/hooks/useThrottledState.d.ts +31 -0
- package/dist/hooks/useThrottledState.js +2 -0
- package/dist/hooks/useThrottledState.js.map +1 -0
- package/dist/hooks/useThrottledValue.cjs +2 -0
- package/dist/hooks/useThrottledValue.cjs.map +1 -0
- package/dist/hooks/useThrottledValue.d.cts +21 -0
- package/dist/hooks/useThrottledValue.d.ts +21 -0
- package/dist/hooks/useThrottledValue.js +2 -0
- package/dist/hooks/useThrottledValue.js.map +1 -0
- package/dist/hooks/useTimeout.cjs +2 -0
- package/dist/hooks/useTimeout.cjs.map +1 -0
- package/dist/hooks/useTimeout.d.cts +38 -0
- package/dist/hooks/useTimeout.d.ts +38 -0
- package/dist/hooks/useTimeout.js +2 -0
- package/dist/hooks/useTimeout.js.map +1 -0
- package/dist/hooks/useTimeoutData.cjs +2 -0
- package/dist/hooks/useTimeoutData.cjs.map +1 -0
- package/dist/hooks/useTimeoutData.d.cts +7 -0
- package/dist/hooks/useTimeoutData.d.ts +7 -0
- package/dist/hooks/useTimeoutData.js +2 -0
- package/dist/hooks/useTimeoutData.js.map +1 -0
- package/dist/hooks/useUncontrolled.cjs +2 -0
- package/dist/hooks/useUncontrolled.cjs.map +1 -0
- package/dist/hooks/useUncontrolled.d.cts +48 -0
- package/dist/hooks/useUncontrolled.d.ts +48 -0
- package/dist/hooks/useUncontrolled.js +2 -0
- package/dist/hooks/useUncontrolled.js.map +1 -0
- package/dist/hooks/useUnmount.cjs +2 -0
- package/dist/hooks/useUnmount.cjs.map +1 -0
- package/dist/hooks/useUnmount.d.cts +4 -0
- package/dist/hooks/useUnmount.d.ts +4 -0
- package/dist/hooks/useUnmount.js +2 -0
- package/dist/hooks/useUnmount.js.map +1 -0
- package/dist/hooks/useUpdate.cjs +2 -0
- package/dist/hooks/useUpdate.cjs.map +1 -0
- package/dist/hooks/useUpdate.d.cts +4 -0
- package/dist/hooks/useUpdate.d.ts +4 -0
- package/dist/hooks/useUpdate.js +2 -0
- package/dist/hooks/useUpdate.js.map +1 -0
- package/dist/hooks/useUpdateEffect.cjs +2 -0
- package/dist/hooks/useUpdateEffect.cjs.map +1 -0
- package/dist/hooks/useUpdateEffect.d.cts +5 -0
- package/dist/hooks/useUpdateEffect.d.ts +5 -0
- package/dist/hooks/useUpdateEffect.js +2 -0
- package/dist/hooks/useUpdateEffect.js.map +1 -0
- package/dist/hooks/useUpdateLayoutEffect.cjs +2 -0
- package/dist/hooks/useUpdateLayoutEffect.cjs.map +1 -0
- package/dist/hooks/useUpdateLayoutEffect.d.cts +5 -0
- package/dist/hooks/useUpdateLayoutEffect.d.ts +5 -0
- package/dist/hooks/useUpdateLayoutEffect.js +2 -0
- package/dist/hooks/useUpdateLayoutEffect.js.map +1 -0
- package/dist/hooks/useWindowEvent.cjs +2 -0
- package/dist/hooks/useWindowEvent.cjs.map +1 -0
- package/dist/hooks/useWindowEvent.d.cts +24 -0
- package/dist/hooks/useWindowEvent.d.ts +24 -0
- package/dist/hooks/useWindowEvent.js +2 -0
- package/dist/hooks/useWindowEvent.js.map +1 -0
- package/dist/hooks/useWindowSize.cjs +2 -0
- package/dist/hooks/useWindowSize.cjs.map +1 -0
- package/dist/hooks/useWindowSize.d.cts +13 -0
- package/dist/hooks/useWindowSize.d.ts +13 -0
- package/dist/hooks/useWindowSize.js +2 -0
- package/dist/hooks/useWindowSize.js.map +1 -0
- package/dist/hooks/useXsOrDown.cjs +2 -0
- package/dist/hooks/useXsOrDown.cjs.map +1 -0
- package/dist/hooks/useXsOrDown.d.cts +5 -0
- package/dist/hooks/useXsOrDown.d.ts +5 -0
- package/dist/hooks/useXsOrDown.js +2 -0
- package/dist/hooks/useXsOrDown.js.map +1 -0
- package/dist/index.cjs +1 -2
- package/dist/index.d.cts +65 -1406
- package/dist/index.d.ts +65 -1406
- package/dist/index.js +1 -2
- package/dist/misc/debounce.cjs +2 -0
- package/dist/misc/debounce.cjs.map +1 -0
- package/dist/misc/debounce.js +2 -0
- package/dist/misc/debounce.js.map +1 -0
- package/dist/misc/deepEq.cjs +2 -0
- package/dist/misc/deepEq.cjs.map +1 -0
- package/dist/misc/deepEq.js +2 -0
- package/dist/misc/deepEq.js.map +1 -0
- package/dist/persistence/codec.cjs +2 -0
- package/dist/persistence/codec.cjs.map +1 -0
- package/dist/persistence/codec.d.cts +21 -0
- package/dist/persistence/codec.d.ts +21 -0
- package/dist/persistence/codec.js +2 -0
- package/dist/persistence/codec.js.map +1 -0
- package/dist/persistence/index.d.cts +2 -0
- package/dist/persistence/index.d.ts +2 -0
- package/dist/persistence/useStorageState.cjs +2 -0
- package/dist/persistence/useStorageState.cjs.map +1 -0
- package/dist/persistence/useStorageState.d.cts +39 -0
- package/dist/persistence/useStorageState.d.ts +39 -0
- package/dist/persistence/useStorageState.js +2 -0
- package/dist/persistence/useStorageState.js.map +1 -0
- package/dist/util/closables.cjs +2 -0
- package/dist/util/closables.cjs.map +1 -0
- package/dist/util/closables.d.cts +70 -0
- package/dist/util/closables.d.ts +70 -0
- package/dist/util/closables.js +2 -0
- package/dist/util/closables.js.map +1 -0
- package/dist/util/event-utils.cjs +2 -0
- package/dist/util/event-utils.cjs.map +1 -0
- package/dist/util/event-utils.d.cts +12 -0
- package/dist/util/event-utils.d.ts +12 -0
- package/dist/util/event-utils.js +2 -0
- package/dist/util/event-utils.js.map +1 -0
- package/dist/util/internal-util.cjs +2 -0
- package/dist/util/internal-util.cjs.map +1 -0
- package/dist/util/internal-util.js +2 -0
- package/dist/util/internal-util.js.map +1 -0
- package/dist/util/misc-utils.cjs +2 -0
- package/dist/util/misc-utils.cjs.map +1 -0
- package/dist/util/misc-utils.d.cts +15 -0
- package/dist/util/misc-utils.d.ts +15 -0
- package/dist/util/misc-utils.js +2 -0
- package/dist/util/misc-utils.js.map +1 -0
- package/dist/util/override-props.cjs +2 -0
- package/dist/util/override-props.cjs.map +1 -0
- package/dist/util/override-props.js +2 -0
- package/dist/util/override-props.js.map +1 -0
- package/dist/util/sx-props.cjs +2 -0
- package/dist/util/sx-props.cjs.map +1 -0
- package/dist/util/sx-props.d.cts +22 -0
- package/dist/util/sx-props.d.ts +22 -0
- package/dist/util/sx-props.js +2 -0
- package/dist/util/sx-props.js.map +1 -0
- package/dist/util/ymd-date.cjs +2 -0
- package/dist/util/ymd-date.cjs.map +1 -0
- package/dist/util/ymd-date.js +2 -0
- package/dist/util/ymd-date.js.map +1 -0
- package/llm.txt +16 -9
- package/package.json +21 -22
- package/dist/closables-CeOGJV-d.d.cts +0 -136
- package/dist/closables-CeOGJV-d.d.ts +0 -136
- package/dist/file-drop/index.cjs.map +0 -1
- package/dist/file-drop/index.js.map +0 -1
- package/dist/helper/index.cjs.map +0 -1
- package/dist/helper/index.js.map +0 -1
- package/dist/hooks/index.cjs.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/misc-utils-B2de-HS4.cjs +0 -2
- package/dist/misc-utils-B2de-HS4.cjs.map +0 -1
- package/dist/misc-utils-BXQ8UU0R.js +0 -2
- package/dist/misc-utils-BXQ8UU0R.js.map +0 -1
- package/dist/parallel-map-DyuHvxYY.js.map +0 -1
- package/dist/parallel-map-_ZhC5iBn.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{A as e,E as t,T as n,a as r,b as i,c as a,f as o,g as s,h as c,i as l,j as u,l as d,m as f,n as p,o as m,r as h,s as g,t as _,u as v,w as y,y as b}from"./misc-utils-BXQ8UU0R.js";import x from"@mui/material/Box";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import T from"@mui/material/Stack";import E from"@mui/material/Button";import{useCallback as D,useEffect as O,useMemo as k,useRef as A,useState as j}from"react";import ee from"@mui/material/ButtonBase";import M from"@mui/material/IconButton";import te from"@mui/material/TableBody";import N,{clsx as P}from"clsx";import F from"@mui/material/Grid";import I from"@mui/material/Typography";import L from"@mui/material/useMediaQuery";import ne from"@mui/material/Pagination";import re from"@mui/material/Paper";import ie from"@mui/material/InputAdornment";import ae from"@mui/material/TextField";import{createSvgIcon as oe}from"@mui/material/utils";import se from"@mui/material/CircularProgress";import ce from"@mui/material/SvgIcon";import{styled as R}from"@mui/material/styles";import le from"@mui/material/Link";function z(e){let t=(t=>{let{sx:n,ref:r,...i}=t,a;e.supportsFullWidth&&(a=i.fullWidth,delete i.fullWidth);let o={};for(let t of e.axes)o[t.cssProp]=i[t.cssProp]??t.defaultValue,delete i[t.cssProp];return/* @__PURE__ */ C(x,{ref:r,sx:[{position:`absolute`,...o,...e.fixedStyle,...a?{width:`100%`}:{}},...Array.isArray(n)?n:[n]],...i})});return t.displayName=e.displayName,t}const ue=z({displayName:`BottomAbsolute.Center`,axes:[{cssProp:`bottom`,defaultValue:0}],fixedStyle:{left:`50%`,transform:`translate(-50%, -50%)`},supportsFullWidth:!0}),de=z({displayName:`BottomAbsolute.Left`,axes:[{cssProp:`left`,defaultValue:0},{cssProp:`bottom`,defaultValue:0}],supportsFullWidth:!0}),fe=z({displayName:`BottomAbsolute.Right`,axes:[{cssProp:`right`,defaultValue:0},{cssProp:`bottom`,defaultValue:0}],supportsFullWidth:!0}),B=z({displayName:`BottomAbsolute`,axes:[{cssProp:`bottom`,defaultValue:0},{cssProp:`left`,defaultValue:0},{cssProp:`right`,defaultValue:0}],supportsFullWidth:!1});B.Left=de,B.Right=fe,B.Center=ue;const pe=({vertical:e=!1,sx:t,ref:n,...r})=>/* @__PURE__ */ C(T,{ref:n,...r,direction:e?`column`:`row`,sx:[{alignItems:`center`,justifyContent:`center`},...Array.isArray(t)?t:[t??!1]]});pe.displayName=`Center`;const me=({cooldown:e=1e3,onClick:t,disabled:n,ref:r,...i})=>{let{isCooldown:a,trigger:o}=u(t,e);return/* @__PURE__ */ C(E,{...i,ref:r,onClick:o,disabled:n||a,children:i.children})};me.displayName=`CooldownButton`;const he=({cooldown:e=1e3,onClick:t,disabled:n,ref:r,...i})=>{let{isCooldown:a,trigger:o}=u(t,e);return/* @__PURE__ */ C(ee,{...i,ref:r,onClick:o,disabled:n||a,children:i.children})};he.displayName=`CooldownButtonBase`;const ge=({cooldown:e=700,onClick:t,disabled:n,ref:r,...i})=>{let{isCooldown:a,trigger:o}=u(t,e);return/* @__PURE__ */ C(M,{...i,ref:r,onClick:o,disabled:n||a,children:i.children})};ge.displayName=`CooldownIconButton`;function _e(t){let{children:n,onCopySuccess:r,value:i,timeout:a=1e3}=t,o=e({timeout:a});return/* @__PURE__ */ C(S,{children:n({copy:()=>{let e=typeof i==`function`?i():i;typeof e==`string`&&e.length>0&&o.copy(e).then(t=>{t&&r?.(e)})},copied:o.copied})})}function ve(e){let{sx:t,className:n,loading:r,stripe:i,...a}=e;return/* @__PURE__ */ C(te,{className:N(`CustomTableBody-root`,n,{"CustomTableBody-stripe":!!i,"CustomTableBody-loading":!!r}),sx:[{"&.CustomTableBody-loading":{opacity:.5},"&.CustomTableBody-stripe":{"& .MuiTableRow-root:nth-of-type(even)":{backgroundColor:`action.hover`}}},...Array.isArray(t)?t:[t??!1]],...a})}const ye=z({displayName:`CenterAbsolute.Center`,axes:[],fixedStyle:{top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`},supportsFullWidth:!0}),be=z({displayName:`CenterAbsolute.Left`,axes:[{cssProp:`left`,defaultValue:0}],fixedStyle:{top:`50%`,transform:`translateY(-50%)`},supportsFullWidth:!0}),xe=z({displayName:`CenterAbsolute.Right`,axes:[{cssProp:`right`,defaultValue:0}],fixedStyle:{top:`50%`,transform:`translateY(-50%)`},supportsFullWidth:!0}),V=z({displayName:`CenterAbsolute`,axes:[{cssProp:`left`,defaultValue:0},{cssProp:`right`,defaultValue:0}],fixedStyle:{top:`50%`,transform:`translateY(-50%)`},supportsFullWidth:!1});V.Left=be,V.Right=xe,V.Center=ye;const Se=({debounce:e=700,onClick:t,disabled:r,children:i,ref:a,...o})=>{let s=n(e=>{!r&&t&&t(e)},e);return/* @__PURE__ */ C(E,{...o,ref:a,onClick:s,disabled:r,children:i})},Ce=({debounce:e=700,onClick:t,disabled:r,children:i,ref:a,...o})=>{let s=n(e=>{!r&&t&&t(e)},e);return/* @__PURE__ */ C(ee,{...o,ref:a,onClick:s,disabled:r,children:i})},we=({debounce:e=700,onClick:t,disabled:r,ref:i,...a})=>{let o=n(e=>{!r&&t&&t(e)},e);return/* @__PURE__ */ C(M,{...a,ref:i,onClick:o,disabled:r,children:a.children})},Te=({children:e,leading:t=!1,trailing:n=!0,maxWait:r=100})=>{let[i,a]=j(t?e:void 0),o=A(null),s=A(null),c=D(()=>{o.current&&clearTimeout(o.current)},[]);return O(()=>{let i=Date.now(),c=()=>{a(e),s.current=i};return t&&s.current===null&&c(),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n&&c(),o.current=null},r),t&&s.current!==null&&i-(s.current||0)>=r&&c(),()=>{o.current&&clearTimeout(o.current)}},[e,t,n,r,c]),/* @__PURE__ */ C(S,{children:i})};function Ee(e){let{delayMs:t=500,children:n}=e,r=Math.max(0,t),[i,a]=j(null);return O(()=>{if(r===0)return;let e=setTimeout(()=>a(r),r);return()=>{clearTimeout(e),a(null)}},[r]),r===0||i===r?n:null}function De(e,t){typeof e==`function`?e(t):typeof e==`object`&&e&&`current`in e&&(e.current=t)}const Oe=(e=>{let{ref:t,onChange:n,children:r,multiple:i,accept:a,name:o,form:s,resetRef:c,disabled:l,capture:u,inputProps:d}=e,f=A(null),[p,m]=j(0),h=D(()=>{l||m(e=>e+1)},[l]);O(()=>{p!==0&&f.current?.click()},[p]);let g=e=>{let t=e.currentTarget?.files;if(t){if(i)n(Array.from(t));else{let e=t[0];e&&n(e)}}},_=D(()=>{f.current&&(f.current.value=``)},[]);return O(()=>{if(c)return De(c,_),()=>{De(c,()=>{})}},[c,_]),/* @__PURE__ */ w(S,{children:[r({onClick:h}),/* @__PURE__ */ C(`input`,{style:{display:`none`},type:`file`,accept:a,multiple:i,onChange:g,ref:y(t,f),name:o,form:s,capture:u,...d})]})});Oe.displayName=`FileButton`;function H(e){return e==null}function ke(e){return!H(e)}function Ae(e){let{className:t,items:n,getItemKey:r,getItemSize:i,isLineBreakItem:a,breakBefore:o,breakAfter:s,children:c,lineBreakHeight:l,lineBreakGroup:u,...d}=e;return Array.isArray(n)?/* @__PURE__ */ C(F,{className:N(`FlexItemsContainer-root`,t),container:!0,role:`grid`,...d,children:je({items:n,isLineBreakItem:a,lineBreakGroup:u,lineBreakHeight:l,breakBefore:o,breakAfter:s,getItemKey:r,getItemSize:i,renderItem:c})}):(console.error(`FlexItemsContainer: items must be an array`),null)}Ae.displayName=`FlexItemsContainer`;function je(e){let{items:t,getItemKey:n,getItemSize:r,isLineBreakItem:i,lineBreakHeight:a=0,lineBreakGroup:o,breakBefore:s,breakAfter:c,renderItem:l}=e,u=[],d=!0,f;return t.forEach((e,t)=>{if(i?.(e,t))d||(d=!0,u.push(U(t,`break-item`,a)));else{if(o){let n=o(e,t);Me(f,n)&&(f=n,d||(d=!0,u.push(U(t,`group`,a))))}!d&&s?.(e,t)&&(d=!0,u.push(U(t,`break-before`,a))),d=!1,u.push(/* @__PURE__ */ C(F,{size:r?.(e,t),children:l(e,t)},n(e,t))),c?.(e,t)&&(d=!0,u.push(U(t,`break-after`,a)))}}),d&&u.length>0&&u.pop(),u}function Me(e,t){return H(e)&&H(t)?!1:e!==t}function U(e,t,n){return/* @__PURE__ */ C(F,{className:`FlexItemsContainer-emptyLine`,size:`auto`,style:{flexBasis:`100%`,width:0,height:n}},`FlexItemsContainer:${t}:${e}`)}function W(e){return e?parseInt(e,10):0}function Ne(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;ke(n);){if(n===e)return!0;n=n.parentNode}return!1}function Pe({target:e,parent:n,indicatorRef:r,excludeTargetBorderWidth:a=!1,displayAfterTransitionEnd:o=!1}){let s=A(-1),[c,l]=j(!1),[u,d]=j(o),f=t(()=>{if(!e||!n||!r.current)return;let t=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=window.getComputedStyle(e),s=window.getComputedStyle(n),c={top:W(s.borderTopWidth),left:W(s.borderLeftWidth)},l={top:W(o.borderTopWidth),bottom:W(o.borderBottomWidth),left:W(o.borderLeftWidth),right:W(o.borderRightWidth)},u={top:t.top-i.top-c.top,left:t.left-i.left-c.left,width:t.width,height:t.height};a&&(u.top+=l.top,u.left+=l.left,u.height-=l.top+l.bottom,u.width-=l.left+l.right),r.current.style.transform=`translateX(${u.left}px) translateY(${u.top}px)`,r.current.style.width=`${u.width}px`,r.current.style.height=`${u.height}px`}),p=t(()=>{window.clearTimeout(s.current),r.current&&(r.current.style.transitionDuration=`0ms`),f.current(),s.current=window.setTimeout(()=>{r.current&&(r.current.style.transitionDuration=``)},30)}),m=A(null),h=A(null);return O(()=>{if(f.current(),e)return m.current=new ResizeObserver(p.current),m.current.observe(e),n&&(h.current=new ResizeObserver(p.current),h.current.observe(n)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[n,e,f,p]),O(()=>{if(n){let e=e=>{Ne(e.target,n)&&(p.current(),d(!1))};return n.addEventListener(`transitionend`,e),()=>{n.removeEventListener(`transitionend`,e)}}},[n,p]),b(()=>{l(!0)},20,{autoInvoke:!0}),i(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p.current()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}const Fe=e=>{let{target:t,parent:n,transitionDuration:r=150,excludeTargetBorderWidth:i=!1,displayAfterTransitionEnd:a,sx:o,className:s,ref:c,...l}=e,u=A(null),{initialized:d,hidden:f}=Pe({target:t,parent:n,indicatorRef:u,excludeTargetBorderWidth:i,displayAfterTransitionEnd:a}),p=y(c,u);return!t||!n?null:/* @__PURE__ */ C(x,{className:N(`FloatingIndicator-root`,s),ref:p,sx:[{position:`absolute`,top:0,left:0,transition:`transform ${r}ms`,opacity:+!!d,...f?{display:`none`}:void 0},...Array.isArray(o)?o:[o??!1]],...l})};var Ie=Fe;function Le(e,...t){let n=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0)),r=t.reduce((e,t)=>{let n=Object.fromEntries(Object.entries(t).filter(([e,t])=>t!==void 0));return Object.assign(e,n),e},{});return{...n,...r}}function G(e){let t=e.defaultProps??{},n=(n=>{let{center:r,alignItems:i,justifyContent:a,flexWrap:o,inlineFlex:s,sx:c,ref:l,...u}=n,d=!!(e.supportsCenterProp&&r),f={alignItems:`center`,justifyContent:`center`},p;p=e.base===`stack`?d?f:Le(t,{alignItems:i,justifyContent:a}):Le(d?f:t,{alignItems:i,justifyContent:a,flexWrap:o});let m=Array.isArray(c)?c:[c];return e.base===`stack`?/* @__PURE__ */ C(T,{direction:e.direction,...u,ref:l,sx:[p,...m]}):/* @__PURE__ */ C(x,{ref:l,sx:[{display:s?`inline-flex`:`flex`,flexDirection:e.direction,...p},...m],...u})});return n.displayName=e.displayName,n}const Re=G({displayName:`FlexColumn.Start`,base:`box`,direction:`column`,defaultProps:{justifyContent:`flex-start`}}),ze=G({displayName:`FlexColumn.End`,base:`box`,direction:`column`,defaultProps:{justifyContent:`flex-end`}}),Be=G({displayName:`FlexColumn.Center`,base:`box`,direction:`column`,defaultProps:{justifyContent:`center`}}),Ve=G({displayName:`FlexColumn.Around`,base:`box`,direction:`column`,defaultProps:{justifyContent:`space-around`}}),He=G({displayName:`FlexColumn.Between`,base:`box`,direction:`column`,defaultProps:{justifyContent:`space-between`}}),Ue=G({displayName:`FlexColumn.Evenly`,base:`box`,direction:`column`,defaultProps:{justifyContent:`space-evenly`}}),K=G({displayName:`FlexColumn`,base:`box`,direction:`column`,supportsCenterProp:!0});K.Start=Re,K.End=ze,K.Center=Be,K.Between=He,K.Evenly=Ue,K.Around=Ve;const We=G({displayName:`FlexRow.Start`,base:`box`,direction:`row`,defaultProps:{justifyContent:`flex-start`}}),Ge=G({displayName:`FlexRow.End`,base:`box`,direction:`row`,defaultProps:{justifyContent:`flex-end`}}),Ke=G({displayName:`FlexRow.Around`,base:`box`,direction:`row`,defaultProps:{justifyContent:`space-around`}}),qe=G({displayName:`FlexRow.Between`,base:`box`,direction:`row`,defaultProps:{justifyContent:`space-between`}}),Je=G({displayName:`FlexRow.Evenly`,base:`box`,direction:`row`,defaultProps:{justifyContent:`space-evenly`}}),Ye=G({displayName:`FlexRow.Center`,base:`box`,direction:`row`,defaultProps:{justifyContent:`center`}}),q=G({displayName:`FlexRow`,base:`box`,direction:`row`,supportsCenterProp:!0});q.Start=We,q.End=Ge,q.Center=Ye,q.Between=qe,q.Around=Ke,q.Evenly=Je;function Xe(e){return null}const J=e=>{let{sx:t,className:n,color:r=`#000`,bgcolor:i=`#ff0`,children:a,ref:o,...s}=e;return/* @__PURE__ */ C(x,{className:N(`Mark-root`,n),component:`mark`,ref:o,sx:[{display:`inline-block`,color:r,bgcolor:i},...Array.isArray(t)?t:[t??!1]],...s,children:a})};J.displayName=`Mark`;function Ze(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,`\\$&`)}function Qe(e,t,n){if(!t||t.length===0)return[{chunk:e,highlighted:!1}];let r=n?.ignorecase??!0,i=Array.isArray(t)?t.map(Ze):Ze(t);if(!(Array.isArray(i)?i.filter(e=>e.trim().length>0).length>0:i.trim()!==``))return[{chunk:e,highlighted:!1}];let a=typeof i==`string`?i.trim():i.filter(e=>e.trim().length!==0).map(e=>e.trim()).sort((e,t)=>t.length-e.length).join(`|`),o=RegExp(`(${a})`,r?`gi`:`g`);return e.split(o).map(e=>({chunk:e,highlighted:o.test(e)})).filter(({chunk:e})=>e)}const $e=e=>{let{sx:t,className:n,style:r,variant:i,highlight:a,color:o,highlightSx:s,ignorecase:c=!1,includeDataAttribute:l=!1,children:u,ref:d,...f}=e,p=k(()=>Qe(u,a,{ignorecase:c}),[u,a,c]);return/* @__PURE__ */ C(I,{ref:d,variant:i,className:N(`Highlight-root`,n),sx:t,style:r,...f,children:p.map(({chunk:e,highlighted:t},n)=>t?l?/* @__PURE__ */ C(J,{color:o,sx:s,"data-highlight":e,children:e},n):/* @__PURE__ */ C(J,{color:o,sx:s,children:e},n):/* @__PURE__ */ C(`span`,{children:e},n))})};$e.displayName=`Highlight`;function et(e){let{sx:t,className:n,text:r,maxLen:i,currentLen:a=0}=e,o=a>i;return r?/* @__PURE__ */ w(x,{className:N(`LengthLimitHelperText-root`,n),component:`span`,sx:[{display:`flex`,justifyContent:`space-between`,alignItems:`center`,color:o?`error.main`:`text.secondary`},...Array.isArray(t)?t:[t??!1]],children:[typeof r==`string`?/* @__PURE__ */ C(`span`,{children:r}):r,/* @__PURE__ */ w(x,{component:`span`,sx:{ml:2,whiteSpace:`nowrap`},children:[a,` / `,i]})]}):/* @__PURE__ */ w(x,{className:N(`LengthLimitHelperText-root`,n),component:`span`,sx:[{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,color:o?`error.main`:`text.secondary`,whiteSpace:`nowrap`},...Array.isArray(t)?t:[t??!1]],children:[a,` / `,i]})}function tt(e){let{children:t}=e;return!L(e=>e.breakpoints.up(`lg`))||!t?null:/* @__PURE__ */ C(S,{children:t})}const nt=({page:e,count:t,onChange:n,zeroBased:r=!1,hidden:i=!1,disableAutoScroll:a=!1,className:o,sx:s,...c})=>{if(i||t<=1)return null;let l=+!!r,u=(e,t)=>{n?.(t-l),a||window.scrollTo({top:0,behavior:`instant`})};return/* @__PURE__ */ C(pe,{className:N(o,`ListPagination-root`),sx:[{py:1.5},...Array.isArray(s)?s:[s??!1]],children:/* @__PURE__ */ C(ne,{...c,page:e+l,count:t,onChange:n?u:void 0})})};nt.displayName=`ListPagination`;function rt(e){let{children:t}=e;return!L(e=>e.breakpoints.down(`lg`))||!t?null:/* @__PURE__ */ C(S,{children:t})}function it(e){let{children:t}=e;return!L(e=>e.breakpoints.up(`md`))||!t?null:/* @__PURE__ */ C(S,{children:t})}function at(e){let{className:t,sx:n,squared:r,outlined:i,children:a,...o}=e;return/* @__PURE__ */ C(re,{...o,className:N(`Paper-root`,t),sx:[{borderRadius:+!r,border:i?`1px solid #ddd`:`none`},...Array.isArray(n)?n:[n??!1]],children:a})}const ot=oe(/* @__PURE__ */ C(`path`,{d:`M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3`}),`Visibility`),st=oe(/* @__PURE__ */ C(`path`,{d:`M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z`}),`VisibilityOff`);function ct(e){let{slotProps:t,size:n,disabled:r,showLabel:i=`비밀번호 보기`,hideLabel:a=`비밀번호 숨기기`,...o}=e,[s,c]=j(!1),l=/* @__PURE__ */ C(ie,{position:`end`,children:/* @__PURE__ */ C(M,{"aria-label":s?a:i,edge:`end`,disabled:r,onClick:()=>{c(e=>!e)},onMouseDown:e=>{e.preventDefault()},size:n===`small`?`small`:`medium`,children:C(s?ot:st,{})})}),u=t?.input,d=typeof u==`function`?e=>({endAdornment:l,...u(e)}):{endAdornment:l,...u};return/* @__PURE__ */ C(ae,{type:s?`text`:`password`,size:n,disabled:r,...o,slotProps:{...t,input:d}})}const lt=e=>{let{noPadding:t=!1,className:n,sx:r,children:i,ref:a,...o}=e;return/* @__PURE__ */ C(x,{...o,className:P(`PortletContent-root`,n,{"PortletContent-noPadding":t}),ref:a,sx:[e=>({flex:1,p:e.spacing(2,3),"&.PortletContent-noPadding":{p:0}}),...Array.isArray(r)?r:[r??!1]],children:i})};lt.displayName=`PortletContent`;const ut=e=>{let{noDivider:t,sx:n,className:r,children:i,ref:a,...o}=e;return/* @__PURE__ */ C(x,{...o,className:P(`PortletFooter-root`,r,{"PortletFooter-noDivider":t}),ref:a,sx:[e=>({p:e.spacing(1,2),borderTop:`1px solid #E0E4EE`,borderBottomLeftRadius:`2px`,borderBottomRightRadius:`2px`,"&.PortletFooter-noDivider":{borderTop:`none`}}),...Array.isArray(n)?n:[n??!1]],children:i})};ut.displayName=`PortletFooter`;const dt=e=>{let{children:t,noDivider:n,className:r,noPadding:i=!1,sx:a,ref:o,...s}=e;return/* @__PURE__ */ C(x,{...s,className:P(`PortletHeader-root`,r,{"PortletHeader-noPadding":i,"PortletHeader-noDivider":n}),ref:o,sx:[e=>({position:`relative`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,borderBottom:`1px solid #E0E4EE`,borderTopLeftRadius:2,borderTopRightRadius:2,height:56,minHeight:56,p:e.spacing(.5,1,.5,3),"&.PortletHeader-noPadding":{p:e.spacing(.5,0,.5,0)},"&.PortletHeader-noDivider":{borderBottom:`none`}}),...Array.isArray(a)?a:[a??!1]],children:t})};dt.displayName=`PortletHeader`;const ft=e=>{let{icon:t,title:n,subtitle:r,className:i,sx:a,ref:o,...s}=e;return/* @__PURE__ */ w(x,{...s,className:P(`PortletLabel-root`,i),ref:o,sx:[{display:`flex`,alignItems:`center`},...Array.isArray(a)?a:[a??!1]],children:[t&&/* @__PURE__ */ C(x,{component:`span`,sx:{fontSize:`1.2rem`,mr:1,color:`text.secondary`,alignItems:`center`,display:`flex`},children:t}),n&&/* @__PURE__ */ C(I,{sx:{fontWeight:500,fontSize:`1.1rem`},variant:`h6`,children:n}),r&&/* @__PURE__ */ C(I,{variant:`subtitle2`,sx:{fontWeight:400,ml:1,color:`text.secondary`},children:r})]})};ft.displayName=`PortletLabel`;const pt=e=>e.toLocaleString(),mt=e=>{let{title:t,titleVariant:n=`h5`,itemCount:r=0,formatItemCount:i=pt,loading:a,disableNowrapTitle:o=!1,refreshLabel:s=`새로고침`,onClickRefresh:c,className:l,sx:u,ref:d,...f}=e;return/* @__PURE__ */ w(T,{direction:`row`,spacing:.5,...f,ref:d,className:P(`PortletTitle-root`,l),sx:[{alignItems:`center`},...Array.isArray(u)?u:[u??!1]],children:[typeof t==`string`?/* @__PURE__ */ w(I,{variant:n,className:`PortletTitle-title`,sx:{display:`flex`,alignItems:`center`,whiteSpace:o?`inherit`:`nowrap`,"& small":{display:`inline-block`,ml:1,color:`text.secondary`,fontSize:`0.7rem`}},children:[t,r>0&&/* @__PURE__ */ C(`small`,{children:i(r)})]}):t,/* @__PURE__ */ w(x,{className:`PortletTitle-reloadBtnBox`,sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,minWidth:40},children:[!a&&c?/* @__PURE__ */ C(M,{color:`primary`,size:`small`,"aria-label":s,className:`PortletTitle-reloadBtn`,onClick:c,children:/* @__PURE__ */ C(ce,{children:/* @__PURE__ */ C(`path`,{d:`M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z`})})}):null,a?/* @__PURE__ */ C(se,{color:`primary`,size:`1rem`}):null]})]})};mt.displayName=`PortletTitle`;const ht=e=>{let{className:t,sx:n,children:r,ref:i,...a}=e;return/* @__PURE__ */ C(x,{...a,ref:i,className:P(`PortletToolbar-root`,t),sx:[{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,ml:`auto`},...Array.isArray(n)?n:[n??!1]],children:r})};ht.displayName=`PortletToolbar`;const gt={square:!0},Y=(e=>{let{sx:t,className:n,children:r,ref:i,...a}=e;return/* @__PURE__ */ C(re,{...gt,...a,elevation:0,ref:i,component:`div`,className:P(`Portlet-root`,n),sx:[{display:`flex`,flexDirection:`column`,alignItems:`stretch`,border:`1px solid #E0E4EE`},...Array.isArray(t)?t:[t??!1]],children:r})});Y.displayName=`Portlet`,Y.Content=lt,Y.Header=dt,Y.Footer=ut,Y.Label=ft,Y.Title=mt,Y.Toolbar=ht;function _t(e){let{delayMs:t,params:n,onChange:r,children:i}=e,a=s(n,r,{delayMs:t});return/* @__PURE__ */ C(S,{children:i(a)})}const vt=R(x)(({theme:e})=>({position:`relative`,display:`inline-flex`,flexDirection:`row`,width:`auto`,borderRadius:e.shape.borderRadius,overflow:`hidden`,padding:`0.25rem`,backgroundColor:`#f1f3f5`,'&[data-vertical="true"]':{display:`flex`,flexDirection:`column`,width:`max-content`},'&[data-fullwidth="true"]':{display:`flex`,width:`auto`},'&[data-size="small"]':{padding:`0.15rem`},'&[data-size="large"]':{padding:`0.35rem`}}));vt.displayName=`SegmentedControlRoot`;const yt=R(x,{shouldForwardProp:e=>e!==`transitionDuration`&&e!==`transitionTimingFunction`})(({theme:e,transitionDuration:t=150,transitionTimingFunction:n=`ease`})=>({position:`relative`,flex:1,zIndex:2,transition:`border-color ${t}ms ${n}`,'.SegmentedControl-root[data-with-item-border="true"] &::before':{content:`""`,position:`absolute`,top:0,bottom:0,insetInlineStart:0,backgroundColor:e.palette.divider,width:`1px`,transition:`background-color ${t}ms ${n}`},'.SegmentedControl-root[data-with-item-border="true"] &:first-of-type::before':{backgroundColor:`transparent`},'.SegmentedControl-root[data-vertical="true"] &::before':{top:0,insetInline:0,bottom:`auto`,height:`1px`,width:`auto`}}));yt.displayName=`SegmentedControlItem`;const bt=R(x)(()=>({height:0,width:0,position:`absolute`,overflow:`hidden`,whiteSpace:`nowrap`,opacity:0}));bt.displayName=`SegmentedControlInput`;function xt(e,t){if(!t)return;let n=[`primary`,`secondary`,`info`,`warning`,`error`,`success`],r=[`textPrimary`,`textSecondary`,`textDisabled`];if(n.includes(t))return e.palette[t].main;if(r.includes(t)){let n=t.substring(4).toLowerCase();return e.palette.text[n]}return t}const St=R(x,{shouldForwardProp:e=>e!==`transitionDuration`&&e!==`transitionTimingFunction`&&e!==`primaryColor`&&e!==`secondaryColor`})(({theme:e,transitionDuration:t=150,transitionTimingFunction:n=`ease`,primaryColor:r,secondaryColor:i})=>{let a=xt(e,r)??e.palette.primary.main,o=xt(e,i)??e.palette.text.secondary;return{fontWeight:500,display:`block`,textAlign:`center`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,userSelect:`none`,borderRadius:1,padding:`0.3125rem 0.625rem`,fontSize:e.typography.body1.fontSize,cursor:`pointer`,color:o,transition:`color ${t}ms ${n}`,".SegmentedControl-item.Mui-active > &&":{color:a,"&::before":{content:`""`,position:`absolute`,inset:0,zIndex:0}},".SegmentedControl-item.Mui-readOnly > &&":{cursor:`default`},".SegmentedControl-item.Mui-disabled > &&":{cursor:`not-allowed`,color:e.palette.text.disabled,opacity:.7},'.SegmentedControl-root[data-size="small"] &':{padding:`0.2rem 0.4rem`,fontSize:`0.7rem`},'.SegmentedControl-root[data-size="large"] &':{padding:`0.4rem 0.8rem`,fontSize:e.typography.subtitle1.fontSize}}});St.displayName=`SegmentedControlLabel`;function Ct(e){return e?!0:void 0}const wt=e=>{let{sx:t,className:n,style:r,disabled:i,data:a,value:o,defaultValue:s,onChange:l,fullWidth:u,withItemBorder:d,primaryColor:p=`primary`,secondaryColor:m=`textSecondary`,transitionDuration:h,transitionTimingFunction:g,vertical:_,readOnly:v,size:b=`medium`,indicator:S,ref:T}=e,E=a.map(e=>typeof e==`string`?{label:e,value:e}:e),[D,O]=j(null),[k,A]=j({}),ee=e=>t=>{k[e]=t,A(k)},[M,te]=f({value:o,defaultValue:s,finalValue:Array.isArray(a)?E.find(e=>!e.disabled)?.value??E[0]?.value??void 0:void 0,onChange:l}),P=c(),F=y(T,O);return a.length===0?null:/* @__PURE__ */ w(vt,{className:N(`SegmentedControl-root`,n,{x_readOnly:v,x_fullWidth:u,"Mui-disabled":i,"Mui-readOnly":v}),sx:t,style:r,ref:F,role:`radiogroup`,"data-vertical":Ct(_),"data-fullwidth":Ct(u),"data-with-item-border":Ct(d),"data-size":b,children:[typeof M==`string`&&/* @__PURE__ */ C(Ie,{className:`SegmentedControl-indicator`,component:`span`,target:k[M],parent:D,transitionDuration:h,sx:{display:`block`,zIndex:1,borderRadius:1,bgcolor:`#fff`,boxShadow:`rgba(0, 0, 0, 0.05) 0px 1px 3px 0px, rgba(0, 0, 0, 0.1) 0px 1px 2px 0px`},children:S}),E.map(e=>/* @__PURE__ */ w(yt,{className:N(`SegmentedControl-item`,{"Mui-active":M===e.value,"Mui-disabled":e.disabled||i,"Mui-readOnly":v}),transitionDuration:h,transitionTimingFunction:g,children:[/* @__PURE__ */ C(bt,{component:`input`,className:`SegmentedControl-input`,type:`radio`,name:P,value:e.value,checked:M===e.value,id:`${P}-${e.value}`,onChange:()=>{!v&&!e.disabled&&!i&&te(e.value)}},`${e.value}-input`),/* @__PURE__ */ C(St,{component:`label`,className:`SegmentedControl-label`,ref:ee(e.value),htmlFor:`${P}-${e.value}`,primaryColor:p,secondaryColor:m,transitionDuration:h,transitionTimingFunction:g,children:/* @__PURE__ */ C(x,{component:`span`,sx:{position:`relative`,zIndex:2},children:e.label})},`${e.value}-label`)]},e.value))]})},Tt=({when:e,fallback:t,children:n})=>e?n:t;Tt.displayName=`Show`;function Et(e){let{children:t}=e;return!L(e=>e.breakpoints.down(`md`))||!t?null:/* @__PURE__ */ C(S,{children:t})}function Dt(e){let{children:t}=e;return!L(e=>e.breakpoints.up(`sm`))||!t?null:/* @__PURE__ */ C(S,{children:t})}const Ot=({width:e,height:t,minWidth:n,minHeight:r,sx:i,ref:a,...o})=>/* @__PURE__ */ C(x,{ref:a,sx:[{width:e,height:t,minWidth:n??e,minHeight:r??t},...Array.isArray(i)?i:[i]],...o});Ot.displayName=`Space`;const kt=e=>{let{sx:t,className:n,style:r,id:i,initialState:a,maxHeight:s=100,hideLabel:l,showLabel:u,expanded:d,onExpandedChange:p,controlRef:m,children:h,transitionDuration:g=100,ref:_,...v}=e,y=c(i),b=`${y}-region`,[x,S]=f({value:d,defaultValue:a,finalValue:!1,onChange:p}),{ref:T,height:E}=o(),D=x?l:u,O=D!==null&&s<E;return/* @__PURE__ */ w(At,{className:N(`Spoiler-root`,n),sx:[t,...Array.isArray(t)?t:[t??!1]],style:r,id:y,ref:_,"data-has-spoiler":O,...v,children:[O&&/* @__PURE__ */ C(jt,{component:`button`,ref:m,onClick:()=>{S(!x)},"aria-expanded":x,"aria-controls":b,children:D}),/* @__PURE__ */ C(Mt,{"data-reduce-motion":!0,role:`region`,id:b,transitionDuration:g,style:{maxHeight:x?E??void 0:s},children:/* @__PURE__ */ C(`div`,{ref:T,children:h})})]})};kt.displayName=`Spoiler`;const At=R(x)(()=>({position:`relative`,'&:where([data-has-spoiler="true"])':{marginBottom:24}})),jt=R(le)(()=>({position:`absolute`,insetInlineStart:0,top:`100%`,height:32,textDecoration:`none`,"&:hover":{textDecoration:`underline`}})),Mt=R(x,{shouldForwardProp:e=>e!==`transitionDuration`})(({transitionDuration:e=200})=>({display:`flex`,flexDirection:`column`,overflow:`hidden`,transition:`max-height ${e}ms ease`})),Nt=G({displayName:`StackColumn.Center`,base:`stack`,direction:`column`,defaultProps:{justifyContent:`center`}}),Pt=G({displayName:`StackColumn.Start`,base:`stack`,direction:`column`,defaultProps:{justifyContent:`flex-start`}}),Ft=G({displayName:`StackColumn.End`,base:`stack`,direction:`column`,defaultProps:{justifyContent:`flex-end`}}),It=G({displayName:`StackColumn.Between`,base:`stack`,direction:`column`,defaultProps:{justifyContent:`space-between`}}),Lt=G({displayName:`StackColumn.Around`,base:`stack`,direction:`column`,defaultProps:{justifyContent:`space-around`}}),Rt=G({displayName:`StackColumn.Evenly`,base:`stack`,direction:`column`,defaultProps:{justifyContent:`space-evenly`}}),X=G({displayName:`StackColumn`,base:`stack`,direction:`column`,supportsCenterProp:!0});X.Start=Pt,X.End=Ft,X.Between=It,X.Around=Lt,X.Center=Nt,X.Evenly=Rt;const zt=G({displayName:`StackRow.Center`,base:`stack`,direction:`row`,defaultProps:{justifyContent:`center`}}),Bt=G({displayName:`StackRow.Start`,base:`stack`,direction:`row`,defaultProps:{justifyContent:`flex-start`}}),Vt=G({displayName:`StackRow.End`,base:`stack`,direction:`row`,defaultProps:{justifyContent:`flex-end`}}),Ht=G({displayName:`StackRow.Between`,base:`stack`,direction:`row`,defaultProps:{justifyContent:`space-between`}}),Ut=G({displayName:`StackRow.Around`,base:`stack`,direction:`row`,defaultProps:{justifyContent:`space-around`}}),Wt=G({displayName:`StackRow.Evenly`,base:`stack`,direction:`row`,defaultProps:{justifyContent:`space-evenly`}}),Z=G({displayName:`StackRow`,base:`stack`,direction:`row`,supportsCenterProp:!0});Z.Start=Bt,Z.End=Vt,Z.Between=Ht,Z.Around=Ut,Z.Center=zt,Z.Evenly=Wt;const Gt=z({displayName:`TopAbsolute.Center`,axes:[{cssProp:`top`}],fixedStyle:{left:`50%`,transform:`translate(-50%, -50%)`},supportsFullWidth:!0}),Kt=z({displayName:`TopAbsolute.Left`,axes:[{cssProp:`left`,defaultValue:0},{cssProp:`top`,defaultValue:0}],supportsFullWidth:!0}),qt=z({displayName:`TopAbsolute.Right`,axes:[{cssProp:`right`,defaultValue:0},{cssProp:`top`,defaultValue:0}],supportsFullWidth:!0}),Q=z({displayName:`TopAbsolute`,axes:[{cssProp:`top`,defaultValue:0},{cssProp:`left`,defaultValue:0},{cssProp:`right`,defaultValue:0}],supportsFullWidth:!1});Q.Left=Kt,Q.Right=qt,Q.Center=Gt;function Jt(e){let{children:t}=e;return!L(e=>e.breakpoints.down(`sm`))||!t?null:/* @__PURE__ */ C(S,{children:t})}function $(e){return String(e??``).replace(/\D/g,``).slice(0,8)}function Yt(e){if(e.length!==2)return e;let t=Number.parseInt(e,10),n=(/* @__PURE__ */ new Date()).getFullYear(),r=Math.floor(n/100)*100+t;return r>n+20&&(r-=100),r.toString()}function Xt(e,t){let n=$(e==null?null:String(e));if(!n)return``;let r=n.length<=6,i=r?n.slice(0,2):n.slice(0,4),a=r?n.slice(2,4):n.slice(4,6),o=r?n.slice(4,6):n.slice(6,8);if(!t?.format)return[i,a,o].filter(Boolean).join(`-`);let s=i,c=t.format;return c.includes(`YYYY`)&&s.length===2?s=Yt(s):c.includes(`YY`)&&!c.includes(`YYYY`)&&s.length===4&&(s=s.slice(2,4)),c.replace(`YYYY`,s).replace(`YY`,s.length===4?s.slice(2,4):s).replace(`MM`,a).replace(`DD`,o)}function Zt(e){return String(e??``).replace(/\D/g,``).slice(0,6)}function Qt(e,t){let n=Zt(e==null?null:String(e));if(!n)return``;let r=n.slice(0,4),i=n.slice(4,6);return t?.format?t.format.replace(`YYYY`,r).replace(`MM`,i):[r,i].filter(Boolean).join(`-`)}function $t(e){return e?e.includes(`YYYY`)?8:e.includes(`YY`)?6:null:null}function en(e,t){let n=$(e);if(!n)return``;let r=$t(t?.format);return r?n.length===r?Xt(n,t):n:n.length===6||n.length===8?Xt(n,t):n}function tn(e){let{value:t,onChange:n,format:r,placeholder:i,slotProps:a,...o}=e,s=e=>{let t=e.target.value??``;n($(t))},c=a?.htmlInput,l=typeof c==`function`?e=>({inputMode:`numeric`,...c(e)}):{inputMode:`numeric`,...c};return/* @__PURE__ */ C(ae,{value:en(t??``,{format:r}),onChange:s,placeholder:i??r,...o,slotProps:{...a,htmlInput:l}})}function nn(e){let{className:t,value:n,format:r,fallback:i=`-`,raw:a=!1,...o}=e,s=(a?n:Xt(n,r?{format:r}:void 0))||i;return/* @__PURE__ */ C(I,{className:N(`YmdTypography-root`,t),...o,children:s})}function rn(e){let{className:t,value:n,format:r,fallback:i=`-`,raw:a=!1,...o}=e,s=(a?n:Qt(n,r?{format:r}:void 0))||i;return/* @__PURE__ */ C(I,{className:N(`YmTypography-root`,t),...o,children:s})}const an=e=>!e.shiftKey&&e.key===`Tab`,on=e=>e.key===`Enter`||!e.shiftKey&&e.key===`Tab`,sn=e=>e.key===`Enter`,cn=e=>e.key===`Escape`,ln=e=>!!e.touches?.length,un=e=>!(!e.clientX&&e.clientX!==0||!e.clientY&&e.clientY!==0),dn=(e,t=-1)=>{let n=e.target;n&&typeof n.blur==`function`&&(t>=0?setTimeout(()=>{n.blur()},t):n.blur())};function fn(...e){let t=[];return e.forEach(e=>{e&&(Array.isArray(e)?e.forEach(e=>{e&&t.push(e)}):t.push(e))}),t}function pn(...e){let t=fn(...e);return t.length>0?t[0]:void 0}const mn=(e=`height`,t=100)=>({"& .MuiDialog-scrollPaper > .MuiDialog-paper":{[e]:`calc(${t}% - 64px)`}});export{B as BottomAbsolute,pe as Center,V as CenterAbsolute,v as Closables,me as CooldownButton,he as CooldownButtonBase,ge as CooldownIconButton,_e as CopyButtonWrapper,ve as CustomTableBody,Se as DebouncedButton,Ce as DebouncedButtonBase,we as DebouncedIconButton,Te as DebouncedRender,Ee as DelayedRender,Oe as FileButton,K as FlexColumn,Ae as FlexItemsContainer,q as FlexRow,Fe as FloatingIndicator,Xe as Hide,$e as Highlight,et as LengthLimitHelperText,tt as LgOrUp,nt as ListPagination,J as Mark,rt as MdOrDown,it as MdOrUp,at as Paper,ct as PasswordTextField,Y as Portlet,_t as SearchBoxDebouncer,wt as SegmentedControl,Tt as Show,Et as SmOrDown,Dt as SmOrUp,Ot as Space,kt as Spoiler,X as StackColumn,Z as StackRow,Q as TopAbsolute,Jt as XsOrDown,rn as YmTypography,tn as YmdTextField,nn as YmdTypography,dn as blurEventTarget,pn as firstSx,fn as flatSx,_ as getAbsolutePosition,p as isBrowser,sn as isEnterKeyEvent,on as isEnterOrTabKeyEvent,cn as isEscapeKeyEvent,un as isMouseEvent,h as isNavigator,an as isTabKeyEvent,l as isTouchDevice,ln as isTouchEvent,r as isWebSerialSupportBrowser,m as matchesOrClosest,g as noop,a as requestFocusSelector,d as requestSelector,mn as sxDialogHeight};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{BottomAbsolute as e}from"./components/bottom-absolute/BottomAbsolute.js";import{Center as t}from"./components/Center.js";import{CooldownButton as n}from"./components/CooldownButton.js";import{CooldownButtonBase as r}from"./components/CooldownButtonBase.js";import{CooldownIconButton as i}from"./components/CooldownIconButton.js";import{CopyButtonWrapper as a}from"./components/CopyButtonWrapper.js";import{CustomTableBody as o}from"./components/CustomTableBody.js";import{CenterAbsolute as s}from"./components/center-absolute/CenterAbsolute.js";import{DebouncedButton as c}from"./components/DebouncedButton.js";import{DebouncedButtonBase as l}from"./components/DebouncedButtonBase.js";import{DebouncedIconButton as u}from"./components/DebouncedIconButton.js";import{DebouncedRender as d}from"./components/DebouncedRender.js";import{DelayedRender as f}from"./components/DelayedRender.js";import{FileButton as p}from"./components/FileButton.js";import{FlexItemsContainer as m}from"./components/FlexItemsContainer.js";import{FloatingIndicator as h}from"./components/FloatingIndicator/FloatingIndicator.js";import{FlexColumn as g}from"./components/flex/FlexColumn.js";import{FlexRow as _}from"./components/flex/FlexRow.js";import{Hide as v}from"./components/Hide.js";import{Mark as y}from"./components/Mark.js";import{Highlight as b}from"./components/Highlight/Highlight.js";import{LengthLimitHelperText as x}from"./components/LengthLimitHelperText.js";import{LgOrUp as S}from"./components/LgOrUp.js";import{ListPagination as C}from"./components/ListPagination.js";import{MdOrDown as w}from"./components/MdOrDown.js";import{MdOrUp as T}from"./components/MdOrUp.js";import{Paper as E}from"./components/Paper.js";import{PasswordTextField as D}from"./components/PasswordTextField.js";import{PortletContent as O}from"./components/portlet/PortletContent.js";import{PortletFooter as k}from"./components/portlet/PortletFooter.js";import{PortletHeader as A}from"./components/portlet/PortletHeader.js";import{PortletLabel as j}from"./components/portlet/PortletLabel.js";import{PortletTitle as M}from"./components/portlet/PortletTitle.js";import{PortletToolbar as N}from"./components/portlet/PortletToolbar.js";import{Portlet as P}from"./components/portlet/Portlet.js";import{SearchBoxDebouncer as F}from"./components/SearchBoxDebouncer.js";import{SegmentedControl as I}from"./components/SegmentedControl/SegmentedControl.js";import{Show as L}from"./components/Show.js";import{SmOrDown as R}from"./components/SmOrDown.js";import{SmOrUp as z}from"./components/SmOrUp.js";import{Space as B}from"./components/Space.js";import{Spoiler as V}from"./components/Spoiler.js";import{StackColumn as H}from"./components/stack/StackColumn.js";import{StackRow as U}from"./components/stack/StackRow.js";import{TopAbsolute as W}from"./components/top-absolute/TopAbsolute.js";import{XsOrDown as G}from"./components/XsOrDown.js";import{YmdTextField as K}from"./components/YmdTextField.js";import{YmdTypography as q}from"./components/YmdTypography.js";import{YmTypography as J}from"./components/YmTypography.js";import{Closables as Y}from"./util/closables.js";import{blurEventTarget as X,isEnterKeyEvent as Z,isEnterOrTabKeyEvent as Q,isEscapeKeyEvent as $,isMouseEvent as ee,isTabKeyEvent as te,isTouchEvent as ne}from"./util/event-utils.js";import{getAbsolutePosition as re,isBrowser as ie,isNavigator as ae,isTouchDevice as oe,isWebSerialSupportBrowser as se,matchesOrClosest as ce,noop as le,requestFocusSelector as ue,requestSelector as de}from"./util/misc-utils.js";import{firstSx as fe,flatSx as pe,sxDialogHeight as me}from"./util/sx-props.js";export{e as BottomAbsolute,t as Center,s as CenterAbsolute,Y as Closables,n as CooldownButton,r as CooldownButtonBase,i as CooldownIconButton,a as CopyButtonWrapper,o as CustomTableBody,c as DebouncedButton,l as DebouncedButtonBase,u as DebouncedIconButton,d as DebouncedRender,f as DelayedRender,p as FileButton,g as FlexColumn,m as FlexItemsContainer,_ as FlexRow,h as FloatingIndicator,v as Hide,b as Highlight,x as LengthLimitHelperText,S as LgOrUp,C as ListPagination,y as Mark,w as MdOrDown,T as MdOrUp,E as Paper,D as PasswordTextField,P as Portlet,O as PortletContent,k as PortletFooter,A as PortletHeader,j as PortletLabel,M as PortletTitle,N as PortletToolbar,F as SearchBoxDebouncer,I as SegmentedControl,L as Show,R as SmOrDown,z as SmOrUp,B as Space,V as Spoiler,H as StackColumn,U as StackRow,W as TopAbsolute,G as XsOrDown,J as YmTypography,K as YmdTextField,q as YmdTypography,X as blurEventTarget,fe as firstSx,pe as flatSx,re as getAbsolutePosition,ie as isBrowser,Z as isEnterKeyEvent,Q as isEnterOrTabKeyEvent,$ as isEscapeKeyEvent,ee as isMouseEvent,ae as isNavigator,te as isTabKeyEvent,oe as isTouchDevice,ne as isTouchEvent,se as isWebSerialSupportBrowser,ce as matchesOrClosest,le as noop,ue as requestFocusSelector,de as requestSelector,me as sxDialogHeight};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t=0,n={}){let r,i,a,o,s,c,l=0,{leading:u=!1,trailing:d=!0,maxWait:f}=n;if(typeof e!=`function`)throw TypeError(`Expected a function`);typeof f==`number`&&(a=Math.max(f,t));function p(){return Date.now()}function m(t){let n=r,a=i;return r=void 0,i=void 0,l=t,o=e.apply(a,n),o}function h(e){return l=e,s=setTimeout(v,t),u?m(e):o}function g(e){let n=e-(c||0),r=e-l,i=t-n;return a===void 0?i:Math.min(i,a-r)}function _(e){let n=e-(c||0),r=e-l;return c===void 0||n>=t||n<0||a!==void 0&&r>=a}function v(){let e=p();if(_(e))return y(e);s=setTimeout(v,g(e))}function y(e){return s=void 0,d&&r?m(e):(r=void 0,i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),l=0,r=void 0,c=void 0,i=void 0,s=void 0}function x(){return s===void 0?o:y(p())}function S(...e){let n=p(),l=_(n);if(r=e,i=this,c=n,l){if(s===void 0)return h(c);if(a!==void 0)return clearTimeout(s),s=setTimeout(v,t),m(c)}return s===void 0&&(s=setTimeout(v,t)),o}return S.cancel=b,S.flush=x,S}function t(t,n=0,r={}){return e(t,n,{leading:r.leading??!0,trailing:r.trailing??!0,maxWait:n})}exports.debounce=e,exports.throttle=t;
|
|
2
|
+
//# sourceMappingURL=debounce.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.cjs","names":["debounce","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","userMaxWait","options","func","wait","now","invokeFunc","args","thisArg","time","leadingEdge","timerExpired","leading","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","trailing","cancel","flush","debounced","isInvoking","throttle"],"sources":["../../src/misc/debounce.ts"],"sourcesContent":["/**\n * debounce와 throttle 타이밍 제어 유틸을 제공한다.\n *\n * lodash 의존성을 늘리지 않기 위해 필요한 동작만 내부 구현으로 유지한다.\n */\n\n/** 지연 실행 함수에 정리와 즉시 실행 제어 메서드를 더한 타입 */\ntype DebouncedFunction<T extends (...args: any[]) => any> = T & {\n /** 예약된 trailing 호출 취소 */\n cancel: () => void;\n\n /** 예약된 trailing 호출 즉시 실행 */\n flush: () => ReturnType<T> | undefined;\n};\n\n/** debounce 실행 시점 제어 옵션 */\ninterface DebounceOptions {\n /** 첫 호출 시 즉시 실행 여부 */\n leading?: boolean;\n\n /** 마지막 호출을 wait 이후 실행할지 여부 */\n trailing?: boolean;\n\n /** 연속 호출 중에도 실행을 보장할 최대 대기 시간 */\n maxWait?: number;\n}\n\n/** throttle에서 노출하는 실행 시점 옵션 */\ntype ThrottleOptions = Pick<DebounceOptions, 'leading' | 'trailing'>;\n\n/**\n * 연속 호출이 멈춘 뒤 지정한 시간만큼 기다렸다가 마지막 호출을 실행한다.\n *\n * @param func 지연 실행할 함수\n * @param wait 호출을 미룰 시간\n * @param options leading, trailing, maxWait 실행 정책\n * @returns 취소와 즉시 실행 제어가 가능한 함수\n */\nfunction debounce<T extends (...args: any[]) => any>(\n func: T,\n wait: number = 0,\n options: DebounceOptions = {},\n): DebouncedFunction<T> {\n let lastArgs: any;\n let lastThis: any;\n let maxWait: number | undefined;\n let result: ReturnType<T>;\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let lastCallTime: number | undefined;\n let lastInvokeTime = 0;\n const { leading = false, trailing = true, maxWait: userMaxWait } = options;\n\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n\n if (typeof userMaxWait === 'number') {\n maxWait = Math.max(userMaxWait, wait);\n }\n\n // 테스트와 런타임에서 같은 시간 기준을 사용하도록 현재 시각 조회를 한곳에 모은다.\n function now(): number {\n return Date.now();\n }\n\n // 마지막 호출 인자와 this를 사용해 실제 함수를 실행하고 대기 상태를 비운다.\n function invokeFunc(time: number) {\n const args = lastArgs;\n const thisArg = lastThis;\n\n lastArgs = undefined;\n lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n // leading 실행 여부와 관계없이 다음 trailing 판단을 위한 타이머를 시작한다.\n function leadingEdge(time: number) {\n lastInvokeTime = time;\n timerId = setTimeout(timerExpired, wait);\n return leading ? invokeFunc(time) : result;\n }\n\n // wait와 maxWait 중 먼저 도달하는 시점을 다음 확인 시각으로 사용한다.\n function remainingWait(time: number): number {\n const timeSinceLastCall = time - (lastCallTime || 0);\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxWait !== undefined\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n // 첫 호출, wait 경과, 시계 보정, maxWait 도달 여부를 실행 기준으로 삼는다.\n function shouldInvoke(time: number): boolean {\n const timeSinceLastCall = time - (lastCallTime || 0);\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n return (\n lastCallTime === undefined ||\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxWait !== undefined && timeSinceLastInvoke >= maxWait)\n );\n }\n\n // 아직 실행 조건이 아니면 남은 시간만큼 다시 예약한다.\n function timerExpired() {\n const time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n // trailing 정책이 켜져 있고 마지막 호출 정보가 남아 있을 때만 실행한다.\n function trailingEdge(time: number) {\n timerId = undefined;\n\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = undefined;\n lastThis = undefined;\n return result;\n }\n\n // 예약된 타이머와 마지막 호출 정보를 모두 초기화한다.\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = undefined;\n lastCallTime = undefined;\n lastThis = undefined;\n timerId = undefined;\n }\n\n // 예약된 trailing 호출이 있으면 즉시 실행하고, 없으면 마지막 결과를 반환한다.\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n // 호출 정보는 항상 최신 값으로 갱신하고, 실행 가능 여부만 정책으로 판단한다.\n function debounced(this: any, ...args: any[]) {\n const time = now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n\n // maxWait가 있으면 연속 호출 중에도 주기적으로 실제 함수를 실행한다.\n if (maxWait !== undefined) {\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced as DebouncedFunction<T>;\n}\n\n/**\n * 지정한 시간 간격 안에서 함수 실행 빈도를 제한한다.\n *\n * debounce에 maxWait를 적용해 lodash throttle과 같은 기본 정책을 제공한다.\n *\n * @param func 실행 빈도를 제한할 함수\n * @param wait 최소 실행 간격\n * @param options leading과 trailing 실행 여부\n * @returns 취소와 즉시 실행 제어가 가능한 함수\n */\nfunction throttle<T extends (...args: any[]) => any>(\n func: T,\n wait: number = 0,\n options: ThrottleOptions = {},\n): DebouncedFunction<T> {\n return debounce(func, wait, {\n leading: options.leading ?? true,\n trailing: options.trailing ?? true,\n maxWait: wait,\n });\n}\n\nexport { debounce, throttle };\n"],"mappings":"AAsCA,SAASA,EACP,EACA,EAAe,EACf,EAA2B,CAAC,EACN,CACtB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAAiB,EACf,CAAE,UAAU,GAAO,WAAW,GAAM,QAASC,GAAgBC,EAEnE,GAAI,OAAOC,GAAS,WAClB,MAAU,UAAU,qBAAqB,EAGvC,OAAOF,GAAgB,WACzB,EAAU,KAAK,IAAIA,EAAaG,CAAI,GAItC,SAASC,GAAc,CACrB,OAAO,KAAK,IAAI,CAClB,CAGA,SAASC,EAAW,EAAc,CAChC,IAAMC,EAAOb,EACPc,EAAUb,EAMhB,MAJA,GAAW,IAAA,GACX,EAAW,IAAA,GACX,EAAiBc,EACjB,EAASN,EAAK,MAAMK,EAASD,CAAI,EAC1BV,CACT,CAGA,SAASa,EAAY,EAAc,CAGjC,MAFA,GAAiBD,EACjB,EAAU,WAAWE,EAAcP,CAAI,EAChCQ,EAAUN,EAAWG,CAAI,EAAIZ,CACtC,CAGA,SAASgB,EAAc,EAAsB,CAC3C,IAAMC,EAAoBL,GAAQV,GAAgB,GAC5CgB,EAAsBN,EAAOT,EAC7BgB,EAAcZ,EAAOU,EAE3B,OAAOlB,IAAY,IAAA,GAEfoB,EADA,KAAK,IAAIA,EAAapB,EAAUmB,CAAmB,CAEzD,CAGA,SAASE,EAAa,EAAuB,CAC3C,IAAMH,EAAoBL,GAAQV,GAAgB,GAC5CgB,EAAsBN,EAAOT,EAEnC,OACED,IAAiB,IAAA,IACjBe,GAAqBV,GACrBU,EAAoB,GACnBlB,IAAY,IAAA,IAAamB,GAAuBnB,CAErD,CAGA,SAASe,GAAe,CACtB,IAAMF,EAAOJ,EAAI,EACjB,GAAIY,EAAaR,CAAI,EACnB,OAAOS,EAAaT,CAAI,EAE1B,EAAU,WAAWE,EAAcE,EAAcJ,CAAI,CAAC,CACxD,CAGA,SAASS,EAAa,EAAc,CAQlC,MAPA,GAAU,IAAA,GAENC,GAAYzB,EACPY,EAAWG,CAAI,GAExB,EAAW,IAAA,GACX,EAAW,IAAA,GACJZ,EACT,CAGA,SAASuB,GAAS,CACZtB,IAAY,IAAA,IACd,aAAaA,CAAO,EAEtB,EAAiB,EACjB,EAAW,IAAA,GACX,EAAe,IAAA,GACf,EAAW,IAAA,GACX,EAAU,IAAA,EACZ,CAGA,SAASuB,GAAQ,CACf,OAAOvB,IAAY,IAAA,GAAYD,EAASqB,EAAab,EAAI,CAAC,CAC5D,CAGA,SAASiB,EAAqB,GAAGf,EAAa,CAC5C,IAAME,EAAOJ,EAAI,EACXkB,EAAaN,EAAaR,CAAI,EAOpC,GALA,EAAWF,EAEX,EAAW,KACX,EAAeE,EAEXc,EAAY,CACd,GAAIzB,IAAY,IAAA,GACd,OAAOY,EAAYX,CAAY,EAIjC,GAAIH,IAAY,IAAA,GAGd,OAFA,aAAaE,CAAO,EACpB,EAAU,WAAWa,EAAcP,CAAI,EAChCE,EAAWP,CAAY,CAElC,CAKA,OAHID,IAAY,IAAA,KACd,EAAU,WAAWa,EAAcP,CAAI,GAElCP,CACT,CAIA,MAFA,GAAU,OAASuB,EACnB,EAAU,MAAQC,EACXC,CACT,CAYA,SAASE,EACP,EACA,EAAe,EACf,EAA2B,CAAC,EACN,CACtB,OAAO/B,EAASU,EAAMC,EAAM,CAC1B,QAASF,EAAQ,SAAW,GAC5B,SAAUA,EAAQ,UAAY,GAC9B,QAASE,CACX,CAAC,CACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t=0,n={}){let r,i,a,o,s,c,l=0,{leading:u=!1,trailing:d=!0,maxWait:f}=n;if(typeof e!=`function`)throw TypeError(`Expected a function`);typeof f==`number`&&(a=Math.max(f,t));function p(){return Date.now()}function m(t){let n=r,a=i;return r=void 0,i=void 0,l=t,o=e.apply(a,n),o}function h(e){return l=e,s=setTimeout(v,t),u?m(e):o}function g(e){let n=e-(c||0),r=e-l,i=t-n;return a===void 0?i:Math.min(i,a-r)}function _(e){let n=e-(c||0),r=e-l;return c===void 0||n>=t||n<0||a!==void 0&&r>=a}function v(){let e=p();if(_(e))return y(e);s=setTimeout(v,g(e))}function y(e){return s=void 0,d&&r?m(e):(r=void 0,i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),l=0,r=void 0,c=void 0,i=void 0,s=void 0}function x(){return s===void 0?o:y(p())}function S(...e){let n=p(),l=_(n);if(r=e,i=this,c=n,l){if(s===void 0)return h(c);if(a!==void 0)return clearTimeout(s),s=setTimeout(v,t),m(c)}return s===void 0&&(s=setTimeout(v,t)),o}return S.cancel=b,S.flush=x,S}function t(t,n=0,r={}){return e(t,n,{leading:r.leading??!0,trailing:r.trailing??!0,maxWait:n})}export{e as debounce,t as throttle};
|
|
2
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.js","names":["debounce","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","userMaxWait","options","func","wait","now","invokeFunc","args","thisArg","time","leadingEdge","timerExpired","leading","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","trailing","cancel","flush","debounced","isInvoking","throttle"],"sources":["../../src/misc/debounce.ts"],"sourcesContent":["/**\n * debounce와 throttle 타이밍 제어 유틸을 제공한다.\n *\n * lodash 의존성을 늘리지 않기 위해 필요한 동작만 내부 구현으로 유지한다.\n */\n\n/** 지연 실행 함수에 정리와 즉시 실행 제어 메서드를 더한 타입 */\ntype DebouncedFunction<T extends (...args: any[]) => any> = T & {\n /** 예약된 trailing 호출 취소 */\n cancel: () => void;\n\n /** 예약된 trailing 호출 즉시 실행 */\n flush: () => ReturnType<T> | undefined;\n};\n\n/** debounce 실행 시점 제어 옵션 */\ninterface DebounceOptions {\n /** 첫 호출 시 즉시 실행 여부 */\n leading?: boolean;\n\n /** 마지막 호출을 wait 이후 실행할지 여부 */\n trailing?: boolean;\n\n /** 연속 호출 중에도 실행을 보장할 최대 대기 시간 */\n maxWait?: number;\n}\n\n/** throttle에서 노출하는 실행 시점 옵션 */\ntype ThrottleOptions = Pick<DebounceOptions, 'leading' | 'trailing'>;\n\n/**\n * 연속 호출이 멈춘 뒤 지정한 시간만큼 기다렸다가 마지막 호출을 실행한다.\n *\n * @param func 지연 실행할 함수\n * @param wait 호출을 미룰 시간\n * @param options leading, trailing, maxWait 실행 정책\n * @returns 취소와 즉시 실행 제어가 가능한 함수\n */\nfunction debounce<T extends (...args: any[]) => any>(\n func: T,\n wait: number = 0,\n options: DebounceOptions = {},\n): DebouncedFunction<T> {\n let lastArgs: any;\n let lastThis: any;\n let maxWait: number | undefined;\n let result: ReturnType<T>;\n let timerId: ReturnType<typeof setTimeout> | undefined;\n let lastCallTime: number | undefined;\n let lastInvokeTime = 0;\n const { leading = false, trailing = true, maxWait: userMaxWait } = options;\n\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n\n if (typeof userMaxWait === 'number') {\n maxWait = Math.max(userMaxWait, wait);\n }\n\n // 테스트와 런타임에서 같은 시간 기준을 사용하도록 현재 시각 조회를 한곳에 모은다.\n function now(): number {\n return Date.now();\n }\n\n // 마지막 호출 인자와 this를 사용해 실제 함수를 실행하고 대기 상태를 비운다.\n function invokeFunc(time: number) {\n const args = lastArgs;\n const thisArg = lastThis;\n\n lastArgs = undefined;\n lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n // leading 실행 여부와 관계없이 다음 trailing 판단을 위한 타이머를 시작한다.\n function leadingEdge(time: number) {\n lastInvokeTime = time;\n timerId = setTimeout(timerExpired, wait);\n return leading ? invokeFunc(time) : result;\n }\n\n // wait와 maxWait 중 먼저 도달하는 시점을 다음 확인 시각으로 사용한다.\n function remainingWait(time: number): number {\n const timeSinceLastCall = time - (lastCallTime || 0);\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxWait !== undefined\n ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n // 첫 호출, wait 경과, 시계 보정, maxWait 도달 여부를 실행 기준으로 삼는다.\n function shouldInvoke(time: number): boolean {\n const timeSinceLastCall = time - (lastCallTime || 0);\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n return (\n lastCallTime === undefined ||\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxWait !== undefined && timeSinceLastInvoke >= maxWait)\n );\n }\n\n // 아직 실행 조건이 아니면 남은 시간만큼 다시 예약한다.\n function timerExpired() {\n const time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n // trailing 정책이 켜져 있고 마지막 호출 정보가 남아 있을 때만 실행한다.\n function trailingEdge(time: number) {\n timerId = undefined;\n\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = undefined;\n lastThis = undefined;\n return result;\n }\n\n // 예약된 타이머와 마지막 호출 정보를 모두 초기화한다.\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = undefined;\n lastCallTime = undefined;\n lastThis = undefined;\n timerId = undefined;\n }\n\n // 예약된 trailing 호출이 있으면 즉시 실행하고, 없으면 마지막 결과를 반환한다.\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n // 호출 정보는 항상 최신 값으로 갱신하고, 실행 가능 여부만 정책으로 판단한다.\n function debounced(this: any, ...args: any[]) {\n const time = now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n\n // maxWait가 있으면 연속 호출 중에도 주기적으로 실제 함수를 실행한다.\n if (maxWait !== undefined) {\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced as DebouncedFunction<T>;\n}\n\n/**\n * 지정한 시간 간격 안에서 함수 실행 빈도를 제한한다.\n *\n * debounce에 maxWait를 적용해 lodash throttle과 같은 기본 정책을 제공한다.\n *\n * @param func 실행 빈도를 제한할 함수\n * @param wait 최소 실행 간격\n * @param options leading과 trailing 실행 여부\n * @returns 취소와 즉시 실행 제어가 가능한 함수\n */\nfunction throttle<T extends (...args: any[]) => any>(\n func: T,\n wait: number = 0,\n options: ThrottleOptions = {},\n): DebouncedFunction<T> {\n return debounce(func, wait, {\n leading: options.leading ?? true,\n trailing: options.trailing ?? true,\n maxWait: wait,\n });\n}\n\nexport { debounce, throttle };\n"],"mappings":"AAsCA,SAASA,EACP,EACA,EAAe,EACf,EAA2B,CAAC,EACN,CACtB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAAiB,EACf,CAAE,UAAU,GAAO,WAAW,GAAM,QAASC,GAAgBC,EAEnE,GAAI,OAAOC,GAAS,WAClB,MAAU,UAAU,qBAAqB,EAGvC,OAAOF,GAAgB,WACzB,EAAU,KAAK,IAAIA,EAAaG,CAAI,GAItC,SAASC,GAAc,CACrB,OAAO,KAAK,IAAI,CAClB,CAGA,SAASC,EAAW,EAAc,CAChC,IAAMC,EAAOb,EACPc,EAAUb,EAMhB,MAJA,GAAW,IAAA,GACX,EAAW,IAAA,GACX,EAAiBc,EACjB,EAASN,EAAK,MAAMK,EAASD,CAAI,EAC1BV,CACT,CAGA,SAASa,EAAY,EAAc,CAGjC,MAFA,GAAiBD,EACjB,EAAU,WAAWE,EAAcP,CAAI,EAChCQ,EAAUN,EAAWG,CAAI,EAAIZ,CACtC,CAGA,SAASgB,EAAc,EAAsB,CAC3C,IAAMC,EAAoBL,GAAQV,GAAgB,GAC5CgB,EAAsBN,EAAOT,EAC7BgB,EAAcZ,EAAOU,EAE3B,OAAOlB,IAAY,IAAA,GAEfoB,EADA,KAAK,IAAIA,EAAapB,EAAUmB,CAAmB,CAEzD,CAGA,SAASE,EAAa,EAAuB,CAC3C,IAAMH,EAAoBL,GAAQV,GAAgB,GAC5CgB,EAAsBN,EAAOT,EAEnC,OACED,IAAiB,IAAA,IACjBe,GAAqBV,GACrBU,EAAoB,GACnBlB,IAAY,IAAA,IAAamB,GAAuBnB,CAErD,CAGA,SAASe,GAAe,CACtB,IAAMF,EAAOJ,EAAI,EACjB,GAAIY,EAAaR,CAAI,EACnB,OAAOS,EAAaT,CAAI,EAE1B,EAAU,WAAWE,EAAcE,EAAcJ,CAAI,CAAC,CACxD,CAGA,SAASS,EAAa,EAAc,CAQlC,MAPA,GAAU,IAAA,GAENC,GAAYzB,EACPY,EAAWG,CAAI,GAExB,EAAW,IAAA,GACX,EAAW,IAAA,GACJZ,EACT,CAGA,SAASuB,GAAS,CACZtB,IAAY,IAAA,IACd,aAAaA,CAAO,EAEtB,EAAiB,EACjB,EAAW,IAAA,GACX,EAAe,IAAA,GACf,EAAW,IAAA,GACX,EAAU,IAAA,EACZ,CAGA,SAASuB,GAAQ,CACf,OAAOvB,IAAY,IAAA,GAAYD,EAASqB,EAAab,EAAI,CAAC,CAC5D,CAGA,SAASiB,EAAqB,GAAGf,EAAa,CAC5C,IAAME,EAAOJ,EAAI,EACXkB,EAAaN,EAAaR,CAAI,EAOpC,GALA,EAAWF,EAEX,EAAW,KACX,EAAeE,EAEXc,EAAY,CACd,GAAIzB,IAAY,IAAA,GACd,OAAOY,EAAYX,CAAY,EAIjC,GAAIH,IAAY,IAAA,GAGd,OAFA,aAAaE,CAAO,EACpB,EAAU,WAAWa,EAAcP,CAAI,EAChCE,EAAWP,CAAY,CAElC,CAKA,OAHID,IAAY,IAAA,KACd,EAAU,WAAWa,EAAcP,CAAI,GAElCP,CACT,CAIA,MAFA,GAAU,OAASuB,EACnB,EAAU,MAAQC,EACXC,CACT,CAYA,SAASE,EACP,EACA,EAAe,EACf,EAA2B,CAAC,EACN,CACtB,OAAO/B,EAASU,EAAMC,EAAM,CAC1B,QAASF,EAAQ,SAAW,GAC5B,SAAUA,EAAQ,UAAY,GAC9B,QAASE,CACX,CAAC,CACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(t,n){if(t===n)return!0;let r=typeof t;if(r!==typeof n||r!==`object`||t===null||n===null)return!1;if(Array.isArray(t)&&Array.isArray(n))return t.length===n.length&&t.every((t,r)=>e(t,n[r]));let i=t,a=n,o=Object.keys(i),s=Object.keys(a);return o.length===s.length&&o.every(t=>e(i[t],a[t]))}exports.deepEq=e;
|
|
2
|
+
//# sourceMappingURL=deepEq.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepEq.cjs","names":["deepEq","a","b","t1","item","index","aObj","bObj","aKeys","bKeys","key"],"sources":["../../src/misc/deepEq.ts"],"sourcesContent":["export function deepEq<T>(a: T, b: T): boolean {\n if (a === b) {\n return true; // 같은 참조를 가리키면 true\n }\n\n const t1 = typeof a;\n const t2 = typeof b;\n if (t1 !== t2) {\n // 타입이 다르면 false\n return false;\n }\n\n if (t1 !== 'object' || a === null || b === null) {\n return false; // 하나가 null이거나 객체가 아닌 경우 false\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((item, index) => deepEq(item, b[index]));\n }\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n\n if (aKeys.length !== bKeys.length) {\n return false; // 속성의 개수가 다르면 false\n }\n\n return aKeys.every((key) => deepEq(aObj[key], bObj[key]));\n}\n"],"mappings":"AAAA,SAAgBA,EAAU,EAAM,EAAe,CAC7C,GAAIC,IAAMC,EACR,MAAO,GAGT,IAAMC,EAAK,OAAOF,EAOlB,GALIE,IAAO,OADOD,GAMdC,IAAO,UAAYF,IAAM,MAAQC,IAAM,KACzC,MAAO,GAGT,GAAI,MAAM,QAAQD,CAAC,GAAK,MAAM,QAAQC,CAAC,EAIrC,OAHID,EAAE,SAAWC,EAAE,QAGZD,EAAE,OAAO,EAAM,IAAUD,EAAOI,EAAMF,EAAEG,EAAM,CAAC,EAGxD,IAAMC,EAAOL,EACPM,EAAOL,EACPM,EAAQ,OAAO,KAAKF,CAAI,EACxBG,EAAQ,OAAO,KAAKF,CAAI,EAM9B,OAJIC,EAAM,SAAWC,EAAM,QAIpBD,EAAM,MAAO,GAAQR,EAAOM,EAAKI,GAAMH,EAAKG,EAAI,CAAC,CAC1D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(t,n){if(t===n)return!0;let r=typeof t;if(r!==typeof n||r!==`object`||t===null||n===null)return!1;if(Array.isArray(t)&&Array.isArray(n))return t.length===n.length&&t.every((t,r)=>e(t,n[r]));let i=t,a=n,o=Object.keys(i),s=Object.keys(a);return o.length===s.length&&o.every(t=>e(i[t],a[t]))}export{e as deepEq};
|
|
2
|
+
//# sourceMappingURL=deepEq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepEq.js","names":["deepEq","a","b","t1","item","index","aObj","bObj","aKeys","bKeys","key"],"sources":["../../src/misc/deepEq.ts"],"sourcesContent":["export function deepEq<T>(a: T, b: T): boolean {\n if (a === b) {\n return true; // 같은 참조를 가리키면 true\n }\n\n const t1 = typeof a;\n const t2 = typeof b;\n if (t1 !== t2) {\n // 타입이 다르면 false\n return false;\n }\n\n if (t1 !== 'object' || a === null || b === null) {\n return false; // 하나가 null이거나 객체가 아닌 경우 false\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((item, index) => deepEq(item, b[index]));\n }\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n\n if (aKeys.length !== bKeys.length) {\n return false; // 속성의 개수가 다르면 false\n }\n\n return aKeys.every((key) => deepEq(aObj[key], bObj[key]));\n}\n"],"mappings":"AAAA,SAAgBA,EAAU,EAAM,EAAe,CAC7C,GAAIC,IAAMC,EACR,MAAO,GAGT,IAAMC,EAAK,OAAOF,EAOlB,GALIE,IAAO,OADOD,GAMdC,IAAO,UAAYF,IAAM,MAAQC,IAAM,KACzC,MAAO,GAGT,GAAI,MAAM,QAAQD,CAAC,GAAK,MAAM,QAAQC,CAAC,EAIrC,OAHID,EAAE,SAAWC,EAAE,QAGZD,EAAE,OAAO,EAAM,IAAUD,EAAOI,EAAMF,EAAEG,EAAM,CAAC,EAGxD,IAAMC,EAAOL,EACPM,EAAOL,EACPM,EAAQ,OAAO,KAAKF,CAAI,EACxBG,EAAQ,OAAO,KAAKF,CAAI,EAM9B,OAJIC,EAAM,SAAWC,EAAM,QAIpBD,EAAM,MAAO,GAAQR,EAAOM,EAAKI,GAAMH,EAAKG,EAAI,CAAC,CAC1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.cjs","names":["CODEC_STRING","value"],"sources":["../../src/persistence/codec.tsx"],"sourcesContent":["/**\n * A codec that can encode and decode values of type V to and from strings.\n * @typeParam V The type of values that can be encoded and decoded.\n */\nexport interface Codec<V> {\n /**\n * Decodes a string value into a value of type V.\n * @param value The value to decode.\n * @returns The decoded value.\n */\n parse: (value: string) => V;\n /**\n * Encodes a value of type V into a string.\n * @param value The value to encode.\n * @returns The encoded value.\n */\n stringify: (value: V) => string;\n}\n\n/**\n * A codec that can encode and decode Date objects to and from strings.\n */\nexport const CODEC_DATE: Codec<Date> = {\n parse: (value) => new Date(value),\n stringify: (value) => value.toISOString(),\n};\n\n/**\n * A codec that can encode and decode Date objects to and from strings, but only the date part.\n */\nexport const CODEC_DATE_ONLY: Codec<Date> = {\n parse: (value) => new Date(value),\n stringify: (value) => value.toISOString().split('T')[0],\n};\n\n/**\n * A codec that can encode and decode numbers to and from strings.\n */\nexport const CODEC_NUMBER: Codec<number> = {\n parse: (value) => Number(value),\n stringify: (value) => String(value),\n};\n\n/**\n * A codec that can encode and decode boolean values to and from strings.\n */\nexport const CODE_BOOLEAN: Codec<boolean> = {\n parse: (value) => value === 'true',\n stringify: (value) => String(value),\n};\n\n/**\n * A codec that can encode and decode JSON values to and from strings.\n */\nexport const CODEC_JSON: Codec<unknown> = {\n parse: (value) => {\n try {\n return JSON.parse(value);\n } catch {\n return null;\n }\n },\n stringify: (value) => JSON.stringify(value),\n};\n\n/**\n * A codec that can encode and decode JSON values to and from strings.\n * If the JSON value is invalid, parsing will fail.\n */\nexport const CODEC_JSON_STRICT: Codec<unknown> = {\n parse: (value) => JSON.parse(value),\n stringify: (value) => JSON.stringify(value),\n};\n\n/**\n * A codec that can encode and decode strings to and from strings.\n */\nexport const CODEC_STRING: Codec<string> = {\n parse: (value) => value,\n stringify: (value) => value,\n};\n"],"mappings":"AA6EA,MAAaA,EAA8B,CACzC,MAAQ,GAAUC,EAClB,UAAY,GAAUA,CACxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/persistence/codec.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A codec that can encode and decode values of type V to and from strings.
|
|
4
|
+
* @typeParam V The type of values that can be encoded and decoded.
|
|
5
|
+
*/
|
|
6
|
+
export interface Codec<V> {
|
|
7
|
+
/**
|
|
8
|
+
* Decodes a string value into a value of type V.
|
|
9
|
+
* @param value The value to decode.
|
|
10
|
+
* @returns The decoded value.
|
|
11
|
+
*/
|
|
12
|
+
parse: (value: string) => V;
|
|
13
|
+
/**
|
|
14
|
+
* Encodes a value of type V into a string.
|
|
15
|
+
* @param value The value to encode.
|
|
16
|
+
* @returns The encoded value.
|
|
17
|
+
*/
|
|
18
|
+
stringify: (value: V) => string;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=codec.d.cts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/persistence/codec.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A codec that can encode and decode values of type V to and from strings.
|
|
4
|
+
* @typeParam V The type of values that can be encoded and decoded.
|
|
5
|
+
*/
|
|
6
|
+
export interface Codec<V> {
|
|
7
|
+
/**
|
|
8
|
+
* Decodes a string value into a value of type V.
|
|
9
|
+
* @param value The value to decode.
|
|
10
|
+
* @returns The decoded value.
|
|
11
|
+
*/
|
|
12
|
+
parse: (value: string) => V;
|
|
13
|
+
/**
|
|
14
|
+
* Encodes a value of type V into a string.
|
|
15
|
+
* @param value The value to encode.
|
|
16
|
+
* @returns The encoded value.
|
|
17
|
+
*/
|
|
18
|
+
stringify: (value: V) => string;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.js","names":["CODEC_STRING","value"],"sources":["../../src/persistence/codec.tsx"],"sourcesContent":["/**\n * A codec that can encode and decode values of type V to and from strings.\n * @typeParam V The type of values that can be encoded and decoded.\n */\nexport interface Codec<V> {\n /**\n * Decodes a string value into a value of type V.\n * @param value The value to decode.\n * @returns The decoded value.\n */\n parse: (value: string) => V;\n /**\n * Encodes a value of type V into a string.\n * @param value The value to encode.\n * @returns The encoded value.\n */\n stringify: (value: V) => string;\n}\n\n/**\n * A codec that can encode and decode Date objects to and from strings.\n */\nexport const CODEC_DATE: Codec<Date> = {\n parse: (value) => new Date(value),\n stringify: (value) => value.toISOString(),\n};\n\n/**\n * A codec that can encode and decode Date objects to and from strings, but only the date part.\n */\nexport const CODEC_DATE_ONLY: Codec<Date> = {\n parse: (value) => new Date(value),\n stringify: (value) => value.toISOString().split('T')[0],\n};\n\n/**\n * A codec that can encode and decode numbers to and from strings.\n */\nexport const CODEC_NUMBER: Codec<number> = {\n parse: (value) => Number(value),\n stringify: (value) => String(value),\n};\n\n/**\n * A codec that can encode and decode boolean values to and from strings.\n */\nexport const CODE_BOOLEAN: Codec<boolean> = {\n parse: (value) => value === 'true',\n stringify: (value) => String(value),\n};\n\n/**\n * A codec that can encode and decode JSON values to and from strings.\n */\nexport const CODEC_JSON: Codec<unknown> = {\n parse: (value) => {\n try {\n return JSON.parse(value);\n } catch {\n return null;\n }\n },\n stringify: (value) => JSON.stringify(value),\n};\n\n/**\n * A codec that can encode and decode JSON values to and from strings.\n * If the JSON value is invalid, parsing will fail.\n */\nexport const CODEC_JSON_STRICT: Codec<unknown> = {\n parse: (value) => JSON.parse(value),\n stringify: (value) => JSON.stringify(value),\n};\n\n/**\n * A codec that can encode and decode strings to and from strings.\n */\nexport const CODEC_STRING: Codec<string> = {\n parse: (value) => value,\n stringify: (value) => value,\n};\n"],"mappings":"AA6EA,MAAaA,EAA8B,CACzC,MAAQ,GAAUC,EAClB,UAAY,GAAUA,CACxB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DefaultStorageStateoptions, StorageStateInitializer, StorageStateOptions, UseStorageState, UseStorageStateHookResult } from "./useStorageState.cjs";
|
|
2
|
+
export { DefaultStorageStateoptions, StorageStateInitializer, StorageStateOptions, UseStorageState, UseStorageStateHookResult };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DefaultStorageStateoptions, StorageStateInitializer, StorageStateOptions, UseStorageState, UseStorageStateHookResult } from "./useStorageState.js";
|
|
2
|
+
export { DefaultStorageStateoptions, StorageStateInitializer, StorageStateOptions, UseStorageState, UseStorageStateHookResult };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";const e=require("./codec.cjs");let t=require("react");const n=/* @__PURE__ */ new Map;function r(e,t){let r=n.get(e);r||(r=/* @__PURE__ */ new Set,n.set(e,r)),r.add(t)}function i(e,t){let r=n.get(e);r&&(r.delete(t),r.size===0&&n.delete(e))}function a(e){let t=n.get(e);t&&t.forEach(e=>{e()})}if(typeof window<`u`){let e=window.localStorage.setItem;window.localStorage.setItem=function(t,n){let r=e.call(this,t,n);return a(t),r}}function o(e,t,n){if(!t)return()=>{};let a=r=>{r.storageArea===e&&r.key===t&&n()};return window.addEventListener(`storage`,a),r(t,n),()=>{window.removeEventListener(`storage`,a),i(t,n)}}function s(e,t){if(!t)return null;try{return e.getItem(t)}catch{return null}}function c(e,t,n){if(t){try{n===null?e.removeItem(t):e.setItem(t,String(n))}catch{return}a(t)}}const l=[null,()=>{}];function u(){return l}function d(e,t){return t===null?null:e.stringify(t)}function f(e,t){return t===null?null:e.parse(t)}const p=()=>null;function m(n,r,i=null,a){let l=a?.codec??e.CODEC_STRING,[u]=(0,t.useState)(i),m=(0,t.useMemo)(()=>d(l,u),[l,u]),h=(0,t.useCallback)(e=>o(n,r,e),[n,r]),g=(0,t.useCallback)(()=>s(n,r)??m,[n,m,r]),_=(0,t.useSyncExternalStore)(h,g,p),v=(0,t.useMemo)(()=>f(l,_),[l,_]),y=(0,t.useCallback)(e=>{let t=e instanceof Function?e(v):e;c(n,r,d(l,t))},[n,l,v,r]),[b,x]=(0,t.useState)(u);return r?[v,y]:[b,x]}exports.useStorageState=m,exports.useStorageStateServer=u;
|
|
2
|
+
//# sourceMappingURL=useStorageState.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStorageState.cjs","names":["CODEC_STRING","useState","useMemo","useCallback","useSyncExternalStore","require_codec","react","currentTabChangeListeners","onCurrentTabStorageChange","listeners","key","handler","offCurrentTabStorageChange","emitCurrentTabStorageChange","listener","origSetItem","result","value","subscribe","storageHandler","event","area","callback","getSnapshot","setValue","serverValue","useStorageStateServer","encode","codec","decode","getKeyServerSnapshot","useStorageState","options","initialValue","initializer","encodedInitialValue","subscribeKey","getKeySnapshot","encodedStoredValue","storedValue","setStoredValue","valueToStore","nonStoredValue","setNonStoredValue"],"sources":["../../src/persistence/useStorageState.tsx"],"sourcesContent":["'use client';\n\nimport type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useMemo, useState, useSyncExternalStore } from 'react';\nimport type { Codec } from './codec.js';\nimport { CODEC_STRING } from './codec.js';\n\n// storage events only work across tabs, we'll use an event emitter to announce within the current tab\nconst currentTabChangeListeners = new Map<string, Set<() => void>>();\n\nfunction onCurrentTabStorageChange(key: string, handler: () => void) {\n let listeners = currentTabChangeListeners.get(key);\n\n if (!listeners) {\n listeners = new Set();\n currentTabChangeListeners.set(key, listeners);\n }\n\n listeners.add(handler);\n}\n\nfunction offCurrentTabStorageChange(key: string, handler: () => void) {\n const listeners = currentTabChangeListeners.get(key);\n if (!listeners) {\n return;\n }\n\n listeners.delete(handler);\n\n if (listeners.size === 0) {\n currentTabChangeListeners.delete(key);\n }\n}\n\nfunction emitCurrentTabStorageChange(key: string) {\n const listeners = currentTabChangeListeners.get(key);\n if (listeners) {\n listeners.forEach((listener) => {\n listener();\n });\n }\n}\n\nif (typeof window !== 'undefined') {\n const origSetItem = window.localStorage.setItem;\n window.localStorage.setItem = function setItem(key, value) {\n const result = origSetItem.call(this, key, value);\n emitCurrentTabStorageChange(key);\n return result;\n };\n}\n\nfunction subscribe(area: Storage, key: string | null, callback: () => void): () => void {\n if (!key) {\n return () => {};\n }\n const storageHandler = (event: StorageEvent) => {\n if (event.storageArea === area && event.key === key) {\n callback();\n }\n };\n window.addEventListener('storage', storageHandler);\n onCurrentTabStorageChange(key, callback);\n return () => {\n window.removeEventListener('storage', storageHandler);\n offCurrentTabStorageChange(key, callback);\n };\n}\n\nfunction getSnapshot(area: Storage, key: string | null): string | null {\n if (!key) {\n return null;\n }\n try {\n return area.getItem(key);\n } catch {\n // ignore\n // See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage\n return null;\n }\n}\n\nfunction setValue(area: Storage, key: string | null, value: string | null) {\n if (!key) {\n return;\n }\n try {\n if (value === null) {\n area.removeItem(key);\n } else {\n area.setItem(key, String(value));\n }\n } catch {\n // ignore\n // See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage\n return;\n }\n emitCurrentTabStorageChange(key);\n}\n\nexport type StorageStateInitializer<T> = () => T | null;\n\nexport type UseStorageStateHookResult<T> = [T | null, Dispatch<SetStateAction<T | null>>];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst serverValue: UseStorageStateHookResult<any> = [null, () => {}];\n\nexport function useStorageStateServer<T = string>(): UseStorageStateHookResult<T> {\n return serverValue;\n}\n\nexport interface DefaultStorageStateoptions<T = string> {\n codec?: Codec<T>;\n}\n\nexport interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {\n codec: Codec<T>;\n}\n\nfunction encode<V>(codec: Codec<V>, value: V | null): string | null {\n return value === null ? null : codec.stringify(value);\n}\n\nfunction decode<V>(codec: Codec<V>, value: string | null): V | null {\n return value === null ? null : codec.parse(value);\n}\n\n// Start with null for the hydration, and then switch to the actual value.\nconst getKeyServerSnapshot = () => null;\n\n/**\n * Sync state to local storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key so that we can default\n * to that value on page load instead of the specified initial value.\n *\n * Since the storage API isn't available in server-rendering environments, we\n * return null during SSR and hydration.\n */\nexport function useStorageState(\n area: Storage,\n key: string | null,\n initializer?: string | null | StorageStateInitializer<string>,\n options?: DefaultStorageStateoptions,\n): UseStorageStateHookResult<string>;\n\nexport function useStorageState<T>(\n area: Storage,\n key: string | null,\n initializer: T | null | StorageStateInitializer<T>,\n options: StorageStateOptions<T>,\n): UseStorageStateHookResult<T>;\n\nexport function useStorageState<T = string>(\n area: Storage,\n key: string | null,\n initializer: T | null | StorageStateInitializer<T> = null,\n options?: DefaultStorageStateoptions | StorageStateOptions<T>,\n): UseStorageStateHookResult<T> {\n const codec = (options?.codec ?? CODEC_STRING) as Codec<T>;\n\n const [initialValue] = useState(initializer);\n const encodedInitialValue = useMemo(() => encode(codec, initialValue), [codec, initialValue]);\n\n const subscribeKey = useCallback(\n (callback: () => void) => subscribe(area, key, callback),\n [area, key],\n );\n\n const getKeySnapshot = useCallback<() => string | null>(\n () => getSnapshot(area, key) ?? encodedInitialValue,\n [area, encodedInitialValue, key],\n );\n\n const encodedStoredValue = useSyncExternalStore(\n subscribeKey,\n getKeySnapshot,\n getKeyServerSnapshot,\n );\n\n const storedValue = useMemo(() => decode(codec, encodedStoredValue), [codec, encodedStoredValue]);\n\n const setStoredValue = useCallback(\n (value: SetStateAction<T | null>) => {\n const valueToStore = value instanceof Function ? value(storedValue) : value;\n const encodedValueToStore = encode(codec, valueToStore);\n setValue(area, key, encodedValueToStore);\n },\n [area, codec, storedValue, key],\n );\n\n const [nonStoredValue, setNonStoredValue] = useState(initialValue);\n\n if (!key) {\n return [nonStoredValue, setNonStoredValue];\n }\n\n return [storedValue, setStoredValue];\n}\n\nexport interface UseStorageState {\n /**\n * Sync state to local or session storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key that uniquely identifies the value.\n * @param key The key to use for storing the value in local or session storage.\n * @param initializer The initial value to use if the key is not present in storage.\n * @param options Additional options for the storage state.\n */\n (\n key: string | null,\n initializer?: string | null | StorageStateInitializer<string>,\n options?: DefaultStorageStateoptions,\n ): UseStorageStateHookResult<string>;\n\n /**\n * Sync state to local or session storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key that uniquely identifies the value.\n * @param key The key to use for storing the value in local or session storage.\n * @param initializer The initial value to use if the key is not present in storage.\n * @param options Additional options for the storage state.\n */\n <T>(\n key: string | null,\n initializer: T | null | StorageStateInitializer<T>,\n options: StorageStateOptions<T>,\n ): UseStorageStateHookResult<T>;\n\n /**\n * Sync state to local or session storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key that uniquely identifies the value.\n * @param key The key to use for storing the value in local or session storage.\n * @param initializer The initial value to use if the key is not present in storage.\n * @param options Additional options for the storage state.\n */\n <T>(\n key: string | null,\n initializer?: T | null | StorageStateInitializer<T>,\n options?: StorageStateOptions<T>,\n ): UseStorageStateHookResult<T>;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Codec } from "./codec.cjs";
|
|
2
|
+
import { Dispatch, SetStateAction } from "react";
|
|
3
|
+
//#region src/persistence/useStorageState.d.ts
|
|
4
|
+
export type StorageStateInitializer<T> = () => T | null;
|
|
5
|
+
export type UseStorageStateHookResult<T> = [T | null, Dispatch<SetStateAction<T | null>>];
|
|
6
|
+
export interface DefaultStorageStateoptions<T = string> {
|
|
7
|
+
codec?: Codec<T>;
|
|
8
|
+
}
|
|
9
|
+
export interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {
|
|
10
|
+
codec: Codec<T>;
|
|
11
|
+
}
|
|
12
|
+
export interface UseStorageState {
|
|
13
|
+
/**
|
|
14
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
15
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
16
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
17
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
18
|
+
* @param options Additional options for the storage state.
|
|
19
|
+
*/
|
|
20
|
+
(key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
23
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
24
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
25
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
26
|
+
* @param options Additional options for the storage state.
|
|
27
|
+
*/
|
|
28
|
+
<T>(key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
31
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
32
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
33
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
34
|
+
* @param options Additional options for the storage state.
|
|
35
|
+
*/
|
|
36
|
+
<T>(key: string | null, initializer?: T | null | StorageStateInitializer<T>, options?: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//# sourceMappingURL=useStorageState.d.cts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Codec } from "./codec.js";
|
|
2
|
+
import { Dispatch, SetStateAction } from "react";
|
|
3
|
+
//#region src/persistence/useStorageState.d.ts
|
|
4
|
+
export type StorageStateInitializer<T> = () => T | null;
|
|
5
|
+
export type UseStorageStateHookResult<T> = [T | null, Dispatch<SetStateAction<T | null>>];
|
|
6
|
+
export interface DefaultStorageStateoptions<T = string> {
|
|
7
|
+
codec?: Codec<T>;
|
|
8
|
+
}
|
|
9
|
+
export interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {
|
|
10
|
+
codec: Codec<T>;
|
|
11
|
+
}
|
|
12
|
+
export interface UseStorageState {
|
|
13
|
+
/**
|
|
14
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
15
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
16
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
17
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
18
|
+
* @param options Additional options for the storage state.
|
|
19
|
+
*/
|
|
20
|
+
(key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
23
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
24
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
25
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
26
|
+
* @param options Additional options for the storage state.
|
|
27
|
+
*/
|
|
28
|
+
<T>(key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
31
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
32
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
33
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
34
|
+
* @param options Additional options for the storage state.
|
|
35
|
+
*/
|
|
36
|
+
<T>(key: string | null, initializer?: T | null | StorageStateInitializer<T>, options?: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//# sourceMappingURL=useStorageState.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{CODEC_STRING as e}from"./codec.js";import{useCallback as t,useMemo as n,useState as r,useSyncExternalStore as i}from"react";const a=/* @__PURE__ */ new Map;function o(e,t){let n=a.get(e);n||(n=/* @__PURE__ */ new Set,a.set(e,n)),n.add(t)}function s(e,t){let n=a.get(e);n&&(n.delete(t),n.size===0&&a.delete(e))}function c(e){let t=a.get(e);t&&t.forEach(e=>{e()})}if(typeof window<`u`){let e=window.localStorage.setItem;window.localStorage.setItem=function(t,n){let r=e.call(this,t,n);return c(t),r}}function l(e,t,n){if(!t)return()=>{};let r=r=>{r.storageArea===e&&r.key===t&&n()};return window.addEventListener(`storage`,r),o(t,n),()=>{window.removeEventListener(`storage`,r),s(t,n)}}function u(e,t){if(!t)return null;try{return e.getItem(t)}catch{return null}}function d(e,t,n){if(t){try{n===null?e.removeItem(t):e.setItem(t,String(n))}catch{return}c(t)}}const f=[null,()=>{}];function p(){return f}function m(e,t){return t===null?null:e.stringify(t)}function h(e,t){return t===null?null:e.parse(t)}const g=()=>null;function _(a,o,s=null,c){let f=c?.codec??e,[p]=r(s),_=n(()=>m(f,p),[f,p]),v=t(e=>l(a,o,e),[a,o]),y=t(()=>u(a,o)??_,[a,_,o]),b=i(v,y,g),x=n(()=>h(f,b),[f,b]),S=t(e=>{let t=e instanceof Function?e(x):e;d(a,o,m(f,t))},[a,f,x,o]),[C,w]=r(p);return o?[x,S]:[C,w]}export{_ as useStorageState,p as useStorageStateServer};
|
|
2
|
+
//# sourceMappingURL=useStorageState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStorageState.js","names":["currentTabChangeListeners","onCurrentTabStorageChange","listeners","key","handler","offCurrentTabStorageChange","emitCurrentTabStorageChange","listener","origSetItem","result","value","subscribe","storageHandler","event","area","callback","getSnapshot","setValue","serverValue","useStorageStateServer","encode","codec","decode","getKeyServerSnapshot","useStorageState","options","CODEC_STRING","initialValue","useState","initializer","encodedInitialValue","useMemo","subscribeKey","useCallback","getKeySnapshot","encodedStoredValue","useSyncExternalStore","storedValue","setStoredValue","valueToStore","nonStoredValue","setNonStoredValue"],"sources":["../../src/persistence/useStorageState.tsx"],"sourcesContent":["'use client';\n\nimport type { Dispatch, SetStateAction } from 'react';\nimport { useCallback, useMemo, useState, useSyncExternalStore } from 'react';\nimport type { Codec } from './codec.js';\nimport { CODEC_STRING } from './codec.js';\n\n// storage events only work across tabs, we'll use an event emitter to announce within the current tab\nconst currentTabChangeListeners = new Map<string, Set<() => void>>();\n\nfunction onCurrentTabStorageChange(key: string, handler: () => void) {\n let listeners = currentTabChangeListeners.get(key);\n\n if (!listeners) {\n listeners = new Set();\n currentTabChangeListeners.set(key, listeners);\n }\n\n listeners.add(handler);\n}\n\nfunction offCurrentTabStorageChange(key: string, handler: () => void) {\n const listeners = currentTabChangeListeners.get(key);\n if (!listeners) {\n return;\n }\n\n listeners.delete(handler);\n\n if (listeners.size === 0) {\n currentTabChangeListeners.delete(key);\n }\n}\n\nfunction emitCurrentTabStorageChange(key: string) {\n const listeners = currentTabChangeListeners.get(key);\n if (listeners) {\n listeners.forEach((listener) => {\n listener();\n });\n }\n}\n\nif (typeof window !== 'undefined') {\n const origSetItem = window.localStorage.setItem;\n window.localStorage.setItem = function setItem(key, value) {\n const result = origSetItem.call(this, key, value);\n emitCurrentTabStorageChange(key);\n return result;\n };\n}\n\nfunction subscribe(area: Storage, key: string | null, callback: () => void): () => void {\n if (!key) {\n return () => {};\n }\n const storageHandler = (event: StorageEvent) => {\n if (event.storageArea === area && event.key === key) {\n callback();\n }\n };\n window.addEventListener('storage', storageHandler);\n onCurrentTabStorageChange(key, callback);\n return () => {\n window.removeEventListener('storage', storageHandler);\n offCurrentTabStorageChange(key, callback);\n };\n}\n\nfunction getSnapshot(area: Storage, key: string | null): string | null {\n if (!key) {\n return null;\n }\n try {\n return area.getItem(key);\n } catch {\n // ignore\n // See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage\n return null;\n }\n}\n\nfunction setValue(area: Storage, key: string | null, value: string | null) {\n if (!key) {\n return;\n }\n try {\n if (value === null) {\n area.removeItem(key);\n } else {\n area.setItem(key, String(value));\n }\n } catch {\n // ignore\n // See https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API#feature-detecting_localstorage\n return;\n }\n emitCurrentTabStorageChange(key);\n}\n\nexport type StorageStateInitializer<T> = () => T | null;\n\nexport type UseStorageStateHookResult<T> = [T | null, Dispatch<SetStateAction<T | null>>];\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst serverValue: UseStorageStateHookResult<any> = [null, () => {}];\n\nexport function useStorageStateServer<T = string>(): UseStorageStateHookResult<T> {\n return serverValue;\n}\n\nexport interface DefaultStorageStateoptions<T = string> {\n codec?: Codec<T>;\n}\n\nexport interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {\n codec: Codec<T>;\n}\n\nfunction encode<V>(codec: Codec<V>, value: V | null): string | null {\n return value === null ? null : codec.stringify(value);\n}\n\nfunction decode<V>(codec: Codec<V>, value: string | null): V | null {\n return value === null ? null : codec.parse(value);\n}\n\n// Start with null for the hydration, and then switch to the actual value.\nconst getKeyServerSnapshot = () => null;\n\n/**\n * Sync state to local storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key so that we can default\n * to that value on page load instead of the specified initial value.\n *\n * Since the storage API isn't available in server-rendering environments, we\n * return null during SSR and hydration.\n */\nexport function useStorageState(\n area: Storage,\n key: string | null,\n initializer?: string | null | StorageStateInitializer<string>,\n options?: DefaultStorageStateoptions,\n): UseStorageStateHookResult<string>;\n\nexport function useStorageState<T>(\n area: Storage,\n key: string | null,\n initializer: T | null | StorageStateInitializer<T>,\n options: StorageStateOptions<T>,\n): UseStorageStateHookResult<T>;\n\nexport function useStorageState<T = string>(\n area: Storage,\n key: string | null,\n initializer: T | null | StorageStateInitializer<T> = null,\n options?: DefaultStorageStateoptions | StorageStateOptions<T>,\n): UseStorageStateHookResult<T> {\n const codec = (options?.codec ?? CODEC_STRING) as Codec<T>;\n\n const [initialValue] = useState(initializer);\n const encodedInitialValue = useMemo(() => encode(codec, initialValue), [codec, initialValue]);\n\n const subscribeKey = useCallback(\n (callback: () => void) => subscribe(area, key, callback),\n [area, key],\n );\n\n const getKeySnapshot = useCallback<() => string | null>(\n () => getSnapshot(area, key) ?? encodedInitialValue,\n [area, encodedInitialValue, key],\n );\n\n const encodedStoredValue = useSyncExternalStore(\n subscribeKey,\n getKeySnapshot,\n getKeyServerSnapshot,\n );\n\n const storedValue = useMemo(() => decode(codec, encodedStoredValue), [codec, encodedStoredValue]);\n\n const setStoredValue = useCallback(\n (value: SetStateAction<T | null>) => {\n const valueToStore = value instanceof Function ? value(storedValue) : value;\n const encodedValueToStore = encode(codec, valueToStore);\n setValue(area, key, encodedValueToStore);\n },\n [area, codec, storedValue, key],\n );\n\n const [nonStoredValue, setNonStoredValue] = useState(initialValue);\n\n if (!key) {\n return [nonStoredValue, setNonStoredValue];\n }\n\n return [storedValue, setStoredValue];\n}\n\nexport interface UseStorageState {\n /**\n * Sync state to local or session storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key that uniquely identifies the value.\n * @param key The key to use for storing the value in local or session storage.\n * @param initializer The initial value to use if the key is not present in storage.\n * @param options Additional options for the storage state.\n */\n (\n key: string | null,\n initializer?: string | null | StorageStateInitializer<string>,\n options?: DefaultStorageStateoptions,\n ): UseStorageStateHookResult<string>;\n\n /**\n * Sync state to local or session storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key that uniquely identifies the value.\n * @param key The key to use for storing the value in local or session storage.\n * @param initializer The initial value to use if the key is not present in storage.\n * @param options Additional options for the storage state.\n */\n <T>(\n key: string | null,\n initializer: T | null | StorageStateInitializer<T>,\n options: StorageStateOptions<T>,\n ): UseStorageStateHookResult<T>;\n\n /**\n * Sync state to local or session storage so that it persists through a page refresh. Usage is\n * similar to useState except we pass in a storage key that uniquely identifies the value.\n * @param key The key to use for storing the value in local or session storage.\n * @param initializer The initial value to use if the key is not present in storage.\n * @param options Additional options for the storage state.\n */\n <T>(\n key: string | null,\n initializer?: T | null | StorageStateInitializer<T>,\n options?: StorageStateOptions<T>,\n ): UseStorageStateHookResult<T>;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../eventemitter/eventemitter3.cjs");let t=require("rxjs");var n=class n{#e=/* @__PURE__ */ new Set;#t;#n=new e.EventEmitter;get events(){return this.#n}get closeTrigger$(){return this.#t||=new t.Subject,this.#t}add=(...e)=>(e.forEach(e=>{this.#e.add(e)}),this);remove=(...e)=>(e.forEach(e=>{this.#e.delete(e)}),this);addRx=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.unsubscribe()})}),this);addUnsubscribe=this.addRx;addClose=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.close()})}),this);addDispose=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.dispose()})}),this);addDestroy=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.destroy()})}),this);addShutdown=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.shutdown()})}),this);addTerminate=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.terminate()})}),this);addElementListener=(e,t,n,r)=>(e.addEventListener(t,n,r),this.#e.add(()=>{e.removeEventListener(t,n,r)}),this);addDocumentListener=(e,t,n)=>(document.addEventListener(e,t,n),this.#e.add(()=>{document.removeEventListener(e,t,n)}),this);addWindowListener=(e,t,n)=>(window.addEventListener(e,t,n),this.#e.add(()=>{window.removeEventListener(e,t,n)}),this);get count(){return this.#e.size}close=()=>{this.#n.emit(`closed`),this.#n.removeAllListeners(),this.#t&&=(this.#t.next(1),void 0),this.#e.size>0&&(Array.from(this.#e).forEach(e=>{e()}),this.#e.clear())};static create=(...e)=>{let t=new n;return t.add(...e),t};static createWindowListener=(e,t,r)=>{let i=new n;return i.addWindowListener(e,t,r),i};static createDocumentListener=(e,t,r)=>{let i=new n;return i.addDocumentListener(e,t,r),i};static createElementListener=(e,t,r,i)=>{let a=new n;return a.addElementListener(e,t,r,i),a};static createRx=(...e)=>{let t=new n;return t.addRx(...e),t};static createClose=(...e)=>{let t=new n;return t.addClose(...e),t};static createTerminate=(...e)=>{let t=new n;return t.addTerminate(...e),t};static createShutdown=(...e)=>{let t=new n;return t.addShutdown(...e),t};static createDestroy=(...e)=>{let t=new n;return t.addDestroy(...e),t};static createDispose=(...e)=>{let t=new n;return t.addDispose(...e),t}};exports.Closables=n;
|
|
2
|
+
//# sourceMappingURL=closables.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closables.cjs","names":["EventEmitter","Subject","require_eventemitter3","rxjs","Closables","#events","#closeTrigger$","closables","#store","it","s","elem","type","listener","options","fn","c"],"sources":["../../src/util/closables.ts"],"sourcesContent":["import { Subject } from 'rxjs';\nimport { EventEmitter } from '../eventemitter/eventemitter3.js';\n\ntype WinEventType = keyof WindowEventMap;\ntype WinEventListener<K extends WinEventType> = (this: Window, ev: WindowEventMap[K]) => void;\ntype EventOptions = boolean | AddEventListenerOptions;\n\ntype DocEventType = keyof DocumentEventMap;\n\ntype DocEventListener<K extends DocEventType> = (this: Document, ev: DocumentEventMap[K]) => void;\n\ntype ElemEventType = keyof HTMLElementEventMap;\ntype ElemEventListener<K extends ElemEventType> = (\n this: HTMLElement,\n ev: HTMLElementEventMap[K],\n) => void;\n\nexport class Closables {\n #store = new Set<() => void>();\n #closeTrigger$: Subject<unknown> | undefined;\n #events = new EventEmitter<{ closed: () => void }>();\n\n get events() {\n return this.#events;\n }\n\n get closeTrigger$(): Subject<unknown> {\n if (!this.#closeTrigger$) {\n this.#closeTrigger$ = new Subject();\n }\n return this.#closeTrigger$;\n }\n\n add = (...closables: (() => void)[]): this => {\n closables.forEach((it) => {\n this.#store.add(it);\n });\n return this;\n };\n\n remove = (...closables: (() => void)[]): this => {\n closables.forEach((it) => {\n this.#store.delete(it);\n });\n return this;\n };\n\n addRx = (...closables: Array<{ unsubscribe: () => void }>): this => {\n closables.forEach((s) => {\n this.#store.add(() => {\n s.unsubscribe();\n });\n });\n return this;\n };\n\n addUnsubscribe = this.addRx;\n\n addClose = (...closables: Array<{ close: () => void }>): this => {\n closables.forEach((s) => {\n this.#store.add(() => {\n s.close();\n });\n });\n return this;\n };\n\n addDispose = (...closables: Array<{ dispose: () => void }>): this => {\n closables.forEach((s) => {\n this.#store.add(() => {\n s.dispose();\n });\n });\n return this;\n };\n\n addDestroy = (...closables: Array<{ destroy: () => void }>): this => {\n closables.forEach((s) => {\n this.#store.add(() => {\n s.destroy();\n });\n });\n return this;\n };\n\n addShutdown = (...closables: Array<{ shutdown: () => void }>): this => {\n closables.forEach((s) => {\n this.#store.add(() => {\n s.shutdown();\n });\n });\n return this;\n };\n\n addTerminate = (...closables: Array<{ terminate: () => void }>): this => {\n closables.forEach((s) => {\n this.#store.add(() => {\n s.terminate();\n });\n });\n return this;\n };\n\n addElementListener = <K extends ElemEventType>(\n elem: HTMLElement,\n type: K,\n listener: ElemEventListener<K>,\n options?: EventOptions,\n ): this => {\n elem.addEventListener(type, listener, options);\n this.#store.add(() => {\n elem.removeEventListener(type, listener, options);\n });\n return this;\n };\n\n addDocumentListener = <K extends DocEventType>(\n type: K,\n listener: DocEventListener<K>,\n options?: EventOptions,\n ): this => {\n document.addEventListener(type, listener, options);\n this.#store.add(() => {\n document.removeEventListener(type, listener, options);\n });\n return this;\n };\n\n addWindowListener = <K extends WinEventType>(\n type: K,\n listener: WinEventListener<K>,\n options?: EventOptions,\n ): this => {\n window.addEventListener(type, listener, options);\n this.#store.add(() => {\n window.removeEventListener(type, listener, options);\n });\n return this;\n };\n\n get count() {\n return this.#store.size;\n }\n\n close = () => {\n this.#events.emit('closed');\n this.#events.removeAllListeners();\n if (this.#closeTrigger$) {\n this.#closeTrigger$.next(1);\n this.#closeTrigger$ = undefined;\n }\n\n if (this.#store.size > 0) {\n Array.from(this.#store).forEach((fn) => {\n fn();\n });\n this.#store.clear();\n }\n };\n\n static create = (...closables: (() => void)[]) => {\n const c = new Closables();\n c.add(...closables);\n return c;\n };\n\n static createWindowListener = <K extends WinEventType>(\n type: K,\n listener: WinEventListener<K>,\n options?: EventOptions,\n ) => {\n const c = new Closables();\n c.addWindowListener(type, listener, options);\n return c;\n };\n\n static createDocumentListener = <K extends DocEventType>(\n type: K,\n listener: DocEventListener<K>,\n options?: EventOptions,\n ) => {\n const c = new Closables();\n c.addDocumentListener(type, listener, options);\n return c;\n };\n\n static createElementListener = <K extends ElemEventType>(\n elem: HTMLElement,\n type: K,\n listener: ElemEventListener<K>,\n options?: EventOptions,\n ) => {\n const c = new Closables();\n c.addElementListener(elem, type, listener, options);\n return c;\n };\n\n static createRx = (...closables: { unsubscribe: () => void }[]) => {\n const c = new Closables();\n c.addRx(...closables);\n return c;\n };\n\n static createClose = (...closables: { close: () => void }[]) => {\n const c = new Closables();\n c.addClose(...closables);\n return c;\n };\n\n static createTerminate = (...closables: { terminate: () => void }[]) => {\n const c = new Closables();\n c.addTerminate(...closables);\n return c;\n };\n\n static createShutdown = (...closables: { shutdown: () => void }[]) => {\n const c = new Closables();\n c.addShutdown(...closables);\n return c;\n };\n\n static createDestroy = (...closables: { destroy: () => void }[]) => {\n const c = new Closables();\n c.addDestroy(...closables);\n return c;\n };\n\n static createDispose = (...closables: { dispose: () => void }[]) => {\n const c = new Closables();\n c.addDispose(...closables);\n return c;\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EventEmitter } from "../eventemitter/eventemitter3.cjs";
|
|
2
|
+
import { Subject } from "rxjs";
|
|
3
|
+
//#region src/util/closables.d.ts
|
|
4
|
+
type WinEventType = keyof WindowEventMap;
|
|
5
|
+
type WinEventListener<K extends WinEventType> = (this: Window, ev: WindowEventMap[K]) => void;
|
|
6
|
+
type EventOptions = boolean | AddEventListenerOptions;
|
|
7
|
+
type DocEventType = keyof DocumentEventMap;
|
|
8
|
+
type DocEventListener<K extends DocEventType> = (this: Document, ev: DocumentEventMap[K]) => void;
|
|
9
|
+
type ElemEventType = keyof HTMLElementEventMap;
|
|
10
|
+
type ElemEventListener<K extends ElemEventType> = (this: HTMLElement, ev: HTMLElementEventMap[K]) => void;
|
|
11
|
+
export declare class Closables {
|
|
12
|
+
#private;
|
|
13
|
+
get events(): EventEmitter<{
|
|
14
|
+
closed: () => void;
|
|
15
|
+
}, any>;
|
|
16
|
+
get closeTrigger$(): Subject<unknown>;
|
|
17
|
+
add: (...closables: (() => void)[]) => this;
|
|
18
|
+
remove: (...closables: (() => void)[]) => this;
|
|
19
|
+
addRx: (...closables: Array<{
|
|
20
|
+
unsubscribe: () => void;
|
|
21
|
+
}>) => this;
|
|
22
|
+
addUnsubscribe: (...closables: Array<{
|
|
23
|
+
unsubscribe: () => void;
|
|
24
|
+
}>) => this;
|
|
25
|
+
addClose: (...closables: Array<{
|
|
26
|
+
close: () => void;
|
|
27
|
+
}>) => this;
|
|
28
|
+
addDispose: (...closables: Array<{
|
|
29
|
+
dispose: () => void;
|
|
30
|
+
}>) => this;
|
|
31
|
+
addDestroy: (...closables: Array<{
|
|
32
|
+
destroy: () => void;
|
|
33
|
+
}>) => this;
|
|
34
|
+
addShutdown: (...closables: Array<{
|
|
35
|
+
shutdown: () => void;
|
|
36
|
+
}>) => this;
|
|
37
|
+
addTerminate: (...closables: Array<{
|
|
38
|
+
terminate: () => void;
|
|
39
|
+
}>) => this;
|
|
40
|
+
addElementListener: <K extends ElemEventType>(elem: HTMLElement, type: K, listener: ElemEventListener<K>, options?: EventOptions) => this;
|
|
41
|
+
addDocumentListener: <K extends DocEventType>(type: K, listener: DocEventListener<K>, options?: EventOptions) => this;
|
|
42
|
+
addWindowListener: <K extends WinEventType>(type: K, listener: WinEventListener<K>, options?: EventOptions) => this;
|
|
43
|
+
get count(): number;
|
|
44
|
+
close: () => void;
|
|
45
|
+
static create: (...closables: (() => void)[]) => Closables;
|
|
46
|
+
static createWindowListener: <K extends WinEventType>(type: K, listener: WinEventListener<K>, options?: EventOptions) => Closables;
|
|
47
|
+
static createDocumentListener: <K extends DocEventType>(type: K, listener: DocEventListener<K>, options?: EventOptions) => Closables;
|
|
48
|
+
static createElementListener: <K extends ElemEventType>(elem: HTMLElement, type: K, listener: ElemEventListener<K>, options?: EventOptions) => Closables;
|
|
49
|
+
static createRx: (...closables: {
|
|
50
|
+
unsubscribe: () => void;
|
|
51
|
+
}[]) => Closables;
|
|
52
|
+
static createClose: (...closables: {
|
|
53
|
+
close: () => void;
|
|
54
|
+
}[]) => Closables;
|
|
55
|
+
static createTerminate: (...closables: {
|
|
56
|
+
terminate: () => void;
|
|
57
|
+
}[]) => Closables;
|
|
58
|
+
static createShutdown: (...closables: {
|
|
59
|
+
shutdown: () => void;
|
|
60
|
+
}[]) => Closables;
|
|
61
|
+
static createDestroy: (...closables: {
|
|
62
|
+
destroy: () => void;
|
|
63
|
+
}[]) => Closables;
|
|
64
|
+
static createDispose: (...closables: {
|
|
65
|
+
dispose: () => void;
|
|
66
|
+
}[]) => Closables;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=closables.d.cts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EventEmitter } from "../eventemitter/eventemitter3.js";
|
|
2
|
+
import { Subject } from "rxjs";
|
|
3
|
+
//#region src/util/closables.d.ts
|
|
4
|
+
type WinEventType = keyof WindowEventMap;
|
|
5
|
+
type WinEventListener<K extends WinEventType> = (this: Window, ev: WindowEventMap[K]) => void;
|
|
6
|
+
type EventOptions = boolean | AddEventListenerOptions;
|
|
7
|
+
type DocEventType = keyof DocumentEventMap;
|
|
8
|
+
type DocEventListener<K extends DocEventType> = (this: Document, ev: DocumentEventMap[K]) => void;
|
|
9
|
+
type ElemEventType = keyof HTMLElementEventMap;
|
|
10
|
+
type ElemEventListener<K extends ElemEventType> = (this: HTMLElement, ev: HTMLElementEventMap[K]) => void;
|
|
11
|
+
export declare class Closables {
|
|
12
|
+
#private;
|
|
13
|
+
get events(): EventEmitter<{
|
|
14
|
+
closed: () => void;
|
|
15
|
+
}, any>;
|
|
16
|
+
get closeTrigger$(): Subject<unknown>;
|
|
17
|
+
add: (...closables: (() => void)[]) => this;
|
|
18
|
+
remove: (...closables: (() => void)[]) => this;
|
|
19
|
+
addRx: (...closables: Array<{
|
|
20
|
+
unsubscribe: () => void;
|
|
21
|
+
}>) => this;
|
|
22
|
+
addUnsubscribe: (...closables: Array<{
|
|
23
|
+
unsubscribe: () => void;
|
|
24
|
+
}>) => this;
|
|
25
|
+
addClose: (...closables: Array<{
|
|
26
|
+
close: () => void;
|
|
27
|
+
}>) => this;
|
|
28
|
+
addDispose: (...closables: Array<{
|
|
29
|
+
dispose: () => void;
|
|
30
|
+
}>) => this;
|
|
31
|
+
addDestroy: (...closables: Array<{
|
|
32
|
+
destroy: () => void;
|
|
33
|
+
}>) => this;
|
|
34
|
+
addShutdown: (...closables: Array<{
|
|
35
|
+
shutdown: () => void;
|
|
36
|
+
}>) => this;
|
|
37
|
+
addTerminate: (...closables: Array<{
|
|
38
|
+
terminate: () => void;
|
|
39
|
+
}>) => this;
|
|
40
|
+
addElementListener: <K extends ElemEventType>(elem: HTMLElement, type: K, listener: ElemEventListener<K>, options?: EventOptions) => this;
|
|
41
|
+
addDocumentListener: <K extends DocEventType>(type: K, listener: DocEventListener<K>, options?: EventOptions) => this;
|
|
42
|
+
addWindowListener: <K extends WinEventType>(type: K, listener: WinEventListener<K>, options?: EventOptions) => this;
|
|
43
|
+
get count(): number;
|
|
44
|
+
close: () => void;
|
|
45
|
+
static create: (...closables: (() => void)[]) => Closables;
|
|
46
|
+
static createWindowListener: <K extends WinEventType>(type: K, listener: WinEventListener<K>, options?: EventOptions) => Closables;
|
|
47
|
+
static createDocumentListener: <K extends DocEventType>(type: K, listener: DocEventListener<K>, options?: EventOptions) => Closables;
|
|
48
|
+
static createElementListener: <K extends ElemEventType>(elem: HTMLElement, type: K, listener: ElemEventListener<K>, options?: EventOptions) => Closables;
|
|
49
|
+
static createRx: (...closables: {
|
|
50
|
+
unsubscribe: () => void;
|
|
51
|
+
}[]) => Closables;
|
|
52
|
+
static createClose: (...closables: {
|
|
53
|
+
close: () => void;
|
|
54
|
+
}[]) => Closables;
|
|
55
|
+
static createTerminate: (...closables: {
|
|
56
|
+
terminate: () => void;
|
|
57
|
+
}[]) => Closables;
|
|
58
|
+
static createShutdown: (...closables: {
|
|
59
|
+
shutdown: () => void;
|
|
60
|
+
}[]) => Closables;
|
|
61
|
+
static createDestroy: (...closables: {
|
|
62
|
+
destroy: () => void;
|
|
63
|
+
}[]) => Closables;
|
|
64
|
+
static createDispose: (...closables: {
|
|
65
|
+
dispose: () => void;
|
|
66
|
+
}[]) => Closables;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=closables.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{EventEmitter as e}from"../eventemitter/eventemitter3.js";import{Subject as t}from"rxjs";var n=class n{#e=/* @__PURE__ */ new Set;#t;#n=new e;get events(){return this.#n}get closeTrigger$(){return this.#t||=new t,this.#t}add=(...e)=>(e.forEach(e=>{this.#e.add(e)}),this);remove=(...e)=>(e.forEach(e=>{this.#e.delete(e)}),this);addRx=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.unsubscribe()})}),this);addUnsubscribe=this.addRx;addClose=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.close()})}),this);addDispose=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.dispose()})}),this);addDestroy=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.destroy()})}),this);addShutdown=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.shutdown()})}),this);addTerminate=(...e)=>(e.forEach(e=>{this.#e.add(()=>{e.terminate()})}),this);addElementListener=(e,t,n,r)=>(e.addEventListener(t,n,r),this.#e.add(()=>{e.removeEventListener(t,n,r)}),this);addDocumentListener=(e,t,n)=>(document.addEventListener(e,t,n),this.#e.add(()=>{document.removeEventListener(e,t,n)}),this);addWindowListener=(e,t,n)=>(window.addEventListener(e,t,n),this.#e.add(()=>{window.removeEventListener(e,t,n)}),this);get count(){return this.#e.size}close=()=>{this.#n.emit(`closed`),this.#n.removeAllListeners(),this.#t&&=(this.#t.next(1),void 0),this.#e.size>0&&(Array.from(this.#e).forEach(e=>{e()}),this.#e.clear())};static create=(...e)=>{let t=new n;return t.add(...e),t};static createWindowListener=(e,t,r)=>{let i=new n;return i.addWindowListener(e,t,r),i};static createDocumentListener=(e,t,r)=>{let i=new n;return i.addDocumentListener(e,t,r),i};static createElementListener=(e,t,r,i)=>{let a=new n;return a.addElementListener(e,t,r,i),a};static createRx=(...e)=>{let t=new n;return t.addRx(...e),t};static createClose=(...e)=>{let t=new n;return t.addClose(...e),t};static createTerminate=(...e)=>{let t=new n;return t.addTerminate(...e),t};static createShutdown=(...e)=>{let t=new n;return t.addShutdown(...e),t};static createDestroy=(...e)=>{let t=new n;return t.addDestroy(...e),t};static createDispose=(...e)=>{let t=new n;return t.addDispose(...e),t}};export{n as Closables};
|
|
2
|
+
//# sourceMappingURL=closables.js.map
|