@mercurjs/dashboard-shared 2.3.5 → 2.3.6-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -56
- package/dist/index.js +1405 -1396
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -181,52 +181,14 @@ declare const AddressSchema: z.ZodObject<{
|
|
|
181
181
|
province: z.ZodOptional<z.ZodString>;
|
|
182
182
|
country_code: z.ZodString;
|
|
183
183
|
phone: z.ZodOptional<z.ZodString>;
|
|
184
|
-
},
|
|
185
|
-
first_name: string;
|
|
186
|
-
last_name: string;
|
|
187
|
-
address_1: string;
|
|
188
|
-
city: string;
|
|
189
|
-
postal_code: string;
|
|
190
|
-
country_code: string;
|
|
191
|
-
address_2?: string | undefined;
|
|
192
|
-
province?: string | undefined;
|
|
193
|
-
company?: string | undefined;
|
|
194
|
-
phone?: string | undefined;
|
|
195
|
-
}, {
|
|
196
|
-
first_name: string;
|
|
197
|
-
last_name: string;
|
|
198
|
-
address_1: string;
|
|
199
|
-
city: string;
|
|
200
|
-
postal_code: string;
|
|
201
|
-
country_code: string;
|
|
202
|
-
address_2?: string | undefined;
|
|
203
|
-
province?: string | undefined;
|
|
204
|
-
company?: string | undefined;
|
|
205
|
-
phone?: string | undefined;
|
|
206
|
-
}>;
|
|
184
|
+
}, z.core.$strip>;
|
|
207
185
|
declare const EmailSchema: z.ZodObject<{
|
|
208
186
|
email: z.ZodString;
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
}, {
|
|
212
|
-
email: string;
|
|
213
|
-
}>;
|
|
214
|
-
declare const TransferOwnershipSchema: z.ZodEffects<z.ZodObject<{
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
declare const TransferOwnershipSchema: z.ZodObject<{
|
|
215
189
|
current_owner_id: z.ZodString;
|
|
216
190
|
new_owner_id: z.ZodString;
|
|
217
|
-
},
|
|
218
|
-
current_owner_id: string;
|
|
219
|
-
new_owner_id: string;
|
|
220
|
-
}, {
|
|
221
|
-
current_owner_id: string;
|
|
222
|
-
new_owner_id: string;
|
|
223
|
-
}>, {
|
|
224
|
-
current_owner_id: string;
|
|
225
|
-
new_owner_id: string;
|
|
226
|
-
}, {
|
|
227
|
-
current_owner_id: string;
|
|
228
|
-
new_owner_id: string;
|
|
229
|
-
}>;
|
|
191
|
+
}, z.core.$strip>;
|
|
230
192
|
|
|
231
193
|
type Action = {
|
|
232
194
|
icon: ReactNode;
|
|
@@ -414,7 +376,7 @@ interface FileUploadProps {
|
|
|
414
376
|
}
|
|
415
377
|
declare const FileUpload: ({ label, hint, multiple, hasError, formats, onUploaded, uploadedImage, }: FileUploadProps) => react_jsx_runtime.JSX.Element;
|
|
416
378
|
|
|
417
|
-
declare const Form: (<TFieldValues extends FieldValues, TContext = any, TTransformedValues
|
|
379
|
+
declare const Form: (<TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React__default.JSX.Element) & {
|
|
418
380
|
Item: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLDivElement> & React__default.RefAttributes<HTMLDivElement>>;
|
|
419
381
|
Label: React__default.ForwardRefExoticComponent<Omit<Label.LabelProps & React__default.RefAttributes<HTMLLabelElement>, "ref"> & {
|
|
420
382
|
optional?: boolean;
|
|
@@ -1058,7 +1020,7 @@ type InputProps = ComponentProps<typeof Input>;
|
|
|
1058
1020
|
declare const DeprecatedPercentageInput: ForwardRefExoticComponent<InputProps>;
|
|
1059
1021
|
declare const PercentageInput: ForwardRefExoticComponent<Omit<Pick<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
1060
1022
|
ref?: React$1.RefObject<HTMLInputElement> | ((instance: HTMLInputElement | null) => void | React$1.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React$1.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
|
1061
|
-
}, "list" | "title" | "name" | "is" | "style" | "type" | "
|
|
1023
|
+
}, "list" | "title" | "name" | "is" | "style" | "type" | "pattern" | "key" | "ref" | "content" | "onClick" | "form" | "slot" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "exportparts" | "part" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "size" | "autoComplete" | "minLength" | "readOnly" | "required" | "multiple" | "accept" | "src" | "alt" | "height" | "max" | "min" | "width" | "capture" | "checked"> & {
|
|
1062
1024
|
allowDecimals?: boolean;
|
|
1063
1025
|
allowNegativeValue?: boolean;
|
|
1064
1026
|
id?: string;
|
|
@@ -1918,17 +1880,11 @@ declare function createFormHelper<TData>(): {
|
|
|
1918
1880
|
number: () => z.ZodNumber;
|
|
1919
1881
|
boolean: () => z.ZodBoolean;
|
|
1920
1882
|
date: () => z.ZodDate;
|
|
1921
|
-
array:
|
|
1922
|
-
object:
|
|
1883
|
+
array: typeof z.array;
|
|
1884
|
+
object: typeof z.object;
|
|
1923
1885
|
null: () => z.ZodNull;
|
|
1924
|
-
nullable:
|
|
1925
|
-
coerce:
|
|
1926
|
-
string: (typeof z.ZodString)["create"];
|
|
1927
|
-
number: (typeof z.ZodNumber)["create"];
|
|
1928
|
-
boolean: (typeof z.ZodBoolean)["create"];
|
|
1929
|
-
bigint: (typeof z.ZodBigInt)["create"];
|
|
1930
|
-
date: (typeof z.ZodDate)["create"];
|
|
1931
|
-
};
|
|
1886
|
+
nullable: typeof z.nullable;
|
|
1887
|
+
coerce: typeof z.coerce;
|
|
1932
1888
|
};
|
|
1933
1889
|
/**
|
|
1934
1890
|
* Build the `additional_data` zod object for a model's custom fields, to merge
|
|
@@ -1942,7 +1898,7 @@ declare function buildAdditionalDataDefaults(registry: ExtensionRegistry, model:
|
|
|
1942
1898
|
type WithAdditionalData<T> = T & {
|
|
1943
1899
|
additional_data?: Record<string, unknown>;
|
|
1944
1900
|
};
|
|
1945
|
-
interface UseExtendableFormProps<TSchema extends ZodObject<Record<string, z.ZodTypeAny>>, TContext = unknown, TData = unknown
|
|
1901
|
+
interface UseExtendableFormProps<TSchema extends ZodObject<Record<string, z.ZodTypeAny>>, TContext = unknown, TData = unknown, TTransformedValues extends FieldValues = WithAdditionalData<z.infer<TSchema>>> extends Omit<UseFormProps<WithAdditionalData<z.infer<TSchema>>, TContext, TTransformedValues>, "resolver" | "defaultValues"> {
|
|
1946
1902
|
/** Base schema for the built-in fields. */
|
|
1947
1903
|
schema: TSchema;
|
|
1948
1904
|
/** Base default values for the built-in fields. */
|
|
@@ -1967,7 +1923,7 @@ interface UseExtendableFormProps<TSchema extends ZodObject<Record<string, z.ZodT
|
|
|
1967
1923
|
* built-in validators never see them; the extension registry provides the
|
|
1968
1924
|
* per-field zod validation and default values.
|
|
1969
1925
|
*/
|
|
1970
|
-
declare const useExtendableForm: <TSchema extends ZodObject<Record<string, z.ZodTypeAny>>, TContext = unknown, TTransformedValues extends FieldValues
|
|
1926
|
+
declare const useExtendableForm: <TSchema extends ZodObject<Record<string, z.ZodTypeAny>>, TContext = unknown, TTransformedValues extends FieldValues = WithAdditionalData<z.infer<TSchema>>>({ schema: baseSchema, defaultValues: baseDefaultValues, model, data, zone, tab, ...props }: UseExtendableFormProps<TSchema, TContext, unknown, TTransformedValues>) => react_hook_form.UseFormReturn<WithAdditionalData<z.core.output<TSchema>>, TContext, TTransformedValues>;
|
|
1971
1927
|
|
|
1972
1928
|
/** Returns a lookup for the lock reason plugins declare on an entity's action. */
|
|
1973
1929
|
declare const useActionLocks: (model: string, entity: unknown) => (action: string) => string | undefined;
|