Git Product home page Git Product logo

fluentuieditabledetailslist's Introduction

FluentUI Editable DetailsList

Overview

FluentUI is a great UI library with some really cool controls, all adhering to Accessibility Standards.

DetailsList control of FluidUI is great when your requirement is a read-only grid. However, it does not offer any in-place editability functionality just yet.

This component(Editable DetailsList) is a wrapper over the existing DetailsList that makes in-place editability work like a dream(among many other new features).

Some of the features of the Editable Grid are:-

  • Single Cell Edit (in-place)
  • Single Row Edit (in-place)
  • Single Column Edit
  • Multi-Column, multi-row edit (Bulk Edit)
  • Full Edit (Edit Mode)
  • Grid Copy
  • Row Copy
  • Sorting
  • Deleting Rows
  • Adding Rows
  • Ability to Plug In Custom Component for Cell Hover
  • Default Data Export (to Excel, CSV)
  • Implement Custom Export functionality
  • Callback hook to recieve grid data in the consuming component(for Save etc.)
  • Support for various controls in grid in-place edit like TextField, Multiline TextField, DatePicker (Support for Dropdown will be released soon)
  • Flexibility to implement onChange callback on any cell value change (For cases like calculating summation of a column etc)
  • Length Validations during edit
  • Type Validations during edit
  • Rule-Based Cell Styling
  • In-built support for controls like TextField, Multiline-Textfield, Picker, Dropdown, Calendar
  • The component is completely Accessible

Demo

Fluent UI Editable DetailsList Demo

Clone & Run

  • clone the repository on your local machine.
  • open the project
  • open terminal and change directory to your project path
  • type 'npm install'
  • after the installation is complete, type 'npm start'

This starts the project on port 3000 and you are ready to play around with the Editable DetailsList

NPM Install

npm i fluentui-editable-grid

Usage

import { DetailsListLayoutMode, mergeStyles, mergeStyleSets, SelectionMode, TextField } from '@fluentui/react';
import { EditableGrid, EditControlType, IColumnConfig, EventEmitter, EventType, NumberAndDateOperators } from 'fluentui-editable-grid';
import { Fabric } from 'office-ui-fabric-react';
import * as React from 'react';
import { useState } from 'react';

const Consumer = () => {
    const classNames = mergeStyleSets({
        controlWrapper: {
        display: 'flex',
        flexWrap: 'wrap',
        }
    });
  
const [items, setItems] = useState<any[]>([]);
const columns: IColumnConfig[] = [
    {
        key: 'id',
        name: 'ID',
        text: 'ID',
        editable: false,
        dataType: 'number',
        minWidth: 100,
        maxWidth: 100,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        applyColumnFilter: true,
        disableSort: true
    },
    {
        key: 'customerhovercol',
        name: 'Custom Hover Column',
        text: 'Custom Hover Column',
        editable: true,
        dataType: 'string',
        minWidth: 100,
        maxWidth: 100,
        isResizable: true,
        includeColumnInExport: false,
        includeColumnInSearch: false,
        applyColumnFilter: false,
        disableSort: true,
        hoverComponentOptions: { enable:true, hoverChildComponent: <CellHover customProps={{ someProp: '' }} /> }
    },
    {
        key: 'name',
        name: 'Name',
        text: 'Name',
        editable: true,
        dataType: 'string',
        minWidth: 100,
        maxWidth: 100,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        applyColumnFilter: true
    },
    {
        key: 'age',
        name: 'Age',
        text: 'Age',
        editable: true,
        dataType: 'number',
        minWidth: 100,
        maxWidth: 100,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        applyColumnFilter: true
    },
    {
        key: 'designation',
        name: 'Designation',
        text: 'Designation',
        editable: true,
        dataType: 'string',
        minWidth: 100,
        maxWidth: 100,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        inputType: EditControlType.MultilineTextField,
        applyColumnFilter: true
    },
    {
        key: 'salary',
        name: 'Salary',
        text: 'Salary',
        editable: true,
        dataType: 'number',
        minWidth: 100,
        maxWidth: 100,
        isResizable: true,
        includeColumnInExport: false,
        includeColumnInSearch: true,
        maxLength:5,
        applyColumnFilter: true,
        cellStyleRule: { 
            enable: true, 
            rule: { 
                operator : NumberAndDateOperators.LESSTHAN, 
                value: 50000 
            }, 
            whenTrue: { textColor: '#EF5350', fontWeight: 'bold' },
            whenFalse: { textColor: '#9CCC65' }
        }
    },
    {
        key: 'dateofjoining',
        name: 'Date of Joining',
        text: 'Date of Joining',
        editable: true,
        dataType: 'date',
        minWidth: 150,
        maxWidth: 150,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        inputType: EditControlType.Date
    },
    {
        key: 'payrolltype',
        name: 'Payroll Type',
        text: 'Payroll Type',
        editable: true,
        dataType: 'string',
        minWidth: 150,
        maxWidth: 150,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        inputType: EditControlType.DropDown,
        dropdownValues: [
            { key: 'weekly', text: 'Weekly' },
            { key: 'biweekly', text: 'Bi-Weekly' },
            { key: 'monthly', text: 'Monthly' }
        ]
    },
    {
        key: 'employmenttype',
        name: 'Employment Type',
        text: 'Employment Type',
        editable: true,
        dataType: 'string',
        minWidth: 200,
        maxWidth: 200,
        isResizable: true,
        includeColumnInExport: true,
        includeColumnInSearch: true,
        inputType: EditControlType.Picker,
        pickerOptions: {
            pickerTags: ['Employment Type1', 'Employment Type2', 'Employment Type3', 'Employment Type4', 'Employment Type5', 'Employment Type6', 'Employment Type7', 'Employment Type8', 'Employment Type9', 'Employment Type10', 'Employment Type11', 'Employment Type12'],
            minCharLimitForSuggestions: 2,
            tagsLimit: 1,
            pickerDescriptionOptions: { 
                enabled: true, 
                values: [
                    { key: 'Employment Type1', description: 'Employment Type1 Description'},
                    { key: 'Employment Type2', description: 'Employment Type2 Description'},
                    { key: 'Employment Type3', description: 'Employment Type3 Description'},
                    { key: 'Employment Type4', description: 'Employment Type4 Description'},
                    { key: 'Employment Type5', description: 'Employment Type5 Description'},
                    { key: 'Employment Type6', description: 'Employment Type6 Description'},
                    { key: 'Employment Type7', description: 'Employment Type7 Description'},
                    { key: 'Employment Type8', description: 'Employment Type8 Description'},
                    { key: 'Employment Type9', description: 'Employment Type9 Description'},
                    { key: 'Employment Type10', description: 'Employment Type10 Description'},
                    { key: 'Employment Type11', description: 'Employment Type11 Description'},
                    { key: 'Employment Type12', description: 'Employment Type12 Description'},
            ] },
            suggestionsRule: StringOperators.STARTSWITH
        }
    }
];

const SetDummyData = () : void => {
    const dummyData = [
        {
            id: "1",
            customerhovercol: 'Hover Me',
            name: "Name1",
            age:32,
            designation:'Designation1',
            salary:57000,
            dateofjoining:'2010-04-01T14:57:10',
            payrolltype: 'Weekly',
            employmenttype: 'Employment Type11'
        },
        {
            id: "2",
            customerhovercol: 'Hover Me',
            name: "Name2",
            age:27,
            designation:'Designation2',
            salary:42000,
            dateofjoining:'2014-06-09T14:57:10',
            payrolltype: 'Monthly',
            employmenttype: 'Employment Type4'
        },
        {
            id: "3",
            customerhovercol: 'Hover Me',
            name: "Name3",
            age:35,
            designation:'Designation3',
            salary:75000,
            dateofjoining:'2005-07-02T14:57:10',
            payrolltype: 'Weekly',
            employmenttype: 'Employment Type7'
        },
        {
            id: "4",
            customerhovercol: 'Hover Me',
            name: "Name4",
            age:30,
            designation:'Designation4',
            salary:49000,
            dateofjoining:'2019-04-01T14:57:10',
            payrolltype: 'Bi-Weekly',
            employmenttype: 'Employment Type2'
        }
    ];
    setItems(dummyData);
}

React.useEffect(() => {
    SetDummyData();
}, []);

return (
    <Fabric>
        <div className={classNames.controlWrapper}>
            <TextField placeholder='Search Grid' className={mergeStyles({ width: '60vh', paddingBottom:'10px' })} onChange={(event) => EventEmitter.dispatch(EventType.onSearch, event)}/>
        </div>
        <EditableGrid
            id={1}
            columns={columns}
            items={items}
            enableCellEdit={true}
            enableExport={true}
            enableTextFieldEditMode={true}
            enableTextFieldEditModeCancel={true}
            enableGridRowsDelete={true}
            enableGridRowsAdd={true}
            height={'70vh'}
            width={'140vh'}
            position={'relative'}
            enableUnsavedEditIndicator={true}
            //onGridSave={onGridSave}
            enableGridReset={true}
            enableColumnFilters={true}
            enableColumnFilterRules={true}
            enableRowAddWithValues={{enable : true, enableRowsCounterInPanel : true}}
            layoutMode={DetailsListLayoutMode.justified}
            selectionMode={SelectionMode.multiple}
            enableRowEdit={true}
            enableRowEditCancel={true}
            enableBulkEdit={true}
            enableColumnEdit={true}
            enableSave={true}
            customCommandBarItems={[
                {
                    key: "CustomCommandBarItem1",
                    name: "Custom Command Bar Item1",
                    iconProps: { iconName: "Download" },
                    onClick: () => {
                      alert('Clicked');
                    },
                }
            ]}
        />
    </Fabric>
);
};

export default Consumer;

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.


For more details please check out Fluent UI Editable DetailsList Wiki.

fluentuieditabledetailslist's People

Contributors

dependabot[bot] avatar kumehrot avatar kushalmehrotra713 avatar microsoft-github-operations[bot] avatar microsoftopensource avatar unseen1980 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluentuieditabledetailslist's Issues

Grouping items

Is there any functionality to display items in grid in groups?

Selection is not working

Hello guys!

The selection={_selection} functionality is not working when checking a row, the event is not being fired.
Would they know why?

Thanks, I look forward to helping you.

Format date

How to format dates on date columns??
I cant find any method or workarround to accomplish this common feature

Text selection

Hello,

When I want to edit a text in a textbox, it's drawing a rectangle and doesn't select the text. Here is an example:
image

Any idea why ?

I have another question, I use the Picker for the autocomplete. My problem is that by default it only searches in the beginning of the text (like "startswith"), not in whole string. To change this I want to use the callback named onResolveSuggestions. Is it possible ? Do I have access to it ?

Thanks !

On textfield, cursor jumps after every input change

I have tried removing the multiline={true} from the EditControlType.MultilineTextField's render method, and this seems to stop the problem from happening. But obviously, I can't get a multiline text field that way. Has anyone encountered this?

                                <TextField
                                errorMessage={activateCellEdit[rowNum!]['properties'][column.key].error}
                                label={item.text}
                                ariaLabel={column.key}
                                //multiline={true} // this line seems to be causing the issue
                                rows={1}
                                styles={textFieldStyles}
                                onChange={(ev, text) => onCellValueChange(ev, text!, item, rowNum!, column.key, column)}
                                autoFocus={true && !editMode && !(activateCellEdit && activateCellEdit[Number(item['_grid_row_id_'])!] && activateCellEdit[Number(item['_grid_row_id_'])!]['isActivated'])}
                                value={activateCellEdit[rowNum!]['properties'][column.key].value}
                                maxLength={column.maxLength != null ? column.maxLength : 10000}
                                />

EDIT: I have discovered that my cursor is also jumping to the end if multiline is not there. So, this is an issue not specific to multiline, but hopefully gives a clue as to what is going on.

IColumnConfig "onRender" (derived from IColumn) kills "edit" functionality

Hi,

Don't know if I'm doing something wrong, but setting a custom onRender method in my column config (i.e. to display dates in a specific moment format, bolding text, or even just formatting a number to be displayed as currency with a thousand separator and a '$' prefix) makes it so that the column is no longer "editable".

I think the EditControlType defined in the config gets rendered in the same render method behind the scenes, so it's like I'm overwriting that "editing" functionality completely via my custom onRender.

Is there a workaround for this? Is there a way to put in the "editing" functionality myself in an onRender method? Or better yet, could there be another property like "onRenderDisplay" which controls just the display of the values rather than their editing inputs?

I am more than happy to develop this (or part of this). I would just need guidance on where things are.

Many thanks!

Paging

Hello! Is there any method to add the functionality of paging to this grid?

Project still active?

We were looking to implement this library in our production code base. We were wondering if this library is still being maintained. I See the last commit 3 months ago (and the only contributor has not made any github contributions since then.

If the anwser is yes, then my question is, if the library can be made available as a real library instead of a create-react-app implementation?

onChange on TextField error

Hello,

When i add a onChange event on my column, the whole grid crash.

Here is my column:
{
key: 'name',
name: 'Name',
text: 'Name',
editable: true,
dataType: 'string',
minWidth: 100,
maxWidth: 100,
isResizable: true,
includeColumnInExport: true,
includeColumnInSearch: true,
applyColumnFilter: true,
inputType: EditControlType.TextField,
onChange: this.newMethod
},

and whatever I put in "newMethod", when I type something in the textbox, the grid disappear and in the console I got this error twice :

TypeError: Cannot read properties of undefined (reading 'forEach')
at sg (timesheets-web-part_…2fe55e.js:2:1392297)
at Xe (timesheets-web-part_…2fe55e.js:2:1432831)
at We (timesheets-web-part_…2fe55e.js:2:1432291)
at onChange (timesheets-web-part_…2fe55e.js:2:1442932)
at t. (timesheets-web-part_…2fe55e.js:2:1203503)
at dr (react-dom-16-bundle_…d7fd18cd.js:2:54474)
at as (react-dom-16-bundle_…d7fd18cd.js:2:89482)
at uc (react-dom-16-bundle_…7fd18cd.js:2:107135)
at t.unstable_runWithPriority (react-dom-16-bundle_…dd7fd18cd.js:2:5230)
at Bi (react-dom-16-bundle_…d7fd18cd.js:2:50948)

any clue ?
Thanks

Modal "Column Filter" strange initial rendered components.

When column filter is displayed, the modal has 3 dropdowns with the same placeholders,

image

But based on the usage seems that they should not look like that.

  • Second dropdown should have the place holder "Select the operator"

  • Third dropdown should be Textbox instead. (In fact when you select the column, the third dropdown changes to an Textbox)

The modal looks strange with current initial state..

Selection is bound to row position but not the actual selected row

If I selected a row and then change the sorting, the selection will not move with the sorting but just stick to the position:
(selected row is in position 3 from the top)
grafik

Change the sorting and you'll see that ID 345 is not selected anymore but ID933:
(the selection sticks to the position 3; it should go with the ID instead)
grafik

Same misbehavior is when you use the filters to drill down your selection:
If I select a row then change the filter to add a new row to the selection and remove the filter, the latest selected row is not selected, but it selects simply the position of where the filtered row was before.

Publish to npm

Hi, thanks for the very useful component.

I would like to ask you if you plan to publish an npm package? If yes do you know the timeframe?

@kushalmehrotra713

Regards
Christos

"CSV" Export Fails in SPFx in SharePoint Online outside of Workbench due to SharePoint link manipulation

Hi,

Came across an issue where SharePoint Online refuses to download the BLOB created when exporting a CSV from the editable grid. This happens on a live site and NOT in the workbench (using SPFx).

The issue is easy to fix and I've got a working fix but don't quite know how to use Github for pull requests etc.

The issue stems from SharePoint's link manipulation. To disable it, use the attribute data-interception="off" on links so SharePoint forgoes any attempts at intercepting their original intent (i.e. generating BLOBs or even opening links up in new tabs). This is what's causing the CSV download to fail.

image

All that is needed is:

  1. Go to line # 42 in gridexportutil.tsx
  2. Add in :
    link.dataset.interception = 'off';

There is a similar issue reported here for a separate tool - basically just any custom "csv" export.
SharePoint/sp-dev-docs#4958

Resetting items state isn't reflected in the EditableGrid

If I have this component set up, where myItems is a piece of React State:

export default ({ myItems }) => {
  console.log({ myItems })

  return (
    <EditableGrid
      items={myItems}
      // ... rest of the props
    />
  )
}

The EditableGrid displays the items correctly, however setting myItems to an empty array (through the use of a button click separate to this library) re-renders this component and logs myItems as an empty array as you'd expect, but the EditableGrid stays populated with the now non-existent data.

Try changing EditableGrid to DetailsList, and you should see the expected behaviour of the DetailsList updating to display no data

Clicking on "Bulk Edit" causes TypeError: Cannot read properties of undefined (reading 'setExtraStackFrame') | react-jsx-runtime.development.js | happens ONLY when serving my SPFx project in development mode

Currently I'm using SPFx v1.14.0. Clicking on "Bulk Edit" after selecting a row, with at least one editable column, I get the below error. I think there might be an environment mismatch when building/compiling the code via Babel.

Please note that this does not happen with the source code when running "npm start" and works perfectly.

Uncaught TypeError: Cannot read properties of undefined (reading 'setExtraStackFrame')
at setCurrentlyValidatingElement$1 (react-jsx-runtime.development.js:872:1)
at validateExplicitKey (react-jsx-runtime.development.js:984:1)
at validateChildKeys (react-jsx-runtime.development.js:1013:1)
at jsxWithValidation (react-jsx-runtime.development.js:1184:1)
at jsxWithValidationDynamic (react-jsx-runtime.development.js:1209:1)
at EditPanel (editpanel.js:108:43)
at Yr (sp-pages-assembly_en-au_0a4bf7bfd698a9ad6d065bd3d5080219.js:69:63936)
at Ro (sp-pages-assembly_en-au_0a4bf7bfd698a9ad6d065bd3d5080219.js:69:72775)
at ys (sp-pages-assembly_en-au_0a4bf7bfd698a9ad6d065bd3d5080219.js:69:111038)
at pc (sp-pages-assembly_en-au_0a4bf7bfd698a9ad6d065bd3d5080219.js:69:102601)

This happens either when I publish my code to the AppCatalog in SharePoint or via "gulp serve" mode.

I noticed this project uses React 17.0.2+. With SPFx, I'm currently stuck at, but don't know if that impacts this.

"@types/react": "16.9.51",
"@types/react-dom": "16.9.8"

Now, I've tried this with the current latest repo code in addition to a forked repo I'm working on (built via "npm run build") and I get the same result.

Could anyone please help with this?

EDIT: PLEASE SEE MY NEW COMMENT BELOW

Unable to extend command bar

Would be really great if you allowed us to add additional buttons to the command bar. For example, I want to be able to support pasting data from Excel and, although I could handle the event myself it would be nice to have the option to add this to the command bar so I could present a dialog.

Style not being applied to columns

Hi @kushalmehrotra713 ,

I have been trying to apply column styles to the grid but it is not getting applied.

I am creating a style object as :

const headerStyle: Partial<IDetailsColumnStyles> = { cellTitle: { backgroundColor: "#FF0000", } };

And while defining the column, adding the above style
let dataGridColumns: IColumnConfig[] = [...fields].map(f => ({ styles:headerStyle, key: f.key as string, name: f.text, text: f.text as string, editable: true, dataType: 'string', minWidth: 100, maxWidth: 100, isResizable: true, includeColumnInExport: true, includeColumnInSearch: true, applyColumnFilter: true, disableSort:false }));

Unfortunately while running, the column styles are not getting rendered. Am I Missing something. Looking forward to you help on this.

image

Thanks in Advance !

Access to Grid state

Hi,
Keeping in mind issue56 I would like to have an access to Grid state to use it in other component and which will re-render it when I save data in grid. How can I achieve this?
Regards

A way to put the grid in standard edit mode?

Hi,

I've been looking for some time now, for a way to simulate or to just put the grid in edit mode upon rendering. I don't find any options in the codebase to do this. Will this be added? When the grid is rendered I need people to be immediately able to fill in fields and just press 1 save button.

Thanks

Column filter - automatic remove select all

When I use the column filter I type in the search term and the filter drills down the entries but before I can apply the filter I need to deselect the select all and then manually select the entries I want to apply the filter on. Expected behavior would be:
when entering the search term, the select all is already removed and the matching entries are automatically selected. This is similar to how it behaves in Excel.
grafik

Freeze Actions Column as the first Column

Hi ,

Thank You @kushalmehrotra713 for the wonderful work on the editable grid.

I am trying to create a SPFx(SharePoint Framework) webpart and consume the Editable Grid. Since I have like 100+ Columns, the Actions Column that allows Individual Edit/Save is being placed at the extreme right of the grid which can only be viewed by using the scroll bar.

Is there a way to freeze the position of the Actions column to the First Position ?

Grid

Thanks in Advance !

Toggle enableUnsavedEditIndicator

Hi,

sorry for the noobish question but how do i toggle the UnsavedEditIndiator? In the demo the Icon just becomes gray as soon as you submit the changes but but if im correct i cant see what you are doing to acomplish that :)

I hope you can help me

Unable to use the EditableDetailsGrid inside PCF Framework

I am working on Microsoft's PCF framework (you can see the tutorial here), and normally I can easily use the other FleuentUI components in the framework without any errors, but I have a requirement for EditableDetailsGrid, and I am not able to use it, I am getting following error.

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

I think, I am doing everything fine here, I double checked all the points mentioned here, but still getting the error.

Unable to use the EditableDetailsGrid inside PCF Framework

I am working on [Microsoft's PCF framework] and normally I can easily use the other FleuentUI components in the framework without any errors, but I have a requirement for EditableDetailsGrid, and I am not able to use it, I am getting following error. Any leads will be highly helpful.

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app

Install does not work

Hello yall,
We tried to install your library in our project, but the install fails due to dependency issues. Every solution we tried so far did not resolve the issue, sometimes they even got worse.

npm log:

npm i fluentui-editable-grid --save
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @types/[email protected]
npm WARN node_modules/@types/react
npm WARN peer @types/react@">=16.8.0 <18.0.0" from @fluentui/[email protected]
npm WARN node_modules/@fluentui/foundation-legacy
npm WARN @fluentui/foundation-legacy@"^8.1.13" from @fluentui/[email protected]
npm WARN node_modules/@fluentui/react
npm WARN 14 more (@fluentui/react, @fluentui/react-focus, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @types/react@">=16.8.0 <17.0.0" from [email protected]
npm WARN node_modules/office-ui-fabric-react
npm WARN office-ui-fabric-react@"^7.0.0" from [email protected]
npm WARN node_modules/fluentui-editable-grid
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @types/[email protected]
npm WARN node_modules/@types/react-dom
npm WARN peer @types/react-dom@">=16.8.0 <18.0.0" from @fluentui/[email protected]
npm WARN node_modules/@fluentui/react
npm WARN @fluentui/react@"^8.30.3" from the root project
npm WARN 1 more (fluentui-editable-grid)
npm WARN 2 more (the root project, fluentui-editable-grid)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @types/react-dom@">=16.8.0 <17.0.0" from [email protected]
npm WARN node_modules/office-ui-fabric-react
npm WARN office-ui-fabric-react@"^7.0.0" from [email protected]
npm WARN node_modules/fluentui-editable-grid
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN peer react@">=16.8.0 <18.0.0" from @fluentui/[email protected]
npm WARN node_modules/@fluentui/foundation-legacy
npm WARN @fluentui/foundation-legacy@"^8.1.13" from @fluentui/[email protected]
npm WARN node_modules/@fluentui/react
npm WARN 18 more (@fluentui/react, @fluentui/react-focus, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@">=16.8.0 <17.0.0" from [email protected]
npm WARN node_modules/office-ui-fabric-react
npm WARN office-ui-fabric-react@"^7.0.0" from [email protected]
npm WARN node_modules/fluentui-editable-grid
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/react-dom
npm WARN peer react-dom@">=16.8.0 <18.0.0" from @fluentui/[email protected]
npm WARN node_modules/@fluentui/react
npm WARN @fluentui/react@"^8.30.3" from the root project
npm WARN 1 more (fluentui-editable-grid)
npm WARN 5 more (@testing-library/react, styled-components, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@">=16.8.0 <17.0.0" from [email protected]
npm WARN node_modules/office-ui-fabric-react
npm WARN office-ui-fabric-react@"^7.0.0" from [email protected]
npm WARN node_modules/fluentui-editable-grid
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @types/[email protected]
npm ERR! node_modules/@types/react
npm ERR! peer @types/react@">=16.8.0 <18.0.0" from @fluentui/[email protected]
npm ERR! node_modules/@fluentui/foundation-legacy
npm ERR! @fluentui/foundation-legacy@"^8.1.13" from @fluentui/[email protected]
npm ERR! node_modules/@fluentui/react
npm ERR! @fluentui/react@"^8.30.3" from the root project
npm ERR! 1 more (fluentui-editable-grid)
npm ERR! peer @types/react@">=16.8.0 <18.0.0" from @fluentui/[email protected]
npm ERR! node_modules/@fluentui/react
npm ERR! @fluentui/react@"^8.30.3" from the root project
npm ERR! @fluentui/react@"^8.26.0" from [email protected]
npm ERR! node_modules/fluentui-editable-grid
npm ERR! fluentui-editable-grid@"" from the root project
npm ERR! 13 more (@fluentui/react-focus, @fluentui/react-hooks, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@">=16.8.0 <17.0.0" from @fluentui/[email protected]
npm ERR! node_modules/office-ui-fabric-react/node_modules/@fluentui/react-focus
npm ERR! @fluentui/react-focus@"^7.18.0" from [email protected]
npm ERR! node_modules/office-ui-fabric-react
npm ERR! office-ui-fabric-react@"^7.0.0" from [email protected]
npm ERR! node_modules/fluentui-editable-grid
npm ERR! fluentui-editable-grid@"
" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

our package.json:

{
"name": "app.ui",
"version": "0.1.0",
"private": true,
"proxy": "https://localhost:7011",
"dependencies": {
"@azure/msal-browser": "^2.16.1",
"@fluentui/react": "^8.30.3",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.10",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react-json-tree": "^0.13.0",
"@types/react-router-dom": "^5.1.8",
"@types/styled-components": "^5.1.14",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hook-form": "^7.15.3",
"react-json-tree": "^0.15.0",
"react-router-dom": "^5.3.0",
"react-scripts": "4.0.3",
"rxjs": "^7.3.0",
"styled-components": "^5.3.1",
"typescript": "^4.3.4",
"web-vitals": "^2.1.0"
},
"scripts": {
"start": "set PORT=3333&&react-scripts start",
"prestart": "copy .\cert\cert.pem .\node_modules\webpack-dev-server\ssl",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"csp": "node csp.js",
"format": "prettier --write src/**/*.ts{,x}"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"husky": {
"hooks": {
"pre-commit": "npm run format && npm audit fix"
}
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.2",
"prettier": "^2.3.2"
}
}

Do you guys know what is wrong, or why it won't install?
Kind regards

Sorting on dataType 'date' is broken

I'm currently trying to get sort to work on columns containing dates.

Here's my StartDate column
{ key: 'ProjectStartDate', name: strings.StartDate, text: strings.StartDate, minWidth: 200, dataType: "date", isResizable: true, onRender: (item: IProject) => { return <Text>{_formatDate(item.ProjectStartDate)}</Text> } }

Here's a screenshot of the StartDate being sorted.
image

EDIT: I imagine that the ones without dates should be places at the bottom, or top, depending on what sort is active. It shouldn't put them in between items with dates.

xlsx vulnerablility in fluent editable grid

Description
All versions of SheetJS CE through 0.19.2 are vulnerable to "Prototype Pollution" when reading specially crafted files. Workflows that do not read arbitrary files (for example, exporting data to spreadsheet files) are unaffected.

A non-vulnerable version cannot be found via npm, as the repository hosted on GitHub and the npm package xlsx are no longer maintained.

Issue:
In our system, we exclusively use npm, and xlsx does not release new versions to npm. Please let me know how to resolve the problem.

Can't get onChange event for non-text input types

Hello! My issue is that onChange function I pass to columns config fires when using inputType=EditControlType.TextField only. It is ignored for any other inputs - DropDown, etc.

UPD: Also, even for TextField - onChange event fires whenever I type a new letter, but it doesn't fire when I submit the changes by clicking Enter. So I'm struggling to implement pushing the values to backend because when onChange fires - it means that the user is continuing input but I don't know when they finish. Please help.

column minWidth

Hello,

When I define a column, the minWidth is not taken into account. The column always has the max width, even if I don't have enough space. I have a column I defined minWidth 200 and maxWidth 500, with no data : it always takes 500 width, and that creates an horizontal scroll because my screen is too small.

For info, I tried the DetailsList from FluentUI and it works.

Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.