ivt 0.5.1 → 0.5.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/dist/accordion/index.mjs +15 -15
- package/dist/alert/index.mjs +2 -2
- package/dist/alert-dialog/index.mjs +17 -17
- package/dist/aspect-ratio/index.mjs +1 -1
- package/dist/aspect-ratio/index.mjs.map +1 -1
- package/dist/avatar/index.mjs +7 -7
- package/dist/badge/index.mjs +3 -3
- package/dist/base/index.d.ts +1 -7
- package/dist/base/index.mjs +45 -85
- package/dist/base/index.mjs.map +1 -1
- package/dist/breadcrumb/index.mjs +5 -5
- package/dist/button/index.mjs +3 -3
- package/dist/button-group/index.mjs +3 -3
- package/dist/calendar/index.mjs +9 -9
- package/dist/card/index.mjs +3 -3
- package/dist/carousel/index.mjs +4 -4
- package/dist/chart/index.mjs +58 -27
- package/dist/chart/index.mjs.map +1 -1
- package/dist/checkbox/index.mjs +16 -221
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chunks/CalendarRange-cGKHXdiT.mjs +45 -0
- package/dist/chunks/CalendarRange-cGKHXdiT.mjs.map +1 -0
- package/dist/chunks/ComboboxField-BTKXl9y7.mjs +67 -0
- package/dist/chunks/ComboboxField-BTKXl9y7.mjs.map +1 -0
- package/dist/chunks/{Container-BrdBMmR0.mjs → Container-BUT39dlc.mjs} +2 -2
- package/dist/chunks/{Container-BrdBMmR0.mjs.map → Container-BUT39dlc.mjs.map} +1 -1
- package/dist/chunks/{TooltipIndicator-BRnOXovZ.mjs → TooltipIndicator-EfXM1ogO.mjs} +4 -4
- package/dist/chunks/{TooltipIndicator-BRnOXovZ.mjs.map → TooltipIndicator-EfXM1ogO.mjs.map} +1 -1
- package/dist/chunks/{_commonjsHelpers-BMPzsb8G.mjs → _commonjsHelpers-DCzDIER3.mjs} +1 -1
- package/dist/chunks/_commonjsHelpers-DCzDIER3.mjs.map +1 -0
- package/dist/chunks/{accordion-D2idHhKo.mjs → accordion-BXurL6Pv.mjs} +11 -11
- package/dist/chunks/{accordion-D2idHhKo.mjs.map → accordion-BXurL6Pv.mjs.map} +1 -1
- package/dist/chunks/{badge-DBJfSSib.mjs → badge-CpWQDnGV.mjs} +2 -2
- package/dist/chunks/{badge-DBJfSSib.mjs.map → badge-CpWQDnGV.mjs.map} +1 -1
- package/dist/chunks/{bundle-mjs-hDzYn9Rn.mjs → bundle-mjs-C9OlPgmH.mjs} +1 -1
- package/dist/chunks/{bundle-mjs-hDzYn9Rn.mjs.map → bundle-mjs-C9OlPgmH.mjs.map} +1 -1
- package/dist/chunks/{button-D-AuR380.mjs → button-BrmYbiY8.mjs} +2 -2
- package/dist/chunks/{button-D-AuR380.mjs.map → button-BrmYbiY8.mjs.map} +1 -1
- package/dist/chunks/{calendar-UmDqBCDE.mjs → calendar-BQgywKTj.mjs} +7 -7
- package/dist/chunks/{calendar-UmDqBCDE.mjs.map → calendar-BQgywKTj.mjs.map} +1 -1
- package/dist/chunks/{calendar-days-DwMabC50.mjs → calendar-days-C_RzSweF.mjs} +2 -2
- package/dist/chunks/{calendar-days-DwMabC50.mjs.map → calendar-days-C_RzSweF.mjs.map} +1 -1
- package/dist/chunks/{card-BvvM14Gb.mjs → card-DeaeODxs.mjs} +2 -2
- package/dist/chunks/{card-BvvM14Gb.mjs.map → card-DeaeODxs.mjs.map} +1 -1
- package/dist/chunks/{check-BRfyRdfr.mjs → check-CP6BCwvU.mjs} +2 -2
- package/dist/chunks/{check-BRfyRdfr.mjs.map → check-CP6BCwvU.mjs.map} +1 -1
- package/dist/chunks/checkbox-BvnI-3Q6.mjs +219 -0
- package/dist/chunks/checkbox-BvnI-3Q6.mjs.map +1 -0
- package/dist/chunks/{chevron-down-Da1qAjZn.mjs → chevron-down-cCIwKwmA.mjs} +2 -2
- package/dist/chunks/{chevron-down-Da1qAjZn.mjs.map → chevron-down-cCIwKwmA.mjs.map} +1 -1
- package/dist/chunks/{chevron-left-COHT-3Eq.mjs → chevron-left-BPWGf-Mt.mjs} +2 -2
- package/dist/chunks/{chevron-left-COHT-3Eq.mjs.map → chevron-left-BPWGf-Mt.mjs.map} +1 -1
- package/dist/chunks/{chevron-right-DuI9c_Gd.mjs → chevron-right-Bk4Jys-R.mjs} +2 -2
- package/dist/chunks/{chevron-right-DuI9c_Gd.mjs.map → chevron-right-Bk4Jys-R.mjs.map} +1 -1
- package/dist/chunks/{chevrons-up-down-CPNoTxmJ.mjs → chevrons-up-down-BDmpiJmb.mjs} +2 -2
- package/dist/chunks/{chevrons-up-down-CPNoTxmJ.mjs.map → chevrons-up-down-BDmpiJmb.mjs.map} +1 -1
- package/dist/chunks/{command-Qqchwo0s.mjs → command-CTTPLJSd.mjs} +8 -8
- package/dist/chunks/{command-Qqchwo0s.mjs.map → command-CTTPLJSd.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-7URJZQ6y.mjs → createLucideIcon-rdK7ReAV.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-7URJZQ6y.mjs.map → createLucideIcon-rdK7ReAV.mjs.map} +1 -1
- package/dist/chunks/{date-OwUlKCdN.mjs → date-BF0VPeD6.mjs} +13 -3
- package/dist/chunks/{date-OwUlKCdN.mjs.map → date-BF0VPeD6.mjs.map} +1 -1
- package/dist/chunks/{dialog-COoPeq2Z.mjs → dialog-BZ1Bem1X.mjs} +5 -5
- package/dist/chunks/dialog-BZ1Bem1X.mjs.map +1 -0
- package/dist/chunks/{ellipsis-D4Xfhncn.mjs → ellipsis-CvvEpdNm.mjs} +2 -2
- package/dist/chunks/{ellipsis-D4Xfhncn.mjs.map → ellipsis-CvvEpdNm.mjs.map} +1 -1
- package/dist/chunks/form-CLuajH9A.mjs +2223 -0
- package/dist/chunks/form-CLuajH9A.mjs.map +1 -0
- package/dist/chunks/{format-D4e-OzO4.mjs → format-DvB2IToG.mjs} +1 -1
- package/dist/chunks/{format-D4e-OzO4.mjs.map → format-DvB2IToG.mjs.map} +1 -1
- package/dist/chunks/format-numbers-DtAwKNYo.mjs +55 -0
- package/dist/chunks/format-numbers-DtAwKNYo.mjs.map +1 -0
- package/dist/chunks/{hover-card-DWwA1Yuy.mjs → hover-card-Cwtai5wK.mjs} +11 -11
- package/dist/chunks/{hover-card-DWwA1Yuy.mjs.map → hover-card-Cwtai5wK.mjs.map} +1 -1
- package/dist/chunks/{index-DtKExqnn.mjs → index-2wUt7vgM.mjs} +5 -5
- package/dist/chunks/{index-DtKExqnn.mjs.map → index-2wUt7vgM.mjs.map} +1 -1
- package/dist/chunks/{index-5faT867a.mjs → index-9Ejb37i6.mjs} +2 -2
- package/dist/chunks/{index-5faT867a.mjs.map → index-9Ejb37i6.mjs.map} +1 -1
- package/dist/chunks/{index-BkSq4h61.mjs → index-B0fljwsr.mjs} +1 -1
- package/dist/chunks/{index-BkSq4h61.mjs.map → index-B0fljwsr.mjs.map} +1 -1
- package/dist/chunks/{index-Ddd4CdXg.mjs → index-B1HovDby.mjs} +1 -1
- package/dist/chunks/{index-Ddd4CdXg.mjs.map → index-B1HovDby.mjs.map} +1 -1
- package/dist/chunks/{index-v6afswDN.mjs → index-BpfkkunI.mjs} +3 -3
- package/dist/chunks/{index-v6afswDN.mjs.map → index-BpfkkunI.mjs.map} +1 -1
- package/dist/chunks/{index-NklcsNwH.mjs → index-C5dQnmlR.mjs} +9 -9
- package/dist/chunks/{index-NklcsNwH.mjs.map → index-C5dQnmlR.mjs.map} +1 -1
- package/dist/chunks/{index-5Pzed4rM.mjs → index-C7WDAsMc.mjs} +2 -2
- package/dist/chunks/{index-5Pzed4rM.mjs.map → index-C7WDAsMc.mjs.map} +1 -1
- package/dist/chunks/{index-nZoGoNPf.mjs → index-C8YG6ZVI.mjs} +1 -1
- package/dist/chunks/{index-nZoGoNPf.mjs.map → index-C8YG6ZVI.mjs.map} +1 -1
- package/dist/chunks/{index-B8Xjv2ZH.mjs → index-CJIjOsdz.mjs} +1 -1
- package/dist/chunks/{index-B8Xjv2ZH.mjs.map → index-CJIjOsdz.mjs.map} +1 -1
- package/dist/chunks/{index-DBCfgozJ.mjs → index-CN-1P6oe.mjs} +9 -9
- package/dist/chunks/{index-DBCfgozJ.mjs.map → index-CN-1P6oe.mjs.map} +1 -1
- package/dist/chunks/{index-B8-uTAUO.mjs → index-CcfhA3fh.mjs} +11 -11
- package/dist/chunks/{index-B8-uTAUO.mjs.map → index-CcfhA3fh.mjs.map} +1 -1
- package/dist/chunks/{index-C9o4LjP_.mjs → index-CdbLHZ-v.mjs} +2 -2
- package/dist/chunks/{index-C9o4LjP_.mjs.map → index-CdbLHZ-v.mjs.map} +1 -1
- package/dist/chunks/{index-CN5_KnJA.mjs → index-D4Y6_Jit.mjs} +5 -5
- package/dist/chunks/{index-CN5_KnJA.mjs.map → index-D4Y6_Jit.mjs.map} +1 -1
- package/dist/chunks/{index-BtarojiO.mjs → index-DEFfOyUE.mjs} +1 -1
- package/dist/chunks/{index-BtarojiO.mjs.map → index-DEFfOyUE.mjs.map} +1 -1
- package/dist/chunks/{index-B2yIIBCu.mjs → index-DFMyqwc8.mjs} +2 -2
- package/dist/chunks/{index-B2yIIBCu.mjs.map → index-DFMyqwc8.mjs.map} +1 -1
- package/dist/chunks/{index-ZHgU3iXJ.mjs → index-DNPAHxPV.mjs} +1 -1
- package/dist/chunks/{index-ZHgU3iXJ.mjs.map → index-DNPAHxPV.mjs.map} +1 -1
- package/dist/chunks/{index-DLJUwQi9.mjs → index-DkhtbUNc.mjs} +1 -1
- package/dist/chunks/{index-DLJUwQi9.mjs.map → index-DkhtbUNc.mjs.map} +1 -1
- package/dist/chunks/{index-B-6Ckys4.mjs → index-Dpe5NTKJ.mjs} +7 -7
- package/dist/chunks/{index-B-6Ckys4.mjs.map → index-Dpe5NTKJ.mjs.map} +1 -1
- package/dist/chunks/{index-B6brYbxC.mjs → index-DymROPqb.mjs} +1 -1
- package/dist/chunks/{index-B6brYbxC.mjs.map → index-DymROPqb.mjs.map} +1 -1
- package/dist/chunks/{index-CfDMge0f.mjs → index-LOIUbp1N.mjs} +3 -3
- package/dist/chunks/{index-CfDMge0f.mjs.map → index-LOIUbp1N.mjs.map} +1 -1
- package/dist/chunks/{index-B87WmpPj.mjs → index-N54PlKgO.mjs} +1 -1
- package/dist/chunks/{index-B87WmpPj.mjs.map → index-N54PlKgO.mjs.map} +1 -1
- package/dist/chunks/{index-C9PsqjPs.mjs → index-SHhYuecD.mjs} +1 -1
- package/dist/chunks/{index-C9PsqjPs.mjs.map → index-SHhYuecD.mjs.map} +1 -1
- package/dist/chunks/{index-C67E33Wg.mjs → index-eIYpJRu_.mjs} +15 -15
- package/dist/chunks/{index-C67E33Wg.mjs.map → index-eIYpJRu_.mjs.map} +1 -1
- package/dist/chunks/{input-P6tpQoZI.mjs → input-BRRi8JbN.mjs} +2 -2
- package/dist/chunks/{input-P6tpQoZI.mjs.map → input-BRRi8JbN.mjs.map} +1 -1
- package/dist/chunks/{label-DO-vk0C1.mjs → label-DyMdyPfF.mjs} +3 -3
- package/dist/chunks/{label-DO-vk0C1.mjs.map → label-DyMdyPfF.mjs.map} +1 -1
- package/dist/chunks/{loader-circle-ByrzCrlm.mjs → loader-circle-DlDf3jDF.mjs} +2 -2
- package/dist/chunks/{loader-circle-ByrzCrlm.mjs.map → loader-circle-DlDf3jDF.mjs.map} +1 -1
- package/dist/chunks/multi-select-BAp66njF.mjs +277 -0
- package/dist/chunks/multi-select-BAp66njF.mjs.map +1 -0
- package/dist/chunks/{pagination-BokeG2NE.mjs → pagination-CoQF8H-y.mjs} +6 -6
- package/dist/chunks/{pagination-BokeG2NE.mjs.map → pagination-CoQF8H-y.mjs.map} +1 -1
- package/dist/chunks/{popover-BHGG1pi4.mjs → popover-Bx3Ak-qS.mjs} +13 -13
- package/dist/chunks/{popover-BHGG1pi4.mjs.map → popover-Bx3Ak-qS.mjs.map} +1 -1
- package/dist/chunks/{progress-tTjKFb3n.mjs → progress-Unv1Ywou.mjs} +4 -4
- package/dist/chunks/{progress-tTjKFb3n.mjs.map → progress-Unv1Ywou.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-DEPEjRwi.mjs → scroll-area-Bu_eg6tq.mjs} +11 -11
- package/dist/chunks/{scroll-area-DEPEjRwi.mjs.map → scroll-area-Bu_eg6tq.mjs.map} +1 -1
- package/dist/chunks/{select-D65oWCP_.mjs → select-VgTkuC8i.mjs} +5 -5
- package/dist/chunks/{select-D65oWCP_.mjs.map → select-VgTkuC8i.mjs.map} +1 -1
- package/dist/chunks/{separator-DGk34I19.mjs → separator-ChTsmHyH.mjs} +3 -3
- package/dist/chunks/{separator-DGk34I19.mjs.map → separator-ChTsmHyH.mjs.map} +1 -1
- package/dist/chunks/{sheet-DzqTwvfR.mjs → sheet-CX9dlZuk.mjs} +4 -4
- package/dist/chunks/{sheet-DzqTwvfR.mjs.map → sheet-CX9dlZuk.mjs.map} +1 -1
- package/dist/chunks/{skeleton-BKAZlhUa.mjs → skeleton-TvPSLZ-7.mjs} +2 -2
- package/dist/chunks/{skeleton-BKAZlhUa.mjs.map → skeleton-TvPSLZ-7.mjs.map} +1 -1
- package/dist/chunks/{sortable-h2HFN8nu.mjs → sortable-DQ0ESvYM.mjs} +3 -3
- package/dist/chunks/{sortable-h2HFN8nu.mjs.map → sortable-DQ0ESvYM.mjs.map} +1 -1
- package/dist/chunks/{table-CU2pn-A3.mjs → table-5dae4DKj.mjs} +2 -2
- package/dist/chunks/{table-CU2pn-A3.mjs.map → table-5dae4DKj.mjs.map} +1 -1
- package/dist/chunks/{textarea-BwN5bQKw.mjs → textarea-C6sc9FNI.mjs} +2 -2
- package/dist/chunks/{textarea-BwN5bQKw.mjs.map → textarea-C6sc9FNI.mjs.map} +1 -1
- package/dist/chunks/{toggle-D4Zey3Qh.mjs → toggle-SS3ISGud.mjs} +5 -5
- package/dist/chunks/{toggle-D4Zey3Qh.mjs.map → toggle-SS3ISGud.mjs.map} +1 -1
- package/dist/chunks/{tooltip-DzraytiQ.mjs → tooltip-WyVePJR7.mjs} +13 -13
- package/dist/chunks/{tooltip-DzraytiQ.mjs.map → tooltip-WyVePJR7.mjs.map} +1 -1
- package/dist/chunks/{trash-2-CP_u4s-9.mjs → trash-2-Dp8LY8vw.mjs} +2 -2
- package/dist/chunks/{trash-2-CP_u4s-9.mjs.map → trash-2-Dp8LY8vw.mjs.map} +1 -1
- package/dist/chunks/{triangle-alert-BWSa1Gx0.mjs → triangle-alert-CpLMma6K.mjs} +2 -2
- package/dist/chunks/{triangle-alert-BWSa1Gx0.mjs.map → triangle-alert-CpLMma6K.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-OCi7qCQ4.mjs → tslib.es6-BgXxJBc3.mjs} +1 -1
- package/dist/chunks/{tslib.es6-OCi7qCQ4.mjs.map → tslib.es6-BgXxJBc3.mjs.map} +1 -1
- package/dist/chunks/{utils-D0vBZFbG.mjs → utils-DfaTa-5f.mjs} +2 -2
- package/dist/chunks/{utils-D0vBZFbG.mjs.map → utils-DfaTa-5f.mjs.map} +1 -1
- package/dist/chunks/{x-Cpa5dTvp.mjs → x-BtRqeVV7.mjs} +2 -2
- package/dist/chunks/{x-Cpa5dTvp.mjs.map → x-BtRqeVV7.mjs.map} +1 -1
- package/dist/collapsible/index.mjs +9 -9
- package/dist/combobox/index.d.ts +8 -1
- package/dist/combobox/index.mjs +121 -39
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.mjs +20 -20
- package/dist/context-menu/index.mjs +23 -23
- package/dist/dash/index.mjs +25 -75
- package/dist/dash/index.mjs.map +1 -1
- package/dist/data-table/index.mjs +35 -35
- package/dist/date-picker/index.mjs +27 -27
- package/dist/dialog/index.mjs +19 -19
- package/dist/drawer/index.mjs +16 -16
- package/dist/dropdown-menu/index.mjs +23 -23
- package/dist/dropzone/index.d.ts +6 -0
- package/dist/dropzone/index.mjs +40 -28
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/empty/index.mjs +2 -2
- package/dist/field/index.mjs +5 -5
- package/dist/form/index.mjs +7 -653
- package/dist/form/index.mjs.map +1 -1
- package/dist/form-fields/index.mjs +29 -85
- package/dist/form-fields/index.mjs.map +1 -1
- package/dist/hover-card/index.mjs +15 -15
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +3 -3
- package/dist/input-group/index.mjs +5 -5
- package/dist/input-otp/index.mjs +3 -3
- package/dist/item/index.mjs +4 -4
- package/dist/ivt.css +1 -1
- package/dist/kbd/index.mjs +2 -2
- package/dist/label/index.mjs +4 -4
- package/dist/layout/index.mjs +6 -6
- package/dist/menubar/index.mjs +23 -23
- package/dist/multi-select/index.mjs +33 -295
- package/dist/multi-select/index.mjs.map +1 -1
- package/dist/navigation-menu/index.mjs +17 -17
- package/dist/pagination/index.mjs +8 -8
- package/dist/popover/index.mjs +18 -18
- package/dist/progress/index.mjs +5 -5
- package/dist/radio-group/index.mjs +17 -17
- package/dist/resizable/index.mjs +3 -3
- package/dist/scroll-area/index.mjs +12 -12
- package/dist/select/index.mjs +6 -6
- package/dist/separator/index.mjs +4 -4
- package/dist/shared/index.mjs +5 -5
- package/dist/sheet/index.mjs +19 -19
- package/dist/sidebar/index.mjs +27 -27
- package/dist/skeleton/index.mjs +3 -3
- package/dist/skeleton-component/index.mjs +4 -4
- package/dist/slider/index.mjs +12 -12
- package/dist/slider/index.mjs.map +1 -1
- package/dist/sortable/index.mjs +4 -4
- package/dist/spinner/index.mjs +4 -4
- package/dist/switch/index.mjs +10 -10
- package/dist/table/index.mjs +3 -3
- package/dist/table-filter/index.d.ts +49 -0
- package/dist/table-filter/index.mjs +2068 -0
- package/dist/table-filter/index.mjs.map +1 -0
- package/dist/tabs/index.mjs +13 -13
- package/dist/textarea/index.mjs +3 -3
- package/dist/toast/index.mjs +15 -15
- package/dist/toggle/index.mjs +7 -7
- package/dist/toggle-group/index.mjs +13 -13
- package/dist/tooltip/index.mjs +17 -17
- package/package.json +6 -1
- package/dist/chunks/_commonjsHelpers-BMPzsb8G.mjs.map +0 -1
- package/dist/chunks/dialog-COoPeq2Z.mjs.map +0 -1
package/dist/carousel/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRef, useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import { c as cn } from '../chunks/utils-
|
|
4
|
-
import { c as createLucideIcon } from '../chunks/createLucideIcon-
|
|
5
|
-
import { B as Button } from '../chunks/button-
|
|
6
|
-
import '../chunks/bundle-mjs-
|
|
3
|
+
import { c as cn } from '../chunks/utils-DfaTa-5f.mjs';
|
|
4
|
+
import { c as createLucideIcon } from '../chunks/createLucideIcon-rdK7ReAV.mjs';
|
|
5
|
+
import { B as Button } from '../chunks/button-BrmYbiY8.mjs';
|
|
6
|
+
import '../chunks/bundle-mjs-C9OlPgmH.mjs';
|
|
7
7
|
import '@radix-ui/react-slot';
|
|
8
8
|
import 'class-variance-authority';
|
|
9
9
|
|
package/dist/chart/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { isValidElement, forwardRef, useContext, createContext, PureComponent, useState, useCallback, useMemo, useRef, useImperativeHandle, useEffect, cloneElement, createElement } from 'react';
|
|
3
|
-
import { a as clsx, c as cn } from '../chunks/utils-
|
|
3
|
+
import { a as clsx, c as cn } from '../chunks/utils-DfaTa-5f.mjs';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import { g as getDefaultExportFromCjs } from '../chunks/_commonjsHelpers-
|
|
6
|
-
import { r as requireShim } from '../chunks/index-
|
|
7
|
-
import '../chunks/bundle-mjs-
|
|
5
|
+
import { g as getDefaultExportFromCjs } from '../chunks/_commonjsHelpers-DCzDIER3.mjs';
|
|
6
|
+
import { r as requireShim } from '../chunks/index-N54PlKgO.mjs';
|
|
7
|
+
import '../chunks/bundle-mjs-C9OlPgmH.mjs';
|
|
8
8
|
|
|
9
9
|
var EventKeys = [
|
|
10
10
|
'dangerouslySetInnerHTML',
|
|
@@ -4361,19 +4361,25 @@ function isDraftable(value) {
|
|
|
4361
4361
|
return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
|
|
4362
4362
|
}
|
|
4363
4363
|
var objectCtorString = Object.prototype.constructor.toString();
|
|
4364
|
+
var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
|
|
4364
4365
|
function isPlainObject(value) {
|
|
4365
4366
|
if (!value || typeof value !== "object") return false;
|
|
4366
|
-
const proto = getPrototypeOf(value);
|
|
4367
|
-
if (proto === null)
|
|
4368
|
-
return true;
|
|
4369
|
-
}
|
|
4367
|
+
const proto = Object.getPrototypeOf(value);
|
|
4368
|
+
if (proto === null || proto === Object.prototype) return true;
|
|
4370
4369
|
const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
4371
4370
|
if (Ctor === Object) return true;
|
|
4372
|
-
|
|
4371
|
+
if (typeof Ctor !== "function") return false;
|
|
4372
|
+
let ctorString = cachedCtorStrings.get(Ctor);
|
|
4373
|
+
if (ctorString === void 0) {
|
|
4374
|
+
ctorString = Function.toString.call(Ctor);
|
|
4375
|
+
cachedCtorStrings.set(Ctor, ctorString);
|
|
4376
|
+
}
|
|
4377
|
+
return ctorString === objectCtorString;
|
|
4373
4378
|
}
|
|
4374
|
-
function each(obj, iter) {
|
|
4379
|
+
function each(obj, iter, strict = true) {
|
|
4375
4380
|
if (getArchtype(obj) === 0 /* Object */ ) {
|
|
4376
|
-
Reflect.ownKeys(obj).
|
|
4381
|
+
const keys = strict ? Reflect.ownKeys(obj) : Object.keys(obj);
|
|
4382
|
+
keys.forEach((key)=>{
|
|
4377
4383
|
iter(key, obj[key], obj);
|
|
4378
4384
|
});
|
|
4379
4385
|
} else {
|
|
@@ -4454,18 +4460,10 @@ function freeze(obj, deep = false) {
|
|
|
4454
4460
|
if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj;
|
|
4455
4461
|
if (getArchtype(obj) > 1) {
|
|
4456
4462
|
Object.defineProperties(obj, {
|
|
4457
|
-
set:
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
value: dontMutateFrozenCollections
|
|
4462
|
-
},
|
|
4463
|
-
clear: {
|
|
4464
|
-
value: dontMutateFrozenCollections
|
|
4465
|
-
},
|
|
4466
|
-
delete: {
|
|
4467
|
-
value: dontMutateFrozenCollections
|
|
4468
|
-
}
|
|
4463
|
+
set: dontMutateMethodOverride,
|
|
4464
|
+
add: dontMutateMethodOverride,
|
|
4465
|
+
clear: dontMutateMethodOverride,
|
|
4466
|
+
delete: dontMutateMethodOverride
|
|
4469
4467
|
});
|
|
4470
4468
|
}
|
|
4471
4469
|
Object.freeze(obj);
|
|
@@ -4475,7 +4473,11 @@ function freeze(obj, deep = false) {
|
|
|
4475
4473
|
function dontMutateFrozenCollections() {
|
|
4476
4474
|
die(2);
|
|
4477
4475
|
}
|
|
4476
|
+
var dontMutateMethodOverride = {
|
|
4477
|
+
value: dontMutateFrozenCollections
|
|
4478
|
+
};
|
|
4478
4479
|
function isFrozen(obj) {
|
|
4480
|
+
if (obj === null || typeof obj !== "object") return true;
|
|
4479
4481
|
return Object.isFrozen(obj);
|
|
4480
4482
|
}
|
|
4481
4483
|
// src/utils/plugins.ts
|
|
@@ -4557,9 +4559,10 @@ function processResult(result, scope) {
|
|
|
4557
4559
|
}
|
|
4558
4560
|
function finalize(rootScope, value, path) {
|
|
4559
4561
|
if (isFrozen(value)) return value;
|
|
4562
|
+
const useStrictIteration = rootScope.immer_.shouldUseStrictIteration();
|
|
4560
4563
|
const state = value[DRAFT_STATE];
|
|
4561
4564
|
if (!state) {
|
|
4562
|
-
each(value, (key, childValue)=>finalizeProperty(rootScope, state, value, key, childValue, path));
|
|
4565
|
+
each(value, (key, childValue)=>finalizeProperty(rootScope, state, value, key, childValue, path), useStrictIteration);
|
|
4563
4566
|
return value;
|
|
4564
4567
|
}
|
|
4565
4568
|
if (state.scope_ !== rootScope) return value;
|
|
@@ -4578,7 +4581,7 @@ function finalize(rootScope, value, path) {
|
|
|
4578
4581
|
result.clear();
|
|
4579
4582
|
isSet2 = true;
|
|
4580
4583
|
}
|
|
4581
|
-
each(resultEach, (key, childValue)=>finalizeProperty(rootScope, state, result, key, childValue, path, isSet2));
|
|
4584
|
+
each(resultEach, (key, childValue)=>finalizeProperty(rootScope, state, result, key, childValue, path, isSet2), useStrictIteration);
|
|
4582
4585
|
maybeFreeze(rootScope, result, false);
|
|
4583
4586
|
if (path && rootScope.patches_) {
|
|
4584
4587
|
getPlugin("Patches").generatePatches_(state, path, rootScope.patches_, rootScope.inversePatches_);
|
|
@@ -4587,6 +4590,16 @@ function finalize(rootScope, value, path) {
|
|
|
4587
4590
|
return state.copy_;
|
|
4588
4591
|
}
|
|
4589
4592
|
function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {
|
|
4593
|
+
if (childValue == null) {
|
|
4594
|
+
return;
|
|
4595
|
+
}
|
|
4596
|
+
if (typeof childValue !== "object" && !targetIsSet) {
|
|
4597
|
+
return;
|
|
4598
|
+
}
|
|
4599
|
+
const childIsFrozen = isFrozen(childValue);
|
|
4600
|
+
if (childIsFrozen && !targetIsSet) {
|
|
4601
|
+
return;
|
|
4602
|
+
}
|
|
4590
4603
|
if (process.env.NODE_ENV !== "production" && childValue === targetObject) die(5);
|
|
4591
4604
|
if (isDraft(childValue)) {
|
|
4592
4605
|
const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.
|
|
@@ -4599,10 +4612,13 @@ function finalizeProperty(rootScope, parentState, targetObject, prop, childValue
|
|
|
4599
4612
|
} else if (targetIsSet) {
|
|
4600
4613
|
targetObject.add(childValue);
|
|
4601
4614
|
}
|
|
4602
|
-
if (isDraftable(childValue) && !
|
|
4615
|
+
if (isDraftable(childValue) && !childIsFrozen) {
|
|
4603
4616
|
if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
|
|
4604
4617
|
return;
|
|
4605
4618
|
}
|
|
4619
|
+
if (parentState && parentState.base_ && parentState.base_[prop] === childValue && childIsFrozen) {
|
|
4620
|
+
return;
|
|
4621
|
+
}
|
|
4606
4622
|
finalize(rootScope, childValue);
|
|
4607
4623
|
if ((!parentState || !parentState.scope_.parent_) && typeof prop !== "symbol" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop))) maybeFreeze(rootScope, childValue);
|
|
4608
4624
|
}
|
|
@@ -4816,6 +4832,17 @@ var Immer2 = class {
|
|
|
4816
4832
|
*/ setUseStrictShallowCopy(value) {
|
|
4817
4833
|
this.useStrictShallowCopy_ = value;
|
|
4818
4834
|
}
|
|
4835
|
+
/**
|
|
4836
|
+
* Pass false to use faster iteration that skips non-enumerable properties
|
|
4837
|
+
* but still handles symbols for compatibility.
|
|
4838
|
+
*
|
|
4839
|
+
* By default, strict iteration is enabled (includes all own properties).
|
|
4840
|
+
*/ setUseStrictIteration(value) {
|
|
4841
|
+
this.useStrictIteration_ = value;
|
|
4842
|
+
}
|
|
4843
|
+
shouldUseStrictIteration() {
|
|
4844
|
+
return this.useStrictIteration_;
|
|
4845
|
+
}
|
|
4819
4846
|
applyPatches(base, patches) {
|
|
4820
4847
|
let i;
|
|
4821
4848
|
for(i = patches.length - 1; i >= 0; i--){
|
|
@@ -4837,6 +4864,7 @@ var Immer2 = class {
|
|
|
4837
4864
|
constructor(config){
|
|
4838
4865
|
this.autoFreeze_ = true;
|
|
4839
4866
|
this.useStrictShallowCopy_ = false;
|
|
4867
|
+
this.useStrictIteration_ = true;
|
|
4840
4868
|
/**
|
|
4841
4869
|
* The `produce` function takes a value and a "recipe function" (whose
|
|
4842
4870
|
* return value often depends on the base state). The recipe function is
|
|
@@ -4911,6 +4939,7 @@ var Immer2 = class {
|
|
|
4911
4939
|
};
|
|
4912
4940
|
if (typeof config?.autoFreeze === "boolean") this.setAutoFreeze(config.autoFreeze);
|
|
4913
4941
|
if (typeof config?.useStrictShallowCopy === "boolean") this.setUseStrictShallowCopy(config.useStrictShallowCopy);
|
|
4942
|
+
if (typeof config?.useStrictIteration === "boolean") this.setUseStrictIteration(config.useStrictIteration);
|
|
4914
4943
|
}
|
|
4915
4944
|
};
|
|
4916
4945
|
function createProxy(value, parent) {
|
|
@@ -4928,16 +4957,18 @@ function currentImpl(value) {
|
|
|
4928
4957
|
if (!isDraftable(value) || isFrozen(value)) return value;
|
|
4929
4958
|
const state = value[DRAFT_STATE];
|
|
4930
4959
|
let copy;
|
|
4960
|
+
let strict = true;
|
|
4931
4961
|
if (state) {
|
|
4932
4962
|
if (!state.modified_) return state.base_;
|
|
4933
4963
|
state.finalized_ = true;
|
|
4934
4964
|
copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
|
|
4965
|
+
strict = state.scope_.immer_.shouldUseStrictIteration();
|
|
4935
4966
|
} else {
|
|
4936
4967
|
copy = shallowCopy(value, true);
|
|
4937
4968
|
}
|
|
4938
4969
|
each(copy, (key, childValue)=>{
|
|
4939
4970
|
set(copy, key, currentImpl(childValue));
|
|
4940
|
-
});
|
|
4971
|
+
}, strict);
|
|
4941
4972
|
if (state) {
|
|
4942
4973
|
state.finalized_ = false;
|
|
4943
4974
|
}
|