@vritti/quantum-ui 0.6.9 → 0.6.11
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/Avatar.js +5 -5
- package/dist/Badge2.js +86 -11
- package/dist/Badge2.js.map +1 -1
- package/dist/ChartFrame.js +4 -1
- package/dist/ChartFrame.js.map +1 -1
- package/dist/Checkbox2.js +5 -5
- package/dist/CurrencyFieldFilter.js +60 -34
- package/dist/CurrencyFieldFilter.js.map +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/DropdownMenu.js +6 -1
- package/dist/DropdownMenu.js.map +1 -1
- package/dist/IconSelect.js +2302 -2324
- package/dist/IconSelect.js.map +1 -1
- package/dist/Input.js +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/OTPField.js +2 -2
- package/dist/OTPField.js.map +1 -1
- package/dist/PhoneField.js +2 -2
- package/dist/PhoneField.js.map +1 -1
- package/dist/Progress.js +2 -2
- package/dist/QuantityField.js +437 -105
- package/dist/QuantityField.js.map +1 -1
- package/dist/RadioGroup.js +7 -7
- package/dist/Select.js +92 -4
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +1 -1
- package/dist/SingleSelect.js +1 -1
- package/dist/SingleSelect.js.map +1 -1
- package/dist/Sonner.js +1 -1
- package/dist/Spinner.js +8 -2
- package/dist/Spinner.js.map +1 -1
- package/dist/Switch.js +5 -5
- package/dist/TabsSkeleton.js +2 -2
- package/dist/TextArea.js +1 -1
- package/dist/TextArea.js.map +1 -1
- package/dist/TextField.js +29 -27
- package/dist/TextField.js.map +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/assets/quantum-ui.css +473 -171
- package/dist/bindFilters.js +14 -1
- package/dist/bindFilters.js.map +1 -1
- package/dist/components/ContextBar.js.map +1 -1
- package/dist/components/QuantityField.js +1 -1
- package/dist/components/RichTextEditor.js +1 -1
- package/dist/components/TreeView.js +4 -4
- package/dist/currencyCode.js +1520 -0
- package/dist/currencyCode.js.map +1 -0
- package/dist/dropdown-menu.js +9 -9
- package/dist/image-component.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index10.js +37 -1499
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +503 -28
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +230 -454
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +1073 -213
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +20 -1139
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +14 -20
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +173 -19
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +173 -168
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +201 -171
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +190 -186
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +204 -202
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +68 -209
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +1128 -70
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +4 -1133
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +232 -4
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +1100 -207
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +2469 -1023
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +35 -2569
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +308 -36
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +7 -307
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +30 -8
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +59 -29
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +10 -59
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +35347 -9
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +72 -35342
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +187 -72
- package/dist/index35.js.map +1 -1
- package/dist/index5.js +4 -4
- package/dist/index9.js +1 -1
- package/dist/lib/components/ContextBar/useContextState.d.ts +7 -1
- package/dist/lib/components/ContextBar/useContextState.d.ts.map +1 -1
- package/dist/lib/components/CurrencyField/CurrencyField.d.ts +8 -4
- package/dist/lib/components/CurrencyField/CurrencyField.d.ts.map +1 -1
- package/dist/lib/components/CurrencyField/CurrencyFieldFilter.d.ts +3 -2
- package/dist/lib/components/CurrencyField/CurrencyFieldFilter.d.ts.map +1 -1
- package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/lib/components/DataTable/components/DataTablePagination.d.ts.map +1 -1
- package/dist/lib/components/DataTable/components/DataTableSelectionBar.d.ts +3 -2
- package/dist/lib/components/DataTable/components/DataTableSelectionBar.d.ts.map +1 -1
- package/dist/lib/components/DataTable/hooks/useDataTable.d.ts +4 -1
- package/dist/lib/components/DataTable/hooks/useDataTable.d.ts.map +1 -1
- package/dist/lib/components/DataTable/index.d.ts +1 -1
- package/dist/lib/components/DataTable/index.d.ts.map +1 -1
- package/dist/lib/components/DataTable/types.d.ts +13 -1
- package/dist/lib/components/DataTable/types.d.ts.map +1 -1
- package/dist/lib/components/DataTable/utils.d.ts +2 -2
- package/dist/lib/components/DataTable/utils.d.ts.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/lib/components/DropdownMenu/types.d.ts +2 -0
- package/dist/lib/components/DropdownMenu/types.d.ts.map +1 -1
- package/dist/lib/components/Field/numberConstraints.d.ts +19 -0
- package/dist/lib/components/Field/numberConstraints.d.ts.map +1 -0
- package/dist/lib/components/PhoneField/PhoneField.d.ts.map +1 -1
- package/dist/lib/components/QuantityField/QuantityField.d.ts +11 -1
- package/dist/lib/components/QuantityField/QuantityField.d.ts.map +1 -1
- package/dist/lib/components/QuantityField/index.d.ts +1 -1
- package/dist/lib/components/QuantityField/index.d.ts.map +1 -1
- package/dist/lib/components/QuantityField/quantity.d.ts +14 -0
- package/dist/lib/components/QuantityField/quantity.d.ts.map +1 -1
- package/dist/lib/components/Select/Select.d.ts +3 -0
- package/dist/lib/components/Select/Select.d.ts.map +1 -1
- package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts.map +1 -1
- package/dist/lib/components/TextField/TextField.d.ts.map +1 -1
- package/dist/lib/hooks/useWorkspaceCurrency.d.ts +2 -1
- package/dist/lib/hooks/useWorkspaceCurrency.d.ts.map +1 -1
- package/dist/lib/types/conditions.d.ts +2 -1
- package/dist/lib/types/conditions.d.ts.map +1 -1
- package/dist/lib/{components/DataTable/components → utils}/bindFilters.d.ts +2 -1
- package/dist/lib/utils/bindFilters.d.ts.map +1 -0
- package/dist/lib/utils/currency.d.ts +7 -5
- package/dist/lib/utils/currency.d.ts.map +1 -1
- package/dist/lib/utils/currencyCode.d.ts +14 -0
- package/dist/lib/utils/currencyCode.d.ts.map +1 -0
- package/dist/lib/utils/format.d.ts +7 -5
- package/dist/lib/utils/format.d.ts.map +1 -1
- package/dist/lib/utils/money.d.ts +5 -4
- package/dist/lib/utils/money.d.ts.map +1 -1
- package/dist/lib/utils/store.d.ts +3 -0
- package/dist/lib/utils/store.d.ts.map +1 -0
- package/dist/lib/utils/zod.d.ts +3 -1
- package/dist/lib/utils/zod.d.ts.map +1 -1
- package/dist/numberConstraints.js +68 -0
- package/dist/numberConstraints.js.map +1 -0
- package/dist/popover.js +5 -2
- package/dist/popover.js.map +1 -1
- package/dist/react.js +45 -0
- package/dist/react.js.map +1 -0
- package/dist/ruler.js +27 -0
- package/dist/ruler.js.map +1 -0
- package/dist/select2.js +2 -2
- package/dist/select2.js.map +1 -1
- package/dist/separator2.js +1 -1
- package/dist/shadcn/shadcnBadge/Badge.d.ts +5 -2
- package/dist/shadcn/shadcnBadge/Badge.d.ts.map +1 -1
- package/dist/shadcn/shadcnChart/Chart.d.ts.map +1 -1
- package/dist/shadcn/shadcnPopover/index.d.ts +1 -1
- package/dist/shadcn/shadcnPopover/index.d.ts.map +1 -1
- package/dist/shadcn/shadcnPopover/popover.d.ts +2 -1
- package/dist/shadcn/shadcnPopover/popover.d.ts.map +1 -1
- package/dist/tooltip2.js +1 -1
- package/dist/useContextState.js +39 -6
- package/dist/useContextState.js.map +1 -1
- package/dist/useDataTable.js +148 -64
- package/dist/useDataTable.js.map +1 -1
- package/dist/useWorkspaceCurrency.js.map +1 -1
- package/dist/utils/currency.js +3 -14
- package/dist/utils/currency.js.map +1 -1
- package/dist/utils/format.js +14 -6
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/money.js +5 -3
- package/dist/utils/money.js.map +1 -1
- package/dist/utils/motion.js +2 -2
- package/dist/utils/store.js +67 -0
- package/dist/utils/store.js.map +1 -0
- package/dist/utils/zod.js +10 -7
- package/dist/utils/zod.js.map +1 -1
- package/dist/value.js +1 -1
- package/package.json +5 -1
- package/dist/Spinner2.js +0 -10
- package/dist/Spinner2.js.map +0 -1
- package/dist/index36.js +0 -199
- package/dist/index36.js.map +0 -1
- package/dist/lib/components/DataTable/components/bindFilters.d.ts.map +0 -1
package/dist/utils/motion.js
CHANGED
|
@@ -3,8 +3,8 @@ export { A as AnimatePresence, aE as AsyncMotionValueAnimation, aF as DOMKeyfram
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useState, useRef, useEffect, useContext, useMemo, useInsertionEffect, useCallback, useLayoutEffect, createContext, forwardRef } from 'react';
|
|
6
|
-
import { u as useForceUpdate, L as LayoutGroup } from '../
|
|
7
|
-
export { D as DeprecatedLayoutGroupContext, n as nodeGroup } from '../
|
|
6
|
+
import { u as useForceUpdate, L as LayoutGroup } from '../index34.js';
|
|
7
|
+
export { D as DeprecatedLayoutGroupContext, n as nodeGroup } from '../index34.js';
|
|
8
8
|
|
|
9
9
|
const wrap = (min, max, v) => {
|
|
10
10
|
const rangeSize = max - min;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
export { c as create, a as createStore, u as useStore } from '../react.js';
|
|
3
|
+
|
|
4
|
+
const isIterable = (obj) => Symbol.iterator in obj;
|
|
5
|
+
const hasIterableEntries = (value) => (
|
|
6
|
+
// HACK: avoid checking entries type
|
|
7
|
+
"entries" in value
|
|
8
|
+
);
|
|
9
|
+
const compareEntries = (valueA, valueB) => {
|
|
10
|
+
const mapA = valueA instanceof Map ? valueA : new Map(valueA.entries());
|
|
11
|
+
const mapB = valueB instanceof Map ? valueB : new Map(valueB.entries());
|
|
12
|
+
if (mapA.size !== mapB.size) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
for (const [key, value] of mapA) {
|
|
16
|
+
if (!mapB.has(key) || !Object.is(value, mapB.get(key))) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
const compareIterables = (valueA, valueB) => {
|
|
23
|
+
const iteratorA = valueA[Symbol.iterator]();
|
|
24
|
+
const iteratorB = valueB[Symbol.iterator]();
|
|
25
|
+
let nextA = iteratorA.next();
|
|
26
|
+
let nextB = iteratorB.next();
|
|
27
|
+
while (!nextA.done && !nextB.done) {
|
|
28
|
+
if (!Object.is(nextA.value, nextB.value)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
nextA = iteratorA.next();
|
|
32
|
+
nextB = iteratorB.next();
|
|
33
|
+
}
|
|
34
|
+
return !!nextA.done && !!nextB.done;
|
|
35
|
+
};
|
|
36
|
+
function shallow(valueA, valueB) {
|
|
37
|
+
if (Object.is(valueA, valueB)) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
if (typeof valueA !== "object" || valueA === null || typeof valueB !== "object" || valueB === null) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (Object.getPrototypeOf(valueA) !== Object.getPrototypeOf(valueB)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (isIterable(valueA) && isIterable(valueB)) {
|
|
47
|
+
if (hasIterableEntries(valueA) && hasIterableEntries(valueB)) {
|
|
48
|
+
return compareEntries(valueA, valueB);
|
|
49
|
+
}
|
|
50
|
+
return compareIterables(valueA, valueB);
|
|
51
|
+
}
|
|
52
|
+
return compareEntries(
|
|
53
|
+
{ entries: () => Object.entries(valueA) },
|
|
54
|
+
{ entries: () => Object.entries(valueB) }
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function useShallow(selector) {
|
|
59
|
+
const prev = React__default.useRef(void 0);
|
|
60
|
+
return (state) => {
|
|
61
|
+
const next = selector(state);
|
|
62
|
+
return shallow(prev.current, next) ? prev.current : prev.current = next;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { useShallow };
|
|
67
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sources":["../../node_modules/.pnpm/zustand@5.0.11_@types+react@19.2.14_immer@11.1.4_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla/shallow.mjs","../../node_modules/.pnpm/zustand@5.0.11_@types+react@19.2.14_immer@11.1.4_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/react/shallow.mjs"],"sourcesContent":["const isIterable = (obj) => Symbol.iterator in obj;\nconst hasIterableEntries = (value) => (\n // HACK: avoid checking entries type\n \"entries\" in value\n);\nconst compareEntries = (valueA, valueB) => {\n const mapA = valueA instanceof Map ? valueA : new Map(valueA.entries());\n const mapB = valueB instanceof Map ? valueB : new Map(valueB.entries());\n if (mapA.size !== mapB.size) {\n return false;\n }\n for (const [key, value] of mapA) {\n if (!mapB.has(key) || !Object.is(value, mapB.get(key))) {\n return false;\n }\n }\n return true;\n};\nconst compareIterables = (valueA, valueB) => {\n const iteratorA = valueA[Symbol.iterator]();\n const iteratorB = valueB[Symbol.iterator]();\n let nextA = iteratorA.next();\n let nextB = iteratorB.next();\n while (!nextA.done && !nextB.done) {\n if (!Object.is(nextA.value, nextB.value)) {\n return false;\n }\n nextA = iteratorA.next();\n nextB = iteratorB.next();\n }\n return !!nextA.done && !!nextB.done;\n};\nfunction shallow(valueA, valueB) {\n if (Object.is(valueA, valueB)) {\n return true;\n }\n if (typeof valueA !== \"object\" || valueA === null || typeof valueB !== \"object\" || valueB === null) {\n return false;\n }\n if (Object.getPrototypeOf(valueA) !== Object.getPrototypeOf(valueB)) {\n return false;\n }\n if (isIterable(valueA) && isIterable(valueB)) {\n if (hasIterableEntries(valueA) && hasIterableEntries(valueB)) {\n return compareEntries(valueA, valueB);\n }\n return compareIterables(valueA, valueB);\n }\n return compareEntries(\n { entries: () => Object.entries(valueA) },\n { entries: () => Object.entries(valueB) }\n );\n}\n\nexport { shallow };\n","import React from 'react';\nimport { shallow } from 'zustand/vanilla/shallow';\n\nfunction useShallow(selector) {\n const prev = React.useRef(void 0);\n return (state) => {\n const next = selector(state);\n return shallow(prev.current, next) ? prev.current : prev.current = next;\n };\n}\n\nexport { useShallow };\n"],"names":["React"],"mappings":"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","x_google_ignoreList":[0,1]}
|
package/dist/utils/zod.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { j as joinValues, b as stringifyPrimitive, p as parsedType, e as en, c as clone, i as isBackEdge, d as isRecursiveSchema, D as Doc, C as CONSTANT_CATCH, f as esc, g as isPlainObject, n as number$1, m as mergeValues, h as shallowClone, k as isValidBase64, l as isValidBase64URL, q as isValidJWT, r as isValidIPv6, t as isValidCIDRv6, u as isValidCreditCard, v as parseURLObject, w as urlHostnameOk, x as urlProtocolOk, y as stripTabAndNewline, z as codePointLength, A as floatSafeRemainder, $ as $ZodAsyncError, B as initializeContext, E as process, F as extractDefs, G as finalize, H as allProcessors, I as $ZodAny, J as $ZodArray, K as $ZodBase64, L as $ZodBase64URL, M as $ZodBigInt, N as $ZodBigIntFormat, O as $ZodBoolean, P as $ZodCIDRv4, Q as $ZodCIDRv6, R as $ZodCUID, S as $ZodCUID2, T as $ZodCatch, U as $ZodCheck, V as $ZodCheckBigIntFormat, W as $ZodCheckEndsWith, X as $ZodCheckGreaterThan, Y as $ZodCheckIncludes, Z as $ZodCheckLengthEquals, _ as $ZodCheckLessThan, a0 as $ZodCheckLowerCase, a1 as $ZodCheckMaxLength, a2 as $ZodCheckMaxSize, a3 as $ZodCheckMimeType, a4 as $ZodCheckMinLength, a5 as $ZodCheckMinSize, a6 as $ZodCheckMultipleOf, a7 as $ZodCheckNumberFormat, a8 as $ZodCheckOverwrite, a9 as $ZodCheckProperty, aa as $ZodCheckRegex, ab as $ZodCheckSizeEquals, ac as $ZodCheckStartsWith, ad as $ZodCheckStringFormat, ae as $ZodCheckUpperCase, af as $ZodCodec, ag as $ZodCreditCard, ah as $ZodCustom, ai as $ZodCustomStringFormat, aj as $ZodCyclicError, ak as $ZodDate, al as $ZodDefault, am as $ZodDiscriminatedUnion, an as $ZodE164, ao as $ZodEmail, ap as $ZodEmoji, aq as $ZodEncodeError, ar as $ZodEnum, as as $ZodError, at as $ZodExactOptional, au as $ZodFile, av as $ZodFunction, aw as $ZodGUID, ax as $ZodIPv4, ay as $ZodIPv6, az as $ZodISODate, aA as $ZodISODateTime, aB as $ZodISODuration, aC as $ZodISOTime, aD as $ZodIntersection, aE as $ZodJWT, aF as $ZodKSUID, aG as $ZodLazy, aH as $ZodLiteral, aI as $ZodMAC, aJ as $ZodMap, aK as $ZodNaN, aL as $ZodNanoID, aM as $ZodNever, aN as $ZodNonOptional, aO as $ZodNull, aP as $ZodNullable, aQ as $ZodNumber, aR as $ZodNumberFormat, aS as $ZodObject, aT as $ZodObjectJIT, aU as $ZodOptional, aV as $ZodPipe, aW as $ZodPrefault, aX as $ZodPreprocess, aY as $ZodPromise, aZ as $ZodReadonly, a_ as $ZodRealError, a$ as $ZodRecord, b0 as $ZodRegistry, b1 as $ZodSet, b2 as $ZodString, b3 as $ZodStringFormat, b4 as $ZodSuccess, b5 as $ZodSymbol, b6 as $ZodTemplateLiteral, b7 as $ZodTransform, b8 as $ZodTuple, b9 as $ZodType, ba as $ZodULID, bb as $ZodURL, bc as $ZodUUID, bd as $ZodUndefined, be as $ZodUnion, bf as $ZodUnknown, bg as $ZodVoid, bh as $ZodXID, bi as $ZodXor, bj as $brand, bk as $constructor, bl as $input, bm as $output, bn as NEVER, bo as TimePrecision, bp as URL_BAD_FORMAT, bq as URL_UNPARSEABLE, br as _any, bs as _array, bt as _base64, bu as _base64url, bv as _bigint, bw as _boolean, bx as _catch, by as _check, bz as _cidrv4, bA as _cidrv6, bB as _coercedBigint, bC as _coercedBoolean, bD as _coercedDate, bE as _coercedNumber, bF as _coercedString, bG as _creditCard, bH as _cuid, bI as _cuid2, bJ as _custom, bK as _date, bL as _decode, bM as _decodeAsync, bN as _default, bO as _discriminatedUnion, bP as _e164, bQ as _email, bR as _emoji, bS as _encode, bT as _encodeAsync, bU as _endsWith, bV as _enum, bW as _file, bX as _float32, bY as _float64, bZ as _gt, b_ as _gte, b$ as _guid, c0 as _includes, c1 as _int, c2 as _int32, c3 as _int64, c4 as _intersection, c5 as _ipv4, c6 as _ipv6, c7 as _isoDate, c8 as _isoDateTime, c9 as _isoDuration, ca as _isoTime, cb as _jwt, cc as _ksuid, cd as _lazy, ce as _length, cf as _literal, cg as _lowercase, ch as _lt, ci as _lte, cj as _mac, ck as _map, cl as _maxLength, cm as _maxSize, cn as _mime, co as _minLength, cp as _minSize, cq as _multipleOf, cr as _nan, cs as _nanoid, ct as _nativeEnum, cu as _negative, cv as _never, cw as _nonnegative, cx as _nonoptional, cy as _nonpositive, cz as _normalize, cA as _null, cB as _nullable, cC as _number, cD as _optional, cE as _overwrite, cF as _parse, cG as _parseAsync, cH as _pipe, cI as _positive, cJ as _promise, cK as _properties, cL as _property, cM as _readonly, cN as _record, cO as _refine, cP as _regex, cQ as _safeDecode, cR as _safeDecodeAsync, cS as _safeEncode, cT as _safeEncodeAsync, cU as _safeParse, cV as _safeParseAsync, cW as _set, cX as _size, cY as _slugify, cZ as _startsWith, c_ as _string, c$ as _stringFormat, d0 as _stringbool, d1 as _success, d2 as _superRefine, d3 as _symbol, d4 as _templateLiteral, d5 as _toLowerCase, d6 as _toUpperCase, d7 as _transform, d8 as _trim, d9 as _tuple, da as _uint32, db as _uint64, dc as _ulid, dd as _undefined, de as _union, df as _unknown, dg as _uppercase, dh as _url, di as _uuid, dj as _uuidv4, dk as _uuidv6, dl as _uuidv7, dm as _void, dn as _xid, dp as _xor, dq as config, dr as createStandardJSONSchemaMethod, ds as createToJSONSchemaMethod, dt as decode, du as decodeAsync, dv as describe, dw as encode, dx as encodeAsync, dy as flattenError, dz as formatError, dA as getDiscriminatedOption, dB as globalConfig, dC as globalRegistry, dD as handleUnrepresentable, dE as memoizer, dF as meta, dG as parse, dH as parseAsync, dI as prettifyError, dJ as regexes, dK as registry, dL as safeDecode, dM as safeDecodeAsync, dN as safeEncode, dO as safeEncodeAsync, dP as safeParse, dQ as safeParseAsync, dR as standardProps, dS as toDotPath, dT as toJSONSchema, dU as toZod, dV as treeifyError, dW as util, dX as validate, dY as validateAsync, dZ as version, d_ as ZodISODate, d$ as ZodISODateTime, e0 as ZodISODuration, e1 as ZodISOTime, e2 as _schemas, e3 as assignProp, e4 as union, e5 as optional, e6 as mergeDefs, e7 as ZodString, e8 as ZodNumber, e9 as ZodBoolean, ea as ZodBigInt, eb as ZodDate, ec as ZodAny, ed as ZodArray, ee as ZodBase64, ef as ZodBase64URL, eg as ZodBigIntFormat, eh as ZodCIDRv4, ei as ZodCIDRv6, ej as ZodCUID, ek as ZodCUID2, el as ZodCatch, em as ZodCodec, en as ZodCreditCard, eo as ZodCustom, ep as ZodCustomStringFormat, eq as ZodDefault, er as ZodDiscriminatedUnion, es as ZodE164, et as ZodEmail, eu as ZodEmoji, ev as ZodEnum, ew as ZodError, ex as ZodExactOptional, ey as ZodFile, ez as ZodFunction, eA as ZodGUID, eB as ZodIPv4, eC as ZodIPv6, eD as ZodIntersection, eE as ZodJWT, eF as ZodKSUID, eG as ZodLazy, eH as ZodLiteral, eI as ZodMAC, eJ as ZodMap, eK as ZodNaN, eL as ZodNanoID, eM as ZodNever, eN as ZodNonOptional, eO as ZodNull, eP as ZodNullable, eQ as ZodNumberFormat, eR as ZodObject, eS as ZodOptional, eT as ZodPipe, eU as ZodPrefault, eV as ZodPreprocess, eW as ZodPromise, eX as ZodReadonly, eY as ZodRealError, eZ as ZodRecord, e_ as ZodSet, e$ as ZodStringFormat, f0 as ZodSuccess, f1 as ZodSymbol, f2 as ZodTemplateLiteral, f3 as ZodTransform, f4 as ZodTuple, f5 as ZodType, f6 as ZodULID, f7 as ZodURL, f8 as ZodUUID, f9 as ZodUndefined, fa as ZodUnion, fb as ZodUnknown, fc as ZodVoid, fd as ZodXID, fe as ZodXor, ff as _ZodString, fg as _default$1, fh as _function, fi as any, fj as array, fk as base64, fl as base64url, fm as bigint$1, fn as boolean$1, fo as _catch$1, fp as check, fq as cidrv4, fr as cidrv6, fs as codec, ft as creditCard, fu as cuid, fv as cuid2, fw as custom, fx as date$2, fy as decode$1, fz as decodeAsync$1, fA as describe$1, fB as discriminatedUnion, fC as e164, fD as email, fE as emoji, fF as encode$1, fG as encodeAsync$1, fH as _enum$1, fI as exactOptional, fJ as file, fK as float32, fL as float64, fM as guid, fN as hash, fO as hex, fP as hostname, fQ as httpUrl, fR as _instanceof, fS as int, fT as int32, fU as int64, fV as intersection, fW as invertCodec, fX as ipv4, fY as ipv6, fZ as json, f_ as jwt, f$ as keyof, g0 as ksuid, g1 as lazy, g2 as literal, g3 as looseObject, g4 as looseRecord, g5 as mac, g6 as map, g7 as meta$1, g8 as nan, g9 as nanoid, ga as nativeEnum, gb as never, gc as nonoptional, gd as _null$1, ge as nullable, gf as nullish, gg as number$2, o as object, gh as parse$1, gi as parseAsync$1, gj as partialRecord, gk as pipe, gl as prefault, gm as preprocess, gn as promise, go as readonly, gp as record, gq as refine, gr as safeDecode$1, gs as safeDecodeAsync$1, gt as safeEncode$1, gu as safeEncodeAsync$1, gv as safeParse$1, gw as safeParseAsync$1, gx as set, gy as strictObject, s as string$1, gz as stringFormat, gA as stringbool, gB as success, gC as superRefine, gD as symbol, gE as templateLiteral, gF as transform, gG as tuple, gH as uint32, gI as uint64, gJ as ulid, gK as _undefined$1, gL as unknown, gM as url, gN as uuid, gO as uuidv4, gP as uuidv6, gQ as uuidv7, gR as _void$1, gS as xid, gT as xor } from '../schemas.js';
|
|
2
2
|
export { a as zodResolver } from '../schemas.js';
|
|
3
3
|
import { i as isValidPhoneNumber } from '../index2.js';
|
|
4
|
+
import { i as isCurrencyCode } from '../currencyCode.js';
|
|
4
5
|
|
|
5
6
|
const error$W = () => {
|
|
6
7
|
const Sizable = {
|
|
@@ -10602,7 +10603,7 @@ function zodNumericField(options = {}) {
|
|
|
10602
10603
|
maxMessage
|
|
10603
10604
|
} = options;
|
|
10604
10605
|
if (nullable) {
|
|
10605
|
-
|
|
10606
|
+
const field = union([number$2(), nan(), _null$1(), _undefined$1()]).transform((v) => v == null || Number.isNaN(v) ? null : v).pipe(
|
|
10606
10607
|
number$2().nullable().superRefine((v, ctx) => {
|
|
10607
10608
|
if (v === null) return;
|
|
10608
10609
|
if (integer && !Number.isInteger(v)) {
|
|
@@ -10618,11 +10619,10 @@ function zodNumericField(options = {}) {
|
|
|
10618
10619
|
}
|
|
10619
10620
|
})
|
|
10620
10621
|
);
|
|
10622
|
+
return field;
|
|
10621
10623
|
}
|
|
10622
|
-
return
|
|
10623
|
-
if (Number.
|
|
10624
|
-
ctx.addIssue({ code: "custom", message: required });
|
|
10625
|
-
} else if (integer && !Number.isInteger(v)) {
|
|
10624
|
+
return number$2({ error: required }).superRefine((v, ctx) => {
|
|
10625
|
+
if (integer && !Number.isInteger(v)) {
|
|
10626
10626
|
ctx.addIssue({ code: "custom", message: integerMessage });
|
|
10627
10627
|
} else if (nonZero && v === 0) {
|
|
10628
10628
|
ctx.addIssue({ code: "custom", message: nonZeroMessage });
|
|
@@ -10635,6 +10635,9 @@ function zodNumericField(options = {}) {
|
|
|
10635
10635
|
}
|
|
10636
10636
|
});
|
|
10637
10637
|
}
|
|
10638
|
+
function zodCurrencyCode(message = "Currency is required") {
|
|
10639
|
+
return custom((value) => isCurrencyCode(value), { message });
|
|
10640
|
+
}
|
|
10638
10641
|
function zodCurrencyField(options = {}) {
|
|
10639
10642
|
const {
|
|
10640
10643
|
required = "Required",
|
|
@@ -10642,7 +10645,7 @@ function zodCurrencyField(options = {}) {
|
|
|
10642
10645
|
positive = true,
|
|
10643
10646
|
positiveMessage = "Must be greater than 0"
|
|
10644
10647
|
} = options;
|
|
10645
|
-
return union([object({ currency:
|
|
10648
|
+
return union([object({ currency: zodCurrencyCode(), value: string$1() }), _undefined$1()]).superRefine((v, ctx) => {
|
|
10646
10649
|
if (!v?.value) {
|
|
10647
10650
|
if (!optional) ctx.addIssue({ code: "custom", message: required });
|
|
10648
10651
|
} else if (positive && Number(v.value) <= 0) {
|
|
@@ -10692,5 +10695,5 @@ function zodFileField(options = {}) {
|
|
|
10692
10695
|
return optional ? schema.optional() : schema;
|
|
10693
10696
|
}
|
|
10694
10697
|
|
|
10695
|
-
export { $brand, $input, $output, CODE_PATTERN, DOTTED_CODE_PATTERN, NEVER, TimePrecision, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCompileAsyncError, ZodCompileUnsupportedError, ZodCreditCard, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodError, ZodExactOptional, ZodFile, ZodFirstPartyTypeKind, ZodFunction, ZodGUID, ZodIPv4, ZodIPv6, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, ZodIntersection, ZodIssueCode, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMAC, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPreprocess, ZodPromise, ZodReadonly, ZodRealError, ZodRecord, ZodSet, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodType, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, ZodXor, _ZodString, _default$1 as _default, _function, any, array, base64, base64url, bigint$1 as bigint, boolean$1 as boolean, _catch$1 as catch, check, cidrv4, cidrv6, clone, codec, coerce, compile, config, index as core, creditCard, cuid, cuid2, custom, date$2 as date, decode$1 as decode, decodeAsync$1 as decodeAsync, deepPartial, describe$1 as describe, discriminatedUnion, e164, email, emoji, encode$1 as encode, encodeAsync$1 as encodeAsync, _endsWith as endsWith, _enum$1 as enum, exactOptional, file, flattenError, float32, float64, formatError, fromJSONSchema, _function as function, getDiscriminatedOption, getErrorMap, globalRegistry, _gt as gt, _gte as gte, guid, hash, hex, hostname, httpUrl, _includes as includes, input, _instanceof as instanceof, int, int32, int64, intersection, invertCodec, ipv4, ipv6, _iso as iso, json, jwt, keyof, ksuid, lazy, _length as length, literal, index$1 as locales, looseObject, looseRecord, _lowercase as lowercase, _lt as lt, _lte as lte, mac, map, _maxLength as maxLength, _maxSize as maxSize, memoizer, meta$1 as meta, _mime as mime, _minLength as minLength, _minSize as minSize, _multipleOf as multipleOf, nan, nanoid, nativeEnum, _negative as negative, never, _nonnegative as nonnegative, nonoptional, _nonpositive as nonpositive, _normalize as normalize, _null$1 as null, nullable, nullish, number$2 as number, object, optional, output, _overwrite as overwrite, parse$1 as parse, parseAsync$1 as parseAsync, partialRecord, pipe, _positive as positive, prefault, preprocess, prettifyError, promise, _properties as properties, _property as property, readonly, record, refine, _regex as regex, regexes, registry, safeDecode$1 as safeDecode, safeDecodeAsync$1 as safeDecodeAsync, safeEncode$1 as safeEncode, safeEncodeAsync$1 as safeEncodeAsync, safeParse$1 as safeParse, safeParseAsync$1 as safeParseAsync, set, setErrorMap, _size as size, _slugify as slugify, _startsWith as startsWith, strictObject, string$1 as string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, toJSONSchema, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, toZod, transform, treeifyError, _trim as trim, tuple, uint32, uint64, ulid, _undefined$1 as undefined, union, unknown, _uppercase as uppercase, url, util, uuid, uuidv4, uuidv6, uuidv7, validate, validateAsync, _void$1 as void, xid, xor, external as z, zodCodeArrayField, zodCodeField, zodCurrencyField, zodFileField, zodNumericField, zodPhoneField };
|
|
10698
|
+
export { $brand, $input, $output, CODE_PATTERN, DOTTED_CODE_PATTERN, NEVER, TimePrecision, ZodAny, ZodArray, ZodBase64, ZodBase64URL, ZodBigInt, ZodBigIntFormat, ZodBoolean, ZodCIDRv4, ZodCIDRv6, ZodCUID, ZodCUID2, ZodCatch, ZodCodec, ZodCompileAsyncError, ZodCompileUnsupportedError, ZodCreditCard, ZodCustom, ZodCustomStringFormat, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodE164, ZodEmail, ZodEmoji, ZodEnum, ZodError, ZodExactOptional, ZodFile, ZodFirstPartyTypeKind, ZodFunction, ZodGUID, ZodIPv4, ZodIPv6, ZodISODate, ZodISODateTime, ZodISODuration, ZodISOTime, ZodIntersection, ZodIssueCode, ZodJWT, ZodKSUID, ZodLazy, ZodLiteral, ZodMAC, ZodMap, ZodNaN, ZodNanoID, ZodNever, ZodNonOptional, ZodNull, ZodNullable, ZodNumber, ZodNumberFormat, ZodObject, ZodOptional, ZodPipe, ZodPrefault, ZodPreprocess, ZodPromise, ZodReadonly, ZodRealError, ZodRecord, ZodSet, ZodString, ZodStringFormat, ZodSuccess, ZodSymbol, ZodTemplateLiteral, ZodTransform, ZodTuple, ZodType, ZodULID, ZodURL, ZodUUID, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, ZodXID, ZodXor, _ZodString, _default$1 as _default, _function, any, array, base64, base64url, bigint$1 as bigint, boolean$1 as boolean, _catch$1 as catch, check, cidrv4, cidrv6, clone, codec, coerce, compile, config, index as core, creditCard, cuid, cuid2, custom, date$2 as date, decode$1 as decode, decodeAsync$1 as decodeAsync, deepPartial, describe$1 as describe, discriminatedUnion, e164, email, emoji, encode$1 as encode, encodeAsync$1 as encodeAsync, _endsWith as endsWith, _enum$1 as enum, exactOptional, file, flattenError, float32, float64, formatError, fromJSONSchema, _function as function, getDiscriminatedOption, getErrorMap, globalRegistry, _gt as gt, _gte as gte, guid, hash, hex, hostname, httpUrl, _includes as includes, input, _instanceof as instanceof, int, int32, int64, intersection, invertCodec, ipv4, ipv6, _iso as iso, json, jwt, keyof, ksuid, lazy, _length as length, literal, index$1 as locales, looseObject, looseRecord, _lowercase as lowercase, _lt as lt, _lte as lte, mac, map, _maxLength as maxLength, _maxSize as maxSize, memoizer, meta$1 as meta, _mime as mime, _minLength as minLength, _minSize as minSize, _multipleOf as multipleOf, nan, nanoid, nativeEnum, _negative as negative, never, _nonnegative as nonnegative, nonoptional, _nonpositive as nonpositive, _normalize as normalize, _null$1 as null, nullable, nullish, number$2 as number, object, optional, output, _overwrite as overwrite, parse$1 as parse, parseAsync$1 as parseAsync, partialRecord, pipe, _positive as positive, prefault, preprocess, prettifyError, promise, _properties as properties, _property as property, readonly, record, refine, _regex as regex, regexes, registry, safeDecode$1 as safeDecode, safeDecodeAsync$1 as safeDecodeAsync, safeEncode$1 as safeEncode, safeEncodeAsync$1 as safeEncodeAsync, safeParse$1 as safeParse, safeParseAsync$1 as safeParseAsync, set, setErrorMap, _size as size, _slugify as slugify, _startsWith as startsWith, strictObject, string$1 as string, stringFormat, stringbool, success, superRefine, symbol, templateLiteral, toJSONSchema, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, toZod, transform, treeifyError, _trim as trim, tuple, uint32, uint64, ulid, _undefined$1 as undefined, union, unknown, _uppercase as uppercase, url, util, uuid, uuidv4, uuidv6, uuidv7, validate, validateAsync, _void$1 as void, xid, xor, external as z, zodCodeArrayField, zodCodeField, zodCurrencyCode, zodCurrencyField, zodFileField, zodNumericField, zodPhoneField };
|
|
10696
10699
|
//# sourceMappingURL=zod.js.map
|