@servicetitan/anvil2 1.46.0 → 1.46.2
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/CHANGELOG.md +32 -0
- package/dist/{Alert-BNGvfMAV.js → Alert-CPOBY6O5.js} +2 -2
- package/dist/{Alert-BNGvfMAV.js.map → Alert-CPOBY6O5.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-CoheCP1i.js → Announcement-BvzAEdx8.js} +2 -2
- package/dist/{Announcement-CoheCP1i.js.map → Announcement-BvzAEdx8.js.map} +1 -1
- package/dist/Announcement.js +1 -1
- package/dist/AnvilProvider-C_qRQnE6.js.map +1 -1
- package/dist/Avatar-CyGjhToG.js.map +1 -1
- package/dist/Avatar-D07f9NH_.js.map +1 -1
- package/dist/Badge-DCA9mfc2.js.map +1 -1
- package/dist/Breadcrumbs-C4_PEolS.js.map +1 -1
- package/dist/{Button-BxFXQ0-n.js → Button-VNQQgZ45.js} +2 -2
- package/dist/{Button-BxFXQ0-n.js.map → Button-VNQQgZ45.js.map} +1 -1
- package/dist/Button.css +48 -48
- package/dist/Button.js +1 -1
- package/dist/Button.module-C1g9rrJs.js +25 -0
- package/dist/Button.module-C1g9rrJs.js.map +1 -0
- package/dist/{ButtonCompound-BF2Q6gGX.js → ButtonCompound-BbPK-Xjj.js} +2 -2
- package/dist/{ButtonCompound-BF2Q6gGX.js.map → ButtonCompound-BbPK-Xjj.js.map} +1 -1
- package/dist/ButtonCompound.js +1 -1
- package/dist/{ButtonLink-CXv65WVV.js → ButtonLink-CqR1F5Wn.js} +3 -3
- package/dist/{ButtonLink-CXv65WVV.js.map → ButtonLink-CqR1F5Wn.js.map} +1 -1
- package/dist/ButtonLink.js +1 -1
- package/dist/{ButtonToggle-pSwg7NvT.js → ButtonToggle-PCeSG-5D.js} +3 -3
- package/dist/{ButtonToggle-pSwg7NvT.js.map → ButtonToggle-PCeSG-5D.js.map} +1 -1
- package/dist/ButtonToggle.js +1 -1
- package/dist/{Calendar-BQ5F2ENO.js → Calendar-X9qUi6Vx.js} +269 -123
- package/dist/Calendar-X9qUi6Vx.js.map +1 -0
- package/dist/Calendar.js +1 -1
- package/dist/Card-vTYeSkxt.js.map +1 -1
- package/dist/{Checkbox-DDrmVC-u.js → Checkbox-BDohwHXQ.js} +2 -2
- package/dist/{Checkbox-DDrmVC-u.js.map → Checkbox-BDohwHXQ.js.map} +1 -1
- package/dist/{Checkbox-Dl4KTwEJ.js → Checkbox-CcYtto5f.js} +2 -2
- package/dist/{Checkbox-Dl4KTwEJ.js.map → Checkbox-CcYtto5f.js.map} +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/Chip-Bz-vlQ4D.js.map +1 -1
- package/dist/{Combobox-B9nesJuc.js → Combobox-DQmW8Tyl.js} +144 -53
- package/dist/Combobox-DQmW8Tyl.js.map +1 -0
- package/dist/Combobox.js +1 -1
- package/dist/{DateField-DXxPsRtf.js → DateField-C43nfkbx.js} +7 -7
- package/dist/{DateField-DXxPsRtf.js.map → DateField-C43nfkbx.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-Xauviu1w.js → DateFieldRange-g7n5QYww.js} +8 -8
- package/dist/{DateFieldRange-Xauviu1w.js.map → DateFieldRange-g7n5QYww.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-yLnwpVzd.js → DateFieldSingle-D3tneqeG.js} +8 -8
- package/dist/{DateFieldSingle-yLnwpVzd.js.map → DateFieldSingle-D3tneqeG.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-Ba7HiTiI.js → DateFieldYearless-3JBVj3wn.js} +4 -4
- package/dist/{DateFieldYearless-Ba7HiTiI.js.map → DateFieldYearless-3JBVj3wn.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DaysOfTheWeek-BYSYZySH.js → DaysOfTheWeek-RcPgDoM3.js} +4 -4
- package/dist/{DaysOfTheWeek-BYSYZySH.js.map → DaysOfTheWeek-RcPgDoM3.js.map} +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/Details-CF8DImjw.js.map +1 -1
- package/dist/{Dialog-CgkrvrQu.js → Dialog-FNJ16gY6.js} +6 -6
- package/dist/{Dialog-CgkrvrQu.js.map → Dialog-FNJ16gY6.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/Divider-DJe8kLf2.js.map +1 -1
- package/dist/Dnd.js +1 -1
- package/dist/DndSort.js +2 -2
- package/dist/DndSort.js.map +1 -1
- package/dist/{Drawer-CM4ZbAro.js → Drawer-DT31CMRd.js} +6 -6
- package/dist/{Drawer-CM4ZbAro.js.map → Drawer-DT31CMRd.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/{DrawerContext-DboTgTmo.js → DrawerContext-D4tWTLVf.js} +27 -10
- package/dist/DrawerContext-D4tWTLVf.js.map +1 -0
- package/dist/{EditCard-WKzZ2XCz.js → EditCard-CZzL0nx7.js} +2 -2
- package/dist/{EditCard-WKzZ2XCz.js.map → EditCard-CZzL0nx7.js.map} +1 -1
- package/dist/EditCard.js +1 -1
- package/dist/{FieldLabel-BsbTTyom.js → FieldLabel-BP8QK5UR.js} +2 -2
- package/dist/{FieldLabel-BsbTTyom.js.map → FieldLabel-BP8QK5UR.js.map} +1 -1
- package/dist/FieldLabel.js +1 -1
- package/dist/FieldMessage-B7uQ8vmr.js.map +1 -1
- package/dist/Flex-BdQMekvA.js.map +1 -1
- package/dist/Grid-MGUC698u.js.map +1 -1
- package/dist/Helper-BkIDJqgA.js.map +1 -1
- package/dist/Icon-D8SPKeO4.js.map +1 -1
- package/dist/{InputMask-_F139qFu.js → InputMask-CPuYMcw9.js} +3 -3
- package/dist/{InputMask-_F139qFu.js.map → InputMask-CPuYMcw9.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/Layout-CUUb2PVr.js.map +1 -1
- package/dist/Link-eRsLWPaQ.js.map +1 -1
- package/dist/LinkButton-2lXfrVoU.js.map +1 -1
- package/dist/{ListView-pb3rIcze.js → ListView-BJI8BQJ-.js} +2 -2
- package/dist/{ListView-pb3rIcze.js.map → ListView-BJI8BQJ-.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/Listbox-CUhMbFm2.js.map +1 -1
- package/dist/LocalizationContext-UsmB5mnR.js.map +1 -1
- package/dist/LocalizationProvider-DEZyjW5d.js.map +1 -1
- package/dist/{Menu-C8we5CHP.js → Menu-t_11BIhU.js} +10 -5
- package/dist/Menu-t_11BIhU.js.map +1 -0
- package/dist/Menu.js +1 -1
- package/dist/{NumberField-CkZZrkYC.js → NumberField-Bjf9Tyvf.js} +6 -6
- package/dist/{NumberField-CkZZrkYC.js.map → NumberField-Bjf9Tyvf.js.map} +1 -1
- package/dist/NumberField.js +1 -1
- package/dist/Overflow.js.map +1 -1
- package/dist/{Page-cKXkjMmd.js → Page-BAyXnhz2.js} +9 -9
- package/dist/Page-BAyXnhz2.js.map +1 -0
- package/dist/Page.js +1 -1
- package/dist/{Pagination-ta8a2cJN.js → Pagination-DCBic619.js} +47 -23
- package/dist/Pagination-DCBic619.js.map +1 -0
- package/dist/Pagination.css +6 -6
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-r26xMIfm.js → Popover-CrksxqKk.js} +11 -5
- package/dist/Popover-CrksxqKk.js.map +1 -0
- package/dist/Popover.js +1 -1
- package/dist/PortalProvider-9lXkQ0xY.js.map +1 -1
- package/dist/{ProgressBar-DXcXZEJ2.js → ProgressBar-CgsAW2d8.js} +2 -2
- package/dist/{ProgressBar-DXcXZEJ2.js.map → ProgressBar-CgsAW2d8.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-C89VCMXd.js → Radio-C_rvxw74.js} +2 -2
- package/dist/{Radio-C89VCMXd.js.map → Radio-C_rvxw74.js.map} +1 -1
- package/dist/Radio.js +2 -2
- package/dist/{RadioGroup-C_4buUtG.js → RadioGroup-DxBblSrx.js} +2 -2
- package/dist/{RadioGroup-C_4buUtG.js.map → RadioGroup-DxBblSrx.js.map} +1 -1
- package/dist/SearchField-Bb0uObwG.js.map +1 -1
- package/dist/{SegmentedControl-CsjjV1Dz.js → SegmentedControl-DC4BpdH5.js} +3 -3
- package/dist/{SegmentedControl-CsjjV1Dz.js.map → SegmentedControl-DC4BpdH5.js.map} +1 -1
- package/dist/SegmentedControl.js +1 -1
- package/dist/{SelectCard-BTYZg9TG.js → SelectCard-DunNE9R3.js} +3 -3
- package/dist/{SelectCard-BTYZg9TG.js.map → SelectCard-DunNE9R3.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/{SelectTrigger-f1hvRrSC.js → SelectTrigger-BYysLREL.js} +2 -2
- package/dist/{SelectTrigger-f1hvRrSC.js.map → SelectTrigger-BYysLREL.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-DP9fmRSo.js → SelectTriggerBase-DqUpJgzk.js} +3 -3
- package/dist/{SelectTriggerBase-DP9fmRSo.js.map → SelectTriggerBase-DqUpJgzk.js.map} +1 -1
- package/dist/{SideNav-CBAzYyML.js → SideNav-B9AWmF_H.js} +2 -2
- package/dist/SideNav-B9AWmF_H.js.map +1 -0
- package/dist/SideNav.js +1 -1
- package/dist/Skeleton.js.map +1 -1
- package/dist/Spinner-wmO8Epw0.js.map +1 -1
- package/dist/SrOnly-CTsYSuby.js.map +1 -1
- package/dist/{Stepper-D-fOH9TF.js → Stepper-DHTrvfXw.js} +3 -3
- package/dist/{Stepper-D-fOH9TF.js.map → Stepper-DHTrvfXw.js.map} +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Switch-C2ddZcr9.js.map +1 -1
- package/dist/{Tab-wNucMTgo.js → Tab-0zx9hsw8.js} +44 -36
- package/dist/Tab-0zx9hsw8.js.map +1 -0
- package/dist/Tab.js +1 -1
- package/dist/Text-BqvcbXyp.js.map +1 -1
- package/dist/{TextField-D8fow9j7.js → TextField-CFWs3lm9.js} +2 -2
- package/dist/{TextField-D8fow9j7.js.map → TextField-CFWs3lm9.js.map} +1 -1
- package/dist/{TextField-BiHxlzE3.js → TextField-Cge6IRo5.js} +2 -2
- package/dist/{TextField-BiHxlzE3.js.map → TextField-Cge6IRo5.js.map} +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{Textarea-BdVJJlbP.js → Textarea-CXd3NKkW.js} +2 -2
- package/dist/{Textarea-BdVJJlbP.js.map → Textarea-CXd3NKkW.js.map} +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/ThemeProvider-Be3Pvtpz.js.map +1 -1
- package/dist/ThemeProviderContext-l52GohYT.js.map +1 -1
- package/dist/{TimeField-CmbErrsZ.js → TimeField-4v5aCwiG.js} +345 -355
- package/dist/TimeField-4v5aCwiG.js.map +1 -0
- package/dist/TimeField.js +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-9cpG_tWR.js → Toaster-D-rNSLTq.js} +17 -17
- package/dist/{Toaster-9cpG_tWR.js.map → Toaster-D-rNSLTq.js.map} +1 -1
- package/dist/{Toaster-B7zUwJOt.js → Toaster-bON5Xc1P.js} +2 -2
- package/dist/{Toaster-B7zUwJOt.js.map → Toaster-bON5Xc1P.js.map} +1 -1
- package/dist/{Toolbar-D4zuUFhb.js → Toolbar-B2Jsuptz.js} +14 -14
- package/dist/{Toolbar-D4zuUFhb.js.map → Toolbar-B2Jsuptz.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{Tooltip-BI3Xs75X.js → Tooltip-CtCLw_vx.js} +8 -2
- package/dist/{Tooltip-BI3Xs75X.js.map → Tooltip-CtCLw_vx.js.map} +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/TrackingProvider-BtSjkmpM.js.map +1 -1
- package/dist/assets/icons/st/gnav_legacy_search_filled.svg +1 -1
- package/dist/assets/icons/st/gnav_legacy_search_outline.svg +1 -1
- package/dist/beta.js +1 -1
- package/dist/childrenToString-Bz9MqbHb.js.map +1 -1
- package/dist/components/Combobox/ComboboxTypes.d.ts +10 -5
- package/dist/components/Combobox/internal/ComboboxGroupContext.d.ts +1 -1
- package/dist/components/Combobox/internal/useGroups.d.ts +2 -2
- package/dist/components/DndSort/internal/test-utils.d.ts +1 -1
- package/dist/components/TimeField/TimeField.d.ts +4 -1
- package/dist/extends-Bg2s_OKl.js.map +1 -1
- package/dist/getActiveElement-BcSyVE7S.js.map +1 -1
- package/dist/getKeyboardFocusableElements-QqcABz0D.js.map +1 -1
- package/dist/{index-V5Ez2gq_.js → index-DrM3iid4.js} +2 -2
- package/dist/{index-V5Ez2gq_.js.map → index-DrM3iid4.js.map} +1 -1
- package/dist/index-tZvMCc77.js.map +1 -1
- package/dist/{index.esm-D889iexm.js → index.esm-BwMVvxTV.js} +199 -144
- package/dist/index.esm-BwMVvxTV.js.map +1 -0
- package/dist/index.js +45 -45
- package/dist/index.js.map +1 -1
- package/dist/makeZeroShortcutPreprocessor-CxsiGTRW.js.map +1 -1
- package/dist/{proxy-CreWmH-e.js → proxy-BbFHSE6L.js} +8631 -8680
- package/dist/proxy-BbFHSE6L.js.map +1 -0
- package/dist/{use-reduced-motion-znCm41qB.js → use-reduced-motion-DSpxmqyT.js} +3 -3
- package/dist/use-reduced-motion-DSpxmqyT.js.map +1 -0
- package/dist/useAccessibleColor-BYKjkGRg.js.map +1 -1
- package/dist/useBreakpoint-Cv5fnZxs.js.map +1 -1
- package/dist/{useDateFieldOrchestration-BNJCsRkS.js → useDateFieldOrchestration-DyAc3gPJ.js} +3 -3
- package/dist/{useDateFieldOrchestration-BNJCsRkS.js.map → useDateFieldOrchestration-DyAc3gPJ.js.map} +1 -1
- package/dist/{useDialogTransitionStates-2NaE_noq.js → useDialogTransitionStates-C1TtiwA_.js} +3 -3
- package/dist/{useDialogTransitionStates-2NaE_noq.js.map → useDialogTransitionStates-C1TtiwA_.js.map} +1 -1
- package/dist/useFocusWithin-BhhgRXdZ.js.map +1 -1
- package/dist/useInfiniteCombobox-WcRgC9p6.js.map +1 -1
- package/dist/useIntersectionObserver-BEmMDO3P.js.map +1 -1
- package/dist/useLayoutPropsUtil-DjD5IMh0.js.map +1 -1
- package/dist/useMergeRefs-Bde85AWI.js.map +1 -1
- package/dist/{useOnClickOutside-BHEWMLa9.js → useOnClickOutside-B1ddwORK.js} +5 -2
- package/dist/useOnClickOutside-B1ddwORK.js.map +1 -0
- package/dist/useOptionallyControlledState-DbDuos5L.js.map +1 -1
- package/dist/usePopoverCloseDelayWorkaround-BZcjPkvT.js.map +1 -1
- package/dist/{usePopoverSupport-DIjjfodl.js → usePopoverSupport-CWTCDfN2.js} +2 -2
- package/dist/{usePopoverSupport-DIjjfodl.js.map → usePopoverSupport-CWTCDfN2.js.map} +1 -1
- package/dist/usePrefersColorScheme-_hT7dK7_.js.map +1 -1
- package/dist/usePrevious-Bvq-5auG.js.map +1 -1
- package/dist/useSize.js.map +1 -1
- package/dist/{useSwipe-CULmVQEk.js → useSwipe-Cp-CJxLU.js} +2 -2
- package/dist/{useSwipe-CULmVQEk.js.map → useSwipe-Cp-CJxLU.js.map} +1 -1
- package/dist/useSwipe.js +1 -1
- package/dist/useTrackingContext-DRwDL8DE.js.map +1 -1
- package/dist/useTrackingId.js.map +1 -1
- package/package.json +12 -18
- package/dist/Button.module-pUNSKoVC.js +0 -25
- package/dist/Button.module-pUNSKoVC.js.map +0 -1
- package/dist/Calendar-BQ5F2ENO.js.map +0 -1
- package/dist/Combobox-B9nesJuc.js.map +0 -1
- package/dist/DrawerContext-DboTgTmo.js.map +0 -1
- package/dist/Menu-C8we5CHP.js.map +0 -1
- package/dist/Page-cKXkjMmd.js.map +0 -1
- package/dist/Pagination-ta8a2cJN.js.map +0 -1
- package/dist/Popover-r26xMIfm.js.map +0 -1
- package/dist/SideNav-CBAzYyML.js.map +0 -1
- package/dist/Tab-wNucMTgo.js.map +0 -1
- package/dist/TimeField-CmbErrsZ.js.map +0 -1
- package/dist/index.esm-D889iexm.js.map +0 -1
- package/dist/proxy-CreWmH-e.js.map +0 -1
- package/dist/use-reduced-motion-znCm41qB.js.map +0 -1
- package/dist/useOnClickOutside-BHEWMLa9.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-V5Ez2gq_.js","sources":["../../hammer-icon/mdi/round/drag_indicator.svg","../src/components/Dnd/DndHandle.tsx","../src/components/Dnd/DndHandleButton.tsx","../src/components/Dnd/DndSortLine.tsx","../src/components/Dnd/DndZone.tsx","../src/components/Dnd/index.ts"],"sourcesContent":["import * as React from \"react\";\nconst SvgDragIndicator = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"1em\", height: \"1em\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\" }));\nexport default SvgDragIndicator;\n","import { Icon } from \"../Icon\";\nimport DragIndicator from \"@servicetitan/hammer-icon/mdi/round/drag_indicator.svg\";\nimport styles from \"./DndHandle.module.scss\";\nimport cx from \"classnames\";\n\n/**\n * Props for the DndHandle component\n */\nexport type DndHandleProps = {\n /**\n * Additional CSS class names to apply to the drag handle.\n */\n className?: string;\n};\n\n/**\n * A reusable drag handle icon component for drag and drop interactions.\n *\n * Features:\n * - Standardized drag indicator icon\n * - Accessible with proper ARIA attributes\n * - Customizable styling through className prop\n * - Consistent visual appearance across applications\n * - Lightweight and performant\n * - Supports all standard HTML element props\n *\n * @example\n * <DndHandle className=\"custom-drag-handle\" />\n */\nexport function DndHandle({ className }: { className?: string }) {\n const handleClasses = cx(styles.handle, className);\n return (\n <Icon svg={DragIndicator} className={handleClasses} role=\"presentation\" />\n );\n}\n","import { ButtonCompound } from \"../ButtonCompound\";\nimport handleStyles from \"./DndHandle.module.scss\";\nimport cx from \"classnames\";\nimport { forwardRef } from \"react\";\nimport { DndHandle } from \"./DndHandle\";\n\n/**\n * Props for the DndHandleButton component\n * @extends React.ComponentPropsWithoutRef<typeof ButtonCompound>\n */\nexport interface DndHandleButtonProps\n extends React.ComponentPropsWithoutRef<typeof ButtonCompound> {\n /**\n * Indicates whether the handle is currently being dragged.\n * @default false\n */\n isActive?: boolean;\n}\n\n/**\n * A reusable drag handle button component for drag and drop functionality.\n *\n * Features:\n * - Interactive button with drag handle icon\n * - Visual feedback for active drag state\n * - Accessible with proper ARIA attributes\n * - Extends ButtonCompound functionality\n * - Customizable styling through className prop\n * - Supports all standard button props\n * - Consistent visual appearance across applications\n *\n * @example\n * <DndHandleButton\n * isActive={isDragging}\n * className=\"custom-handle-button\"\n * onClick={handleClick}\n * />\n */\nexport const DndHandleButton = forwardRef<\n HTMLButtonElement,\n DndHandleButtonProps\n>(({ isActive = false, className, ...props }, ref) => {\n const handleButtonClasses = cx(className, handleStyles[\"handle-button\"], {\n [handleStyles[\"active\"]]: isActive,\n });\n\n return (\n <ButtonCompound\n ref={ref}\n className={handleButtonClasses}\n type=\"button\"\n shape=\"rounded\"\n {...props}\n >\n <DndHandle />\n </ButtonCompound>\n );\n});\n\nDndHandleButton.displayName = \"DndHandleButton\";\n","import cx from \"classnames\";\n\nimport styles from \"./Dnd.module.scss\";\nimport { CSSProperties } from \"react\";\n\n/**\n * Props for the DndSortLine component\n * @extends React.ComponentPropsWithoutRef<\"div\">\n */\nexport type SortLineProps = React.ComponentPropsWithoutRef<\"div\"> & {\n /**\n * The offset of the line from the item. This is a CSS value, typically negative.\n */\n offset: string;\n /**\n * The orientation of the sort - Note this may be counterintuitive, as the line is rendered perpendicular to the sort.\n */\n orientation: \"horizontal\" | \"vertical\";\n /**\n * The position of the line relative to a target item.\n */\n position: \"before\" | \"after\";\n};\n\n/**\n * A visual indicator line that shows where an item will be dropped during drag and drop operations.\n *\n * Features:\n * - Visual feedback for drop positioning\n * - Configurable orientation (horizontal/vertical)\n * - Adjustable positioning (before/after)\n * - Customizable offset for precise placement\n * - Accessible with proper ARIA attributes\n * - Automatic CSS class management\n * - Supports all standard HTML div props\n *\n * @example\n * <DndSortLine\n * offset=\"-10px\"\n * orientation=\"vertical\"\n * position=\"after\"\n * className=\"custom-drop-line\"\n * />\n */\nexport const DndSortLine = ({\n offset,\n orientation,\n position,\n ...rest\n}: SortLineProps) => {\n const classes = cx(\n styles[\"drop-line\"],\n styles[`orientation-${orientation}`],\n styles[`position-${position}`],\n );\n\n return (\n <div\n aria-hidden\n className={classes}\n style={{ \"--drop-line-offset\": offset } as CSSProperties}\n {...rest}\n />\n );\n};\n","import { ElementType, forwardRef, ReactNode } from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./Dnd.module.scss\";\n\n/**\n * Props for the DndZone component\n * @extends Omit<React.ComponentPropsWithoutRef<T>, \"el\" | \"ref\">\n */\nexport type DndZoneProps<T extends ElementType = \"div\"> = {\n /**\n * The HTML element type to render. Can be any valid HTML element or React component.\n * @default \"div\"\n */\n el?: T;\n /**\n * The content to be rendered inside the drop zone.\n */\n children?: ReactNode;\n /**\n * Additional CSS class names to apply to the drop zone.\n */\n className?: string;\n /**\n * Indicates whether a draggable item is currently over this drop zone.\n */\n isOver: boolean;\n /**\n * Indicates whether the current drag operation is valid for this drop zone.\n */\n isValid: boolean;\n /**\n * Indicates whether any item is currently being dragged.\n */\n isDragging: boolean;\n} & Omit<React.ComponentPropsWithoutRef<T>, \"el\" | \"ref\">;\n\n/**\n * Base styling component for drop zones that handles visual states and styling.\n *\n * Features:\n * - Configurable HTML element rendering with the 'el' prop\n * - Visual feedback for drag states (over, valid, dragging)\n * - Automatic CSS class management based on drag state\n * - Supports all standard HTML element props\n * - Accessible with proper ARIA attributes\n * - Flexible styling through className prop\n * - Responsive design that adapts to container\n *\n * @example\n * <DndZone\n * isOver={isOver}\n * isValid={isValid}\n * isDragging={isDragging}\n * className=\"custom-drop-zone\"\n * >\n * Drop items here\n * </DndZone>\n */\nexport const DndZone = forwardRef<HTMLDivElement, DndZoneProps<ElementType>>(\n (\n {\n el: Component = \"div\" as ElementType,\n children,\n className,\n isDragging,\n isOver,\n isValid,\n ...rest\n },\n ref,\n ) => {\n const classes = cx(className, {\n [styles[\"drop-zone\"]]: true,\n [styles[\"over-valid\"]]: isDragging && isOver && isValid,\n [styles[\"over-invalid\"]]: isDragging && isOver && !isValid,\n [styles[\"active-not-over\"]]: isDragging && !isOver,\n });\n\n return (\n <Component ref={ref} className={classes} {...rest}>\n {children}\n </Component>\n );\n },\n);\n\nDndZone.displayName = \"DndZoneBase\";\n","import { DndHandle } from \"./DndHandle\";\nimport { DndHandleButton } from \"./DndHandleButton\";\nimport { DndSortLine } from \"./DndSortLine\";\nimport { DndZone } from \"./DndZone\";\n\nexport const Dnd = {\n Handle: DndHandle,\n HandleButton: DndHandleButton,\n SortLine: DndSortLine,\n Zone: DndZone,\n};\n"],"names":["styles","DragIndicator"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index-DrM3iid4.js","sources":["../../hammer-icon/mdi/round/drag_indicator.svg","../src/components/Dnd/DndHandle.tsx","../src/components/Dnd/DndHandleButton.tsx","../src/components/Dnd/DndSortLine.tsx","../src/components/Dnd/DndZone.tsx","../src/components/Dnd/index.ts"],"sourcesContent":["import * as React from \"react\";\nconst SvgDragIndicator = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"1em\", height: \"1em\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\" }));\nexport default SvgDragIndicator;\n","import { Icon } from \"../Icon\";\nimport DragIndicator from \"@servicetitan/hammer-icon/mdi/round/drag_indicator.svg\";\nimport styles from \"./DndHandle.module.scss\";\nimport cx from \"classnames\";\n\n/**\n * Props for the DndHandle component\n */\nexport type DndHandleProps = {\n /**\n * Additional CSS class names to apply to the drag handle.\n */\n className?: string;\n};\n\n/**\n * A reusable drag handle icon component for drag and drop interactions.\n *\n * Features:\n * - Standardized drag indicator icon\n * - Accessible with proper ARIA attributes\n * - Customizable styling through className prop\n * - Consistent visual appearance across applications\n * - Lightweight and performant\n * - Supports all standard HTML element props\n *\n * @example\n * <DndHandle className=\"custom-drag-handle\" />\n */\nexport function DndHandle({ className }: { className?: string }) {\n const handleClasses = cx(styles.handle, className);\n return (\n <Icon svg={DragIndicator} className={handleClasses} role=\"presentation\" />\n );\n}\n","import { ButtonCompound } from \"../ButtonCompound\";\nimport handleStyles from \"./DndHandle.module.scss\";\nimport cx from \"classnames\";\nimport { forwardRef } from \"react\";\nimport { DndHandle } from \"./DndHandle\";\n\n/**\n * Props for the DndHandleButton component\n * @extends React.ComponentPropsWithoutRef<typeof ButtonCompound>\n */\nexport interface DndHandleButtonProps\n extends React.ComponentPropsWithoutRef<typeof ButtonCompound> {\n /**\n * Indicates whether the handle is currently being dragged.\n * @default false\n */\n isActive?: boolean;\n}\n\n/**\n * A reusable drag handle button component for drag and drop functionality.\n *\n * Features:\n * - Interactive button with drag handle icon\n * - Visual feedback for active drag state\n * - Accessible with proper ARIA attributes\n * - Extends ButtonCompound functionality\n * - Customizable styling through className prop\n * - Supports all standard button props\n * - Consistent visual appearance across applications\n *\n * @example\n * <DndHandleButton\n * isActive={isDragging}\n * className=\"custom-handle-button\"\n * onClick={handleClick}\n * />\n */\nexport const DndHandleButton = forwardRef<\n HTMLButtonElement,\n DndHandleButtonProps\n>(({ isActive = false, className, ...props }, ref) => {\n const handleButtonClasses = cx(className, handleStyles[\"handle-button\"], {\n [handleStyles[\"active\"]]: isActive,\n });\n\n return (\n <ButtonCompound\n ref={ref}\n className={handleButtonClasses}\n type=\"button\"\n shape=\"rounded\"\n {...props}\n >\n <DndHandle />\n </ButtonCompound>\n );\n});\n\nDndHandleButton.displayName = \"DndHandleButton\";\n","import cx from \"classnames\";\n\nimport styles from \"./Dnd.module.scss\";\nimport { CSSProperties } from \"react\";\n\n/**\n * Props for the DndSortLine component\n * @extends React.ComponentPropsWithoutRef<\"div\">\n */\nexport type SortLineProps = React.ComponentPropsWithoutRef<\"div\"> & {\n /**\n * The offset of the line from the item. This is a CSS value, typically negative.\n */\n offset: string;\n /**\n * The orientation of the sort - Note this may be counterintuitive, as the line is rendered perpendicular to the sort.\n */\n orientation: \"horizontal\" | \"vertical\";\n /**\n * The position of the line relative to a target item.\n */\n position: \"before\" | \"after\";\n};\n\n/**\n * A visual indicator line that shows where an item will be dropped during drag and drop operations.\n *\n * Features:\n * - Visual feedback for drop positioning\n * - Configurable orientation (horizontal/vertical)\n * - Adjustable positioning (before/after)\n * - Customizable offset for precise placement\n * - Accessible with proper ARIA attributes\n * - Automatic CSS class management\n * - Supports all standard HTML div props\n *\n * @example\n * <DndSortLine\n * offset=\"-10px\"\n * orientation=\"vertical\"\n * position=\"after\"\n * className=\"custom-drop-line\"\n * />\n */\nexport const DndSortLine = ({\n offset,\n orientation,\n position,\n ...rest\n}: SortLineProps) => {\n const classes = cx(\n styles[\"drop-line\"],\n styles[`orientation-${orientation}`],\n styles[`position-${position}`],\n );\n\n return (\n <div\n aria-hidden\n className={classes}\n style={{ \"--drop-line-offset\": offset } as CSSProperties}\n {...rest}\n />\n );\n};\n","import { ElementType, forwardRef, ReactNode } from \"react\";\nimport cx from \"classnames\";\n\nimport styles from \"./Dnd.module.scss\";\n\n/**\n * Props for the DndZone component\n * @extends Omit<React.ComponentPropsWithoutRef<T>, \"el\" | \"ref\">\n */\nexport type DndZoneProps<T extends ElementType = \"div\"> = {\n /**\n * The HTML element type to render. Can be any valid HTML element or React component.\n * @default \"div\"\n */\n el?: T;\n /**\n * The content to be rendered inside the drop zone.\n */\n children?: ReactNode;\n /**\n * Additional CSS class names to apply to the drop zone.\n */\n className?: string;\n /**\n * Indicates whether a draggable item is currently over this drop zone.\n */\n isOver: boolean;\n /**\n * Indicates whether the current drag operation is valid for this drop zone.\n */\n isValid: boolean;\n /**\n * Indicates whether any item is currently being dragged.\n */\n isDragging: boolean;\n} & Omit<React.ComponentPropsWithoutRef<T>, \"el\" | \"ref\">;\n\n/**\n * Base styling component for drop zones that handles visual states and styling.\n *\n * Features:\n * - Configurable HTML element rendering with the 'el' prop\n * - Visual feedback for drag states (over, valid, dragging)\n * - Automatic CSS class management based on drag state\n * - Supports all standard HTML element props\n * - Accessible with proper ARIA attributes\n * - Flexible styling through className prop\n * - Responsive design that adapts to container\n *\n * @example\n * <DndZone\n * isOver={isOver}\n * isValid={isValid}\n * isDragging={isDragging}\n * className=\"custom-drop-zone\"\n * >\n * Drop items here\n * </DndZone>\n */\nexport const DndZone = forwardRef<HTMLDivElement, DndZoneProps<ElementType>>(\n (\n {\n el: Component = \"div\" as ElementType,\n children,\n className,\n isDragging,\n isOver,\n isValid,\n ...rest\n },\n ref,\n ) => {\n const classes = cx(className, {\n [styles[\"drop-zone\"]]: true,\n [styles[\"over-valid\"]]: isDragging && isOver && isValid,\n [styles[\"over-invalid\"]]: isDragging && isOver && !isValid,\n [styles[\"active-not-over\"]]: isDragging && !isOver,\n });\n\n return (\n <Component ref={ref} className={classes} {...rest}>\n {children}\n </Component>\n );\n },\n);\n\nDndZone.displayName = \"DndZoneBase\";\n","import { DndHandle } from \"./DndHandle\";\nimport { DndHandleButton } from \"./DndHandleButton\";\nimport { DndSortLine } from \"./DndSortLine\";\nimport { DndZone } from \"./DndZone\";\n\nexport const Dnd = {\n Handle: DndHandle,\n HandleButton: DndHandleButton,\n SortLine: DndSortLine,\n Zone: DndZone,\n};\n"],"names":["styles","DragIndicator"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-tZvMCc77.js","sources":["../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAKA;;AAEA,EAAA,CAAC,YAAY;;AAGb,GAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc;;GAE9B,SAAS,UAAU,IAAI;IACtB,IAAI,OAAO,GAAG,EAAE;;AAElB,IAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,KAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;KACtB,IAAI,GAAG,EAAE;MACR,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AACnD;AACA;;AAEA,IAAE,OAAO,OAAO;AAChB;;AAEA,GAAC,SAAS,UAAU,EAAE,GAAG,EAAE;IACzB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC1D,KAAG,OAAO,GAAG;AACb;;AAEA,IAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B,KAAG,OAAO,EAAE;AACZ;;AAEA,IAAE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;KACvB,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC;AACrC;;IAEE,IAAI,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;AACxG,KAAG,OAAO,GAAG,CAAC,QAAQ,EAAE;AACxB;;IAEE,IAAI,OAAO,GAAG,EAAE;;AAElB,IAAE,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACvB,KAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AAC1C,MAAI,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC;AACvC;AACA;;AAEA,IAAE,OAAO,OAAO;AAChB;;AAEA,GAAC,SAAS,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;IACtC,IAAI,CAAC,QAAQ,EAAE;AACjB,KAAG,OAAO,KAAK;AACf;AACA;IACE,IAAI,KAAK,EAAE;AACb,KAAG,OAAO,KAAK,GAAG,GAAG,GAAG,QAAQ;AAChC;AACA;IACE,OAAO,KAAK,GAAG,QAAQ;AACzB;;GAEC,IAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,IAAE,UAAU,CAAC,OAAO,GAAG,UAAU;AACjC,IAAE,iBAAiB,UAAU;AAC7B,
|
|
1
|
+
{"version":3,"file":"index-tZvMCc77.js","sources":["../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAKA;;AAEA,EAAA,CAAC,YAAY;;AAGb,GAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc;;GAE9B,SAAS,UAAU,IAAI;IACtB,IAAI,OAAO,GAAG,EAAE;;AAElB,IAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,KAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;KACtB,IAAI,GAAG,EAAE;MACR,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;AACnD,KAAA;AACA,IAAA;;AAEA,IAAE,OAAO,OAAO;AAChB,GAAA;;AAEA,GAAC,SAAS,UAAU,EAAE,GAAG,EAAE;IACzB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC1D,KAAG,OAAO,GAAG;AACb,IAAA;;AAEA,IAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC/B,KAAG,OAAO,EAAE;AACZ,IAAA;;AAEA,IAAE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;KACvB,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC;AACrC,IAAA;;IAEE,IAAI,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE;AACxG,KAAG,OAAO,GAAG,CAAC,QAAQ,EAAE;AACxB,IAAA;;IAEE,IAAI,OAAO,GAAG,EAAE;;AAElB,IAAE,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACvB,KAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;AAC1C,MAAI,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC;AACvC,KAAA;AACA,IAAA;;AAEA,IAAE,OAAO,OAAO;AAChB,GAAA;;AAEA,GAAC,SAAS,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;IACtC,IAAI,CAAC,QAAQ,EAAE;AACjB,KAAG,OAAO,KAAK;AACf,IAAA;AACA;IACE,IAAI,KAAK,EAAE;AACb,KAAG,OAAO,KAAK,GAAG,GAAG,GAAG,QAAQ;AAChC,IAAA;AACA;IACE,OAAO,KAAK,GAAG,QAAQ;AACzB,GAAA;;GAEC,IAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,IAAE,UAAU,CAAC,OAAO,GAAG,UAAU;AACjC,IAAE,iBAAiB,UAAU;AAC7B,GAAA,CAAE,MAKM;AACR,IAAE,MAAM,CAAC,UAAU,GAAG,UAAU;AAChC,GAAA;AACA,EAAA,CAAC,EAAE,EAAA;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -295,12 +295,14 @@ class MaskModel {
|
|
|
295
295
|
selection: [newCaretIndex, newCaretIndex],
|
|
296
296
|
}, maskExpression, initialElementState);
|
|
297
297
|
const prevLeadingPart = value.slice(0, from);
|
|
298
|
-
const
|
|
298
|
+
const newLeadingPartState = calibrateValueByMask({
|
|
299
299
|
value: newUnmaskedLeadingValuePart,
|
|
300
300
|
selection: [newCaretIndex, newCaretIndex],
|
|
301
|
-
}, maskExpression, initialElementState)
|
|
302
|
-
const isInvalidCharsInsertion =
|
|
303
|
-
|
|
301
|
+
}, maskExpression, initialElementState);
|
|
302
|
+
const isInvalidCharsInsertion = newLeadingPartState.value === prevLeadingPart ||
|
|
303
|
+
(newLeadingPartState.value.length < prevLeadingPart.length &&
|
|
304
|
+
removeFixedMaskCharacters(newLeadingPartState, maskExpression).value ===
|
|
305
|
+
this.unmaskInitialState.value.slice(0, unmaskedFrom));
|
|
304
306
|
if (isInvalidCharsInsertion ||
|
|
305
307
|
areElementStatesEqual(this, maskedElementState) // If typing new characters does not change value
|
|
306
308
|
) {
|
|
@@ -797,6 +799,7 @@ class Maskito extends MaskHistory {
|
|
|
797
799
|
}
|
|
798
800
|
handleInsert(event, data) {
|
|
799
801
|
const { options, maxLength, elementState: initialElementState } = this;
|
|
802
|
+
const [from, to] = initialElementState.selection;
|
|
800
803
|
const { elementState, data: insertedText = data } = this.preprocessor({
|
|
801
804
|
data,
|
|
802
805
|
elementState: initialElementState,
|
|
@@ -808,23 +811,27 @@ class Maskito extends MaskHistory {
|
|
|
808
811
|
catch (_a) {
|
|
809
812
|
return event.preventDefault();
|
|
810
813
|
}
|
|
811
|
-
const [from, to] = initialElementState.selection;
|
|
812
|
-
const newPossibleState = {
|
|
813
|
-
value: initialElementState.value.slice(0, from) +
|
|
814
|
-
data +
|
|
815
|
-
initialElementState.value.slice(to),
|
|
816
|
-
selection: [from + data.length, from + data.length],
|
|
817
|
-
};
|
|
818
814
|
this.upcomingElementState = this.clampState(this.postprocessor(maskModel, initialElementState));
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
815
|
+
/**
|
|
816
|
+
* When textfield value length is already equal to attribute `maxlength`,
|
|
817
|
+
* pressing any key (even with valid value) does not emit `input` event
|
|
818
|
+
* (except to the case when user replaces some characters by selection).
|
|
819
|
+
*/
|
|
820
|
+
const noInputEventDispatch = initialElementState.value.length >= maxLength && from === to;
|
|
821
|
+
if (noInputEventDispatch) {
|
|
822
|
+
if (options.overwriteMode === 'replace' &&
|
|
823
|
+
!areElementStatesEqual(this.upcomingElementState, initialElementState)) {
|
|
824
|
+
this.dispatchInputEvent({ inputType: 'insertText', data });
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
/**
|
|
828
|
+
* This `beforeinput` event will not be followed by `input` event –
|
|
829
|
+
* clear computed state to avoid any possible side effect
|
|
830
|
+
* for new possible `input` event without preceding `beforeinput` event
|
|
831
|
+
* (e.g. browser autofill, `document.execCommand('delete')` etc.)
|
|
832
|
+
*/
|
|
833
|
+
this.upcomingElementState = null;
|
|
834
|
+
}
|
|
828
835
|
}
|
|
829
836
|
}
|
|
830
837
|
handleEnter(event) {
|
|
@@ -971,18 +978,169 @@ function countDigits(str) {
|
|
|
971
978
|
return str.replaceAll(/\W/g, '').length;
|
|
972
979
|
}
|
|
973
980
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
981
|
+
const DATE_SEGMENTS_MAX_VALUES = {
|
|
982
|
+
day: 31,
|
|
983
|
+
month: 12,
|
|
984
|
+
year: 9999,
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
// eslint-disable-next-line i18n/no-russian-character
|
|
988
|
+
const DEFAULT_DECIMAL_PSEUDO_SEPARATORS = ['.', ',', 'б', 'ю'];
|
|
989
|
+
|
|
990
|
+
const DEFAULT_MIN_DATE = new Date('0001-01-01T00:00');
|
|
991
|
+
const DEFAULT_MAX_DATE = new Date('9999-12-31T23:59:59.999');
|
|
992
|
+
|
|
993
|
+
const DEFAULT_TIME_SEGMENT_MAX_VALUES = {
|
|
994
|
+
hours: 23,
|
|
995
|
+
minutes: 59,
|
|
996
|
+
seconds: 59,
|
|
997
|
+
milliseconds: 999,
|
|
998
|
+
};
|
|
999
|
+
const DEFAULT_TIME_SEGMENT_MIN_VALUES = {
|
|
1000
|
+
hours: 0,
|
|
1001
|
+
minutes: 0,
|
|
1002
|
+
seconds: 0,
|
|
1003
|
+
milliseconds: 0,
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* {@link https://unicode-table.com/en/00A0/ Non-breaking space}.
|
|
1008
|
+
*/
|
|
1009
|
+
const CHAR_NO_BREAK_SPACE = '\u00A0';
|
|
1010
|
+
/**
|
|
1011
|
+
* {@link https://symbl.cc/en/200B/ Zero width space}.
|
|
1012
|
+
*/
|
|
1013
|
+
const CHAR_ZERO_WIDTH_SPACE = '\u200B';
|
|
1014
|
+
/**
|
|
1015
|
+
* {@link https://unicode-table.com/en/2013/ EN dash}
|
|
1016
|
+
* is used to indicate a range of numbers or a span of time.
|
|
1017
|
+
* @example 2006–2022
|
|
1018
|
+
*/
|
|
1019
|
+
const CHAR_EN_DASH = '\u2013';
|
|
1020
|
+
/**
|
|
1021
|
+
* {@link https://unicode-table.com/en/2014/ EM dash}
|
|
1022
|
+
* is used to mark a break in a sentence.
|
|
1023
|
+
* @example Taiga UI — powerful set of open source components for Angular
|
|
1024
|
+
* ___
|
|
1025
|
+
* Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!
|
|
1026
|
+
*/
|
|
1027
|
+
const CHAR_EM_DASH = '\u2014';
|
|
1028
|
+
/**
|
|
1029
|
+
* {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}
|
|
1030
|
+
* is used to combine words.
|
|
1031
|
+
* @example well-behaved
|
|
1032
|
+
* ___
|
|
1033
|
+
* Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!
|
|
1034
|
+
*/
|
|
1035
|
+
const CHAR_HYPHEN = '\u002D';
|
|
1036
|
+
/**
|
|
1037
|
+
* {@link https://unicode-table.com/en/2212/ Minus}
|
|
1038
|
+
* is used as math operator symbol or before negative digits.
|
|
1039
|
+
* ---
|
|
1040
|
+
* Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}
|
|
1041
|
+
*/
|
|
1042
|
+
const CHAR_MINUS = '\u2212';
|
|
1043
|
+
/**
|
|
1044
|
+
* {@link https://symbl.cc/en/30FC/ Katakana-Hiragana Prolonged Sound Mark}
|
|
1045
|
+
* is used as prolonged sounds in Japanese.
|
|
1046
|
+
*/
|
|
1047
|
+
const CHAR_JP_HYPHEN = '\u30FC';
|
|
1048
|
+
/**
|
|
1049
|
+
* {@link https://symbl.cc/en/003A/ Colon}
|
|
1050
|
+
* is a punctuation mark that connects parts of a text logically.
|
|
1051
|
+
* ---
|
|
1052
|
+
* is also used as separator in time.
|
|
1053
|
+
*/
|
|
1054
|
+
const CHAR_COLON = '\u003A';
|
|
1055
|
+
/**
|
|
1056
|
+
* {@link https://symbl.cc/en/FF1A/ Full-width colon}
|
|
1057
|
+
* is a full-width punctuation mark used to separate parts of a text commonly in Japanese.
|
|
1058
|
+
*/
|
|
1059
|
+
const CHAR_JP_COLON = '\uFF1A';
|
|
1060
|
+
|
|
1061
|
+
const ANY_MERIDIEM_CHARACTER_RE = new RegExp(`[${CHAR_NO_BREAK_SPACE}APM]+$`, 'g');
|
|
1062
|
+
const ALL_MERIDIEM_CHARACTERS_RE = new RegExp(`${CHAR_NO_BREAK_SPACE}[AP]M$`, 'g');
|
|
1063
|
+
|
|
1064
|
+
const TIME_FIXED_CHARACTERS = [':', '.'];
|
|
1065
|
+
|
|
1066
|
+
const TIME_SEGMENT_VALUE_LENGTHS = {
|
|
1067
|
+
hours: 2,
|
|
1068
|
+
minutes: 2,
|
|
1069
|
+
seconds: 2,
|
|
1070
|
+
milliseconds: 3,
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
const POSSIBLE_DATE_RANGE_SEPARATOR = [
|
|
1074
|
+
CHAR_HYPHEN,
|
|
1075
|
+
CHAR_EN_DASH,
|
|
1076
|
+
CHAR_EM_DASH,
|
|
1077
|
+
CHAR_MINUS,
|
|
1078
|
+
CHAR_JP_HYPHEN,
|
|
1079
|
+
];
|
|
1080
|
+
const MIN_DAY = 1;
|
|
1081
|
+
const MONTHS_IN_YEAR = 12;
|
|
1082
|
+
const MonthNumber = {
|
|
1083
|
+
January: 0,
|
|
1084
|
+
February: 1,
|
|
1085
|
+
April: 3,
|
|
1086
|
+
June: 5,
|
|
1087
|
+
September: 8,
|
|
1088
|
+
November: 10,
|
|
1089
|
+
December: 11,
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
function appendDate(date, { day = 0, month = 0, year = 0 } = {}) {
|
|
1093
|
+
if (day === 0 && month === 0 && year === 0) {
|
|
1094
|
+
return date;
|
|
1095
|
+
}
|
|
1096
|
+
const initialYear = date.getFullYear();
|
|
1097
|
+
const initialMonth = date.getMonth();
|
|
1098
|
+
const initialDate = date.getDate();
|
|
1099
|
+
const totalMonths = (initialYear + year) * MONTHS_IN_YEAR + initialMonth + month;
|
|
1100
|
+
let years = Math.floor(totalMonths / MONTHS_IN_YEAR);
|
|
1101
|
+
let months = totalMonths % MONTHS_IN_YEAR;
|
|
1102
|
+
let days = Math.min(initialDate, getMonthDaysCount(months, isLeapYear(years))) + day;
|
|
1103
|
+
while (days > getMonthDaysCount(months, isLeapYear(years))) {
|
|
1104
|
+
days -= getMonthDaysCount(months, isLeapYear(years));
|
|
1105
|
+
if (months === MonthNumber.December) {
|
|
1106
|
+
years++;
|
|
1107
|
+
months = MonthNumber.January;
|
|
1108
|
+
}
|
|
1109
|
+
else {
|
|
1110
|
+
months++;
|
|
1111
|
+
}
|
|
978
1112
|
}
|
|
979
|
-
|
|
980
|
-
|
|
1113
|
+
while (days < MIN_DAY) {
|
|
1114
|
+
if (months === MonthNumber.January) {
|
|
1115
|
+
years--;
|
|
1116
|
+
months = MonthNumber.December;
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
months--;
|
|
1120
|
+
}
|
|
1121
|
+
days += getMonthDaysCount(months, isLeapYear(years));
|
|
981
1122
|
}
|
|
982
|
-
|
|
983
|
-
|
|
1123
|
+
days =
|
|
1124
|
+
day < 0 || (day === 0 && isLeapYear(initialYear) && (month < 0 || year < 0))
|
|
1125
|
+
? days + 1 // add one day when moving days backward, or months or years backward for leap year
|
|
1126
|
+
: days - 1; // "from"-day is included in the range
|
|
1127
|
+
return new Date(years, months, days);
|
|
1128
|
+
}
|
|
1129
|
+
function getMonthDaysCount(month, isLeapYear) {
|
|
1130
|
+
switch (month) {
|
|
1131
|
+
case MonthNumber.April:
|
|
1132
|
+
case MonthNumber.June:
|
|
1133
|
+
case MonthNumber.November:
|
|
1134
|
+
case MonthNumber.September:
|
|
1135
|
+
return 30;
|
|
1136
|
+
case MonthNumber.February:
|
|
1137
|
+
return isLeapYear ? 29 : 28;
|
|
1138
|
+
default:
|
|
1139
|
+
return 31;
|
|
984
1140
|
}
|
|
985
|
-
|
|
1141
|
+
}
|
|
1142
|
+
function isLeapYear(year) {
|
|
1143
|
+
return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
|
|
986
1144
|
}
|
|
987
1145
|
|
|
988
1146
|
const getDateSegmentValueLength = (dateString) => {
|
|
@@ -1078,98 +1236,6 @@ function toDateString({ day, month, year, hours, minutes, seconds, milliseconds,
|
|
|
1078
1236
|
.replaceAll(/\D+$/g, '');
|
|
1079
1237
|
}
|
|
1080
1238
|
|
|
1081
|
-
const DATE_SEGMENTS_MAX_VALUES = {
|
|
1082
|
-
day: 31,
|
|
1083
|
-
month: 12,
|
|
1084
|
-
year: 9999,
|
|
1085
|
-
};
|
|
1086
|
-
|
|
1087
|
-
// eslint-disable-next-line i18n/no-russian-character
|
|
1088
|
-
const DEFAULT_DECIMAL_PSEUDO_SEPARATORS = ['.', ',', 'б', 'ю'];
|
|
1089
|
-
|
|
1090
|
-
const DEFAULT_MIN_DATE = new Date('0001-01-01T00:00');
|
|
1091
|
-
const DEFAULT_MAX_DATE = new Date('9999-12-31T23:59:59.999');
|
|
1092
|
-
|
|
1093
|
-
const DEFAULT_TIME_SEGMENT_MAX_VALUES = {
|
|
1094
|
-
hours: 23,
|
|
1095
|
-
minutes: 59,
|
|
1096
|
-
seconds: 59,
|
|
1097
|
-
milliseconds: 999,
|
|
1098
|
-
};
|
|
1099
|
-
const DEFAULT_TIME_SEGMENT_MIN_VALUES = {
|
|
1100
|
-
hours: 0,
|
|
1101
|
-
minutes: 0,
|
|
1102
|
-
seconds: 0,
|
|
1103
|
-
milliseconds: 0,
|
|
1104
|
-
};
|
|
1105
|
-
|
|
1106
|
-
/**
|
|
1107
|
-
* {@link https://unicode-table.com/en/00A0/ Non-breaking space}.
|
|
1108
|
-
*/
|
|
1109
|
-
const CHAR_NO_BREAK_SPACE = '\u00A0';
|
|
1110
|
-
/**
|
|
1111
|
-
* {@link https://symbl.cc/en/200B/ Zero width space}.
|
|
1112
|
-
*/
|
|
1113
|
-
const CHAR_ZERO_WIDTH_SPACE = '\u200B';
|
|
1114
|
-
/**
|
|
1115
|
-
* {@link https://unicode-table.com/en/2013/ EN dash}
|
|
1116
|
-
* is used to indicate a range of numbers or a span of time.
|
|
1117
|
-
* @example 2006–2022
|
|
1118
|
-
*/
|
|
1119
|
-
const CHAR_EN_DASH = '\u2013';
|
|
1120
|
-
/**
|
|
1121
|
-
* {@link https://unicode-table.com/en/2014/ EM dash}
|
|
1122
|
-
* is used to mark a break in a sentence.
|
|
1123
|
-
* @example Taiga UI — powerful set of open source components for Angular
|
|
1124
|
-
* ___
|
|
1125
|
-
* Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!
|
|
1126
|
-
*/
|
|
1127
|
-
const CHAR_EM_DASH = '\u2014';
|
|
1128
|
-
/**
|
|
1129
|
-
* {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}
|
|
1130
|
-
* is used to combine words.
|
|
1131
|
-
* @example well-behaved
|
|
1132
|
-
* ___
|
|
1133
|
-
* Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!
|
|
1134
|
-
*/
|
|
1135
|
-
const CHAR_HYPHEN = '\u002D';
|
|
1136
|
-
/**
|
|
1137
|
-
* {@link https://unicode-table.com/en/2212/ Minus}
|
|
1138
|
-
* is used as math operator symbol or before negative digits.
|
|
1139
|
-
* ---
|
|
1140
|
-
* Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}
|
|
1141
|
-
*/
|
|
1142
|
-
const CHAR_MINUS = '\u2212';
|
|
1143
|
-
/**
|
|
1144
|
-
* {@link https://symbl.cc/en/30FC/ Katakana-Hiragana Prolonged Sound Mark}
|
|
1145
|
-
* is used as prolonged sounds in Japanese.
|
|
1146
|
-
*/
|
|
1147
|
-
const CHAR_JP_HYPHEN = '\u30FC';
|
|
1148
|
-
/**
|
|
1149
|
-
* {@link https://symbl.cc/en/003A/ Colon}
|
|
1150
|
-
* is a punctuation mark that connects parts of a text logically.
|
|
1151
|
-
* ---
|
|
1152
|
-
* is also used as separator in time.
|
|
1153
|
-
*/
|
|
1154
|
-
const CHAR_COLON = '\u003A';
|
|
1155
|
-
/**
|
|
1156
|
-
* {@link https://symbl.cc/en/FF1A/ Full-width colon}
|
|
1157
|
-
* is a full-width punctuation mark used to separate parts of a text commonly in Japanese.
|
|
1158
|
-
*/
|
|
1159
|
-
const CHAR_JP_COLON = '\uFF1A';
|
|
1160
|
-
|
|
1161
|
-
const ANY_MERIDIEM_CHARACTER_RE = new RegExp(`[${CHAR_NO_BREAK_SPACE}APM]+$`, 'g');
|
|
1162
|
-
const ALL_MERIDIEM_CHARACTERS_RE = new RegExp(`${CHAR_NO_BREAK_SPACE}[AP]M$`, 'g');
|
|
1163
|
-
|
|
1164
|
-
const TIME_FIXED_CHARACTERS = [':', '.'];
|
|
1165
|
-
|
|
1166
|
-
const TIME_SEGMENT_VALUE_LENGTHS = {
|
|
1167
|
-
hours: 2,
|
|
1168
|
-
minutes: 2,
|
|
1169
|
-
seconds: 2,
|
|
1170
|
-
milliseconds: 3,
|
|
1171
|
-
};
|
|
1172
|
-
|
|
1173
1239
|
function validateDateString({ dateString, dateModeTemplate, dateSegmentsSeparator, offset, selection: [from, to], }) {
|
|
1174
1240
|
var _a, _b;
|
|
1175
1241
|
const parsedDate = parseDateString(dateString, dateModeTemplate);
|
|
@@ -2061,14 +2127,6 @@ function maskitoParseDate(value, { mode, min = DEFAULT_MIN_DATE, max = DEFAULT_M
|
|
|
2061
2127
|
return clamp(parsedDate, min, max);
|
|
2062
2128
|
}
|
|
2063
2129
|
|
|
2064
|
-
const POSSIBLE_DATE_RANGE_SEPARATOR = [
|
|
2065
|
-
CHAR_HYPHEN,
|
|
2066
|
-
CHAR_EN_DASH,
|
|
2067
|
-
CHAR_EM_DASH,
|
|
2068
|
-
CHAR_MINUS,
|
|
2069
|
-
CHAR_JP_HYPHEN,
|
|
2070
|
-
];
|
|
2071
|
-
|
|
2072
2130
|
function createMinMaxRangeLengthPostprocessor({ dateModeTemplate, rangeSeparator, minLength, maxLength, max = DEFAULT_MAX_DATE, }) {
|
|
2073
2131
|
if (isEmpty(minLength) && isEmpty(maxLength)) {
|
|
2074
2132
|
return identity;
|
|
@@ -2083,12 +2141,9 @@ function createMinMaxRangeLengthPostprocessor({ dateModeTemplate, rangeSeparator
|
|
|
2083
2141
|
if (!fromDate || !toDate) {
|
|
2084
2142
|
return { value, selection };
|
|
2085
2143
|
}
|
|
2086
|
-
const minDistantToDate = appendDate(fromDate,
|
|
2087
|
-
// 06.02.2023 - 07.02.2023 => {minLength: {day: 3}} => 06.02.2023 - 08.02.2023
|
|
2088
|
-
// "from"-day is included in the range
|
|
2089
|
-
day: (minLength === null || minLength === void 0 ? void 0 : minLength.day) && minLength.day - 1 }));
|
|
2144
|
+
const minDistantToDate = appendDate(fromDate, minLength);
|
|
2090
2145
|
const maxDistantToDate = !isEmpty(maxLength)
|
|
2091
|
-
? appendDate(fromDate,
|
|
2146
|
+
? appendDate(fromDate, maxLength)
|
|
2092
2147
|
: max;
|
|
2093
2148
|
const minLengthClampedToDate = clamp(toDate, minDistantToDate, max);
|
|
2094
2149
|
const minMaxLengthClampedToDate = minLengthClampedToDate > maxDistantToDate
|
|
@@ -2310,15 +2365,6 @@ decimalSeparatorOrParams = {}) {
|
|
|
2310
2365
|
return NaN;
|
|
2311
2366
|
}
|
|
2312
2367
|
|
|
2313
|
-
function maskitoStringifyNumber(number, params) {
|
|
2314
|
-
if (Number.isNaN(number) || number === null) {
|
|
2315
|
-
return '';
|
|
2316
|
-
}
|
|
2317
|
-
const { min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, decimalSeparator = '.', } = params;
|
|
2318
|
-
const value = clamp(number, min, max).toString().replace('.', decimalSeparator);
|
|
2319
|
-
return maskitoTransform(value, maskitoNumberOptionsGenerator(params));
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
2368
|
/**
|
|
2323
2369
|
* Convert number to string with replacing exponent part on decimals
|
|
2324
2370
|
*
|
|
@@ -2338,6 +2384,15 @@ function stringifyNumberWithoutExp(value) {
|
|
|
2338
2384
|
return valueWithoutExp;
|
|
2339
2385
|
}
|
|
2340
2386
|
|
|
2387
|
+
function maskitoStringifyNumber(number, params) {
|
|
2388
|
+
if (Number.isNaN(number) || number === null) {
|
|
2389
|
+
return '';
|
|
2390
|
+
}
|
|
2391
|
+
const { min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, decimalSeparator = '.', } = params;
|
|
2392
|
+
const value = stringifyNumberWithoutExp(clamp(number, min, max)).replace('.', decimalSeparator);
|
|
2393
|
+
return maskitoTransform(value, maskitoNumberOptionsGenerator(params));
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2341
2396
|
function toNumberParts(value, { decimalSeparator, minusSign }) {
|
|
2342
2397
|
const [integerWithMinus = '', decimalPart = ''] = decimalSeparator
|
|
2343
2398
|
? value.split(decimalSeparator)
|
|
@@ -2954,4 +3009,4 @@ function maskitoNumberOptionsGenerator({ max = Number.MAX_SAFE_INTEGER, min = Nu
|
|
|
2954
3009
|
}
|
|
2955
3010
|
|
|
2956
3011
|
export { maskitoWithPlaceholder as a, maskitoParseDate as b, maskitoDateRangeOptionsGenerator as c, maskitoNumberOptionsGenerator as d, maskitoParseNumber as e, maskitoStringifyNumber as f, maskitoTimeOptionsGenerator as g, maskitoDateOptionsGenerator as m, useMaskito as u };
|
|
2957
|
-
//# sourceMappingURL=index.esm-
|
|
3012
|
+
//# sourceMappingURL=index.esm-BwMVvxTV.js.map
|