@coveord/plasma-mantine 54.3.0 → 54.4.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.
Files changed (45) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-test.log +35 -35
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/button/ButtonWithDisabledTooltip.d.ts +2 -2
  5. package/dist/cjs/components/button/ButtonWithDisabledTooltip.d.ts.map +1 -1
  6. package/dist/cjs/components/code-editor/CodeEditor.js +1 -1
  7. package/dist/cjs/components/code-editor/CodeEditor.js.map +1 -1
  8. package/dist/cjs/components/code-editor/languages/xml.js +1 -1
  9. package/dist/cjs/components/collection/enhanceWithCollectionProps.d.ts +2 -1
  10. package/dist/cjs/components/collection/enhanceWithCollectionProps.d.ts.map +1 -1
  11. package/dist/cjs/components/collection/enhanceWithCollectionProps.js.map +1 -1
  12. package/dist/cjs/components/menu/Menu.d.ts +2 -2
  13. package/dist/cjs/components/menu/Menu.d.ts.map +1 -1
  14. package/dist/cjs/components/table/index.d.ts +3 -2
  15. package/dist/cjs/components/table/index.d.ts.map +1 -1
  16. package/dist/cjs/components/table/index.js +5 -1
  17. package/dist/cjs/components/table/index.js.map +1 -1
  18. package/dist/cjs/components/table/table-predicate/TablePredicate.d.ts +2 -2
  19. package/dist/cjs/components/table/table-predicate/TablePredicate.d.ts.map +1 -1
  20. package/dist/cjs/components/table/table-predicate/TablePredicate.js +4 -2
  21. package/dist/cjs/components/table/table-predicate/TablePredicate.js.map +1 -1
  22. package/dist/cjs/hooks/useClickWithLoading.js +1 -1
  23. package/dist/cjs/utils/overrideComponent.js.map +1 -1
  24. package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts +2 -2
  25. package/dist/esm/components/button/ButtonWithDisabledTooltip.d.ts.map +1 -1
  26. package/dist/esm/components/collection/enhanceWithCollectionProps.d.ts +2 -1
  27. package/dist/esm/components/collection/enhanceWithCollectionProps.d.ts.map +1 -1
  28. package/dist/esm/components/collection/enhanceWithCollectionProps.js.map +1 -1
  29. package/dist/esm/components/menu/Menu.d.ts +2 -2
  30. package/dist/esm/components/menu/Menu.d.ts.map +1 -1
  31. package/dist/esm/components/table/index.d.ts +3 -2
  32. package/dist/esm/components/table/index.d.ts.map +1 -1
  33. package/dist/esm/components/table/index.js +2 -1
  34. package/dist/esm/components/table/index.js.map +1 -1
  35. package/dist/esm/components/table/layouts/row-layout/RowLayoutBody.js.map +1 -1
  36. package/dist/esm/components/table/table-date-range-picker/TableDateRangePicker.js.map +1 -1
  37. package/dist/esm/components/table/table-header/TableHeader.js.map +1 -1
  38. package/dist/esm/components/table/table-predicate/TablePredicate.d.ts +2 -2
  39. package/dist/esm/components/table/table-predicate/TablePredicate.d.ts.map +1 -1
  40. package/dist/esm/components/table/table-predicate/TablePredicate.js +2 -1
  41. package/dist/esm/components/table/table-predicate/TablePredicate.js.map +1 -1
  42. package/package.json +21 -21
  43. package/src/components/collection/enhanceWithCollectionProps.ts +6 -2
  44. package/src/components/table/index.ts +3 -2
  45. package/src/components/table/table-predicate/TablePredicate.tsx +7 -2
@@ -19,11 +19,11 @@ export interface ButtonWithDisabledTooltipProps {
19
19
  */
20
20
  fullWidth?: boolean;
21
21
  }
22
- export declare const ButtonWithDisabledTooltip: (<C = "div">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => import("react").ReactElement) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
22
+ export declare const ButtonWithDisabledTooltip: (<C = "div">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => React.ReactElement) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
23
23
  component?: any;
24
24
  } & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonWithDisabledTooltipProps> & {
25
25
  ref?: any;
26
26
  }) | (ButtonWithDisabledTooltipProps & {
27
- component: import("react").ElementType<any>;
27
+ component: React.ElementType<any>;
28
28
  })>, never> & Record<string, never>;
29
29
  //# sourceMappingURL=ButtonWithDisabledTooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,SAAS,EAAa,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC7E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAeD,eAAO,MAAM,yBAAyB;;;;;;mCAErC,CAAC"}
1
+ {"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,SAAS,EAAa,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC7E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAeD,eAAO,MAAM,yBAAyB,gHAVqC,MAAO,YACjF;;;;;eAGW,MAAM,WACZ;mCAOL,CAAC"}
@@ -64,7 +64,7 @@ var CodeEditor = function(props) {
64
64
  }), 2), _value = _useUncontrolled[0], handleChange = _useUncontrolled[1];
65
65
  var _useParentHeight = _sliced_to_array._((0, _hooks1.useParentHeight)(), 2), parentHeight = _useParentHeight[0], ref = _useParentHeight[1];
66
66
  var editorRef = (0, _react1.useRef)(null);
67
- var loadLocalMonaco = function() {
67
+ var loadLocalMonaco = /*#__PURE__*/ function() {
68
68
  var _ref = _async_to_generator._(function() {
69
69
  var monacoInstance;
70
70
  return _ts_generator._(this, function(_state) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.tsx"],"sourcesContent":["import {\n Box,\n Center,\n Group,\n Input,\n InputWrapperProps,\n Loader,\n Space,\n Stack,\n StackProps,\n px,\n useMantineColorScheme,\n useMantineTheme,\n useProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {Monaco, loader} from '@monaco-editor/react';\nimport {editor as monacoEditor} from 'monaco-editor';\nimport {FunctionComponent, useEffect, useRef, useState} from 'react';\n\nimport cx from 'clsx';\nimport {useParentHeight} from '../../hooks';\nimport {CopyToClipboard} from '../copyToClipboard';\nimport CodeEditorClasses from './CodeEditor.module.css';\nimport {XML} from './languages/xml';\nimport {Search} from './search';\ninterface CodeEditorProps\n extends Omit<\n InputWrapperProps,\n 'inputContainer' | 'inputWrapperOrder' | 'classNames' | 'styles' | 'vars' | 'onChange'\n >,\n Omit<StackProps, 'onChange'> {\n /**\n * The language syntax of the editor\n *\n * @default 'plaintext'\n */\n language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml' | (string & unknown);\n /** Default value for uncontrolled input */\n defaultValue?: string;\n /** Value for controlled input */\n value?: string;\n /** onChange value for controlled input */\n onChange?(value: string): void;\n /** Called whenever the search icon is clicked */\n onSearch?(): void;\n /** Called whenever the copy icon is clicked */\n onCopy?(): void;\n /** Called whenever the code editor gets the focus */\n onFocus?(): void;\n /**\n * The minimal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height is too short, it will use this value as minimum.\n *\n * @default 300\n */\n minHeight?: number;\n /**\n * The maximal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.\n */\n maxHeight?: number;\n disabled?: boolean;\n /**\n * Defines how the monaco editor files will be loaded.\n * Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).\n *\n * @default 'local'\n */\n monacoLoader?: 'cdn' | 'local';\n}\n\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\n monacoLoader: 'local',\n defaultValue: '',\n minHeight: 300,\n};\n\nexport const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {\n const {\n language,\n defaultValue,\n onChange,\n onCopy,\n onSearch,\n onFocus,\n value,\n label,\n required,\n labelProps,\n error,\n errorProps,\n description,\n descriptionProps,\n minHeight,\n maxHeight,\n disabled,\n monacoLoader,\n ...others\n } = useProps('CodeEditor', defaultProps, props);\n const [loaded, setLoaded] = useState(false);\n const [_value, handleChange] = useUncontrolled<string>({\n value,\n defaultValue,\n onChange,\n finalValue: '',\n });\n const [parentHeight, ref] = useParentHeight();\n const editorRef = useRef(null);\n const loadLocalMonaco = async () => {\n const monacoInstance = await import('monaco-editor');\n loader.config({monaco: monacoInstance});\n setLoaded(true);\n };\n\n const registerLanguages = (monaco: Monaco) => {\n if (monaco && language === 'xml') {\n XML.register(monaco);\n }\n };\n\n const handleSearch = () => {\n if (editorRef.current) {\n editorRef.current.focus();\n editorRef.current.trigger('editor', 'actions.find', '');\n onSearch?.();\n }\n };\n\n const [hasMonacoError, setHasMonacoError] = useState(false);\n const renderErrorOutline = !!error || hasMonacoError;\n const theme = useMantineTheme();\n const {colorScheme} = useMantineColorScheme();\n\n useEffect(() => {\n if (monacoLoader === 'local') {\n loadLocalMonaco();\n } else {\n setLoaded(true);\n }\n }, []);\n\n const handleValidate = (markers: monacoEditor.IMarker[]) => {\n setHasMonacoError(\n markers.some((marker) => marker.severity === loader.__getMonacoInstance().MarkerSeverity.Error),\n );\n };\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n\n const _error = error ? (\n <Input.Error mt=\"xs\" {...errorProps}>\n {error}\n </Input.Error>\n ) : (\n <Space h=\"xs\" />\n );\n\n const _header =\n _label || _description ? (\n <Box>\n {_label}\n {_description}\n </Box>\n ) : null;\n\n const _buttons = (\n <Group justify=\"right\" gap={0}>\n <Search handleSearch={handleSearch} />\n <CopyToClipboard value={_value} onCopy={() => onCopy?.()} />\n </Group>\n );\n\n const _editor = loaded ? (\n <Box\n p=\"md\"\n pl=\"xs\"\n className={cx(\n CodeEditorClasses.editor,\n {[CodeEditorClasses.valid]: !renderErrorOutline},\n {[CodeEditorClasses.error]: renderErrorOutline},\n )}\n data-testid=\"editor-wrapper\"\n >\n <Editor\n onValidate={handleValidate}\n defaultLanguage={language}\n theme={colorScheme === 'light' ? 'light' : 'vs-dark'}\n options={{\n minimap: {enabled: false},\n wordWrap: 'on',\n scrollBeyondLastLine: false,\n formatOnPaste: true,\n fontSize: px(theme.fontSizes.xs) as number,\n readOnly: disabled,\n tabSize: 2,\n }}\n value={_value}\n onChange={handleChange}\n onMount={(editor, monaco) => {\n editorRef.current = editor;\n registerLanguages(monaco);\n editor.onDidFocusEditorText(() => onFocus?.());\n editor.onDidBlurEditorText(async () => {\n await editor.getAction('editor.action.formatDocument').run();\n });\n }}\n />\n </Box>\n ) : (\n <Center className={CodeEditorClasses.editor}>\n <Loader />\n </Center>\n );\n\n return (\n <Stack justify=\"flex-start\" gap={0} h={Math.max(parentHeight, minHeight)} mah={maxHeight} ref={ref} {...others}>\n {_header}\n {_buttons}\n {_editor}\n {_error}\n </Stack>\n );\n};\n"],"names":["CodeEditor","defaultProps","language","monacoLoader","defaultValue","minHeight","props","useProps","onChange","onCopy","onSearch","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","useState","loaded","setLoaded","useUncontrolled","finalValue","_value","handleChange","useParentHeight","parentHeight","ref","editorRef","useRef","loadLocalMonaco","monacoInstance","loader","config","monaco","registerLanguages","XML","register","handleSearch","current","focus","trigger","hasMonacoError","setHasMonacoError","renderErrorOutline","theme","useMantineTheme","colorScheme","useMantineColorScheme","useEffect","handleValidate","markers","some","marker","severity","__getMonacoInstance","MarkerSeverity","Error","_label","Input","Label","_description","Description","_error","mt","Space","h","_header","Box","_buttons","Group","justify","gap","Search","CopyToClipboard","_editor","p","pl","className","cx","CodeEditorClasses","editor","valid","data-testid","Editor","onValidate","defaultLanguage","options","minimap","enabled","wordWrap","scrollBeyondLastLine","formatOnPaste","fontSize","px","fontSizes","xs","readOnly","tabSize","onMount","onDidFocusEditorText","onDidBlurEditorText","getAction","run","Center","Loader","Stack","Math","max","mah"],"mappings":";;;;+BAmFaA;;;eAAAA;;;;;;;;;;;;;oBArEN;qBACuB;+DACO;sBAEwB;6DAE9C;sBACe;+BACA;4EACA;mBACZ;sBACG;AAmDrB,IAAMC,eAAyC;IAC3CC,UAAU;IACVC,cAAc;IACdC,cAAc;IACdC,WAAW;AACf;AAEO,IAAML,aAAiD,SAACM;IAC3D,IAoBIC,YAAAA,IAAAA,cAAQ,EAAC,cAAcN,cAAcK,QAnBrCJ,WAmBAK,UAnBAL,UACAE,eAkBAG,UAlBAH,cACAI,WAiBAD,UAjBAC,UACAC,SAgBAF,UAhBAE,QACAC,WAeAH,UAfAG,UACAC,UAcAJ,UAdAI,SACAC,QAaAL,UAbAK,OACAC,QAYAN,UAZAM,OACAC,WAWAP,UAXAO,UACAC,aAUAR,UAVAQ,YACAC,QASAT,UATAS,OACAC,aAQAV,UARAU,YACAC,cA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AsB;gBACtBC,eAAe;gBACfC,UAAUC,IAAAA,QAAE,EAACjD,MAAMkD,SAAS,CAACC,EAAE;gBAC/BC,UAAUjF;gBACVkF,SAAS;YACb;YACA3F,OAAOgB;YACPpB,UAAUqB;YACV2E,SAAS,SAAClB,QAAQ/C;gBACdN,UAAUW,OAAO,GAAG0C;gBACpB9C,kBAAkBD;gBAClB+C,OAAOmB,oBAAoB,CAAC;2BAAM9F,oBAAAA,8BAAAA;;gBAClC2E,OAAOoB,mBAAmB,eAAC,sBAAA;;;;gCACvB;;oCAAMpB,OAAOqB,SAAS,CAAC,gCAAgCC,GAAG;;;gCAA1D;;;;;;gBACJ;YACJ;;uBAIR,qBAACC,YAAM;QAAC1B,WAAWE,4BAAiB,CAACC,MAAM;kBACvC,cAAA,qBAACwB,YAAM;;IAIf,qBACI,sBAACC,WAAK;QAACnC,SAAQ;QAAaC,KAAK;QAAGN,GAAGyC,KAAKC,GAAG,CAAClF,cAAc1B;QAAY6G,KAAK9F;QAAWY,KAAKA;OAASV;;YACnGkD;YACAE;YACAM;YACAZ;;;AAGb"}
1
+ {"version":3,"sources":["../../../../src/components/code-editor/CodeEditor.tsx"],"sourcesContent":["import {\n Box,\n Center,\n Group,\n Input,\n InputWrapperProps,\n Loader,\n Space,\n Stack,\n StackProps,\n px,\n useMantineColorScheme,\n useMantineTheme,\n useProps,\n} from '@mantine/core';\nimport {useUncontrolled} from '@mantine/hooks';\nimport Editor, {Monaco, loader} from '@monaco-editor/react';\nimport {editor as monacoEditor} from 'monaco-editor';\nimport {FunctionComponent, useEffect, useRef, useState} from 'react';\n\nimport cx from 'clsx';\nimport {useParentHeight} from '../../hooks';\nimport {CopyToClipboard} from '../copyToClipboard';\nimport CodeEditorClasses from './CodeEditor.module.css';\nimport {XML} from './languages/xml';\nimport {Search} from './search';\ninterface CodeEditorProps\n extends Omit<\n InputWrapperProps,\n 'inputContainer' | 'inputWrapperOrder' | 'classNames' | 'styles' | 'vars' | 'onChange'\n >,\n Omit<StackProps, 'onChange'> {\n /**\n * The language syntax of the editor\n *\n * @default 'plaintext'\n */\n language?: 'plaintext' | 'json' | 'markdown' | 'python' | 'xml' | (string & unknown);\n /** Default value for uncontrolled input */\n defaultValue?: string;\n /** Value for controlled input */\n value?: string;\n /** onChange value for controlled input */\n onChange?(value: string): void;\n /** Called whenever the search icon is clicked */\n onSearch?(): void;\n /** Called whenever the copy icon is clicked */\n onCopy?(): void;\n /** Called whenever the code editor gets the focus */\n onFocus?(): void;\n /**\n * The minimal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height is too short, it will use this value as minimum.\n *\n * @default 300\n */\n minHeight?: number;\n /**\n * The maximal height of the CodeEditor (label and description included)\n *\n * By default the CodeEditor is adjusted to fill its parent height.\n * In the case where the parent height would be too high for your liking, you can use this prop to set a maximum.\n */\n maxHeight?: number;\n disabled?: boolean;\n /**\n * Defines how the monaco editor files will be loaded.\n * Note that using `'local'` requires [some additional configuration](https://github.com/suren-atoyan/monaco-react#use-monaco-editor-as-an-npm-package).\n *\n * @default 'local'\n */\n monacoLoader?: 'cdn' | 'local';\n}\n\nconst defaultProps: Partial<CodeEditorProps> = {\n language: 'plaintext',\n monacoLoader: 'local',\n defaultValue: '',\n minHeight: 300,\n};\n\nexport const CodeEditor: FunctionComponent<CodeEditorProps> = (props) => {\n const {\n language,\n defaultValue,\n onChange,\n onCopy,\n onSearch,\n onFocus,\n value,\n label,\n required,\n labelProps,\n error,\n errorProps,\n description,\n descriptionProps,\n minHeight,\n maxHeight,\n disabled,\n monacoLoader,\n ...others\n } = useProps('CodeEditor', defaultProps, props);\n const [loaded, setLoaded] = useState(false);\n const [_value, handleChange] = useUncontrolled<string>({\n value,\n defaultValue,\n onChange,\n finalValue: '',\n });\n const [parentHeight, ref] = useParentHeight();\n const editorRef = useRef(null);\n const loadLocalMonaco = async () => {\n const monacoInstance = await import('monaco-editor');\n loader.config({monaco: monacoInstance});\n setLoaded(true);\n };\n\n const registerLanguages = (monaco: Monaco) => {\n if (monaco && language === 'xml') {\n XML.register(monaco);\n }\n };\n\n const handleSearch = () => {\n if (editorRef.current) {\n editorRef.current.focus();\n editorRef.current.trigger('editor', 'actions.find', '');\n onSearch?.();\n }\n };\n\n const [hasMonacoError, setHasMonacoError] = useState(false);\n const renderErrorOutline = !!error || hasMonacoError;\n const theme = useMantineTheme();\n const {colorScheme} = useMantineColorScheme();\n\n useEffect(() => {\n if (monacoLoader === 'local') {\n loadLocalMonaco();\n } else {\n setLoaded(true);\n }\n }, []);\n\n const handleValidate = (markers: monacoEditor.IMarker[]) => {\n setHasMonacoError(\n markers.some((marker) => marker.severity === loader.__getMonacoInstance().MarkerSeverity.Error),\n );\n };\n\n const _label = label ? (\n <Input.Label required={required} {...labelProps}>\n {label}\n </Input.Label>\n ) : null;\n\n const _description = description ? (\n <Input.Description {...descriptionProps}>{description}</Input.Description>\n ) : null;\n\n const _error = error ? (\n <Input.Error mt=\"xs\" {...errorProps}>\n {error}\n </Input.Error>\n ) : (\n <Space h=\"xs\" />\n );\n\n const _header =\n _label || _description ? (\n <Box>\n {_label}\n {_description}\n </Box>\n ) : null;\n\n const _buttons = (\n <Group justify=\"right\" gap={0}>\n <Search handleSearch={handleSearch} />\n <CopyToClipboard value={_value} onCopy={() => onCopy?.()} />\n </Group>\n );\n\n const _editor = loaded ? (\n <Box\n p=\"md\"\n pl=\"xs\"\n className={cx(\n CodeEditorClasses.editor,\n {[CodeEditorClasses.valid]: !renderErrorOutline},\n {[CodeEditorClasses.error]: renderErrorOutline},\n )}\n data-testid=\"editor-wrapper\"\n >\n <Editor\n onValidate={handleValidate}\n defaultLanguage={language}\n theme={colorScheme === 'light' ? 'light' : 'vs-dark'}\n options={{\n minimap: {enabled: false},\n wordWrap: 'on',\n scrollBeyondLastLine: false,\n formatOnPaste: true,\n fontSize: px(theme.fontSizes.xs) as number,\n readOnly: disabled,\n tabSize: 2,\n }}\n value={_value}\n onChange={handleChange}\n onMount={(editor, monaco) => {\n editorRef.current = editor;\n registerLanguages(monaco);\n editor.onDidFocusEditorText(() => onFocus?.());\n editor.onDidBlurEditorText(async () => {\n await editor.getAction('editor.action.formatDocument').run();\n });\n }}\n />\n </Box>\n ) : (\n <Center className={CodeEditorClasses.editor}>\n <Loader />\n </Center>\n );\n\n return (\n <Stack justify=\"flex-start\" gap={0} h={Math.max(parentHeight, minHeight)} mah={maxHeight} ref={ref} {...others}>\n {_header}\n {_buttons}\n {_editor}\n {_error}\n </Stack>\n );\n};\n"],"names":["CodeEditor","defaultProps","language","monacoLoader","defaultValue","minHeight","props","useProps","onChange","onCopy","onSearch","onFocus","value","label","required","labelProps","error","errorProps","description","descriptionProps","maxHeight","disabled","others","useState","loaded","setLoaded","useUncontrolled","finalValue","_value","handleChange","useParentHeight","parentHeight","ref","editorRef","useRef","loadLocalMonaco","monacoInstance","loader","config","monaco","registerLanguages","XML","register","handleSearch","current","focus","trigger","hasMonacoError","setHasMonacoError","renderErrorOutline","theme","useMantineTheme","colorScheme","useMantineColorScheme","useEffect","handleValidate","markers","some","marker","severity","__getMonacoInstance","MarkerSeverity","Error","_label","Input","Label","_description","Description","_error","mt","Space","h","_header","Box","_buttons","Group","justify","gap","Search","CopyToClipboard","_editor","p","pl","className","cx","CodeEditorClasses","editor","valid","data-testid","Editor","onValidate","defaultLanguage","options","minimap","enabled","wordWrap","scrollBeyondLastLine","formatOnPaste","fontSize","px","fontSizes","xs","readOnly","tabSize","onMount","onDidFocusEditorText","onDidBlurEditorText","getAction","run","Center","Loader","Stack","Math","max","mah"],"mappings":";;;;+BAmFaA;;;eAAAA;;;;;;;;;;;;;oBArEN;qBACuB;+DACO;sBAEwB;6DAE9C;sBACe;+BACA;4EACA;mBACZ;sBACG;AAmDrB,IAAMC,eAAyC;IAC3CC,UAAU;IACVC,cAAc;IACdC,cAAc;IACdC,WAAW;AACf;AAEO,IAAML,aAAiD,SAACM;IAC3D,IAoBIC,YAAAA,IAAAA,cAAQ,EAAC,cAAc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B,uBAACD,4BAAiB,CAACE,KAAK,EAAG,CAACtC,qBAC5B,uBAACoC,4BAAiB,CAACrE,KAAK,EAAGiC;QAEhCuC,eAAY;kBAEZ,cAAA,qBAACC,cAAM;YACHC,YAAYnC;YACZoC,iBAAiBzF;YACjBgD,OAAOE,gBAAgB,UAAU,UAAU;YAC3CwC,SAAS;gBACLC,SAAS;oBAACC,SAAS;gBAAK;gBACxBC,UAAU;gBACVC,sBAAsB;gBACtBC,eAAe;gBACfC,UAAUC,IAAAA,QAAE,EAACjD,MAAMkD,SAAS,CAACC,EAAE;gBAC/BC,UAAUjF;gBACVkF,SAAS;YACb;YACA3F,OAAOgB;YACPpB,UAAUqB;YACV2E,SAAS,SAAClB,QAAQ/C;gBACdN,UAAUW,OAAO,GAAG0C;gBACpB9C,kBAAkBD;gBAClB+C,OAAOmB,oBAAoB,CAAC;2BAAM9F,oBAAAA,8BAAAA;;gBAClC2E,OAAOoB,mBAAmB,qCAAC;;;;gCACvB;;oCAAMpB,OAAOqB,SAAS,CAAC,gCAAgCC,GAAG;;;gCAA1D;;;;;;gBACJ;YACJ;;uBAIR,qBAACC,YAAM;QAAC1B,WAAWE,4BAAiB,CAACC,MAAM;kBACvC,cAAA,qBAACwB,YAAM;;IAIf,qBACI,sBAACC,WAAK;QAACnC,SAAQ;QAAaC,KAAK;QAAGN,GAAGyC,KAAKC,GAAG,CAAClF,cAAc1B;QAAY6G,KAAK9F;QAAWY,KAAKA;OAASV;;YACnGkD;YACAE;YACAM;YACAZ;;;AAGb"}
@@ -33,7 +33,7 @@ var format = function(xml) {
33
33
  };
34
34
  var register = function(monaco) {
35
35
  monaco.languages.registerDocumentFormattingEditProvider('xml', {
36
- provideDocumentFormattingEdits: function() {
36
+ provideDocumentFormattingEdits: /*#__PURE__*/ function() {
37
37
  var _ref = _async_to_generator._(function(model) {
38
38
  return _ts_generator._(this, function(_state) {
39
39
  return [
@@ -1,4 +1,5 @@
1
1
  import { UseFormInput } from '@mantine/form';
2
+ import { _TransformValues } from '@mantine/form/lib/types';
2
3
  import { CollectionProps } from './Collection';
3
- export declare const enhanceWithCollectionProps: <FormValues>(payload: Parameters<UseFormInput<FormValues>["enhanceGetInputProps"]>[0], field: (typeof payload)["field"]) => Pick<CollectionProps<unknown>, "onReorderItem" | "onInsertItem" | "onRemoveItem">;
4
+ export declare const enhanceWithCollectionProps: <FormValues, TransformValues extends _TransformValues<FormValues> = (values: FormValues) => FormValues>(payload: Parameters<UseFormInput<FormValues, TransformValues>["enhanceGetInputProps"]>[0], field: (typeof payload)["field"]) => Pick<CollectionProps<unknown>, "onReorderItem" | "onInsertItem" | "onRemoveItem">;
4
5
  //# sourceMappingURL=enhanceWithCollectionProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enhanceWithCollectionProps.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GAAI,UAAU,WACxC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,SACjE,CAAC,OAAO,OAAO,EAAE,OAAO,CAAC,KACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,CAYlF,CAAC"}
1
+ {"version":3,"file":"enhanceWithCollectionProps.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GACnC,UAAU,EACV,eAAe,SAAS,gBAAgB,CAAC,UAAU,CAAC,YAAY,UAAU,KAAK,UAAU,WAEhF,UAAU,CAAC,YAAY,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,SAClF,CAAC,OAAO,OAAO,EAAE,OAAO,CAAC,KACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,CAYlF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"sourcesContent":["import {UseFormInput} from '@mantine/form';\nimport {CollectionProps} from './Collection';\n\nexport const enhanceWithCollectionProps = <FormValues>(\n payload: Parameters<UseFormInput<FormValues>['enhanceGetInputProps']>[0],\n field: (typeof payload)['field'],\n): Pick<CollectionProps<unknown>, 'onReorderItem' | 'onInsertItem' | 'onRemoveItem'> => {\n if (payload.field === field) {\n return {\n onReorderItem: (reorderPayload: Record<'from' | 'to', number>) =>\n payload.form.reorderListItem(field, reorderPayload),\n onRemoveItem: (index: number) => payload.form.removeListItem(field, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n payload.form.insertListItem(field, valueToInsert, index),\n };\n }\n\n return {};\n};\n"],"names":["enhanceWithCollectionProps","payload","field","onReorderItem","reorderPayload","form","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":";;;;+BAGaA;;;eAAAA;;;AAAN,IAAMA,6BAA6B,SACtCC,SACAC;IAEA,IAAID,QAAQC,KAAK,KAAKA,OAAO;QACzB,OAAO;YACHC,eAAe,SAACC;uBACZH,QAAQI,IAAI,CAACC,eAAe,CAACJ,OAAOE;;YACxCG,cAAc,SAACC;uBAAkBP,QAAQI,IAAI,CAACI,cAAc,CAACP,OAAOM;;YACpEE,cAAc,SAACC,eAAwBH;uBACnCP,QAAQI,IAAI,CAACO,cAAc,CAACV,OAAOS,eAAeH;;QAC1D;IACJ;IAEA,OAAO,CAAC;AACZ"}
1
+ {"version":3,"sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"sourcesContent":["import {UseFormInput} from '@mantine/form';\nimport {_TransformValues} from '@mantine/form/lib/types';\nimport {CollectionProps} from './Collection';\n\nexport const enhanceWithCollectionProps = <\n FormValues,\n TransformValues extends _TransformValues<FormValues> = (values: FormValues) => FormValues,\n>(\n payload: Parameters<UseFormInput<FormValues, TransformValues>['enhanceGetInputProps']>[0],\n field: (typeof payload)['field'],\n): Pick<CollectionProps<unknown>, 'onReorderItem' | 'onInsertItem' | 'onRemoveItem'> => {\n if (payload.field === field) {\n return {\n onReorderItem: (reorderPayload: Record<'from' | 'to', number>) =>\n payload.form.reorderListItem(field, reorderPayload),\n onRemoveItem: (index: number) => payload.form.removeListItem(field, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n payload.form.insertListItem(field, valueToInsert, index),\n };\n }\n\n return {};\n};\n"],"names":["enhanceWithCollectionProps","payload","field","onReorderItem","reorderPayload","form","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":";;;;+BAIaA;;;eAAAA;;;AAAN,IAAMA,6BAA6B,SAItCC,SACAC;IAEA,IAAID,QAAQC,KAAK,KAAKA,OAAO;QACzB,OAAO;YACHC,eAAe,SAACC;uBACZH,QAAQI,IAAI,CAACC,eAAe,CAACJ,OAAOE;;YACxCG,cAAc,SAACC;uBAAkBP,QAAQI,IAAI,CAACI,cAAc,CAACP,OAAOM;;YACpEE,cAAc,SAACC,eAAwBH;uBACnCP,QAAQI,IAAI,CAACO,cAAc,CAACV,OAAOS,eAAeH;;QAC1D;IACJ;IAEA,OAAO,CAAC;AACZ"}
@@ -4,12 +4,12 @@ export interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledT
4
4
  }
5
5
  export declare const Menu: ((_props: import("@mantine/core").MenuProps) => import("react/jsx-runtime").JSX.Element) & typeof MantineMenu & {
6
6
  displayName: string;
7
- Item: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, MenuItemProps>) => import("react").ReactElement) & Omit<import("react").FunctionComponent<(MenuItemProps & {
7
+ Item: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, MenuItemProps>) => React.ReactElement) & Omit<import("react").FunctionComponent<(MenuItemProps & {
8
8
  component?: any;
9
9
  } & Omit<Pick<any, string | number | symbol>, "component" | keyof MenuItemProps> & {
10
10
  ref?: any;
11
11
  }) | (MenuItemProps & {
12
- component: import("react").ElementType<any>;
12
+ component: React.ElementType<any>;
13
13
  })>, never> & Record<string, never>;
14
14
  };
15
15
  //# sourceMappingURL=Menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,IAAI,WAAW,EAAE,aAAa,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAIzF,OAAO,EAAC,8BAA8B,EAAC,MAAM,WAAW,CAAC;AAGzD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,EAAE,8BAA8B;CAAG;AAgB9F,eAAO,MAAM,IAAI;;;;;;;;;CAGf,CAAC"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,IAAI,WAAW,EAAE,aAAa,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAIzF,OAAO,EAAC,8BAA8B,EAAC,MAAM,WAAW,CAAC;AAGzD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,EAAE,8BAA8B;CAAG;AAgB9F,eAAO,MAAM,IAAI;;0GAAiB,MAAO,YACzC;;;;;mBAG4G,MAAO,WAAW;;CAD5H,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { flexRender as renderTableCell } from '@tanstack/react-table';
2
2
  export * from './Table';
3
- export { type TableLayout, type TableProps, type TableLayoutProps, type TableAction } from './Table.types';
4
- export { useTable, type TableState, type TableStore, type UseTableOptions } from './use-table';
3
+ export { TablePredicateProps } from './table-predicate/TablePredicate';
4
+ export { type TableAction, type TableLayout, type TableLayoutProps, type TableProps } from './Table.types';
5
5
  export { useTableContext } from './TableContext';
6
+ export { useTable, type TableState, type TableStore, type UseTableOptions } from './use-table';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACpE,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AACzG,OAAO,EAAC,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACpE,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC;AACzG,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,aAAa,CAAC"}
@@ -9,6 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ TablePredicateProps: function() {
13
+ return _TablePredicate.TablePredicateProps;
14
+ },
12
15
  renderTableCell: function() {
13
16
  return _reacttable.flexRender;
14
17
  },
@@ -22,7 +25,8 @@ _export(exports, {
22
25
  var _export_star = require("@swc/helpers/_/_export_star");
23
26
  var _reacttable = require("@tanstack/react-table");
24
27
  _export_star._(require("./Table"), exports);
25
- var _usetable = require("./use-table");
28
+ var _TablePredicate = require("./table-predicate/TablePredicate");
26
29
  var _TableContext = require("./TableContext");
30
+ var _usetable = require("./use-table");
27
31
 
28
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/table/index.ts"],"sourcesContent":["export {flexRender as renderTableCell} from '@tanstack/react-table';\nexport * from './Table';\nexport {type TableLayout, type TableProps, type TableLayoutProps, type TableAction} from './Table.types';\nexport {useTable, type TableState, type TableStore, type UseTableOptions} from './use-table';\nexport {useTableContext} from './TableContext';\n"],"names":["renderTableCell","flexRender","useTable","useTableContext"],"mappings":";;;;;;;;;;;IAAsBA,eAAe;eAA7BC,sBAAU;;IAGVC,QAAQ;eAARA,kBAAQ;;IACRC,eAAe;eAAfA,6BAAe;;;;0BAJqB;uBAC9B;wBAEiE;4BACjD"}
1
+ {"version":3,"sources":["../../../../src/components/table/index.ts"],"sourcesContent":["export {flexRender as renderTableCell} from '@tanstack/react-table';\nexport * from './Table';\nexport {TablePredicateProps} from './table-predicate/TablePredicate';\nexport {type TableAction, type TableLayout, type TableLayoutProps, type TableProps} from './Table.types';\nexport {useTableContext} from './TableContext';\nexport {useTable, type TableState, type TableStore, type UseTableOptions} from './use-table';\n"],"names":["TablePredicateProps","renderTableCell","flexRender","useTable","useTableContext"],"mappings":";;;;;;;;;;;IAEQA,mBAAmB;eAAnBA,mCAAmB;;IAFLC,eAAe;eAA7BC,sBAAU;;IAKVC,QAAQ;eAARA,kBAAQ;;IADRC,eAAe;eAAfA,6BAAe;;;;0BAJqB;uBAC9B;8BACoB;4BAEJ;wBACiD"}
@@ -1,7 +1,7 @@
1
- import { BoxProps, ComboboxData, CompoundStylesApiProps, Factory } from '@mantine/core';
1
+ import { BoxProps, ComboboxData, CompoundStylesApiProps, Factory, SelectProps } from '@mantine/core';
2
2
  import { FunctionComponent } from 'react';
3
3
  export type TablePredicateStylesNames = 'predicate' | 'predicateWrapper' | 'predicateLabel' | 'predicateSelect';
4
- export interface TablePredicateProps extends BoxProps, CompoundStylesApiProps<TablePredicateFactory> {
4
+ export interface TablePredicateProps extends BoxProps, Pick<SelectProps, 'renderOption'>, CompoundStylesApiProps<TablePredicateFactory> {
5
5
  /**
6
6
  * Unique identifier for this predicate. Will be used to access the selected value in the table state
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TablePredicate.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/table-predicate/TablePredicate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,YAAY,EACZ,sBAAsB,EAEtB,OAAO,EAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAKxC,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEhH,MAAM,WAAW,mBAAoB,SAAQ,QAAQ,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;IAChG;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,yBAAyB,CAAC;IACvC,QAAQ,EAAE,IAAI,CAAC;CAClB,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAqChE,CAAC"}
1
+ {"version":3,"file":"TablePredicate.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/table-predicate/TablePredicate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,YAAY,EACZ,sBAAsB,EAEtB,OAAO,EAIP,WAAW,EAGd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAKxC,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEhH,MAAM,WAAW,mBACb,SAAQ,QAAQ,EACZ,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EACjC,sBAAsB,CAAC,qBAAqB,CAAC;IACjD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,yBAAyB,CAAC;IACvC,QAAQ,EAAE,IAAI,CAAC;CAClB,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAsChE,CAAC"}
@@ -19,7 +19,7 @@ var _TableContext = require("../TableContext");
19
19
  var defaultProps = {};
20
20
  var TablePredicate = (0, _core.factory)(function(props, ref) {
21
21
  var _useTableContext = (0, _TableContext.useTableContext)(), store = _useTableContext.store, getStyles = _useTableContext.getStyles;
22
- var _useProps = (0, _core.useProps)('PlasmaTablePredicate', defaultProps, props), id = _useProps.id, data = _useProps.data, label = _useProps.label, classNames = _useProps.classNames, className = _useProps.className, styles = _useProps.styles, style = _useProps.style, vars = _useProps.vars, others = _object_without_properties._(_useProps, [
22
+ var _useProps = (0, _core.useProps)('PlasmaTablePredicate', defaultProps, props), id = _useProps.id, data = _useProps.data, label = _useProps.label, classNames = _useProps.classNames, className = _useProps.className, styles = _useProps.styles, style = _useProps.style, renderOption = _useProps.renderOption, vars = _useProps.vars, others = _object_without_properties._(_useProps, [
23
23
  "id",
24
24
  "data",
25
25
  "label",
@@ -27,6 +27,7 @@ var TablePredicate = (0, _core.factory)(function(props, ref) {
27
27
  "className",
28
28
  "styles",
29
29
  "style",
30
+ "renderOption",
30
31
  "vars"
31
32
  ]);
32
33
  var handleChange = function(newValue) {
@@ -69,7 +70,8 @@ var TablePredicate = (0, _core.factory)(function(props, ref) {
69
70
  onChange: handleChange,
70
71
  data: data,
71
72
  "aria-label": label !== null && label !== void 0 ? label : id,
72
- searchable: data.length > 7
73
+ searchable: data.length > 7,
74
+ renderOption: renderOption
73
75
  }, getStyles('predicateSelect', stylesApiProps)))
74
76
  ]
75
77
  }))
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/table/table-predicate/TablePredicate.tsx"],"sourcesContent":["import {\n BoxProps,\n ComboboxData,\n CompoundStylesApiProps,\n factory,\n Factory,\n Grid,\n Group,\n Select,\n Text,\n useProps,\n} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\nimport {TableComponentsOrder} from '../Table';\nimport {useTableContext} from '../TableContext';\n\nexport type TablePredicateStylesNames = 'predicate' | 'predicateWrapper' | 'predicateLabel' | 'predicateSelect';\n\nexport interface TablePredicateProps extends BoxProps, CompoundStylesApiProps<TablePredicateFactory> {\n /**\n * Unique identifier for this predicate. Will be used to access the selected value in the table state\n */\n id: string;\n /**\n * The values to display in the predicate\n */\n data: ComboboxData;\n /**\n * Input label (not displayed for now)\n *\n * @default default to the predicate id\n */\n label?: string;\n}\n\nexport type TablePredicateFactory = Factory<{\n props: TablePredicateProps;\n ref: HTMLDivElement;\n stylesNames: TablePredicateStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<TablePredicateProps> = {};\n\nexport const TablePredicate: FunctionComponent<TablePredicateProps> = factory<TablePredicateFactory>((props, ref) => {\n const {store, getStyles} = useTableContext();\n const {id, data, label, classNames, className, styles, style, vars, ...others} = useProps(\n 'PlasmaTablePredicate',\n defaultProps,\n props,\n );\n\n const handleChange = (newValue: string) => {\n store.setPredicates((prev) => ({...prev, [id]: newValue}));\n store.setPagination((prev) => ({...prev, pageIndex: 0}));\n };\n\n const stylesApiProps = {classNames, styles};\n\n return (\n <Grid.Col\n span=\"content\"\n order={TableComponentsOrder.Predicate}\n ref={ref}\n {...getStyles('predicate', {className, style, ...stylesApiProps})}\n {...others}\n >\n <Group gap=\"xs\" {...getStyles('predicateWrapper', stylesApiProps)}>\n {label ? <Text {...getStyles('predicateLabel', stylesApiProps)}>{label}:</Text> : null}\n <Select\n comboboxProps={{withinPortal: true}}\n value={store.state.predicates[id]}\n onChange={handleChange}\n data={data}\n aria-label={label ?? id}\n searchable={data.length > 7}\n {...getStyles('predicateSelect', stylesApiProps)}\n />\n </Group>\n </Grid.Col>\n );\n});\n"],"names":["TablePredicate","defaultProps","factory","props","ref","useTableContext","store","getStyles","useProps","id","data","label","classNames","className","styles","style","vars","others","handleChange","newValue","setPredicates","prev","setPagination","pageIndex","stylesApiProps","Grid","Col","span","order","TableComponentsOrder","Predicate","Group","gap","Text","Select","comboboxProps","withinPortal","value","state","predicates","onChange","aria-label","searchable","length"],"mappings":";;;;+BA6CaA;;;eAAAA;;;;;;;;oBAlCN;qBAG4B;4BACL;AA4B9B,IAAMC,eAA6C,CAAC;AAE7C,IAAMD,iBAAyDE,IAAAA,aAAO,EAAwB,SAACC,OAAOC;IACzG,IAA2BC,mBAAAA,IAAAA,6BAAe,KAAnCC,QAAoBD,iBAApBC,OAAOC,YAAaF,iBAAbE;IACd,IAAiFC,YAAAA,IAAAA,cAAQ,EACrF,wBACAP,cACAE,QAHGM,KAA0ED,UAA1EC,IAAIC,OAAsEF,UAAtEE,MAAMC,QAAgEH,UAAhEG,OAAOC,aAAyDJ,UAAzDI,YAAYC,YAA6CL,UAA7CK,WAAWC,SAAkCN,UAAlCM,QAAQC,QAA0BP,UAA1BO,OAAOC,OAAmBR,UAAnBQ,MAASC,sCAAUT;QAA1EC;QAAIC;QAAMC;QAAOC;QAAYC;QAAWC;QAAQC;QAAOC;;IAM9D,IAAME,eAAe,SAACC;QAClBb,MAAMc,aAAa,CAAC,SAACC;mBAAU,4CAAIA,OAAM,uBAACZ,IAAKU;;QAC/Cb,MAAMgB,aAAa,CAAC,SAACD;mBAAU,4CAAIA;gBAAME,WAAW;;;IACxD;IAEA,IAAMC,iBAAiB;QAACZ,YAAAA;QAAYE,QAAAA;IAAM;IAE1C,qBACI,qBAACW,UAAI,CAACC,GAAG;QACLC,MAAK;QACLC,OAAOC,2BAAoB,CAACC,SAAS;QACrC1B,KAAKA;OACDG,UAAU,aAAa;QAACM,WAAAA;QAAWE,OAAAA;OAAUS,kBAC7CP;kBAEJ,cAAA,sBAACc,WAAK;YAACC,KAAI;WAASzB,UAAU,oBAAoBiB;;gBAC7Cb,sBAAQ,sBAACsB,UAAI,8CAAK1B,UAAU,kBAAkBiB;;wBAAkBb;wBAAM;;sBAAW;8BAClF,qBAACuB,YAAM;oBACHC,eAAe;wBAACC,cAAc;oBAAI;oBAClCC,OAAO/B,MAAMgC,KAAK,CAACC,UAAU,CAAC9B,GAAG;oBACjC+B,UAAUtB;oBACVR,MAAMA;oBACN+B,cAAY9B,kBAAAA,mBAAAA,QAASF;oBACrBiC,YAAYhC,KAAKiC,MAAM,GAAG;mBACtBpC,UAAU,mBAAmBiB;;;;AAKrD"}
1
+ {"version":3,"sources":["../../../../../src/components/table/table-predicate/TablePredicate.tsx"],"sourcesContent":["import {\n BoxProps,\n ComboboxData,\n CompoundStylesApiProps,\n factory,\n Factory,\n Grid,\n Group,\n Select,\n SelectProps,\n Text,\n useProps,\n} from '@mantine/core';\nimport {FunctionComponent} from 'react';\n\nimport {TableComponentsOrder} from '../Table';\nimport {useTableContext} from '../TableContext';\n\nexport type TablePredicateStylesNames = 'predicate' | 'predicateWrapper' | 'predicateLabel' | 'predicateSelect';\n\nexport interface TablePredicateProps\n extends BoxProps,\n Pick<SelectProps, 'renderOption'>,\n CompoundStylesApiProps<TablePredicateFactory> {\n /**\n * Unique identifier for this predicate. Will be used to access the selected value in the table state\n */\n id: string;\n /**\n * The values to display in the predicate\n */\n data: ComboboxData;\n /**\n * Input label (not displayed for now)\n *\n * @default default to the predicate id\n */\n label?: string;\n}\n\nexport type TablePredicateFactory = Factory<{\n props: TablePredicateProps;\n ref: HTMLDivElement;\n stylesNames: TablePredicateStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<TablePredicateProps> = {};\n\nexport const TablePredicate: FunctionComponent<TablePredicateProps> = factory<TablePredicateFactory>((props, ref) => {\n const {store, getStyles} = useTableContext();\n const {id, data, label, classNames, className, styles, style, renderOption, vars, ...others} = useProps(\n 'PlasmaTablePredicate',\n defaultProps,\n props,\n );\n\n const handleChange = (newValue: string) => {\n store.setPredicates((prev) => ({...prev, [id]: newValue}));\n store.setPagination((prev) => ({...prev, pageIndex: 0}));\n };\n\n const stylesApiProps = {classNames, styles};\n\n return (\n <Grid.Col\n span=\"content\"\n order={TableComponentsOrder.Predicate}\n ref={ref}\n {...getStyles('predicate', {className, style, ...stylesApiProps})}\n {...others}\n >\n <Group gap=\"xs\" {...getStyles('predicateWrapper', stylesApiProps)}>\n {label ? <Text {...getStyles('predicateLabel', stylesApiProps)}>{label}:</Text> : null}\n <Select\n comboboxProps={{withinPortal: true}}\n value={store.state.predicates[id]}\n onChange={handleChange}\n data={data}\n aria-label={label ?? id}\n searchable={data.length > 7}\n renderOption={renderOption}\n {...getStyles('predicateSelect', stylesApiProps)}\n />\n </Group>\n </Grid.Col>\n );\n});\n"],"names":["TablePredicate","defaultProps","factory","props","ref","useTableContext","store","getStyles","useProps","id","data","label","classNames","className","styles","style","renderOption","vars","others","handleChange","newValue","setPredicates","prev","setPagination","pageIndex","stylesApiProps","Grid","Col","span","order","TableComponentsOrder","Predicate","Group","gap","Text","Select","comboboxProps","within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AAMiC,KAAK,CAACC,UAAU,CAAC/B,GAAG;oBACjCgC,UAAUtB;oBACVT,MAAMA;oBACNgC,cAAY/B,kBAAAA,mBAAAA,QAASF;oBACrBkC,YAAYjC,KAAKkC,MAAM,GAAG;oBAC1B5B,cAAcA;mBACVT,UAAU,mBAAmBkB;;;;AAKrD"}
@@ -15,7 +15,7 @@ var _ts_generator = require("@swc/helpers/_/_ts_generator");
15
15
  var _react = require("react");
16
16
  var useClickWithLoading = function(handler) {
17
17
  var _useState = _sliced_to_array._((0, _react.useState)(false), 2), isLoading = _useState[0], setIsLoading = _useState[1];
18
- var handleClick = function() {
18
+ var handleClick = /*#__PURE__*/ function() {
19
19
  var _ref = _async_to_generator._(function(event) {
20
20
  var possiblePromise, err;
21
21
  return _ts_generator._(this, function(_state) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>,\n>(\n component: Component,\n properties: StaticProperties,\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC;;;;+BACYA;;;eAAAA;;;;AAAN,IAAMA,oBAAoB,SAI7BC,WACAC;IAEA,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,UAAAA,MAAAA,KAAAA,GAAU,uBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD"}
1
+ {"version":3,"sources":["../../../src/utils/overrideComponent.ts"],"sourcesContent":["/**\n * Allows to override static properties from a component function\n *\n * @param component The component which holds the static properties\n * @param properties The new static properties to assign on the component\n * @returns A new component with the specified properties. It doesn't change the original component\n * @example const Menu = overrideComponent(MantineMenu, {Item: MyMenuItem}); // Menu.Item will equal MyMenuItem\n */\nexport const overrideComponent = <\n Component extends (...args: Parameters<Component>) => ReturnType<Component>,\n StaticProperties = Record<keyof Component, never>,\n>(\n component: Component,\n properties: StaticProperties,\n): ((...args: Parameters<Component>) => ReturnType<Component>) & Component & StaticProperties => {\n const componentClone = (...args: Parameters<Component>) => component(...args);\n return Object.assign(componentClone, component, properties);\n};\n"],"names":["overrideComponent","component","properties","componentClone","args","Object","assign"],"mappings":"AAAA;;;;;;;CAOC;;;;+BACYA;;;eAAAA;;;;AAAN,IAAMA,oBAAoB,SAI7BC,WACAC;IAEA,IAAMC,iBAAiB;yCAAIC;YAAAA;;eAAgCH,gBAAAA,KAAAA,GAAU,uBAAGG;;IACxE,OAAOC,OAAOC,MAAM,CAACH,gBAAgBF,WAAWC;AACpD"}
@@ -19,11 +19,11 @@ export interface ButtonWithDisabledTooltipProps {
19
19
  */
20
20
  fullWidth?: boolean;
21
21
  }
22
- export declare const ButtonWithDisabledTooltip: (<C = "div">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => import("react").ReactElement) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
22
+ export declare const ButtonWithDisabledTooltip: (<C = "div">(props: import("@mantine/utils").PolymorphicComponentProps<C, ButtonWithDisabledTooltipProps>) => React.ReactElement) & Omit<import("react").FunctionComponent<(ButtonWithDisabledTooltipProps & {
23
23
  component?: any;
24
24
  } & Omit<Pick<any, string | number | symbol>, "component" | keyof ButtonWithDisabledTooltipProps> & {
25
25
  ref?: any;
26
26
  }) | (ButtonWithDisabledTooltipProps & {
27
- component: import("react").ElementType<any>;
27
+ component: React.ElementType<any>;
28
28
  })>, never> & Record<string, never>;
29
29
  //# sourceMappingURL=ButtonWithDisabledTooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,SAAS,EAAa,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC7E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAeD,eAAO,MAAM,yBAAyB;;;;;;mCAErC,CAAC"}
1
+ {"version":3,"file":"ButtonWithDisabledTooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonWithDisabledTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,SAAS,EAAa,MAAM,OAAO,CAAC;AAI5C,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC7E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAeD,eAAO,MAAM,yBAAyB,gHAVqC,MAAO,YACjF;;;;;eAGW,MAAM,WACZ;mCAOL,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { UseFormInput } from '@mantine/form';
2
+ import { _TransformValues } from '@mantine/form/lib/types';
2
3
  import { CollectionProps } from './Collection';
3
- export declare const enhanceWithCollectionProps: <FormValues>(payload: Parameters<UseFormInput<FormValues>["enhanceGetInputProps"]>[0], field: (typeof payload)["field"]) => Pick<CollectionProps<unknown>, "onReorderItem" | "onInsertItem" | "onRemoveItem">;
4
+ export declare const enhanceWithCollectionProps: <FormValues, TransformValues extends _TransformValues<FormValues> = (values: FormValues) => FormValues>(payload: Parameters<UseFormInput<FormValues, TransformValues>["enhanceGetInputProps"]>[0], field: (typeof payload)["field"]) => Pick<CollectionProps<unknown>, "onReorderItem" | "onInsertItem" | "onRemoveItem">;
4
5
  //# sourceMappingURL=enhanceWithCollectionProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enhanceWithCollectionProps.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GAAI,UAAU,WACxC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,SACjE,CAAC,OAAO,OAAO,EAAE,OAAO,CAAC,KACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,CAYlF,CAAC"}
1
+ {"version":3,"file":"enhanceWithCollectionProps.d.ts","sourceRoot":"","sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7C,eAAO,MAAM,0BAA0B,GACnC,UAAU,EACV,eAAe,SAAS,gBAAgB,CAAC,UAAU,CAAC,YAAY,UAAU,KAAK,UAAU,WAEhF,UAAU,CAAC,YAAY,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,SAClF,CAAC,OAAO,OAAO,EAAE,OAAO,CAAC,KACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,CAYlF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"sourcesContent":["import {UseFormInput} from '@mantine/form';\nimport {CollectionProps} from './Collection';\n\nexport const enhanceWithCollectionProps = <FormValues>(\n payload: Parameters<UseFormInput<FormValues>['enhanceGetInputProps']>[0],\n field: (typeof payload)['field'],\n): Pick<CollectionProps<unknown>, 'onReorderItem' | 'onInsertItem' | 'onRemoveItem'> => {\n if (payload.field === field) {\n return {\n onReorderItem: (reorderPayload: Record<'from' | 'to', number>) =>\n payload.form.reorderListItem(field, reorderPayload),\n onRemoveItem: (index: number) => payload.form.removeListItem(field, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n payload.form.insertListItem(field, valueToInsert, index),\n };\n }\n\n return {};\n};\n"],"names":["enhanceWithCollectionProps","payload","field","onReorderItem","reorderPayload","form","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":"AAGA,OAAO,MAAMA,6BAA6B,CACtCC,SACAC;IAEA,IAAID,QAAQC,KAAK,KAAKA,OAAO;QACzB,OAAO;YACHC,eAAe,CAACC,iBACZH,QAAQI,IAAI,CAACC,eAAe,CAACJ,OAAOE;YACxCG,cAAc,CAACC,QAAkBP,QAAQI,IAAI,CAACI,cAAc,CAACP,OAAOM;YACpEE,cAAc,CAACC,eAAwBH,QACnCP,QAAQI,IAAI,CAACO,cAAc,CAACV,OAAOS,eAAeH;QAC1D;IACJ;IAEA,OAAO,CAAC;AACZ,EAAE"}
1
+ {"version":3,"sources":["../../../../src/components/collection/enhanceWithCollectionProps.ts"],"sourcesContent":["import {UseFormInput} from '@mantine/form';\nimport {_TransformValues} from '@mantine/form/lib/types';\nimport {CollectionProps} from './Collection';\n\nexport const enhanceWithCollectionProps = <\n FormValues,\n TransformValues extends _TransformValues<FormValues> = (values: FormValues) => FormValues,\n>(\n payload: Parameters<UseFormInput<FormValues, TransformValues>['enhanceGetInputProps']>[0],\n field: (typeof payload)['field'],\n): Pick<CollectionProps<unknown>, 'onReorderItem' | 'onInsertItem' | 'onRemoveItem'> => {\n if (payload.field === field) {\n return {\n onReorderItem: (reorderPayload: Record<'from' | 'to', number>) =>\n payload.form.reorderListItem(field, reorderPayload),\n onRemoveItem: (index: number) => payload.form.removeListItem(field, index),\n onInsertItem: (valueToInsert: unknown, index: number) =>\n payload.form.insertListItem(field, valueToInsert, index),\n };\n }\n\n return {};\n};\n"],"names":["enhanceWithCollectionProps","payload","field","onReorderItem","reorderPayload","form","reorderListItem","onRemoveItem","index","removeListItem","onInsertItem","valueToInsert","insertListItem"],"mappings":"AAIA,OAAO,MAAMA,6BAA6B,CAItCC,SACAC;IAEA,IAAID,QAAQC,KAAK,KAAKA,OAAO;QACzB,OAAO;YACHC,eAAe,CAACC,iBACZH,QAAQI,IAAI,CAACC,eAAe,CAACJ,OAAOE;YACxCG,cAAc,CAACC,QAAkBP,QAAQI,IAAI,CAACI,cAAc,CAACP,OAAOM;YACpEE,cAAc,CAACC,eAAwBH,QACnCP,QAAQI,IAAI,CAACO,cAAc,CAACV,OAAOS,eAAeH;QAC1D;IACJ;IAEA,OAAO,CAAC;AACZ,EAAE"}
@@ -4,12 +4,12 @@ export interface MenuItemProps extends MantineMenuItemProps, ButtonWithDisabledT
4
4
  }
5
5
  export declare const Menu: ((_props: import("@mantine/core").MenuProps) => import("react/jsx-runtime").JSX.Element) & typeof MantineMenu & {
6
6
  displayName: string;
7
- Item: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, MenuItemProps>) => import("react").ReactElement) & Omit<import("react").FunctionComponent<(MenuItemProps & {
7
+ Item: (<C = "button">(props: import("@mantine/utils").PolymorphicComponentProps<C, MenuItemProps>) => React.ReactElement) & Omit<import("react").FunctionComponent<(MenuItemProps & {
8
8
  component?: any;
9
9
  } & Omit<Pick<any, string | number | symbol>, "component" | keyof MenuItemProps> & {
10
10
  ref?: any;
11
11
  }) | (MenuItemProps & {
12
- component: import("react").ElementType<any>;
12
+ component: React.ElementType<any>;
13
13
  })>, never> & Record<string, never>;
14
14
  };
15
15
  //# sourceMappingURL=Menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,IAAI,WAAW,EAAE,aAAa,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAIzF,OAAO,EAAC,8BAA8B,EAAC,MAAM,WAAW,CAAC;AAGzD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,EAAE,8BAA8B;CAAG;AAgB9F,eAAO,MAAM,IAAI;;;;;;;;;CAGf,CAAC"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,IAAI,WAAW,EAAE,aAAa,IAAI,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAIzF,OAAO,EAAC,8BAA8B,EAAC,MAAM,WAAW,CAAC;AAGzD,MAAM,WAAW,aAAc,SAAQ,oBAAoB,EAAE,8BAA8B;CAAG;AAgB9F,eAAO,MAAM,IAAI;;0GAAiB,MAAO,YACzC;;;;;mBAG4G,MAAO,WAAW;;CAD5H,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { flexRender as renderTableCell } from '@tanstack/react-table';
2
2
  export * from './Table';
3
- export { type TableLayout, type TableProps, type TableLayoutProps, type TableAction } from './Table.types';
4
- export { useTable, type TableState, type TableStore, type UseTableOptions } from './use-table';
3
+ export { TablePredicateProps } from './table-predicate/TablePredicate';
4
+ export { type TableAction, type TableLayout, type TableLayoutProps, type TableProps } from './Table.types';
5
5
  export { useTableContext } from './TableContext';
6
+ export { useTable, type TableState, type TableStore, type UseTableOptions } from './use-table';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACpE,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AACzG,OAAO,EAAC,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACpE,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAC,MAAM,eAAe,CAAC;AACzG,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,aAAa,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { flexRender as renderTableCell } from '@tanstack/react-table';
2
2
  export * from './Table';
3
- export { useTable } from './use-table';
3
+ export { TablePredicateProps } from './table-predicate/TablePredicate';
4
4
  export { useTableContext } from './TableContext';
5
+ export { useTable } from './use-table';
5
6
 
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/table/index.ts"],"sourcesContent":["export {flexRender as renderTableCell} from '@tanstack/react-table';\nexport * from './Table';\nexport {type TableLayout, type TableProps, type TableLayoutProps, type TableAction} from './Table.types';\nexport {useTable, type TableState, type TableStore, type UseTableOptions} from './use-table';\nexport {useTableContext} from './TableContext';\n"],"names":["flexRender","renderTableCell","useTable","useTableContext"],"mappings":"AAAA,SAAQA,cAAcC,eAAe,QAAO,wBAAwB;AACpE,cAAc,UAAU;AAExB,SAAQC,QAAQ,QAA+D,cAAc;AAC7F,SAAQC,eAAe,QAAO,iBAAiB"}
1
+ {"version":3,"sources":["../../../../src/components/table/index.ts"],"sourcesContent":["export {flexRender as renderTableCell} from '@tanstack/react-table';\nexport * from './Table';\nexport {TablePredicateProps} from './table-predicate/TablePredicate';\nexport {type TableAction, type TableLayout, type TableLayoutProps, type TableProps} from './Table.types';\nexport {useTableContext} from './TableContext';\nexport {useTable, type TableState, type TableStore, type UseTableOptions} from './use-table';\n"],"names":["flexRender","renderTableCell","TablePredicateProps","useTableContext","useTable"],"mappings":"AAAA,SAAQA,cAAcC,eAAe,QAAO,wBAAwB;AACpE,cAAc,UAAU;AACxB,SAAQC,mBAAmB,QAAO,mCAAmC;AAErE,SAAQC,eAAe,QAAO,iBAAiB;AAC/C,SAAQC,QAAQ,QAA+D,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/components/table/layouts/row-layout/RowLayoutBody.tsx"],"sourcesContent":["import {Box, BoxProps, Collapse, CompoundStylesApiProps, Factory, useProps} from '@mantine/core';\nimport {flexRender} from '@tanstack/react-table';\nimport {defaultColumnSizing} from '@tanstack/table-core';\nimport {ForwardedRef, Fragment, type MouseEvent} from 'react';\nimport {CustomComponentThemeExtend, identity} from '../../../../utils';\nimport {TableLayoutProps} from '../../Table.types';\nimport {useTableContext} from '../../TableContext';\nimport {TableCollapsibleColumn} from '../../table-column/TableCollapsibleColumn';\nimport {TableSelectableColumn} from '../../table-column/TableSelectableColumn';\nimport {TableLoading} from '../../table-loading/TableLoading';\nimport {useRowLayout} from './RowLayoutContext';\n\nexport type RowLayoutBodyStylesNames = 'row' | 'cell' | 'collapsibleRow' | 'collapsibleWrapper';\n\nexport interface RowLayoutBodyProps<T>\n extends BoxProps,\n TableLayoutProps<T>,\n CompoundStylesApiProps<RowLayoutBodyFactory> {}\n\nexport type RowLayoutBodyFactory = Factory<{\n props: RowLayoutBodyProps<unknown>;\n ref: HTMLTableRowElement;\n stylesNames: RowLayoutBodyStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<RowLayoutBodyProps<unknown>> = {};\n\nexport const RowLayoutBody = <T,>(props: RowLayoutBodyProps<T> & {ref?: ForwardedRef<HTMLTableRowElement>}) => {\n const ctx = useRowLayout();\n const {\n getRowExpandedContent,\n onRowDoubleClick,\n loading,\n classNames,\n className,\n styles,\n style,\n getRowAttributes,\n ...others\n } = useProps('RowLayoutBody', defaultProps as RowLayoutBodyProps<T>, props);\n const {table, store} = useTableContext<T>();\n const toggleCollapsible = (el: HTMLTableRowElement) => {\n const cell = el.children[el.children.length - 1] as HTMLTableCellElement;\n cell.querySelector('button').click();\n };\n\n const rows = table.getRowModel()?.rows.map((row) => {\n const rowChildren = getRowExpandedContent?.(row.original, row.index, row) ?? null;\n const isSelected = !!row.getIsSelected();\n const shouldKeepSelection = store.rowSelectionForced && isSelected;\n const onClick = (event: MouseEvent<HTMLTableRowElement>) => {\n if (rowChildren) {\n toggleCollapsible(event.currentTarget);\n }\n if (store.rowSelectionEnabled && !store.multiRowSelectionEnabled && !shouldKeepSelection) {\n row.toggleSelected();\n }\n };\n\n return (\n <Fragment key={row.id}>\n <tr\n onClick={onClick}\n onDoubleClick={() => {\n onRowDoubleClick?.(row.original, row.index, row);\n }}\n data-selectable={store.rowSelectionEnabled}\n data-selected={isSelected}\n data-multi-selection={store.multiRowSelectionEnabled}\n aria-selected={isSelected}\n data-testid={row.id}\n {...ctx.getStyles('row', {classNames, className, styles, style})}\n {...(getRowAttributes?.(row.original, row.index, row) ?? {})}\n {...others}\n >\n {row.getVisibleCells().map((cell) => {\n const columnSizing = {\n ...defaultColumnSizing,\n size: cell.column.columnDef.size,\n minSize: cell.column.columnDef.minSize,\n maxSize: cell.column.columnDef.maxSize,\n };\n\n const onCollapsibleCellClick = (event: MouseEvent<HTMLTableCellElement>) => {\n if (cell.column.id === TableSelectableColumn.id && store.rowSelectionEnabled) {\n event.stopPropagation();\n }\n };\n\n return (\n <td\n key={cell.id}\n data-testid={cell.id}\n className={ctx.getStyles('cell', {classNames, styles}).className}\n style={{\n width: columnSizing.size ? `${columnSizing.size}px` : 'auto',\n minWidth: `${columnSizing.minSize}px`,\n maxWidth: `${columnSizing.maxSize}px`,\n ...ctx.getStyles('cell', {classNames, styles}).style,\n }}\n data-collapsible-cell={cell.column.id === TableCollapsibleColumn.id}\n onClick={onCollapsibleCellClick}\n >\n <TableLoading visible={loading}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableLoading>\n </td>\n );\n })}\n </tr>\n {rowChildren ? (\n <tr {...ctx.getStyles('collapsibleRow', {classNames, styles})}>\n <td\n colSpan={table.getAllColumns().length}\n style={{\n padding: 0,\n }}\n >\n <Collapse in={row.getIsExpanded()}>\n <Box {...ctx.getStyles('collapsibleWrapper', {classNames, styles})} px=\"sm\" py=\"xs\">\n {rowChildren}\n </Box>\n </Collapse>\n </td>\n </tr>\n ) : null}\n </Fragment>\n );\n });\n\n return <>{rows}</>;\n};\n\nRowLayoutBody.extend = identity as CustomComponentThemeExtend<RowLayoutBodyFactory>;\n"],"names":["Box","Collapse","useProps","flexRender","defaultColumnSizing","Fragment","identity","useTableContext","TableCollapsibleColumn","TableSelectableColumn","TableLoading","useRowLayout","defaultProps","RowLayoutBody","props","ctx","getRowExpandedContent","onRowDoubleClick","loading","classNames","className","styles","style","getRowAttributes","others","table","store","toggleCollapsible","el","cell","children","length","querySelector","click","rows","getRowModel","map","row","rowChildren","original","index","isSelected","getIsSelected","shouldKeepSelection","rowSelectionForced","onClick","event","currentTarget","rowSelectionEnabled","multiRowSelectionEnabled","toggleSelected","tr","onDoubleClick","data-selectable","data-selected","data-multi-selection","aria-selected","data-testid","id","getStyles","getVisibleCells","columnSizing","size","column","columnDef","minSize","maxSize","onCollapsibleCellClick","stopPropagation","td","width","minWidth","maxWidth","data-collapsible-cell","visible","getContext","colSpan","getAllColumns","padding","in","getIsExpanded","px","py","extend"],"mappings":";AAAA,SAAQA,GAAG,EAAYC,QAAQ,EAAmCC,QAAQ,QAAO,gBAAgB;AACjG,SAAQC,UAAU,QAAO,wBAAwB;AACjD,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAsBC,QAAQ,QAAwB,QAAQ;AAC9D,SAAoCC,QAAQ,QAAO,oBAAoB;AAEvE,SAAQC,eAAe,QAAO,qBAAqB;AACnD,SAAQC,sBAAsB,QAAO,4CAA4C;AACjF,SAAQC,qBAAqB,QAAO,2CAA2C;AAC/E,SAAQC,YAAY,QAAO,mCAAmC;AAC9D,SAAQC,YAAY,QAAO,qBAAqB;AAgBhD,MAAMC,eAAqD,CAAC;AAE5D,OAAO,MAAMC,gBAAgB,CAAKC;IAC9B,MAAMC,MAAMJ;IACZ,MAAM,EACFK,qBAAqB,EACrBC,gBAAgB,EAChBC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,KAAK,EACLC,gBAAgB,EAChB,GAAGC,QACN,GAAGtB,SAAS,iBAAiBU,cAAuCE;IACrE,MAAM,EAACW,KAAK,EAAEC,KAAK,EAAC,GAAGnB;IACvB,MAAMoB,oBAAoB,CAACC;QACvB,MAAMC,OAAOD,GAAGE,QAAQ,CAACF,GAAGE,QA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;qBAKjB;;WAjEOD,IAAIqB,EAAE;IAoE7B;IAEA,qBAAO;kBAAGxB;;AACd,EAAE;AAEFrB,cAAcsE,MAAM,GAAG7E"}
1
+ {"version":3,"sources":["../../../../../../src/components/table/layouts/row-layout/RowLayoutBody.tsx"],"sourcesContent":["import {Box, BoxProps, Collapse, CompoundStylesApiProps, Factory, useProps} from '@mantine/core';\nimport {flexRender} from '@tanstack/react-table';\nimport {defaultColumnSizing} from '@tanstack/table-core';\nimport {ForwardedRef, Fragment, type MouseEvent} from 'react';\nimport {CustomComponentThemeExtend, identity} from '../../../../utils';\nimport {TableLayoutProps} from '../../Table.types';\nimport {useTableContext} from '../../TableContext';\nimport {TableCollapsibleColumn} from '../../table-column/TableCollapsibleColumn';\nimport {TableSelectableColumn} from '../../table-column/TableSelectableColumn';\nimport {TableLoading} from '../../table-loading/TableLoading';\nimport {useRowLayout} from './RowLayoutContext';\n\nexport type RowLayoutBodyStylesNames = 'row' | 'cell' | 'collapsibleRow' | 'collapsibleWrapper';\n\nexport interface RowLayoutBodyProps<T>\n extends BoxProps,\n TableLayoutProps<T>,\n CompoundStylesApiProps<RowLayoutBodyFactory> {}\n\nexport type RowLayoutBodyFactory = Factory<{\n props: RowLayoutBodyProps<unknown>;\n ref: HTMLTableRowElement;\n stylesNames: RowLayoutBodyStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<RowLayoutBodyProps<unknown>> = {};\n\nexport const RowLayoutBody = <T,>(props: RowLayoutBodyProps<T> & {ref?: ForwardedRef<HTMLTableRowElement>}) => {\n const ctx = useRowLayout();\n const {\n getRowExpandedContent,\n onRowDoubleClick,\n loading,\n classNames,\n className,\n styles,\n style,\n getRowAttributes,\n ...others\n } = useProps('RowLayoutBody', defaultProps as RowLayoutBodyProps<T>, props);\n const {table, store} = useTableContext<T>();\n const toggleCollapsible = (el: HTMLTableRowElement) => {\n const cell = el.children[el.children.length - 1] as HTMLTableCellElement;\n cell.querySelector('button').click();\n };\n\n const rows = table.getRowModel()?.rows.map((row) => {\n const rowChildren = getRowExpandedContent?.(row.original, row.index, row) ?? null;\n const isSelected = !!row.getIsSelected();\n const shouldKeepSelection = store.rowSelectionForced && isSelected;\n const onClick = (event: MouseEvent<HTMLTableRowElement>) => {\n if (rowChildren) {\n toggleCollapsible(event.currentTarget);\n }\n if (store.rowSelectionEnabled && !store.multiRowSelectionEnabled && !shouldKeepSelection) {\n row.toggleSelected();\n }\n };\n\n return (\n <Fragment key={row.id}>\n <tr\n onClick={onClick}\n onDoubleClick={() => {\n onRowDoubleClick?.(row.original, row.index, row);\n }}\n data-selectable={store.rowSelectionEnabled}\n data-selected={isSelected}\n data-multi-selection={store.multiRowSelectionEnabled}\n aria-selected={isSelected}\n data-testid={row.id}\n {...ctx.getStyles('row', {classNames, className, styles, style})}\n {...(getRowAttributes?.(row.original, row.index, row) ?? {})}\n {...others}\n >\n {row.getVisibleCells().map((cell) => {\n const columnSizing = {\n ...defaultColumnSizing,\n size: cell.column.columnDef.size,\n minSize: cell.column.columnDef.minSize,\n maxSize: cell.column.columnDef.maxSize,\n };\n\n const onCollapsibleCellClick = (event: MouseEvent<HTMLTableCellElement>) => {\n if (cell.column.id === TableSelectableColumn.id && store.rowSelectionEnabled) {\n event.stopPropagation();\n }\n };\n\n return (\n <td\n key={cell.id}\n data-testid={cell.id}\n className={ctx.getStyles('cell', {classNames, styles}).className}\n style={{\n width: columnSizing.size ? `${columnSizing.size}px` : 'auto',\n minWidth: `${columnSizing.minSize}px`,\n maxWidth: `${columnSizing.maxSize}px`,\n ...ctx.getStyles('cell', {classNames, styles}).style,\n }}\n data-collapsible-cell={cell.column.id === TableCollapsibleColumn.id}\n onClick={onCollapsibleCellClick}\n >\n <TableLoading visible={loading}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableLoading>\n </td>\n );\n })}\n </tr>\n {rowChildren ? (\n <tr {...ctx.getStyles('collapsibleRow', {classNames, styles})}>\n <td\n colSpan={table.getAllColumns().length}\n style={{\n padding: 0,\n }}\n >\n <Collapse in={row.getIsExpanded()}>\n <Box {...ctx.getStyles('collapsibleWrapper', {classNames, styles})} px=\"sm\" py=\"xs\">\n {rowChildren}\n </Box>\n </Collapse>\n </td>\n </tr>\n ) : null}\n </Fragment>\n );\n });\n\n return <>{rows}</>;\n};\n\nRowLayoutBody.extend = identity as CustomComponentThemeExtend<RowLayoutBodyFactory>;\n"],"names":["Box","Collapse","useProps","flexRender","defaultColumnSizing","Fragment","identity","useTableContext","TableCollapsibleColumn","TableSelectableColumn","TableLoading","useRowLayout","defaultProps","RowLayoutBody","props","ctx","getRowExpandedContent","onRowDoubleClick","loading","classNames","className","styles","style","getRowAttributes","others","table","store","toggleCollapsible","el","cell","children","length","querySelector","click","rows","getRowModel","map","row","rowChildren","original","index","isSelected","getIsSelected","shouldKeepSelection","rowSelectionForced","onClick","event","currentTarget","rowSelectionEnabled","multiRowSelectionEnabled","toggleSelected","tr","onDoubleClick","data-selectable","data-selected","data-multi-selection","aria-selected","data-testid","id","getStyles","getVisibleCells","columnSizing","size","column","columnDef","minSize","maxSize","onCollapsibleCellClick","stopPropagation","td","width","minWidth","maxWidth","data-collapsible-cell","visible","getContext","colSpan","getAllColumns","padding","in","getIsExpanded","px","py","extend"],"mappings":";AAAA,SAAQA,GAAG,EAAYC,QAAQ,EAAmCC,QAAQ,QAAO,gBAAgB;AACjG,SAAQC,UAAU,QAAO,wBAAwB;AACjD,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAsBC,QAAQ,QAAwB,QAAQ;AAC9D,SAAoCC,QAAQ,QAAO,oBAAoB;AAEvE,SAAQC,eAAe,QAAO,qBAAqB;AACnD,SAAQC,sBAAsB,QAAO,4CAA4C;AACjF,SAAQC,qBAAqB,QAAO,2CAA2C;AAC/E,SAAQC,YAAY,QAAO,mCAAmC;AAC9D,SAAQC,YAAY,QAAO,qBAAqB;AAgBhD,MAAMC,eAAqD,CAAC;AAE5D,OAAO,MAAMC,gBAAgB,CAAKC;IAC9B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M,EAAE;8BACzD,cAAA,KAACgD;wBACGO,SAASnD,MAAMoD,aAAa,GAAG9C,MAAM;wBACrCT,OAAO;4BACHwD,SAAS;wBACb;kCAEA,cAAA,KAAC7E;4BAAS8E,IAAI1C,IAAI2C,aAAa;sCAC3B,cAAA,KAAChF;gCAAK,GAAGe,IAAI4C,SAAS,CAAC,sBAAsB;oCAACxC;oCAAYE;gCAAM,EAAE;gCAAE4D,IAAG;gCAAKC,IAAG;0CAC1E5C;;;;qBAKjB;;WAjEOD,IAAIqB,EAAE;IAoE7B;IAEA,qBAAO;kBAAGxB;;AACd,EAAE;AAEFrB,cAAcsE,MAAM,GAAG7E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/table/table-date-range-picker/TableDateRangePicker.tsx"],"sourcesContent":["import {CalendarSize16Px} from '@coveord/plasma-react-icons';\nimport {BoxProps, CompoundStylesApiProps, Factory, Grid, InputBase, Popover, factory, useProps} from '@mantine/core';\nimport dayjs from 'dayjs';\n\nimport {useState} from 'react';\nimport {\n DateRangePickerInlineCalendar,\n DateRangePickerInlineCalendarProps,\n DateRangePickerPreset,\n DateRangePickerValue,\n} from '../../date-range-picker';\nimport {TableComponentsOrder} from '../Table';\nimport {useTableContext} from '../TableContext';\n\nexport type TableDateRangePickerStylesNames = 'dateRangeRoot';\n\nexport interface TableDateRangePickerProps\n extends BoxProps,\n CompoundStylesApiProps<TableDateRangePickerFactory>,\n Pick<DateRangePickerInlineCalendarProps, 'startProps' | 'endProps' | 'rangeCalendarProps'> {\n /**\n * An object containing date presets.\n * If empty the preset dropdown won't be shown\n *\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n * @default {}\n */\n presets?: Record<string, DateRangePickerPreset>;\n}\n\nexport type TableDateRangePickerFactory = Factory<{\n props: TableDateRangePickerProps;\n ref: HTMLDivElement;\n stylesNames: TableDateRangePickerStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<TableDateRangePickerProps> = {\n presets: {},\n};\n\nexport const TableDateRangePicker = factory<TableDateRangePickerFactory>((props, ref) => {\n const {store, getStyles} = useTableContext();\n const {presets, rangeCalendarProps, classNames, className, styles, style, vars, ...others} = useProps(\n 'PlasmaTableDateRangePicker',\n defaultProps,\n props,\n );\n const [opened, setOpened] = useState(false);\n\n const onApply = (dates: DateRangePickerValue) => {\n store.setDateRange(dates);\n setOpened(false);\n };\n const onCancel = () => {\n setOpened(false);\n };\n\n const formatDate = (date: Date) => dayjs(date).format('MMM DD, YYYY');\n const formattedRange = `${formatDate(store.state.dateRange[0])} - ${formatDate(store.state.dateRange[1])}`;\n const dateRangeInitialized = store.state.dateRange.every((date) => date instanceof Date);\n\n const stylesApiProps = {classNames, styles};\n\n return (\n <Grid.Col\n span=\"content\"\n order={TableComponentsOrder.DateRangePicker}\n ref={ref}\n {...getStyles('dateRangeRoot', {className, style, ...stylesApiProps})}\n {...others}\n >\n <Popover withinPortal opened={opened} onChange={setOpened}>\n <Popover.Target>\n <InputBase\n component=\"button\"\n leftSection={<CalendarSize16Px height={16} />}\n miw={220}\n onClick={() => setOpened(true)}\n >\n {dateRangeInitialized ? formattedRange : 'Select date range'}\n </InputBase>\n </Popover.Target>\n <Popover.Dropdown p={0}>\n <DateRangePickerInlineCalendar\n initialRange={store.state.dateRange}\n onApply={onApply}\n onCancel={onCancel}\n presets={presets}\n rangeCalendarProps={rangeCalendarProps}\n />\n </Popover.Dropdown>\n </Popover>\n </Grid.Col>\n );\n});\n"],"names":["CalendarSize16Px","Grid","InputBase","Popover","factory","useProps","dayjs","useState","DateRangePickerInlineCalendar","TableComponentsOrder","useTableContext","defaultProps","presets","TableDateRangePicker","props","ref","store","getStyles","rangeCalendarProps","classNames","className","styles","style","vars","others","opened","setOpened","onApply","dates","setDateRange","onCancel","formatDate","date","format","formattedRange","state","dateRange","dateRangeInitialized","every","Date","stylesApiProps","Col","span","order","DateRangePicker","withinPortal","onChange","Target","component","leftSection","height","miw","onClick","Dropdown","p","initialRange"],"mappings":";AAAA,SAAQA,gBAAgB,QAAO,8BAA8B;AAC7D,SAAmDC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,QAAO,gBAAgB;AACrH,OAAOC,WAAW,QAAQ;AAE1B,SAAQC,QAAQ,QAAO,QAAQ;AAC/B,SACIC,6BAA6B,QAI1B,0BAA0B;AACjC,SAAQC,oBAAoB,QAAO,WAAW;AAC9C,SAAQC,eAAe,QAAO,kBAAkB;AA6BhD,MAAMC,eAAmD;IACrDC,SAAS,CAAC;AACd;AAEA,OAAO,MAAMC,uBAAuBT,QAAqC,CAACU,OAAOC;IAC7E,MAAM,EAACC,KAAK,EAAEC,SAAS,EAAC,GAAGP;IAC3B,MAAM,EAACE,OAAO,EAAEM,kBAAkB,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGC,QAAO,GAAGnB,SACzF,8BACAM,cACAG;IAEJ,MAAM,CAACW,QAAQC,UAAU,GAAGnB,SAAS;IAErC,MAAMoB,UAAU,CAACC;QACbZ,MAAMa,YAAY,CAACD;QACnBF,UAAU;IACd;IACA,MAAMI,WAAW;QACbJ,UAAU;IACd;IAEA,MAAMK,aAAa,CAACC,OAAe1B,MAAM0B,MAAMC,MAAM,CAAC;IACtD,MAAMC,iBAAiB,CAAC,EAAEH,WAAWf,MAAMmB,KAAK,CAACC,SAAS,CAAC,EAAE,EAAE,GAAG,EAAEL,WAAWf,MAAMmB,KAAK,CAACC,SAAS,CAAC,EAAE,EAAE,CAAC;IAC1G,MAAMC,uBAAuBrB,MAAMmB,KAAK,CAACC,SAAS,CAACE,KAAK,CAAC,CAACN,OAASA,gBAAgBO;IAEnF,MAAMC,iBAAiB;QAACrB;QAAYE;IAAM;IAE1C,qBACI,KAACpB,KAAKwC,GAAG;QACLC,MAAK;QACLC,OAAOlC,qBAAqBmC,eAAe;QAC3C7B,KAAKA;QACJ,GAAGE,UAAU,iBAAiB;YAACG;YAAWE;YAAO,GAAGkB,cAAc;QAAA,EAAE;QACpE,GAAGhB,MAAM;kBAEV,cAAA,MAACrB;YAAQ0C,YAAY;YAACpB,QAAQA;YAAQqB,UAAUpB;;8BAC5C,KAACvB,QAAQ4C,MAAM;8BACX,cAAA,KAAC7C;wBACG8C,WAAU;wBACVC,2BAAa,KAACjD;4BAAiBkD,QAAQ;;wBACvCC,KAAK;wBACLC,SAAS,IAAM1B,UAAU;kCAExBW,uBAAuBH,iBAAiB;;;8BAGjD,KAAC/B,QAAQkD,QAAQ;oBAACC,GAAG;8BACjB,cAAA,KAAC9C;wBACG+C,cAAcvC,MAAMmB,KAAK,CAACC,SAAS;wBACnCT,SAASA;wBACTG,UAAUA;wBACVlB,SAASA;wBACTM,oBAAoBA;;;;;;AAM5C,GAAG"}
1
+ {"version":3,"sources":["../../../../../src/components/table/table-date-range-picker/TableDateRangePicker.tsx"],"sourcesContent":["import {CalendarSize16Px} from '@coveord/plasma-react-icons';\nimport {BoxProps, CompoundStylesApiProps, Factory, Grid, InputBase, Popover, factory, useProps} from '@mantine/core';\nimport dayjs from 'dayjs';\n\nimport {useState} from 'react';\nimport {\n DateRangePickerInlineCalendar,\n DateRangePickerInlineCalendarProps,\n DateRangePickerPreset,\n DateRangePickerValue,\n} from '../../date-range-picker';\nimport {TableComponentsOrder} from '../Table';\nimport {useTableContext} from '../TableContext';\n\nexport type TableDateRangePickerStylesNames = 'dateRangeRoot';\n\nexport interface TableDateRangePickerProps\n extends BoxProps,\n CompoundStylesApiProps<TableDateRangePickerFactory>,\n Pick<DateRangePickerInlineCalendarProps, 'startProps' | 'endProps' | 'rangeCalendarProps'> {\n /**\n * An object containing date presets.\n * If empty the preset dropdown won't be shown\n *\n * @example\n * {\n * january: {label: 'January', range: [new Date(2022, 0, 1), new Date(2022, 0, 31)]},\n * february: {label: 'February', range: [new Date(2022, 1, 1), new Date(2022, 1, 28)]}\n * }\n * @default {}\n */\n presets?: Record<string, DateRangePickerPreset>;\n}\n\nexport type TableDateRangePickerFactory = Factory<{\n props: TableDateRangePickerProps;\n ref: HTMLDivElement;\n stylesNames: TableDateRangePickerStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<TableDateRangePickerProps> = {\n presets: {},\n};\n\nexport const TableDateRangePicker = factory<TableDateRangePickerFactory>((props, ref) => {\n const {store, getStyles} = useTableContext();\n const {presets, rangeCalendarProps, classNames, className, styles, style, vars, ...others} = useProps(\n 'PlasmaTableDateRangePicker',\n defaultProps,\n props,\n );\n const [opened, setOpened] = useState(false);\n\n const onApply = (dates: DateRangePickerValue) => {\n store.setDateRange(dates);\n setOpened(false);\n };\n const onCancel = () => {\n setOpened(false);\n };\n\n const formatDate = (date: Date) => dayjs(date).format('MMM DD, YYYY');\n const formattedRange = `${formatDate(store.state.dateRange[0])} - ${formatDate(store.state.dateRange[1])}`;\n const dateRangeInitialized = store.state.dateRange.every((date) => date instanceof Date);\n\n const stylesApiProps = {classNames, styles};\n\n return (\n <Grid.Col\n span=\"content\"\n order={TableComponentsOrder.DateRangePicker}\n ref={ref}\n {...getStyles('dateRangeRoot', {className, style, ...stylesApiProps})}\n {...others}\n >\n <Popover withinPortal opened={opened} onChange={setOpened}>\n <Popover.Target>\n <InputBase\n component=\"button\"\n leftSection={<CalendarSize16Px height={16} />}\n miw={220}\n onClick={() => setOpened(true)}\n >\n {dateRangeInitialized ? formattedRange : 'Select date range'}\n </InputBase>\n </Popover.Target>\n <Popover.Dropdown p={0}>\n <DateRangePickerInlineCalendar\n initialRange={store.state.dateRange}\n onApply={onApply}\n onCancel={onCancel}\n presets={presets}\n rangeCalendarProps={rangeCalendarProps}\n />\n </Popover.Dropdown>\n </Popover>\n </Grid.Col>\n );\n});\n"],"names":["CalendarSize16Px","Grid","InputBase","Popover","factory","useProps","dayjs","useState","DateRangePickerInlineCalendar","TableComponentsOrder","useTableContext","defaultProps","presets","TableDateRangePicker","props","ref","store","getStyles","rangeCalendarProps","classNames","className","styles","style","vars","others","opened","setOpened","onApply","dates","setDateRange","onCancel","formatDate","date","format","formattedRange","state","dateRange","dateRangeInitialized","every","Date","stylesApiProps","Col","span","order","DateRangePicker","withinPortal","onChange","Target","component","leftSection","height","miw","onClick","Dropdown","p","initialRange"],"mappings":";AAAA,SAAQA,gBAAgB,QAAO,8BAA8B;AAC7D,SAAmDC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,QAAO,gBAAgB;AACrH,OAAOC,WAAW,QAAQ;AAE1B,SAAQC,QAAQ,QAAO,QAAQ;AAC/B,SACIC,6BAA6B,QAI1B,0BAA0B;AACjC,SAAQC,oBAAoB,QAAO,WAAW;AAC9C,SAAQC,eAAe,QAAO,kBAAkB;AA6BhD,MAAMC,eAAmD;IACrDC,SAAS,CAAC;AACd;AAEA,OAAO,MAAMC,uBAAuBT,QAAqC,CAACU,OAAOC;IAC7E,MAAM,EAACC,KAAK,EAAEC,SAAS,EAAC,GAAGP;IAC3B,MAAM,EAACE,OAAO,EAAEM,kBAAkB,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGC,QAAO,GAAGnB,SACzF,8BACAM,cACAG;IAEJ,MAAM,CAACW,QAAQC,UAAU,GAAGnB,SAAS;IAErC,MAAMoB,UAAU,CAACC;QACbZ,MAAMa,YAAY,CAACD;QACnBF,UAAU;IACd;IACA,MAAMI,WAAW;QACbJ,UAAU;IACd;IAEA,MAAMK,aAAa,CAACC,OAAe1B,MAAM0B,MAAMC,MAAM,CAAC;IACtD,MAAMC,iBAAiB,GAAGH,WAAWf,MAAMmB,KAAK,CAACC,SAAS,CAAC,EAAE,EAAE,GAAG,EAAEL,WAAWf,MAAMmB,KAAK,CAACC,SAAS,CAAC,EAAE,GAAG;IAC1G,MAAMC,uBAAuBrB,MAAMmB,KAAK,CAACC,SAAS,CAACE,KAAK,CAAC,CAACN,OAASA,gBAAgBO;IAEnF,MAAMC,iBAAiB;QAACrB;QAAYE;IAAM;IAE1C,qBACI,KAACpB,KAAKwC,GAAG;QACLC,MAAK;QACLC,OAAOlC,qBAAqBmC,eAAe;QAC3C7B,KAAKA;QACJ,GAAGE,UAAU,iBAAiB;YAACG;YAAWE;YAAO,GAAGkB,cAAc;QAAA,EAAE;QACpE,GAAGhB,MAAM;kBAEV,cAAA,MAACrB;YAAQ0C,YAAY;YAACpB,QAAQA;YAAQqB,UAAUpB;;8BAC5C,KAACvB,QAAQ4C,MAAM;8BACX,cAAA,KAAC7C;wBACG8C,WAAU;wBACVC,2BAAa,KAACjD;4BAAiBkD,QAAQ;;wBACvCC,KAAK;wBACLC,SAAS,IAAM1B,UAAU;kCAExBW,uBAAuBH,iBAAiB;;;8BAGjD,KAAC/B,QAAQkD,QAAQ;oBAACC,GAAG;8BACjB,cAAA,KAAC9C;wBACG+C,cAAcvC,MAAMmB,KAAK,CAACC,SAAS;wBACnCT,SAASA;wBACTG,UAAUA;wBACVlB,SAASA;wBACTM,oBAAoBA;;;;;;AAM5C,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/table/table-header/TableHeader.tsx"],"sourcesContent":["import {CrossSize16Px} from '@coveord/plasma-react-icons';\nimport {Box, BoxProps, CompoundStylesApiProps, factory, Factory, Grid, Tooltip, useProps} from '@mantine/core';\nimport {ReactNode} from 'react';\n\nimport {Button} from '../../button';\nimport {TableLayoutControl} from '../layouts/TableLayoutControl';\nimport {TableComponentsOrder} from '../Table';\nimport {TableHeaderActions} from '../table-actions';\nimport {useTableContext} from '../TableContext';\n\nexport type TableHeaderStylesNames = 'headerRoot' | 'headerGrid' | 'headerGridInner' | 'headerCol';\n\nexport interface TableHeaderProps\n extends Omit<BoxProps, 'classNames' | 'styles' | 'vars'>,\n CompoundStylesApiProps<TableHeaderFactory> {\n /* Children of header (ie: actions, datepicker, etc.) */\n children?: ReactNode;\n unselectAllLabel?: string;\n selectedCountLabel?: (count: number) => string;\n /**\n * Whether to show actions when rows are selected\n *\n * default true\n */\n showActions?: boolean;\n}\n\nexport type TableHeaderFactory = Factory<{\n props: TableHeaderProps;\n ref: HTMLDivElement;\n stylesNames: TableHeaderStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<TableHeaderProps> = {\n unselectAllLabel: 'Unselect all',\n selectedCountLabel: (count) => `${count} selected`,\n showActions: true,\n};\n\nexport const TableHeader = factory<TableHeaderFactory>((props, ref) => {\n const {store, getStyles} = useTableContext();\n const {\n showActions,\n unselectAllLabel,\n selectedCountLabel,\n children,\n classNames,\n className,\n styles,\n style,\n vars: _vars,\n ...others\n } = useProps('PlasmaTableHeader', defaultProps, props);\n const selectedRows = store.getSelectedRows();\n\n const stylesApiProps = {classNames, styles};\n const innerStyles = getStyles('headerGridInner', stylesApiProps);\n const gridStyles = getStyles('headerGrid', stylesApiProps);\n\n return (\n <Box ref={ref} {...getStyles('headerRoot', {className, style, ...stylesApiProps})} {...others}>\n <Grid\n justify=\"flex-start\"\n align=\"center\"\n classNames={{inner: innerStyles.className, root: gridStyles.className}}\n styles={{inner: innerStyles.style, root: gridStyles.style}}\n >\n {store.multiRowSelectionEnabled && selectedRows.length > 0 ? (\n <Grid.Col\n span=\"auto\"\n {...getStyles('headerCol', stylesApiProps)}\n order={TableComponentsOrder.MultiSelectInfo}\n >\n <Tooltip label={unselectAllLabel}>\n <Button\n onClick={store.clearRowSelection}\n variant=\"subtle\"\n disabled={!store.rowSelectionEnabled}\n leftSection={<CrossSize16Px height={16} />}\n >\n {selectedCountLabel(selectedRows.length)}\n </Button>\n </Tooltip>\n </Grid.Col>\n ) : null}\n {children}\n {showActions ? <TableHeaderActions /> : null}\n <TableLayoutControl />\n </Grid>\n </Box>\n );\n});\n"],"names":["CrossSize16Px","Box","factory","Grid","Tooltip","useProps","Button","TableLayoutControl","TableComponentsOrder","TableHeaderActions","useTableContext","defaultProps","unselectAllLabel","selectedCountLabel","count","showActions","TableHeader","props","ref","store","getStyles","children","classNames","className","styles","style","vars","_vars","others","selectedRows","getSelectedRows","stylesApiProps","innerStyles","gridStyles","justify","align","inner","root","multiRowSelectionEnabled","length","Col","span","order","MultiSelectInfo","label","onClick","clearRowSelection","variant","disabled","rowSelectionEnabled","leftSection","height"],"mappings":";AAAA,SAAQA,aAAa,QAAO,8BAA8B;AAC1D,SAAQC,GAAG,EAAoCC,OAAO,EAAWC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,QAAO,gBAAgB;AAG/G,SAAQC,MAAM,QAAO,eAAe;AACpC,SAAQC,kBAAkB,QAAO,gCAAgC;AACjE,SAAQC,oBAAoB,QAAO,WAAW;AAC9C,SAAQC,kBAAkB,QAAO,mBAAmB;AACpD,SAAQC,eAAe,QAAO,kBAAkB;AA0BhD,MAAMC,eAA0C;IAC5CC,kBAAkB;IAClBC,oBAAoB,CAACC,QAAU,CAAC,EAAEA,MAAM,SAAS,CAAC;IAClDC,aAAa;AACjB;AAEA,OAAO,MAAMC,cAAcd,QAA4B,CAACe,OAAOC;IAC3D,MAAM,EAACC,KAAK,EAAEC,SAAS,EAAC,GAAGV;IAC3B,MAAM,EACFK,WAAW,EACXH,gBAAgB,EAChBC,kBAAkB,EAClBQ,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,KAAK,EACLC,MAAMC,KAAK,EACX,GAAGC,QACN,GAAGvB,SAAS,qBAAqBM,cAAcM;IAChD,MAAMY,eAAeV,MAAMW,eAAe;IAE1C,MAAMC,iBAAiB;QAACT;QAAYE;IAAM;IAC1C,MAAMQ,cAAcZ,UAAU,mBAAmBW;IACjD,MAAME,aAAab,UAAU,cAAcW;IAE3C,qBACI,KAAC9B;QAAIiB,KAAKA;QAAM,GAAGE,UAAU,cAAc;YAACG;YAAWE;YAAO,GAAGM,cAAc;QAAA,EAAE;QAAG,GAAGH,MAAM;kBACzF,cAAA,MAACzB;YACG+B,SAAQ;YACRC,OAAM;YACNb,YAAY;gBAACc,OAAOJ,YAAYT,SAAS;gBAAEc,MAAMJ,WAAWV,SAAS;YAAA;YACrEC,QAAQ;gBAACY,OAAOJ,YAAYP,KAAK;gBAAEY,MAAMJ,WAAWR,KAAK;YAAA;;gBAExDN,MAAMmB,wBAAwB,IAAIT,aAAaU,MAAM,GAAG,kBACrD,KAACpC,KAAKqC,GAAG;oBACLC,MAAK;oBACJ,GAAGrB,UAAU,aAAaW,eAAe;oBAC1CW,OAAOlC,qBAAqBmC,eAAe;8BAE3C,cAAA,KAACvC;wBAAQwC,OAAOhC;kCACZ,cAAA,KAACN;4BACGuC,SAAS1B,MAAM2B,iBAAiB;4BAChCC,SAAQ;4BACRC,UAAU,CAAC7B,MAAM8B,mBAAmB;4BACpCC,2BAAa,KAAClD;gCAAcmD,QAAQ;;sCAEnCtC,mBAAmBgB,aAAaU,MAAM;;;qBAInD;gBACHlB;gBACAN,4BAAc,KAACN,0BAAwB;8BACxC,KAACF;;;;AAIjB,GAAG"}
1
+ {"version":3,"sources":["../../../../../src/components/table/table-header/TableHeader.tsx"],"sourcesContent":["import {CrossSize16Px} from '@coveord/plasma-react-icons';\nimport {Box, BoxProps, CompoundStylesApiProps, factory, Factory, Grid, Tooltip, useProps} from '@mantine/core';\nimport {ReactNode} from 'react';\n\nimport {Button} from '../../button';\nimport {TableLayoutControl} from '../layouts/TableLayoutControl';\nimport {TableComponentsOrder} from '../Table';\nimport {TableHeaderActions} from '../table-actions';\nimport {useTableContext} from '../TableContext';\n\nexport type TableHeaderStylesNames = 'headerRoot' | 'headerGrid' | 'headerGridInner' | 'headerCol';\n\nexport interface TableHeaderProps\n extends Omit<BoxProps, 'classNames' | 'styles' | 'vars'>,\n CompoundStylesApiProps<TableHeaderFactory> {\n /* Children of header (ie: actions, datepicker, etc.) */\n children?: ReactNode;\n unselectAllLabel?: string;\n selectedCountLabel?: (count: number) => string;\n /**\n * Whether to show actions when rows are selected\n *\n * default true\n */\n showActions?: boolean;\n}\n\nexport type TableHeaderFactory = Factory<{\n props: TableHeaderProps;\n ref: HTMLDivElement;\n stylesNames: TableHeaderStylesNames;\n compound: true;\n}>;\n\nconst defaultProps: Partial<TableHeaderProps> = {\n unselectAllLabel: 'Unselect all',\n selectedCountLabel: (count) => `${count} selected`,\n showActions: true,\n};\n\nexport const TableHeader = factory<TableHeaderFactory>((props, ref) => {\n const {store, getStyles} = useTableContext();\n const {\n showActions,\n unselectAllLabel,\n selectedCountLabel,\n children,\n classNames,\n className,\n styles,\n style,\n vars: _vars,\n ...others\n } = useProps('PlasmaTableHeader', defaultProps, props);\n const selectedRows = store.getSelectedRows();\n\n const stylesApiProps = {classNames, styles};\n const innerStyles = getStyles('headerGridInner', stylesApiProps);\n const gridStyles = getStyles('headerGrid', stylesApiProps);\n\n return (\n <Box ref={ref} {...getStyles('headerRoot', {className, style, ...stylesApiProps})} {...others}>\n <Grid\n justify=\"flex-start\"\n align=\"center\"\n classNames={{inner: innerStyles.className, root: gridStyles.className}}\n styles={{inner: innerStyles.style, root: gridStyles.style}}\n >\n {store.multiRowSelectionEnabled && selectedRows.length > 0 ? (\n <Grid.Col\n span=\"auto\"\n {...getStyles('headerCol', stylesApiProps)}\n order={TableComponentsOrder.MultiSelectInfo}\n >\n <Tooltip label={unselectAllLabel}>\n <Button\n onClick={store.clearRowSelection}\n variant=\"subtle\"\n disabled={!store.rowSelectionEnabled}\n leftSection={<CrossSize16Px height={16} />}\n >\n {selectedCountLabel(selectedRows.length)}\n </Button>\n </Tooltip>\n </Grid.Col>\n ) : null}\n {children}\n {showActions ? <TableHeaderActions /> : null}\n <TableLayoutControl />\n </Grid>\n </Box>\n );\n});\n"],"names":["CrossSize16Px","Box","factory","Grid","Tooltip","useProps","Button","TableLayoutControl","TableComponentsOrder","TableHeaderActions","useTableContext","defaultProps","unselectAllLabel","selectedCountLabel","count","showActions","TableHeader","props","ref","store","getStyles","children","classNames","className","styles","style","vars","_vars","others","selectedRows","getSelectedRows","stylesApiProps","innerStyles","gridStyles","justify","align","inner","root","multiRowSelectionEnabled","length","Col","span","order","MultiSelectInfo","label","onClick","clearRowSelection","variant","disabled","rowSelectionEnabled","leftSection","height"],"mappings":";AAAA,SAAQA,aAAa,QAAO,8BAA8B;AAC1D,SAAQC,GAAG,EAAoCC,OAAO,EAAWC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,QAAO,gBAAgB;AAG/G,SAAQC,MAAM,QAAO,eAAe;AACpC,SAAQC,kBAAkB,QAAO,gCAAgC;AACjE,SAAQC,oBAAoB,QAAO,WAAW;AAC9C,SAAQC,kBAAkB,QAAO,mBAAmB;AACpD,SAAQC,eAAe,QAAO,kBAAkB;AA0BhD,MAAMC,eAA0C;IAC5CC,kBAAkB;IAClBC,oBAAoB,CAACC,QAAU,GAAGA,MAAM,SAAS,CAAC;IAClDC,aAAa;AACjB;AAEA,OAAO,MAAMC,cAAcd,QAA4B,CAACe,OAAOC;IAC3D,MAAM,EAACC,KAAK,EAAEC,SAAS,EAAC,GAAGV;IAC3B,MAAM,EACFK,WAAW,EACXH,gBAAgB,EAChBC,kBAAkB,EAClBQ,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,KAAK,EACLC,MAAMC,KAAK,EACX,GAAGC,QACN,GAAGvB,SAAS,qBAAqBM,cAAcM;IAChD,MAAMY,eAAeV,MAAMW,eAAe;IAE1C,MAAMC,iBAAiB;QAACT;QAAYE;IAAM;IAC1C,MAAMQ,cAAcZ,UAAU,mBAAmBW;IACjD,MAAME,aAAab,UAAU,cAAcW;IAE3C,qBACI,KAAC9B;QAAIiB,KAAKA;QAAM,GAAGE,UAAU,cAAc;YAACG;YAAWE;YAAO,GAAGM,cAAc;QAAA,EAAE;QAAG,GAAGH,MAAM;kBACzF,cAAA,MAACzB;YACG+B,SAAQ;YACRC,OAAM;YACNb,YAAY;gBAACc,OAAOJ,YAAYT,SAAS;gBAAEc,MAAMJ,WAAWV,SAAS;YAAA;YACrEC,QAAQ;gBAACY,OAAOJ,YAAYP,KAAK;gBAAEY,MAAMJ,WAAWR,KAAK;YAAA;;gBAExDN,MAAMmB,wBAAwB,IAAIT,aAAaU,MAAM,GAAG,kBACrD,KAACpC,KAAKqC,GAAG;oBACLC,MAAK;oBACJ,GAAGrB,UAAU,aAAaW,eAAe;oBAC1CW,OAAOlC,qBAAqBmC,eAAe;8BAE3C,cAAA,KAACvC;wBAAQwC,OAAOhC;kCACZ,cAAA,KAACN;4BACGuC,SAAS1B,MAAM2B,iBAAiB;4BAChCC,SAAQ;4BACRC,UAAU,CAAC7B,MAAM8B,mBAAmB;4BACpCC,2BAAa,KAAClD;gCAAcmD,QAAQ;;sCAEnCtC,mBAAmBgB,aAAaU,MAAM;;;qBAInD;gBACHlB;gBACAN,4BAAc,KAACN,0BAAwB;8BACxC,KAACF;;;;AAIjB,GAAG"}
@@ -1,7 +1,7 @@
1
- import { BoxProps, ComboboxData, CompoundStylesApiProps, Factory } from '@mantine/core';
1
+ import { BoxProps, ComboboxData, CompoundStylesApiProps, Factory, SelectProps } from '@mantine/core';
2
2
  import { FunctionComponent } from 'react';
3
3
  export type TablePredicateStylesNames = 'predicate' | 'predicateWrapper' | 'predicateLabel' | 'predicateSelect';
4
- export interface TablePredicateProps extends BoxProps, CompoundStylesApiProps<TablePredicateFactory> {
4
+ export interface TablePredicateProps extends BoxProps, Pick<SelectProps, 'renderOption'>, CompoundStylesApiProps<TablePredicateFactory> {
5
5
  /**
6
6
  * Unique identifier for this predicate. Will be used to access the selected value in the table state
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TablePredicate.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/table-predicate/TablePredicate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,YAAY,EACZ,sBAAsB,EAEtB,OAAO,EAMV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAKxC,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEhH,MAAM,WAAW,mBAAoB,SAAQ,QAAQ,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;IAChG;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,yBAAyB,CAAC;IACvC,QAAQ,EAAE,IAAI,CAAC;CAClB,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAqChE,CAAC"}
1
+ {"version":3,"file":"TablePredicate.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/table-predicate/TablePredicate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,YAAY,EACZ,sBAAsB,EAEtB,OAAO,EAIP,WAAW,EAGd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAKxC,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEhH,MAAM,WAAW,mBACb,SAAQ,QAAQ,EACZ,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EACjC,sBAAsB,CAAC,qBAAqB,CAAC;IACjD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,yBAAyB,CAAC;IACvC,QAAQ,EAAE,IAAI,CAAC;CAClB,CAAC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAsChE,CAAC"}
@@ -5,7 +5,7 @@ import { useTableContext } from '../TableContext';
5
5
  const defaultProps = {};
6
6
  export const TablePredicate = factory((props, ref)=>{
7
7
  const { store, getStyles } = useTableContext();
8
- const { id, data, label, classNames, className, styles, style, vars, ...others } = useProps('PlasmaTablePredicate', defaultProps, props);
8
+ const { id, data, label, classNames, className, styles, style, renderOption, vars, ...others } = useProps('PlasmaTablePredicate', defaultProps, props);
9
9
  const handleChange = (newValue)=>{
10
10
  store.setPredicates((prev)=>({
11
11
  ...prev,
@@ -50,6 +50,7 @@ export const TablePredicate = factory((props, ref)=>{
50
50
  data: data,
51
51
  "aria-label": label ?? id,
52
52
  searchable: data.length > 7,
53
+ renderOption: renderOption,
53
54
  ...getStyles('predicateSelect', stylesApiProps)
54
55
  })
55
56
  ]