@vritti/quantum-ui 0.3.19 → 0.3.21
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/CopyButton.js +47 -0
- package/dist/CopyButton.js.map +1 -0
- package/dist/Form.js +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/Switch.js +11 -13
- package/dist/Switch.js.map +1 -1
- package/dist/UploadFile.js +53 -46
- package/dist/UploadFile.js.map +1 -1
- package/dist/assets/quantum-ui.css +4 -8
- package/dist/components/CopyButton.js +2 -0
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/field.js +2 -2
- package/dist/field.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/components/CopyButton/CopyButton.d.ts +8 -0
- package/dist/lib/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/lib/components/CopyButton/index.d.ts +2 -0
- package/dist/lib/components/CopyButton/index.d.ts.map +1 -0
- package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/lib/components/Switch/Switch.d.ts.map +1 -1
- package/dist/lib/components/UploadFile/UploadFile.d.ts +2 -0
- package/dist/lib/components/UploadFile/UploadFile.d.ts.map +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/useDataTable.js +153 -122
- package/dist/useDataTable.js.map +1 -1
- package/package.json +5 -1
package/dist/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../shadcn/shadcnField/field.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useMemo } from 'react';\nimport { Label } from '../shadcnLabel';\nimport { Separator } from '../shadcnSeparator';\nimport { cn } from '../utils';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = 'legend',\n ...props\n}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-2 data-[slot=checkbox-group]:gap-1 [&>[data-slot=field-group]]:gap-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {\n variants: {\n orientation: {\n vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center',\n '[&>[data-slot=field-label]]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto',\n '@md/field-group:[&>[data-slot=field-label]]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction Field({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',\n 'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../shadcn/shadcnField/field.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useMemo } from 'react';\nimport { Label } from '../shadcnLabel';\nimport { Separator } from '../shadcnSeparator';\nimport { cn } from '../utils';\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = 'legend',\n ...props\n}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-2 data-[slot=checkbox-group]:gap-1 [&>[data-slot=field-group]]:gap-2',\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {\n variants: {\n orientation: {\n vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],\n horizontal: [\n 'flex-row items-center',\n '[&>[data-slot=field-label]]:flex-auto',\n 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n responsive: [\n 'flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto',\n '@md/field-group:[&>[data-slot=field-label]]:flex-auto',\n '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n ],\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction Field({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',\n 'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-xs leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',\n 'last:-mt-1 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<'div'> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"bg-background text-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n if (errors?.length === 1) {\n return errors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {errors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n};\n"],"names":[],"mappings":";;;;;;;AAQA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,qBAAA;AAAA,QACA,8EAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAA,CAAY;AAAA,EACnB,SAAA;AAAA,EACA,OAAA,GAAU,QAAA;AAAA,EACV,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,cAAA;AAAA,MACV,cAAA,EAAc,OAAA;AAAA,MACd,SAAA,EAAW,EAAA,CAAG,kBAAA,EAAoB,iCAAA,EAAmC,gCAAgC,SAAS,CAAA;AAAA,MAC7G,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACxE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,wIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,MAAM,aAAA,GAAgB,IAAI,oEAAA,EAAsE;AAAA,EAC9F,QAAA,EAAU;AAAA,IACR,WAAA,EAAa;A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AM;AAC5B,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAO,QAAA;AAAA,IACT;AAEA,IAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AACnB,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,IAAI,MAAA,EAAQ,WAAW,CAAA,EAAG;AACxB,MAAA,OAAO,MAAA,CAAO,CAAC,CAAA,EAAG,OAAA;AAAA,IACpB;AAEA,IAAA,2BACG,IAAA,EAAA,EAAG,SAAA,EAAU,oCAAA,EACX,QAAA,EAAA,MAAA,CAAO,IAAI,CAAC,KAAA,KAAU,KAAA,EAAO,OAAA,wBAAY,IAAA,EAAA,EAAwB,QAAA,EAAA,KAAA,CAAM,WAAtB,KAAA,CAAM,OAAwB,CAAK,CAAA,EACvF,CAAA;AAAA,EAEJ,CAAA,EAAG,CAAC,QAAA,EAAU,MAAM,CAAC,CAAA;AAErB,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,OAAA;AAAA,MACL,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,sCAAA,EAAwC,SAAS,CAAA;AAAA,MAC9D,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { C as CompactTableSkeleton, a as CurrencyCell, D as DataTable, b as Data
|
|
|
32
32
|
export { C as CompanySelector } from './CompanySelector.js';
|
|
33
33
|
export { C as ConfirmHost } from './ConfirmHost.js';
|
|
34
34
|
export { C as Controller } from './index.esm.js';
|
|
35
|
+
export { C as CopyButton } from './CopyButton.js';
|
|
35
36
|
export { C as CopyField } from './CopyField.js';
|
|
36
37
|
export { C as CountryFilter, a as CountrySelector } from './CountrySelector.js';
|
|
37
38
|
export { C as CurrencyField } from './CurrencyField.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../../../lib/components/CopyButton/CopyButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,eAAe;IAE9B,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2ChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/components/CopyButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../lib/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAiB,cAAc,EAA4B,MAAM,SAAS,CAAC;AA8BvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,EAC/B,KAAK,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,SAAiB,EACjB,SAAS,EACT,WAAkB,EAClB,YAAY,EACZ,IAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,GACX,EAAE,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../lib/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAiB,cAAc,EAA4B,MAAM,SAAS,CAAC;AA8BvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,EAC/B,KAAK,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,SAAiB,EACjB,SAAS,EACT,WAAkB,EAClB,YAAY,EACZ,IAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,GACX,EAAE,cAAc,CAAC,KAAK,CAAC,kDAkdvB;yBAjee,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../lib/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,YAAY,CAAC;IACtF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAE7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../lib/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEtE,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,YAAY,CAAC;IACtF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAE7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,eAAO,MAAM,MAAM,uFAoClB,CAAC;AAIF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AAG3E,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAEtD,CAAC"}
|
|
@@ -4,12 +4,14 @@ interface UploadFileBaseProps {
|
|
|
4
4
|
anchor?: AnchorPreset | React.ReactNode;
|
|
5
5
|
multiple?: boolean;
|
|
6
6
|
accept?: string;
|
|
7
|
+
className?: string;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
label?: string;
|
|
9
10
|
error?: string;
|
|
10
11
|
placeholder?: string;
|
|
11
12
|
hint?: string;
|
|
12
13
|
value?: File | File[] | null;
|
|
14
|
+
previewUrl?: string;
|
|
13
15
|
isLoading?: boolean;
|
|
14
16
|
}
|
|
15
17
|
interface UploadFileStandaloneProps extends UploadFileBaseProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadFile.d.ts","sourceRoot":"","sources":["../../../../lib/components/UploadFile/UploadFile.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErD,UAAU,mBAAmB;IAC3B,MAAM,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE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C,EAAE,CAAC,eAAe,CA0OhD,CAAC"}
|
|
@@ -18,6 +18,7 @@ export * from './DatePicker';
|
|
|
18
18
|
export * from './DateRangePicker';
|
|
19
19
|
export * from './DateTimePicker';
|
|
20
20
|
export * from './DateTimeRangePicker';
|
|
21
|
+
export * from './CopyButton';
|
|
21
22
|
export * from './CopyField';
|
|
22
23
|
export * from './DetailField';
|
|
23
24
|
export * from './Dialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAA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,CAAC"}
|
package/dist/useDataTable.js
CHANGED
|
@@ -21830,6 +21830,13 @@ function DataTable({
|
|
|
21830
21830
|
}) {
|
|
21831
21831
|
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
21832
21832
|
const importDialog = useDialog();
|
|
21833
|
+
const headerScrollRef = useRef(null);
|
|
21834
|
+
const bodyScrollRef = useRef(null);
|
|
21835
|
+
const syncHeaderScroll = () => {
|
|
21836
|
+
if (headerScrollRef.current && bodyScrollRef.current) {
|
|
21837
|
+
headerScrollRef.current.scrollLeft = bodyScrollRef.current.scrollLeft;
|
|
21838
|
+
}
|
|
21839
|
+
};
|
|
21833
21840
|
const tableGate = usePermission(permission);
|
|
21834
21841
|
const importGate = usePermission(importExport?.importPermission);
|
|
21835
21842
|
const exportGate = usePermission(importExport?.exportPermission);
|
|
@@ -22002,134 +22009,158 @@ function DataTable({
|
|
|
22002
22009
|
},
|
|
22003
22010
|
"filters"
|
|
22004
22011
|
) : null }),
|
|
22005
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
22006
|
-
/* @__PURE__ */
|
|
22007
|
-
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
"aria-hidden": true,
|
|
22025
|
-
className: "pointer-events-none absolute inset-x-0 top-0 bottom-px bg-muted/40 backdrop-blur-sm"
|
|
22026
|
-
}
|
|
22012
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col flex-1 min-h-0", children: [
|
|
22013
|
+
/* @__PURE__ */ jsx("div", { ref: headerScrollRef, className: "shrink-0 overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
22014
|
+
"table",
|
|
22015
|
+
{
|
|
22016
|
+
className: "w-full caption-bottom text-sm table-fixed",
|
|
22017
|
+
style: { minWidth: table.getCenterTotalSize() },
|
|
22018
|
+
children: /* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
22019
|
+
const isActions = header.column.id === "actions";
|
|
22020
|
+
const headerAlignClass = isActions ? "justify-end" : "justify-center";
|
|
22021
|
+
return /* @__PURE__ */ jsxs(
|
|
22022
|
+
TableHead,
|
|
22023
|
+
{
|
|
22024
|
+
colSpan: header.colSpan,
|
|
22025
|
+
style: isActions ? { width: "70px" } : { width: header.getSize(), minWidth: header.getSize(), maxWidth: header.getSize() },
|
|
22026
|
+
className: cn(
|
|
22027
|
+
"relative group/resize",
|
|
22028
|
+
// actions header stays pinned on horizontal scroll; z-20 keeps it above the
|
|
22029
|
+
// regular header cells that scroll underneath it.
|
|
22030
|
+
isActions ? "text-right sticky right-0 z-20" : "text-center"
|
|
22027
22031
|
),
|
|
22028
|
-
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
22044
|
-
|
|
22045
|
-
|
|
22046
|
-
|
|
22047
|
-
{ length: table.getState().pagination?.pageSize ?? 20 },
|
|
22048
|
-
(_, i) => `skeleton-row-${i}`
|
|
22049
|
-
).map((rowKey) => /* @__PURE__ */ jsx(TableRow, { children: Array.from({ length: columnCount }, (_, i) => `${rowKey}-cell-${i}`).map((cellKey) => /* @__PURE__ */ jsx(TableCell, { className: densityClasses[density], children: /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" }) }, cellKey)) }, rowKey)) : table.getRowModel().rows.map((row, index) => {
|
|
22050
|
-
const externallySelected = selectedRowId != null && row.id === selectedRowId;
|
|
22051
|
-
const isSelected = row.getIsSelected() || externallySelected;
|
|
22052
|
-
return /* @__PURE__ */ jsx(
|
|
22053
|
-
TableRow,
|
|
22054
|
-
{
|
|
22055
|
-
"data-state": isSelected ? "selected" : void 0,
|
|
22056
|
-
className: "group animate-in fade-in duration-300",
|
|
22057
|
-
style: { animationDelay: `${Math.min(index, 12) * 25}ms`, animationFillMode: "both" },
|
|
22058
|
-
children: row.getVisibleCells().map((cell) => {
|
|
22059
|
-
const isActionsCell = cell.column.id === "actions";
|
|
22060
|
-
return /* @__PURE__ */ jsxs(
|
|
22061
|
-
TableCell,
|
|
22062
|
-
{
|
|
22063
|
-
className: cn(
|
|
22064
|
-
densityClasses[density],
|
|
22065
|
-
isActionsCell ? "px-2 sticky right-0 z-10" : void 0,
|
|
22066
|
-
onRowClick && !isActionsCell ? "cursor-pointer" : void 0
|
|
22067
|
-
),
|
|
22068
|
-
onClick: onRowClick && !isActionsCell ? () => onRowClick(row.original) : void 0,
|
|
22069
|
-
style: isActionsCell ? { width: "70px" } : {
|
|
22070
|
-
width: cell.column.getSize(),
|
|
22071
|
-
minWidth: cell.column.getSize(),
|
|
22072
|
-
maxWidth: cell.column.getSize()
|
|
22073
|
-
},
|
|
22074
|
-
children: [
|
|
22075
|
-
isActionsCell && /* @__PURE__ */ jsx(
|
|
22076
|
-
"div",
|
|
22077
|
-
{
|
|
22078
|
-
"aria-hidden": true,
|
|
22079
|
-
className: "pointer-events-none absolute inset-x-0 top-0 bottom-px bg-background/40 backdrop-blur-sm group-hover:bg-muted/30 group-data-[state=selected]:bg-muted/40"
|
|
22080
|
-
}
|
|
22081
|
-
),
|
|
22082
|
-
/* @__PURE__ */ jsx(
|
|
22083
|
-
"div",
|
|
22084
|
-
{
|
|
22085
|
-
className: cn(
|
|
22086
|
-
isActionsCell ? "relative flex items-center justify-end" : "overflow-hidden text-center"
|
|
22087
|
-
),
|
|
22088
|
-
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
22089
|
-
}
|
|
22032
|
+
"aria-sort": header.column.getCanSort() ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
|
|
22033
|
+
children: [
|
|
22034
|
+
isActions && /* @__PURE__ */ jsx(
|
|
22035
|
+
"div",
|
|
22036
|
+
{
|
|
22037
|
+
"aria-hidden": true,
|
|
22038
|
+
className: "pointer-events-none absolute inset-x-0 top-0 bottom-px bg-muted backdrop-blur-sm"
|
|
22039
|
+
}
|
|
22040
|
+
),
|
|
22041
|
+
/* @__PURE__ */ jsx("div", { className: cn(isActions ? "relative" : void 0), children: header.isPlaceholder ? null : typeof header.column.columnDef.header === "string" ? /* @__PURE__ */ jsx("div", { className: cn("flex", headerAlignClass), children: /* @__PURE__ */ jsx(DataTableColumnHeader, { column: header.column, title: header.column.columnDef.header }) }) : flexRender(header.column.columnDef.header, header.getContext()) }),
|
|
22042
|
+
!meta?.lockedColumnSizing && header.column.getCanResize() && /* @__PURE__ */ jsx(
|
|
22043
|
+
"div",
|
|
22044
|
+
{
|
|
22045
|
+
onPointerDown: header.getResizeHandler(),
|
|
22046
|
+
onTouchStart: header.getResizeHandler(),
|
|
22047
|
+
className: cn(
|
|
22048
|
+
"absolute top-0 right-0 w-1 h-full cursor-col-resize select-none touch-none z-10",
|
|
22049
|
+
"opacity-0 group-hover/resize:opacity-100 hover:bg-primary/50",
|
|
22050
|
+
header.column.getIsResizing() && "opacity-100 bg-primary"
|
|
22090
22051
|
)
|
|
22091
|
-
|
|
22092
|
-
|
|
22093
|
-
|
|
22094
|
-
|
|
22095
|
-
|
|
22096
|
-
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
|
|
22100
|
-
|
|
22101
|
-
|
|
22102
|
-
/* @__PURE__ */ jsx(PermissionLockIcon, { reason: tableGate.reason, className: "size-6" }),
|
|
22103
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: lockedTip(tableGate) })
|
|
22104
|
-
] }) : isFiltered ? /* @__PURE__ */ jsx(
|
|
22105
|
-
DataTableEmpty,
|
|
22052
|
+
}
|
|
22053
|
+
)
|
|
22054
|
+
]
|
|
22055
|
+
},
|
|
22056
|
+
header.id
|
|
22057
|
+
);
|
|
22058
|
+
}) }, headerGroup.id)) })
|
|
22059
|
+
}
|
|
22060
|
+
) }),
|
|
22061
|
+
/* @__PURE__ */ jsxs(
|
|
22062
|
+
"div",
|
|
22106
22063
|
{
|
|
22107
|
-
|
|
22108
|
-
|
|
22109
|
-
|
|
22110
|
-
|
|
22111
|
-
|
|
22112
|
-
|
|
22113
|
-
hasActiveView && slug && /* @__PURE__ */ jsx(
|
|
22114
|
-
Button,
|
|
22064
|
+
ref: bodyScrollRef,
|
|
22065
|
+
onScroll: syncHeaderScroll,
|
|
22066
|
+
className: "relative flex flex-col flex-1 min-h-0 overflow-auto overscroll-auto",
|
|
22067
|
+
children: [
|
|
22068
|
+
!locked && (isLoading || table.getRowModel().rows.length > 0) && /* @__PURE__ */ jsx(
|
|
22069
|
+
"table",
|
|
22115
22070
|
{
|
|
22116
|
-
|
|
22117
|
-
|
|
22118
|
-
|
|
22119
|
-
|
|
22071
|
+
className: "w-full caption-bottom text-sm table-fixed",
|
|
22072
|
+
style: { minWidth: table.getCenterTotalSize() },
|
|
22073
|
+
children: /* @__PURE__ */ jsx(TableBody, { children: isLoading ? Array.from(
|
|
22074
|
+
{ length: table.getState().pagination?.pageSize ?? 20 },
|
|
22075
|
+
(_, i) => `skeleton-row-${i}`
|
|
22076
|
+
).map((rowKey) => /* @__PURE__ */ jsx(TableRow, { children: Array.from({ length: columnCount }, (_, i) => `${rowKey}-cell-${i}`).map((cellKey) => /* @__PURE__ */ jsx(TableCell, { className: densityClasses[density], children: /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" }) }, cellKey)) }, rowKey)) : table.getRowModel().rows.map((row, index) => {
|
|
22077
|
+
const externallySelected = selectedRowId != null && row.id === selectedRowId;
|
|
22078
|
+
const isSelected = row.getIsSelected() || externallySelected;
|
|
22079
|
+
return /* @__PURE__ */ jsx(
|
|
22080
|
+
TableRow,
|
|
22081
|
+
{
|
|
22082
|
+
"data-state": isSelected ? "selected" : void 0,
|
|
22083
|
+
className: "group animate-in fade-in duration-300",
|
|
22084
|
+
style: { animationDelay: `${Math.min(index, 12) * 25}ms`, animationFillMode: "both" },
|
|
22085
|
+
children: row.getVisibleCells().map((cell) => {
|
|
22086
|
+
const isActionsCell = cell.column.id === "actions";
|
|
22087
|
+
return /* @__PURE__ */ jsxs(
|
|
22088
|
+
TableCell,
|
|
22089
|
+
{
|
|
22090
|
+
className: cn(
|
|
22091
|
+
densityClasses[density],
|
|
22092
|
+
isActionsCell ? "px-2 sticky right-0 z-10" : void 0,
|
|
22093
|
+
onRowClick && !isActionsCell ? "cursor-pointer" : void 0
|
|
22094
|
+
),
|
|
22095
|
+
onClick: onRowClick && !isActionsCell ? () => onRowClick(row.original) : void 0,
|
|
22096
|
+
style: isActionsCell ? { width: "70px" } : {
|
|
22097
|
+
width: cell.column.getSize(),
|
|
22098
|
+
minWidth: cell.column.getSize(),
|
|
22099
|
+
maxWidth: cell.column.getSize()
|
|
22100
|
+
},
|
|
22101
|
+
children: [
|
|
22102
|
+
isActionsCell && /* @__PURE__ */ jsx(
|
|
22103
|
+
"div",
|
|
22104
|
+
{
|
|
22105
|
+
"aria-hidden": true,
|
|
22106
|
+
className: "pointer-events-none absolute inset-x-0 top-0 bottom-px bg-background/40 backdrop-blur-sm group-hover:bg-muted/30 group-data-[state=selected]:bg-muted/40"
|
|
22107
|
+
}
|
|
22108
|
+
),
|
|
22109
|
+
/* @__PURE__ */ jsx(
|
|
22110
|
+
"div",
|
|
22111
|
+
{
|
|
22112
|
+
className: cn(
|
|
22113
|
+
isActionsCell ? "relative flex items-center justify-end" : "overflow-hidden text-center"
|
|
22114
|
+
),
|
|
22115
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
22116
|
+
}
|
|
22117
|
+
)
|
|
22118
|
+
]
|
|
22119
|
+
},
|
|
22120
|
+
cell.id
|
|
22121
|
+
);
|
|
22122
|
+
})
|
|
22123
|
+
},
|
|
22124
|
+
row.id
|
|
22125
|
+
);
|
|
22126
|
+
}) })
|
|
22120
22127
|
}
|
|
22121
|
-
)
|
|
22122
|
-
|
|
22123
|
-
|
|
22124
|
-
|
|
22125
|
-
|
|
22126
|
-
|
|
22127
|
-
|
|
22128
|
-
|
|
22129
|
-
|
|
22130
|
-
|
|
22128
|
+
),
|
|
22129
|
+
(locked || !isLoading && table.getRowModel().rows.length === 0) && /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center", children: locked ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-2 text-center", children: [
|
|
22130
|
+
/* @__PURE__ */ jsx(PermissionLockIcon, { reason: tableGate.reason, className: "size-6" }),
|
|
22131
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: lockedTip(tableGate) })
|
|
22132
|
+
] }) : isFiltered ? /* @__PURE__ */ jsx(
|
|
22133
|
+
DataTableEmpty,
|
|
22134
|
+
{
|
|
22135
|
+
icon: emptyStateConfig?.icon,
|
|
22136
|
+
title: "No results found",
|
|
22137
|
+
description: buildNoResultsDescription({ hasActiveSearch, hasActiveFilters, hasActiveView }),
|
|
22138
|
+
action: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
22139
|
+
hasActiveSearch && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => meta?.setSearch?.(searchBaseline), children: "Clear Search" }),
|
|
22140
|
+
hasActiveFilters && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => meta?.setFilters?.(filtersBaseline), children: "Clear Filters" }),
|
|
22141
|
+
hasActiveView && slug && /* @__PURE__ */ jsx(
|
|
22142
|
+
Button,
|
|
22143
|
+
{
|
|
22144
|
+
variant: "outline",
|
|
22145
|
+
size: "sm",
|
|
22146
|
+
onClick: () => loadViewState(slug, EMPTY_TABLE_STATE, null, false),
|
|
22147
|
+
children: "Clear View"
|
|
22148
|
+
}
|
|
22149
|
+
)
|
|
22150
|
+
] })
|
|
22151
|
+
}
|
|
22152
|
+
) : /* @__PURE__ */ jsx(
|
|
22153
|
+
DataTableEmpty,
|
|
22154
|
+
{
|
|
22155
|
+
icon: emptyStateConfig?.icon,
|
|
22156
|
+
title: emptyStateConfig?.title,
|
|
22157
|
+
description: emptyStateConfig?.description,
|
|
22158
|
+
action: emptyStateConfig?.action
|
|
22159
|
+
}
|
|
22160
|
+
) })
|
|
22161
|
+
]
|
|
22131
22162
|
}
|
|
22132
|
-
)
|
|
22163
|
+
)
|
|
22133
22164
|
] })
|
|
22134
22165
|
] }),
|
|
22135
22166
|
(mode !== "compact" || table.getRowCount() > (table.getState().pagination?.pageSize ?? 20)) && /* @__PURE__ */ jsx(DataTablePagination, { table }),
|