@applica-software-guru/react-admin 1.0.40 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applica-software-guru/react-admin",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  import { IconButton, MenuItem, styled } from '@mui/material';
2
- import React, { Children, useState } from 'react';
2
+ import React, { Children, useCallback, useState } from 'react';
3
3
 
4
4
  import MenuPopover from './MenuPopover/MenuPopover';
5
5
  import { MoreVert } from '@mui/icons-material';
@@ -14,7 +14,7 @@ const StyledRoot = styled('div', {
14
14
  }));
15
15
 
16
16
  const StyledMenuPopover = styled(MenuPopover, {
17
- name: 'ApplicaActionsMenuPopover',
17
+ name: 'ApplicaActionsMenu',
18
18
  slot: 'root'
19
19
  })(({ theme }) => ({
20
20
  '& .MuiMenuItem-root': {
@@ -50,9 +50,9 @@ const ActionsMenu = ({ children }: ActionsMenuProps): React.ReactElement | null
50
50
  e.preventDefault();
51
51
  setOpen(e.currentTarget);
52
52
  };
53
- const handleClose = () => {
53
+ const handleClose = useCallback(() => {
54
54
  setOpen(null);
55
- };
55
+ }, []);
56
56
 
57
57
  if (
58
58
  !children ||
@@ -71,12 +71,7 @@ const ActionsMenu = ({ children }: ActionsMenuProps): React.ReactElement | null
71
71
  <StyledMenuPopover open={open} onClose={handleClose} arrow="right-top">
72
72
  {Children.map(
73
73
  children,
74
- (action, index) =>
75
- React.isValidElement(action) && (
76
- <MenuItem key={index} onClick={handleClose}>
77
- {React.cloneElement(action)}
78
- </MenuItem>
79
- )
74
+ (action, index) => React.isValidElement(action) && <MenuItem key={index}>{React.cloneElement(action)}</MenuItem>
80
75
  )}
81
76
  </StyledMenuPopover>
82
77
  </StyledRoot>
package/vite.config.js CHANGED
@@ -1,12 +1,12 @@
1
- import * as packageJson from './package.json'
1
+ import * as packageJson from './package.json';
2
2
 
3
- import EsLint from 'vite-plugin-linter'
4
- import { defineConfig } from 'vite'
5
- import dts from 'vite-plugin-dts'
6
- import react from '@vitejs/plugin-react'
7
- import { resolve } from 'node:path'
3
+ import EsLint from 'vite-plugin-linter';
4
+ import { defineConfig } from 'vite';
5
+ import dts from 'vite-plugin-dts';
6
+ import react from '@vitejs/plugin-react';
7
+ import { resolve } from 'node:path';
8
8
 
9
- const { EsLinter, linterPlugin } = EsLint
9
+ const { EsLinter, linterPlugin } = EsLint;
10
10
  export default defineConfig((configEnv) => ({
11
11
  plugins: [
12
12
  dts({
@@ -22,6 +22,7 @@ export default defineConfig((configEnv) => ({
22
22
  include: ['react', 'react-dom', 'react-admin']
23
23
  },
24
24
  build: {
25
+ sourcemap: true,
25
26
  lib: {
26
27
  entry: resolve('src', 'index.jsx'),
27
28
  name: 'react-admin',
@@ -31,9 +32,9 @@ export default defineConfig((configEnv) => ({
31
32
  rollupOptions: {
32
33
  onwarn(warning, warn) {
33
34
  if (warning.code === 'MODULE_LEVEL_DIRECTIVE' && warning.message.includes(`'use client'`)) {
34
- return
35
+ return;
35
36
  }
36
- warn(warning)
37
+ warn(warning);
37
38
  },
38
39
  external: Object.keys(packageJson.peerDependencies || {}).concat([
39
40
  '@ant-design/icons',
@@ -71,4 +72,4 @@ export default defineConfig((configEnv) => ({
71
72
  }
72
73
  }
73
74
  }
74
- }))
75
+ }));