@trsys-tech/matrix-library 0.5.0-beta.1 → 0.5.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/accordion.es.js.map +1 -1
- package/dist/avatar.es.js.map +1 -1
- package/dist/badge.es.js.map +1 -1
- package/dist/breadcrumb.es.js +4 -4
- package/dist/breadcrumb.es.js.map +1 -1
- package/dist/buildformatlongfn.es.js.map +1 -1
- package/dist/buildlocalizefn.es.js.map +1 -1
- package/dist/buildmatchfn.es.js.map +1 -1
- package/dist/buildmatchpatternfn.es.js.map +1 -1
- package/dist/button.es.js +3 -3
- package/dist/button.es.js.map +1 -1
- package/dist/calendar.es.js +3 -3
- package/dist/calendar.es.js.map +1 -1
- package/dist/card.es.js.map +1 -1
- package/dist/checkbox.es.js.map +1 -1
- package/dist/chip.es.js.map +1 -1
- package/dist/collapsible.es.js.map +1 -1
- package/dist/combobox.es.js +3 -3
- package/dist/combobox.es.js.map +1 -1
- package/dist/command.es.js.map +1 -1
- package/dist/components/command/Command.d.ts.map +1 -1
- package/dist/components/data-grid/DataGrid.d.ts +4 -2
- package/dist/components/data-grid/DataGrid.d.ts.map +1 -1
- package/dist/components/form/Form.d.ts +1 -1
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/confirm.es.js.map +1 -1
- package/dist/contextmenu.es.js +4 -4
- package/dist/contextmenu.es.js.map +1 -1
- package/dist/dangercircleicon.es.js.map +1 -1
- package/dist/datagrid.es.js +106 -108
- package/dist/datagrid.es.js.map +1 -1
- package/dist/datepicker.es.js.map +1 -1
- package/dist/daterangepicker.es.js.map +1 -1
- package/dist/defaultoptions.es.js.map +1 -1
- package/dist/desktopdatepicker.es.js.map +1 -1
- package/dist/desktopdaterangepicker.es.js.map +1 -1
- package/dist/desktoptimepicker.es.js.map +1 -1
- package/dist/dialog.es.js.map +1 -1
- package/dist/differenceincalendardays.es.js.map +1 -1
- package/dist/drawer.es.js.map +1 -1
- package/dist/en-us.es.js.map +1 -1
- package/dist/form.es.js.map +1 -1
- package/dist/format.es.js.map +1 -1
- package/dist/formatdistance.es.js.map +1 -1
- package/dist/formatters.es.js +68 -2
- package/dist/formatters.es.js.map +1 -1
- package/dist/formcheckbox.es.js.map +1 -1
- package/dist/formcombobox.es.js.map +1 -1
- package/dist/formdatepicker.es.js.map +1 -1
- package/dist/formdaterangepicker.es.js.map +1 -1
- package/dist/forminput.es.js.map +1 -1
- package/dist/formmultiselect.es.js.map +1 -1
- package/dist/formrating.es.js.map +1 -1
- package/dist/formselect.es.js.map +1 -1
- package/dist/formswitch.es.js.map +1 -1
- package/dist/formtextarea.es.js.map +1 -1
- package/dist/formtimepicker.es.js.map +1 -1
- package/dist/getisoweekyear.es.js.map +1 -1
- package/dist/gettimezoneoffsetinmilliseconds.es.js.map +1 -1
- package/dist/getweekyear.es.js.map +1 -1
- package/dist/iconbutton.es.js +3 -3
- package/dist/iconbutton.es.js.map +1 -1
- package/dist/infocircleicon.es.js.map +1 -1
- package/dist/label.es.js.map +1 -1
- package/dist/lightformatters.es.js.map +1 -1
- package/dist/localize.es.js.map +1 -1
- package/dist/longformatters.es.js.map +1 -1
- package/dist/match.es.js.map +1 -1
- package/dist/matrix-library.css +1 -0
- package/dist/mobiledatepicker.es.js.map +1 -1
- package/dist/mobiledaterangepicker.es.js.map +1 -1
- package/dist/mobiletimepicker.es.js.map +1 -1
- package/dist/modal.es.js.map +1 -1
- package/dist/multiselect.es.js +3 -3
- package/dist/multiselect.es.js.map +1 -1
- package/dist/normalizedates.es.js.map +1 -1
- package/dist/popover.es.js.map +1 -1
- package/dist/printhtml.es.js.map +1 -1
- package/dist/progress.es.js.map +1 -1
- package/dist/protectedtokens.es.js.map +1 -1
- package/dist/radiogroup.es.js.map +1 -1
- package/dist/rating.es.js.map +1 -1
- package/dist/select.es.js +3 -3
- package/dist/select.es.js.map +1 -1
- package/dist/sheet.es.js.map +1 -1
- package/dist/sidebar.es.js +6 -6
- package/dist/sidebar.es.js.map +1 -1
- package/dist/skeleton.es.js.map +1 -1
- package/dist/startofweek.es.js.map +1 -1
- package/dist/startofweekyear.es.js.map +1 -1
- package/dist/successcircleicon.es.js.map +1 -1
- package/dist/swipabledrawer.es.js.map +1 -1
- package/dist/switch.es.js.map +1 -1
- package/dist/tabs.es.js.map +1 -1
- package/dist/textarea.es.js.map +1 -1
- package/dist/textfield.es.js.map +1 -1
- package/dist/timepicker.es.js.map +1 -1
- package/dist/timepickercontent.es.js.map +1 -1
- package/dist/toast-components.es.js.map +1 -1
- package/dist/toast.es.js.map +1 -1
- package/dist/tooltip.es.js +2 -2
- package/dist/tooltip.es.js.map +1 -1
- package/dist/use-mobile.es.js.map +1 -1
- package/dist/use-toast.es.js.map +1 -1
- package/dist/utils.es.js.map +1 -1
- package/dist/warningcircleicon.es.js.map +1 -1
- package/package.json +9 -9
- package/dist/style.css +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControllerProps, FieldPath, FieldValues, FormProviderProps } from 'react-hook-form';
|
|
2
2
|
import { SlotProps } from '@radix-ui/react-slot';
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
5
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
declare const FormLabel: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,eAAe,EAAE,SAAS,EAAE,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAKpH,QAAA,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,eAAe,EAAE,SAAS,EAAE,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAKpH,QAAA,MAAM,IAAI,iMA6DiH,GAAG,CAAC,OAAO,AA7D7G,CAAC;AAQ1B,QAAA,MAAM,SAAS,GAAI,YAAY,SAAS,WAAW,gBAAgB,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,0CAErG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAC;AA+BF,QAAA,MAAM,QAAQ,6GAQZ,CAAC;AAGH,QAAA,MAAM,SAAS,8KAIb,CAAC;AAGH,QAAA,MAAM,WAAW,8JAaf,CAAC;AAGH,QAAA,MAAM,eAAe,yHAInB,CAAC;AAGH,QAAA,MAAM,WAAW,yHAaf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/confirm.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.es.js","sources":["../src/components/confirm/Confirm.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { useCallback, useEffect } from \"react\";\r\nimport { Modal, ModalFooter } from \"../modal/Modal\";\r\nimport { Button } from \"../button/Button\";\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nlet confirmId = 0;\r\n\r\ntype ConfirmOptions = {\r\n title: string;\r\n description: string;\r\n confirmationText?: string;\r\n cancelationText?: string;\r\n modalProps?: React.ComponentProps<typeof Modal>;\r\n hideCancelButton?: boolean;\r\n buttonOrder?: (\"confirm\" | \"cancel\")[];\r\n confirmButtonProps?: React.ComponentProps<typeof Button>;\r\n cancelButtonProps?: React.ComponentProps<typeof Button>;\r\n descriptionProps?: React.ComponentProps<\"p\">;\r\n};\r\ntype ConfirmState = { resolve: (value: unknown) => void; reject: (reason?: any) => void; parentId: ParentId } | null;\r\ntype ParentId = string;\r\n\r\ntype ConfirmContext = {\r\n confirmBase: (parentId: ParentId, options: ConfirmOptions) => Promise<unknown>;\r\n closeOnParentUnmount: (parentId: ParentId) => void;\r\n} | null;\r\nconst ConfirmContext = React.createContext<ConfirmContext>(null);\r\n\r\n/**\r\n * ConfirmProvider\r\n */\r\ntype ConfirmProviderProps = {\r\n children: React.ReactNode;\r\n};\r\nconst ConfirmProvider: React.FC<ConfirmProviderProps> = ({ children }) => {\r\n const [state, setState] = React.useState<ConfirmState>(null);\r\n const [options, setOptions] = React.useState<ConfirmOptions>({\r\n buttonOrder: [\"cancel\", \"confirm\"],\r\n description: \"\",\r\n title: \"Are you sure?\",\r\n });\r\n const [key, setKey] = React.useState(0);\r\n\r\n const confirmBase = useCallback((parentId: ParentId, options: ConfirmOptions) => {\r\n return new Promise((resolve, reject) => {\r\n setKey(key => key + 1);\r\n setOptions(options);\r\n setState({ resolve, reject, parentId });\r\n });\r\n }, []);\r\n\r\n const closeOnParentUnmount = useCallback((parentId: ParentId) => {\r\n setState(state => {\r\n if (state?.parentId === parentId) {\r\n return null;\r\n } else {\r\n return state;\r\n }\r\n });\r\n }, []);\r\n\r\n const handleClose = useCallback(() => {\r\n setState(state => {\r\n state?.reject();\r\n return null;\r\n });\r\n }, []);\r\n\r\n const handleConfirm = useCallback(() => {\r\n setState(state => {\r\n state?.resolve(null);\r\n return null;\r\n });\r\n }, []);\r\n\r\n return (\r\n <ConfirmContext.Provider value={{ confirmBase, closeOnParentUnmount }}>\r\n {children}\r\n <ConfirmModal key={key} open={state !== null} options={options} onCancel={handleClose} onConfirm={handleConfirm} />\r\n </ConfirmContext.Provider>\r\n );\r\n};\r\n\r\nconst useConfirmId = () => {\r\n const id = React.useMemo(() => {\r\n return confirmId++;\r\n }, []);\r\n\r\n return `confirm-${id}`;\r\n};\r\n\r\nconst useConfirm = () => {\r\n const parentId = useConfirmId();\r\n const context = React.useContext(ConfirmContext);\r\n if (!context) {\r\n throw new Error(\"useConfirm must be used within a ConfirmProvider\");\r\n }\r\n\r\n const { confirmBase, closeOnParentUnmount } = context;\r\n\r\n const confirm = useCallback(\r\n (options: ConfirmOptions) => {\r\n return confirmBase(parentId, options);\r\n },\r\n [parentId, confirmBase],\r\n );\r\n\r\n useEffect(() => {\r\n return () => {\r\n closeOnParentUnmount(parentId);\r\n };\r\n }, [parentId, closeOnParentUnmount]);\r\n\r\n return confirm;\r\n};\r\n\r\ntype ConfirmModalProps = {\r\n open: boolean;\r\n onCancel?: () => void;\r\n onConfirm: () => void;\r\n options: ConfirmOptions;\r\n};\r\n\r\nconst ConfirmModal: React.FC<ConfirmModalProps> = ({ onConfirm, open, options, onCancel }) => {\r\n const {\r\n buttonOrder = [\"cancel\", \"confirm\"],\r\n description,\r\n title,\r\n cancelationText,\r\n confirmationText,\r\n hideCancelButton,\r\n modalProps,\r\n cancelButtonProps,\r\n confirmButtonProps,\r\n descriptionProps,\r\n } = options;\r\n\r\n const actions = React.useMemo(\r\n () =>\r\n buttonOrder.map(action => {\r\n const { className: confirmClassName, ...restConfirmButtonProps } = confirmButtonProps ?? {};\r\n const { className: cancelClassName, ...restCancelButtonProps } = cancelButtonProps ?? {};\r\n if (action === \"confirm\") {\r\n return (\r\n <Button key=\"confirm-button\" onClick={onConfirm} variant=\"primary\" className={cn(\"w-28\", confirmClassName)} {...restConfirmButtonProps}>\r\n {confirmationText || \"Confirm\"}\r\n </Button>\r\n );\r\n }\r\n if (action === \"cancel\" && !hideCancelButton) {\r\n return (\r\n <Button key=\"cancel-button\" onClick={onCancel} variant=\"text\" className={cn(\"w-28\", cancelClassName)} {...restCancelButtonProps}>\r\n {cancelationText || \"Cancel\"}\r\n </Button>\r\n );\r\n }\r\n }),\r\n [hideCancelButton, buttonOrder, confirmationText, cancelationText, confirmButtonProps, cancelButtonProps, onConfirm, onCancel],\r\n );\r\n\r\n return (\r\n <Modal open={open} onOpenChange={onCancel} title={title} role=\"alertdialog\" {...modalProps}>\r\n <p {...descriptionProps}>{description}</p>\r\n <ModalFooter>{actions}</ModalFooter>\r\n </Modal>\r\n );\r\n};\r\n\r\nexport { ConfirmProvider, useConfirm };\r\n"],"names":["confirmId","ConfirmContext","React","ConfirmProvider","children","state","setState","options","setOptions","key","setKey","confirmBase","useCallback","parentId","resolve","reject","closeOnParentUnmount","handleClose","handleConfirm","jsxs","jsx","ConfirmModal","useConfirmId","useConfirm","context","confirm","useEffect","onConfirm","open","onCancel","buttonOrder","description","title","cancelationText","confirmationText","hideCancelButton","modalProps","cancelButtonProps","confirmButtonProps","descriptionProps","actions","action","confirmClassName","restConfirmButtonProps","cancelClassName","restCancelButtonProps","Button","cn","Modal","ModalFooter"],"mappings":";;;;;AAOA,IAAIA,IAAY;AAqBhB,MAAMC,IAAiBC,EAAM,cAA8B,IAAI,GAQzDC,IAAkD,CAAC,EAAE,UAAAC,QAAe;AACxE,QAAM,CAACC,GAAOC,CAAQ,IAAIJ,EAAM,SAAuB,IAAI,GACrD,CAACK,GAASC,CAAU,IAAIN,EAAM,SAAyB;AAAA,IAC3D,aAAa,CAAC,UAAU,SAAS;AAAA,IACjC,aAAa;AAAA,IACb,OAAO;AAAA,EAAA,CACR,GACK,CAACO,GAAKC,CAAM,IAAIR,EAAM,SAAS,CAAC,GAEhCS,IAAcC,EAAY,CAACC,GAAoBN,MAC5C,IAAI,QAAQ,CAACO,GAASC,MAAW;
|
|
1
|
+
{"version":3,"file":"confirm.es.js","sources":["../src/components/confirm/Confirm.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { useCallback, useEffect } from \"react\";\r\nimport { Modal, ModalFooter } from \"../modal/Modal\";\r\nimport { Button } from \"../button/Button\";\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nlet confirmId = 0;\r\n\r\ntype ConfirmOptions = {\r\n title: string;\r\n description: string;\r\n confirmationText?: string;\r\n cancelationText?: string;\r\n modalProps?: React.ComponentProps<typeof Modal>;\r\n hideCancelButton?: boolean;\r\n buttonOrder?: (\"confirm\" | \"cancel\")[];\r\n confirmButtonProps?: React.ComponentProps<typeof Button>;\r\n cancelButtonProps?: React.ComponentProps<typeof Button>;\r\n descriptionProps?: React.ComponentProps<\"p\">;\r\n};\r\ntype ConfirmState = { resolve: (value: unknown) => void; reject: (reason?: any) => void; parentId: ParentId } | null;\r\ntype ParentId = string;\r\n\r\ntype ConfirmContext = {\r\n confirmBase: (parentId: ParentId, options: ConfirmOptions) => Promise<unknown>;\r\n closeOnParentUnmount: (parentId: ParentId) => void;\r\n} | null;\r\nconst ConfirmContext = React.createContext<ConfirmContext>(null);\r\n\r\n/**\r\n * ConfirmProvider\r\n */\r\ntype ConfirmProviderProps = {\r\n children: React.ReactNode;\r\n};\r\nconst ConfirmProvider: React.FC<ConfirmProviderProps> = ({ children }) => {\r\n const [state, setState] = React.useState<ConfirmState>(null);\r\n const [options, setOptions] = React.useState<ConfirmOptions>({\r\n buttonOrder: [\"cancel\", \"confirm\"],\r\n description: \"\",\r\n title: \"Are you sure?\",\r\n });\r\n const [key, setKey] = React.useState(0);\r\n\r\n const confirmBase = useCallback((parentId: ParentId, options: ConfirmOptions) => {\r\n return new Promise((resolve, reject) => {\r\n setKey(key => key + 1);\r\n setOptions(options);\r\n setState({ resolve, reject, parentId });\r\n });\r\n }, []);\r\n\r\n const closeOnParentUnmount = useCallback((parentId: ParentId) => {\r\n setState(state => {\r\n if (state?.parentId === parentId) {\r\n return null;\r\n } else {\r\n return state;\r\n }\r\n });\r\n }, []);\r\n\r\n const handleClose = useCallback(() => {\r\n setState(state => {\r\n state?.reject();\r\n return null;\r\n });\r\n }, []);\r\n\r\n const handleConfirm = useCallback(() => {\r\n setState(state => {\r\n state?.resolve(null);\r\n return null;\r\n });\r\n }, []);\r\n\r\n return (\r\n <ConfirmContext.Provider value={{ confirmBase, closeOnParentUnmount }}>\r\n {children}\r\n <ConfirmModal key={key} open={state !== null} options={options} onCancel={handleClose} onConfirm={handleConfirm} />\r\n </ConfirmContext.Provider>\r\n );\r\n};\r\n\r\nconst useConfirmId = () => {\r\n const id = React.useMemo(() => {\r\n return confirmId++;\r\n }, []);\r\n\r\n return `confirm-${id}`;\r\n};\r\n\r\nconst useConfirm = () => {\r\n const parentId = useConfirmId();\r\n const context = React.useContext(ConfirmContext);\r\n if (!context) {\r\n throw new Error(\"useConfirm must be used within a ConfirmProvider\");\r\n }\r\n\r\n const { confirmBase, closeOnParentUnmount } = context;\r\n\r\n const confirm = useCallback(\r\n (options: ConfirmOptions) => {\r\n return confirmBase(parentId, options);\r\n },\r\n [parentId, confirmBase],\r\n );\r\n\r\n useEffect(() => {\r\n return () => {\r\n closeOnParentUnmount(parentId);\r\n };\r\n }, [parentId, closeOnParentUnmount]);\r\n\r\n return confirm;\r\n};\r\n\r\ntype ConfirmModalProps = {\r\n open: boolean;\r\n onCancel?: () => void;\r\n onConfirm: () => void;\r\n options: ConfirmOptions;\r\n};\r\n\r\nconst ConfirmModal: React.FC<ConfirmModalProps> = ({ onConfirm, open, options, onCancel }) => {\r\n const {\r\n buttonOrder = [\"cancel\", \"confirm\"],\r\n description,\r\n title,\r\n cancelationText,\r\n confirmationText,\r\n hideCancelButton,\r\n modalProps,\r\n cancelButtonProps,\r\n confirmButtonProps,\r\n descriptionProps,\r\n } = options;\r\n\r\n const actions = React.useMemo(\r\n () =>\r\n buttonOrder.map(action => {\r\n const { className: confirmClassName, ...restConfirmButtonProps } = confirmButtonProps ?? {};\r\n const { className: cancelClassName, ...restCancelButtonProps } = cancelButtonProps ?? {};\r\n if (action === \"confirm\") {\r\n return (\r\n <Button key=\"confirm-button\" onClick={onConfirm} variant=\"primary\" className={cn(\"w-28\", confirmClassName)} {...restConfirmButtonProps}>\r\n {confirmationText || \"Confirm\"}\r\n </Button>\r\n );\r\n }\r\n if (action === \"cancel\" && !hideCancelButton) {\r\n return (\r\n <Button key=\"cancel-button\" onClick={onCancel} variant=\"text\" className={cn(\"w-28\", cancelClassName)} {...restCancelButtonProps}>\r\n {cancelationText || \"Cancel\"}\r\n </Button>\r\n );\r\n }\r\n }),\r\n [hideCancelButton, buttonOrder, confirmationText, cancelationText, confirmButtonProps, cancelButtonProps, onConfirm, onCancel],\r\n );\r\n\r\n return (\r\n <Modal open={open} onOpenChange={onCancel} title={title} role=\"alertdialog\" {...modalProps}>\r\n <p {...descriptionProps}>{description}</p>\r\n <ModalFooter>{actions}</ModalFooter>\r\n </Modal>\r\n );\r\n};\r\n\r\nexport { ConfirmProvider, useConfirm };\r\n"],"names":["confirmId","ConfirmContext","React","ConfirmProvider","children","state","setState","options","setOptions","key","setKey","confirmBase","useCallback","parentId","resolve","reject","closeOnParentUnmount","handleClose","handleConfirm","jsxs","jsx","ConfirmModal","useConfirmId","useConfirm","context","confirm","useEffect","onConfirm","open","onCancel","buttonOrder","description","title","cancelationText","confirmationText","hideCancelButton","modalProps","cancelButtonProps","confirmButtonProps","descriptionProps","actions","action","confirmClassName","restConfirmButtonProps","cancelClassName","restCancelButtonProps","Button","cn","Modal","ModalFooter"],"mappings":";;;;;AAOA,IAAIA,IAAY;AAqBhB,MAAMC,IAAiBC,EAAM,cAA8B,IAAI,GAQzDC,IAAkD,CAAC,EAAE,UAAAC,QAAe;AACxE,QAAM,CAACC,GAAOC,CAAQ,IAAIJ,EAAM,SAAuB,IAAI,GACrD,CAACK,GAASC,CAAU,IAAIN,EAAM,SAAyB;AAAA,IAC3D,aAAa,CAAC,UAAU,SAAS;AAAA,IACjC,aAAa;AAAA,IACb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GI,GAC9E,UAAA;AAAA,IAAA,gBAAAhB,EAAC,KAAA,EAAG,GAAGmB,GAAmB,UAAAR,EAAA,CAAY;AAAA,IACtC,gBAAAX,EAAC6B,KAAa,UAAAT,EAAA,CAAQ;AAAA,EAAA,GACxB;AAEJ;"}
|
package/dist/contextmenu.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-context-menu";
|
|
4
|
-
import {
|
|
4
|
+
import { Check as c, Circle as m, ChevronRight as u } from "@trsys-tech/matrix-icons";
|
|
5
5
|
import { cn as d } from "./utils.es.js";
|
|
6
6
|
const v = e.Root, I = e.Trigger, S = e.Group, z = e.Portal, k = e.Sub, T = e.RadioGroup, p = r.forwardRef(({ className: t, inset: a, children: o, ...s }, i) => /* @__PURE__ */ l(
|
|
7
7
|
e.SubTrigger,
|
|
@@ -15,7 +15,7 @@ const v = e.Root, I = e.Trigger, S = e.Group, z = e.Portal, k = e.Sub, T = e.Rad
|
|
|
15
15
|
...s,
|
|
16
16
|
children: [
|
|
17
17
|
o,
|
|
18
|
-
/* @__PURE__ */ n(
|
|
18
|
+
/* @__PURE__ */ n(u, { className: "ml-auto h-4 w-4" })
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
));
|
|
@@ -68,7 +68,7 @@ const g = r.forwardRef(({ className: t, children: a, checked: o, ...s }, i) => /
|
|
|
68
68
|
checked: o,
|
|
69
69
|
...s,
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(
|
|
71
|
+
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(c, { className: "h-4 w-4" }) }) }),
|
|
72
72
|
a
|
|
73
73
|
]
|
|
74
74
|
}
|
|
@@ -84,7 +84,7 @@ const N = r.forwardRef(({ className: t, children: a, ...o }, s) => /* @__PURE__
|
|
|
84
84
|
),
|
|
85
85
|
...o,
|
|
86
86
|
children: [
|
|
87
|
-
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(
|
|
87
|
+
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(m, { className: "h-4 w-4 fill-current" }) }) }),
|
|
88
88
|
a
|
|
89
89
|
]
|
|
90
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextmenu.es.js","sources":["../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\r\nimport { Check, ChevronRight, Circle } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst ContextMenu = ContextMenuPrimitive.Root;\r\n\r\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\r\n\r\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\r\n\r\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\r\n\r\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\r\n\r\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\r\n\r\nconst ContextMenuSubTrigger = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ChevronRight className=\"ml-auto h-4 w-4\" />\r\n </ContextMenuPrimitive.SubTrigger>\r\n));\r\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst ContextMenuSubContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\r\n\r\nconst ContextMenuContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.Portal>\r\n <ContextMenuPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </ContextMenuPrimitive.Portal>\r\n));\r\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\r\n\r\nconst ContextMenuItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\r\n\r\nconst ContextMenuCheckboxItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\r\n>(({ className, children, checked, ...props }, ref) => (\r\n <ContextMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.CheckboxItem>\r\n));\r\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst ContextMenuRadioItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\r\n>(({ className, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Circle className=\"h-4 w-4 fill-current\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.RadioItem>\r\n));\r\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\r\n\r\nconst ContextMenuLabel = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Label ref={ref} className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)} {...props} />\r\n));\r\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\r\n\r\nconst ContextMenuSeparator = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\r\n>(({ className, ...props }, ref) => <ContextMenuPrimitive.Separator ref={ref} className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props} />);\r\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\r\n\r\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return <span className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)} {...props} />;\r\n};\r\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\r\n\r\nexport {\r\n ContextMenu,\r\n ContextMenuTrigger,\r\n ContextMenuContent,\r\n ContextMenuItem,\r\n ContextMenuCheckboxItem,\r\n ContextMenuRadioItem,\r\n ContextMenuLabel,\r\n ContextMenuSeparator,\r\n ContextMenuShortcut,\r\n ContextMenuGroup,\r\n ContextMenuPortal,\r\n ContextMenuSub,\r\n ContextMenuSubContent,\r\n ContextMenuSubTrigger,\r\n ContextMenuRadioGroup,\r\n};\r\n"],"names":["ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","Check","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":";;;;;AAQA,MAAMA,IAAcC,EAAqB,MAEnCC,IAAqBD,EAAqB,SAE1CE,IAAmBF,EAAqB,OAExCG,IAAoBH,EAAqB,QAEzCI,IAAiBJ,EAAqB,KAEtCK,IAAwBL,EAAqB,YAE7CM,IAAwBC,EAAM,WAKlC,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,KAASC,MAC3C,gBAAAC;AAAA,EAACb,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL,KAAS;AAAA,MACTD;AAAA,IACF;AAAA,IACC,GAAGG;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAK,EAACC,GAAa,EAAA,WAAU,kBAAkB,CAAA;AAAA,IAAA;AAAA,EAAA;AAC5C,CACD;AACDV,EAAsB,cAAcN,EAAqB,WAAW;AAE9D,M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,GAAI,GAAGG,GAAO;AAE7GgB,EAAoB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"contextmenu.es.js","sources":["../src/components/context-menu/ContextMenu.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\r\nimport { Check, ChevronRight, Circle } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\n\r\nconst ContextMenu = ContextMenuPrimitive.Root;\r\n\r\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\r\n\r\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\r\n\r\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\r\n\r\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\r\n\r\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\r\n\r\nconst ContextMenuSubTrigger = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <ChevronRight className=\"ml-auto h-4 w-4\" />\r\n </ContextMenuPrimitive.SubTrigger>\r\n));\r\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst ContextMenuSubContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\r\n\r\nconst ContextMenuContent = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\r\n>(({ className, ...props }, ref) => (\r\n <ContextMenuPrimitive.Portal>\r\n <ContextMenuPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </ContextMenuPrimitive.Portal>\r\n));\r\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\r\n\r\nconst ContextMenuItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\r\n\r\nconst ContextMenuCheckboxItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\r\n>(({ className, children, checked, ...props }, ref) => (\r\n <ContextMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.CheckboxItem>\r\n));\r\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst ContextMenuRadioItem = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\r\n>(({ className, children, ...props }, ref) => (\r\n <ContextMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Circle className=\"h-4 w-4 fill-current\" />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.RadioItem>\r\n));\r\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\r\n\r\nconst ContextMenuLabel = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n <ContextMenuPrimitive.Label ref={ref} className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)} {...props} />\r\n));\r\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\r\n\r\nconst ContextMenuSeparator = React.forwardRef<\r\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\r\n>(({ className, ...props }, ref) => <ContextMenuPrimitive.Separator ref={ref} className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props} />);\r\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\r\n\r\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return <span className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)} {...props} />;\r\n};\r\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\r\n\r\nexport {\r\n ContextMenu,\r\n ContextMenuTrigger,\r\n ContextMenuContent,\r\n ContextMenuItem,\r\n ContextMenuCheckboxItem,\r\n ContextMenuRadioItem,\r\n ContextMenuLabel,\r\n ContextMenuSeparator,\r\n ContextMenuShortcut,\r\n ContextMenuGroup,\r\n ContextMenuPortal,\r\n ContextMenuSub,\r\n ContextMenuSubContent,\r\n ContextMenuSubTrigger,\r\n ContextMenuRadioGroup,\r\n};\r\n"],"names":["ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRight","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","Check","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":";;;;;AAQA,MAAMA,IAAcC,EAAqB,MAEnCC,IAAqBD,EAAqB,SAE1CE,IAAmBF,EAAqB,OAExCG,IAAoBH,EAAqB,QAEzCI,IAAiBJ,EAAqB,KAEtCK,IAAwBL,EAAqB,YAE7CM,IAAwBC,EAAM,WAKlC,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,KAASC,MAC3C,gBAAAC;AAAA,EAACb,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL,KAAS;AAAA,MACTD;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAK,EAACC,GAAA,EAAa,WAAU,kBAAA,CAAkB;AAAA,IAAA;AAAA,EAAA;AAC5C,CACD;AACDV,EAAsB,cAAcN,EAAqB,WAAW;AAEpE,MAAMiB,IAAwBV,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MAC1B,gBAAAG;AAAA,EAACf,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGG;AAAA,EAAA;AACN,CACD;AACDM,EAAsB,cAAcjB,EAAqB,WAAW;AAEpE,MAAMkB,IAAqBX,EAAM,WAG/B,CAAC,EAAE,WAAAC,GAAW,GAAGG,KAASC,MAC1B,gBAAAG,EAACf,EAAqB,QAArB,EACC,UAAA,gBAAAe;AAAA,EAACf,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE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gBAAAA,EAACf,EAAqB,eAArB,EACC,UAAA,gBAAAe,EAACS,GAAA,EAAO,WAAU,uBAAA,CAAuB,EAAA,CAC3C,GACF;AAAA,MACCd;AAAA,IAAA;AAAA,EAAA;AACH,CACD;AACDa,EAAqB,cAAcvB,EAAqB,UAAU;AAElE,MAAMyB,IAAmBlB,EAAM,WAK7B,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGE,EAAA,GAASC,MACjC,gBAAAG,EAACf,EAAqB,OAArB,EAA2B,KAAAY,GAAU,WAAWE,EAAG,qDAAqDL,KAAS,QAAQD,CAAS,GAAI,GAAGG,GAAO,CAClJ;AACDc,EAAiB,cAAczB,EAAqB,MAAM;AAE1D,MAAM0B,IAAuBnB,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MAAQ,gBAAAG,EAACf,EAAqB,WAArB,EAA+B,KAAAY,GAAU,WAAWE,EAAG,6BAA6BN,CAAS,GAAI,GAAGG,GAAO,CAAE;AAClJe,EAAqB,cAAc1B,EAAqB,UAAU;AAElE,MAAM2B,IAAsB,CAAC,EAAE,WAAAnB,GAAW,GAAGG,QACpC,gBAAAI,EAAC,UAAK,WAAWD,EAAG,yDAAyDN,CAAS,GAAI,GAAGG,GAAO;AAE7GgB,EAAoB,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dangercircleicon.es.js","sources":["../src/components/Icons/DangerCircleIcon.tsx"],"sourcesContent":["import { SVGProps } from \"react\";\r\n\r\nexport function DangerCircleIcon(props: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" {...props}>\r\n <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#981c1c\" />\r\n <path\r\n d=\"M12 4.757a7.242 7.242 0 1 0 0 14.485 7.242 7.242 0 0 0 0-14.485ZM6.116 12c0-1.378.48-2.644 1.276-3.624l8.258 8.258a6.001 6.001 0 0 1-3.65 1.25A5.89 5.89 0 0 1 6.116 12Zm10.492 3.624L8.351 7.391A5.855 5.855 0 0 1 12 6.115 5.89 5.89 0 0 1 17.884 12a5.74 5.74 0 0 1-1.276 3.624Z\"\r\n fill=\"#fff\"\r\n />\r\n </svg>\r\n );\r\n}\r\n"],"names":["DangerCircleIcon","props","jsxs","jsx"],"mappings":";AAEO,SAASA,EAAiBC,GAAgC;
|
|
1
|
+
{"version":3,"file":"dangercircleicon.es.js","sources":["../src/components/Icons/DangerCircleIcon.tsx"],"sourcesContent":["import { SVGProps } from \"react\";\r\n\r\nexport function DangerCircleIcon(props: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" {...props}>\r\n <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#981c1c\" />\r\n <path\r\n d=\"M12 4.757a7.242 7.242 0 1 0 0 14.485 7.242 7.242 0 0 0 0-14.485ZM6.116 12c0-1.378.48-2.644 1.276-3.624l8.258 8.258a6.001 6.001 0 0 1-3.65 1.25A5.89 5.89 0 0 1 6.116 12Zm10.492 3.624L8.351 7.391A5.855 5.855 0 0 1 12 6.115 5.89 5.89 0 0 1 17.884 12a5.74 5.74 0 0 1-1.276 3.624Z\"\r\n fill=\"#fff\"\r\n />\r\n </svg>\r\n );\r\n}\r\n"],"names":["DangerCircleIcon","props","jsxs","jsx"],"mappings":";AAEO,SAASA,EAAiBC,GAAgC;AAC/D,SACE,gBAAAC,EAAC,OAAA,EAAI,OAAM,8BAA6B,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAa,GAAGD,GACrF,UAAA;AAAA,IAAA,gBAAAE,EAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,MAAK,MAAK,UAAA,CAAU;AAAA,IAC9C,gBAAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAE;AAAA,QACF,MAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EACP,GACF;AAEJ;"}
|
package/dist/datagrid.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import t, { useMemo as
|
|
3
|
-
import { AgGridReact as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { cn as
|
|
7
|
-
import { printHtml as
|
|
8
|
-
import { TextField as
|
|
1
|
+
import { jsx as r, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import t, { forwardRef as A, useMemo as T } from "react";
|
|
3
|
+
import { AgGridReact as k } from "ag-grid-react";
|
|
4
|
+
import { themeQuartz as y, ModuleRegistry as F, AllCommunityModule as P } from "ag-grid-community";
|
|
5
|
+
import { CircleXmark as z, Magnifier as G, Snowflake as I, Print as H, Refresh as O, ElipsisVertical as L, Trashcan as M } from "@trsys-tech/matrix-icons";
|
|
6
|
+
import { cn as x } from "./utils.es.js";
|
|
7
|
+
import { printHtml as B } from "./printhtml.es.js";
|
|
8
|
+
import { TextField as Q } from "./textfield.es.js";
|
|
9
9
|
import { Button as E } from "./button.es.js";
|
|
10
|
-
import { IconButton as
|
|
11
|
-
import { Popover as
|
|
12
|
-
|
|
13
|
-
const
|
|
10
|
+
import { IconButton as b } from "./iconbutton.es.js";
|
|
11
|
+
import { Popover as q, PopoverTrigger as $, PopoverContent as j } from "./popover.es.js";
|
|
12
|
+
F.registerModules([P]);
|
|
13
|
+
const _ = y.withParams({
|
|
14
14
|
fontFamily: "DMSans",
|
|
15
15
|
fontSize: "12px",
|
|
16
16
|
headerFontSize: "12px",
|
|
@@ -20,13 +20,13 @@ const j = F.withParams({
|
|
|
20
20
|
accentColor: "hsl(var(--primary-300))",
|
|
21
21
|
foregroundColor: "hsl(var(--text-500))",
|
|
22
22
|
cellTextColor: "hsl(var(--text-500))"
|
|
23
|
-
}), p = t.createContext(null),
|
|
23
|
+
}), p = t.createContext(null), oe = () => {
|
|
24
24
|
const o = t.useContext(p);
|
|
25
25
|
if (!o)
|
|
26
26
|
throw new Error("useDataGrid should be used within <DataGrid>");
|
|
27
27
|
return o;
|
|
28
|
-
},
|
|
29
|
-
const s = t.useId(), [a, n] = t.useState(null), [i, d] = t.useState([]), [c,
|
|
28
|
+
}, ae = ({ children: o }) => {
|
|
29
|
+
const s = t.useId(), [a, n] = t.useState(null), [i, d] = t.useState([]), [c, l] = t.useState(0), [h, u] = t.useState(""), [e, f] = t.useState(!1);
|
|
30
30
|
return /* @__PURE__ */ r(
|
|
31
31
|
p.Provider,
|
|
32
32
|
{
|
|
@@ -37,49 +37,47 @@ const j = F.withParams({
|
|
|
37
37
|
setRowData: d,
|
|
38
38
|
gridId: s,
|
|
39
39
|
quickFilterText: h,
|
|
40
|
-
setQuickFilterText:
|
|
40
|
+
setQuickFilterText: u,
|
|
41
41
|
actionbarExists: e,
|
|
42
|
-
setActionbarExists:
|
|
42
|
+
setActionbarExists: f,
|
|
43
43
|
actionbarHeight: c,
|
|
44
|
-
setActionbarHeight:
|
|
44
|
+
setActionbarHeight: l
|
|
45
45
|
},
|
|
46
46
|
children: o
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
|
-
},
|
|
50
|
-
theme: o,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
);
|
|
82
|
-
}, ae = ({ className: o, ...s }) => {
|
|
49
|
+
}, U = A(
|
|
50
|
+
({ theme: o, onGridReady: s, quickFilterText: a, rowData: n, containerStyle: i, ...d }, c) => {
|
|
51
|
+
const l = t.useContext(p);
|
|
52
|
+
if (!l)
|
|
53
|
+
throw new Error("DataGridContent should be used within <DataGrid>");
|
|
54
|
+
const { rowData: h, setRowData: u, actionbarExists: e, setApi: f, setQuickFilterText: g, quickFilterText: C, gridId: D, actionbarHeight: w } = l, R = T(() => _.withParams({
|
|
55
|
+
headerHeight: 40,
|
|
56
|
+
wrapperBorderRadius: e ? "0px 0px 8px 8px" : "8px"
|
|
57
|
+
}), [e]), v = (m) => {
|
|
58
|
+
f(m.api), s?.(m);
|
|
59
|
+
};
|
|
60
|
+
return t.useEffect(() => {
|
|
61
|
+
u(n);
|
|
62
|
+
}, [n, u]), t.useEffect(() => {
|
|
63
|
+
a !== void 0 && g(a ?? "");
|
|
64
|
+
}, [a, g]), /* @__PURE__ */ r(
|
|
65
|
+
k,
|
|
66
|
+
{
|
|
67
|
+
gridId: D,
|
|
68
|
+
theme: o ?? R,
|
|
69
|
+
rowData: h,
|
|
70
|
+
quickFilterText: C,
|
|
71
|
+
onGridReady: v,
|
|
72
|
+
containerStyle: { height: `calc(100% - ${w}px)`, ...i },
|
|
73
|
+
...d,
|
|
74
|
+
ref: c
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
U.displayName = "DataGridContent";
|
|
80
|
+
const ie = ({ className: o, ...s }) => {
|
|
83
81
|
const a = t.useContext(p);
|
|
84
82
|
if (!a)
|
|
85
83
|
throw new Error("DataGridActionBar should be used within <DataGrid>");
|
|
@@ -89,7 +87,7 @@ const j = F.withParams({
|
|
|
89
87
|
}, [d]), /* @__PURE__ */ r(
|
|
90
88
|
"div",
|
|
91
89
|
{
|
|
92
|
-
className:
|
|
90
|
+
className: x(
|
|
93
91
|
"relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]",
|
|
94
92
|
o
|
|
95
93
|
),
|
|
@@ -97,126 +95,126 @@ const j = F.withParams({
|
|
|
97
95
|
children: c
|
|
98
96
|
}
|
|
99
97
|
);
|
|
100
|
-
},
|
|
98
|
+
}, se = ({ defaultOpen: o = !1, className: s, ...a }) => {
|
|
101
99
|
const n = t.useContext(p);
|
|
102
100
|
if (!n)
|
|
103
101
|
throw new Error("SearchAction should be used within <DataGrid>");
|
|
104
|
-
const { quickFilterText: i, setQuickFilterText: d } = n, [c,
|
|
102
|
+
const { quickFilterText: i, setQuickFilterText: d } = n, [c, l] = t.useState(o), [h, u] = t.useState(!1), e = t.useRef(null), f = () => {
|
|
105
103
|
n.setQuickFilterText(""), e.current && e.current.focus();
|
|
106
|
-
},
|
|
107
|
-
|
|
104
|
+
}, g = () => {
|
|
105
|
+
l(!0);
|
|
108
106
|
};
|
|
109
107
|
t.useEffect(() => {
|
|
110
108
|
c && e?.current && e.current.focus();
|
|
111
109
|
}, [c]);
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
const C = () => {
|
|
111
|
+
u(!0), n.setQuickFilterText(""), setTimeout(() => {
|
|
112
|
+
l(!1), u(!1);
|
|
115
113
|
}, 200);
|
|
116
114
|
};
|
|
117
|
-
return /* @__PURE__ */ r("div", { className:
|
|
118
|
-
|
|
115
|
+
return /* @__PURE__ */ r("div", { className: x("max-w-60", s), ...a, children: c || h ? /* @__PURE__ */ r(
|
|
116
|
+
Q,
|
|
119
117
|
{
|
|
120
118
|
ref: e,
|
|
121
|
-
className:
|
|
122
|
-
onChange: (
|
|
119
|
+
className: x("relative h-7.5", c && !h ? "animate-input-open" : "", h && "animate-input-close"),
|
|
120
|
+
onChange: (D) => d(D.target.value),
|
|
123
121
|
value: i,
|
|
124
|
-
startAdornment: /* @__PURE__ */ r(
|
|
125
|
-
endAdornment: i && /* @__PURE__ */ r(
|
|
122
|
+
startAdornment: /* @__PURE__ */ r(b, { variant: "toolbar", className: "p-0.5 h-6 w-6 border-none mx-1", onClick: C, children: /* @__PURE__ */ r(G, { className: "w-5 h-5" }) }),
|
|
123
|
+
endAdornment: i && /* @__PURE__ */ r(b, { variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick: f, children: /* @__PURE__ */ r(z, { className: "w-5 h-5" }) })
|
|
126
124
|
}
|
|
127
|
-
) : /* @__PURE__ */ r(
|
|
128
|
-
},
|
|
125
|
+
) : /* @__PURE__ */ r(b, { variant: "toolbar", className: "p-0.5 w-6 h-6 m-1", onClick: g, children: /* @__PURE__ */ r(G, { className: "w-5 h-5" }) }) });
|
|
126
|
+
}, ce = ({ freezeText: o, unFreezeText: s, onClick: a, disabled: n, ...i }) => {
|
|
129
127
|
const d = t.useContext(p);
|
|
130
128
|
if (!d)
|
|
131
129
|
throw new Error("FreezeAction should be used within <DataGrid>");
|
|
132
|
-
const [c,
|
|
130
|
+
const [c, l] = t.useState(0), [h, u] = t.useState(0), { api: e, rowData: f } = d, g = () => {
|
|
133
131
|
if (!e) return;
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
132
|
+
const w = e.getSelectedNodes();
|
|
133
|
+
if (w.length > 0) {
|
|
136
134
|
e.setGridOption(
|
|
137
135
|
"pinnedTopRowData",
|
|
138
|
-
|
|
136
|
+
w.map((m) => m.data)
|
|
139
137
|
);
|
|
140
|
-
const v = e.getRenderedNodes().filter((
|
|
138
|
+
const v = e.getRenderedNodes().filter((m) => !w.some((N) => N.id === m.id));
|
|
141
139
|
e.setGridOption(
|
|
142
140
|
"rowData",
|
|
143
|
-
v.map((
|
|
141
|
+
v.map((m) => m.data)
|
|
144
142
|
);
|
|
145
143
|
}
|
|
146
|
-
},
|
|
147
|
-
e && (e.setGridOption("pinnedTopRowData", []), e.setGridOption("rowData",
|
|
148
|
-
},
|
|
149
|
-
e && (e.getPinnedTopRowCount() > 0 ?
|
|
144
|
+
}, C = () => {
|
|
145
|
+
e && (e.setGridOption("pinnedTopRowData", []), e.setGridOption("rowData", f));
|
|
146
|
+
}, D = (w) => {
|
|
147
|
+
e && (e.getPinnedTopRowCount() > 0 ? C() : g()), a?.(w);
|
|
150
148
|
};
|
|
151
149
|
return t.useEffect(() => (e?.addEventListener("pinnedRowDataChanged", () => {
|
|
152
|
-
|
|
150
|
+
l(e.getPinnedTopRowCount());
|
|
153
151
|
}), e?.addEventListener("selectionChanged", () => {
|
|
154
|
-
|
|
152
|
+
u(e.getSelectedNodes().length);
|
|
155
153
|
}), () => {
|
|
156
154
|
e?.removeEventListener("pinnedRowDataChanged", () => {
|
|
157
|
-
|
|
155
|
+
l(e.getPinnedTopRowCount());
|
|
158
156
|
}), e?.removeEventListener("selectionChanged", () => {
|
|
159
|
-
|
|
157
|
+
u(e.getSelectedNodes().length);
|
|
160
158
|
});
|
|
161
159
|
}), [e]), /* @__PURE__ */ r(
|
|
162
160
|
E,
|
|
163
161
|
{
|
|
164
162
|
variant: "text",
|
|
165
|
-
onClick:
|
|
166
|
-
startIcon: /* @__PURE__ */ r(
|
|
163
|
+
onClick: D,
|
|
164
|
+
startIcon: /* @__PURE__ */ r(I, { className: "w-4.5 h-4.5" }),
|
|
167
165
|
disabled: !c && !h || n,
|
|
168
166
|
...i,
|
|
169
167
|
children: c ? s ?? "Unfreeze" : o ?? "Freeze"
|
|
170
168
|
}
|
|
171
169
|
);
|
|
172
|
-
},
|
|
170
|
+
}, de = ({ children: o, className: s, onClick: a, ...n }) => {
|
|
173
171
|
const i = t.useContext(p);
|
|
174
172
|
if (!i)
|
|
175
173
|
throw new Error("PrintAction should be used within <DataGrid>");
|
|
176
174
|
const d = (c) => {
|
|
177
175
|
i.api && (i.api.setGridOption("domLayout", "print"), setTimeout(() => {
|
|
178
|
-
const
|
|
176
|
+
const l = document.querySelector("[grid-id='" + i.gridId + "']"), u = `<html>
|
|
179
177
|
${document.head.innerHTML}
|
|
180
|
-
${
|
|
178
|
+
${l.outerHTML}
|
|
181
179
|
</html>`;
|
|
182
|
-
|
|
180
|
+
B(u), i?.api?.setGridOption("domLayout", void 0);
|
|
183
181
|
})), a?.(c);
|
|
184
182
|
};
|
|
185
|
-
return /* @__PURE__ */ r(
|
|
186
|
-
},
|
|
183
|
+
return /* @__PURE__ */ r(b, { variant: "toolbar", className: x("p-0.5 w-6 h-6", s), onClick: d, ...n, children: o ?? /* @__PURE__ */ r(H, { className: "w-5 h-5" }) });
|
|
184
|
+
}, le = ({ className: o, onRefresh: s, children: a, loading: n, ...i }) => {
|
|
187
185
|
if (!t.useContext(p))
|
|
188
186
|
throw new Error("RefreshAction should be used within <DataGrid>");
|
|
189
187
|
const c = () => {
|
|
190
188
|
s();
|
|
191
189
|
};
|
|
192
190
|
return /* @__PURE__ */ r(
|
|
193
|
-
|
|
191
|
+
b,
|
|
194
192
|
{
|
|
195
|
-
className:
|
|
193
|
+
className: x("p-0.5 w-6 h-6", n && "disabled:bg-transparent", o),
|
|
196
194
|
variant: "toolbar",
|
|
197
195
|
onClick: c,
|
|
198
196
|
disabled: n,
|
|
199
197
|
...i,
|
|
200
|
-
children: a ?? /* @__PURE__ */ r(
|
|
198
|
+
children: a ?? /* @__PURE__ */ r(O, { className: x("w-4.5 h-4.5", n && "animate-spin") })
|
|
201
199
|
}
|
|
202
200
|
);
|
|
203
|
-
},
|
|
201
|
+
}, ue = ({ onDelete: o, children: s, ...a }) => /* @__PURE__ */ r(E, { variant: "danger", onClick: () => {
|
|
204
202
|
o();
|
|
205
|
-
}, startIcon: /* @__PURE__ */ r(
|
|
206
|
-
/* @__PURE__ */ r(
|
|
207
|
-
/* @__PURE__ */ r(
|
|
203
|
+
}, startIcon: /* @__PURE__ */ r(M, { className: "w-4.5 h-4.5" }), ...a, children: s }), he = ({ children: o, slotProps: s, className: a, ...n }) => /* @__PURE__ */ S(q, { ...s?.popoverProps ?? {}, children: [
|
|
204
|
+
/* @__PURE__ */ r($, { ...s?.triggerProps ?? {}, children: /* @__PURE__ */ r(L, { className: "w-4.5 h-4.5 text-primary" }) }),
|
|
205
|
+
/* @__PURE__ */ r(j, { align: "end", className: x("w-40", a), ...n, children: o })
|
|
208
206
|
] });
|
|
209
207
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
208
|
+
ae as DataGrid,
|
|
209
|
+
ie as DataGridActionBar,
|
|
210
|
+
U as DataGridContent,
|
|
211
|
+
ue as DeleteAction,
|
|
212
|
+
he as ExtraActions,
|
|
213
|
+
ce as FreezeAction,
|
|
214
|
+
de as PrintAction,
|
|
215
|
+
le as RefreshAction,
|
|
216
|
+
se as SearchAction,
|
|
217
|
+
_ as dataGridDefaultTheme,
|
|
218
|
+
oe as useDataGrid
|
|
221
219
|
};
|
|
222
220
|
//# sourceMappingURL=datagrid.es.js.map
|