@mui/x-data-grid-generator 6.16.0 → 6.16.2
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/CHANGELOG.md +165 -1
- package/index.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/services/random-generator.js +7 -5
- package/modern/index.js +1 -1
- package/modern/services/random-generator.js +7 -5
- package/node/index.js +1 -1
- package/node/renderer/renderLink.js +1 -2
- package/node/services/basic-data-service.js +1 -2
- package/node/services/random-generator.js +8 -8
- package/node/services/static-data.js +11 -22
- package/package.json +4 -4
- package/services/random-generator.js +7 -5
- package/services/tree-data-generator.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,170 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.16.2
|
|
7
|
+
|
|
8
|
+
_Oct 12, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📊 Chart's legend text management has been reworked and contains breaking changes (#10138) @alexfauquette
|
|
13
|
+
- 📝 Add [Bulk editing](https://mui.com/x/react-data-grid/recipes-editing/#bulk-editing) demo (#10333) @cherniavskii
|
|
14
|
+
- 🚀 Column grouping now works smoothly with column pinning (#10518) @MBilalShafi
|
|
15
|
+
- 🌍 Improve Arabic (ar-SD) and Spanish (es-ES) locales
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
- 📚 Documentation improvements
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@6.16.2`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix `LazyLoading` demo crash (#10621) @MBilalShafi
|
|
24
|
+
- [DataGrid] Fix cells overlapping the scrollbar in iOS Safari (#10633) @cherniavskii
|
|
25
|
+
- [DataGrid] Fix `getRowId is not defined` error (#10613) @romgrk
|
|
26
|
+
- [DataGrid] Get quick filter to work OOTB with `date` and `dateTime` fields (#10636) @MBilalShafi
|
|
27
|
+
- [DataGrid] Make cursor for selectable cells to be `default` unless editable (#9997) @gitstart
|
|
28
|
+
- [DataGrid] Remove unnecessary syntax in JSDoc (#10567) @Lev-Shapiro
|
|
29
|
+
- [DataGrid] Update row hover behavior to match native hover (#10623) @cherniavskii
|
|
30
|
+
- [l10n] Improve Arabic (ar-SD) locale (#10625) @alabenyahia
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@6.16.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@6.16.2`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Improve column grouping and column pinning friendship (#10518) @MBilalShafi
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-premium@6.16.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.2`.
|
|
41
|
+
|
|
42
|
+
### Date Pickers
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers@6.16.2`
|
|
45
|
+
|
|
46
|
+
- [DateTimePicker] Add support for `DigitalClock` view renderer (#10624) @LukasTy
|
|
47
|
+
- [fields] Bootstrap the multi-HTML input component (#10638) @flaviendelangle
|
|
48
|
+
- [pickers] Fix timezone `UTC` false positive (#10586) @alexfauquette
|
|
49
|
+
- [l10n] Improve Spanish (es-ES) locale (#10588) @eduardodallmann
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers-pro@6.16.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
52
|
+
|
|
53
|
+
Same changes as in `@mui/x-date-pickers@6.16.2`.
|
|
54
|
+
|
|
55
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.15`
|
|
56
|
+
|
|
57
|
+
#### Breaking changes
|
|
58
|
+
|
|
59
|
+
The charts have a new text display mechanism.
|
|
60
|
+
It adds line break support and avoids overlapping text in the legend.
|
|
61
|
+
This comes with some breaking changes.
|
|
62
|
+
|
|
63
|
+
- The DOM structure is modified. An intermediary `<tspan />` element has been added. This can impact how your style is applied.
|
|
64
|
+
```diff
|
|
65
|
+
- <text>The label</text>
|
|
66
|
+
+ <text><tspan>The label</tspan></text>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- The top margin has been reduced from 100 to 50 to benefit from the denser legend.
|
|
70
|
+
|
|
71
|
+
- To accurately compute the text size and then place it, styling should be provided as a JS object. For example, to set the legend font size, you should do:
|
|
72
|
+
```jsx
|
|
73
|
+
<PieChart
|
|
74
|
+
{/** ... */}
|
|
75
|
+
slotProps={{
|
|
76
|
+
legend: {
|
|
77
|
+
labelStyle: {
|
|
78
|
+
fontSize: 16,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
Support for other text elements (axis labels and tick labels) will be implemented in follow-up PR.
|
|
85
|
+
|
|
86
|
+
#### Changes
|
|
87
|
+
|
|
88
|
+
- [charts] Fix typo between internal/external variable (#10640) @alexfauquette
|
|
89
|
+
- [charts] Improve the management of the text (#10138) @alexfauquette
|
|
90
|
+
|
|
91
|
+
### Docs
|
|
92
|
+
|
|
93
|
+
- [docs] Add bulk editing demo (#10333) @cherniavskii
|
|
94
|
+
- [docs] Add reference links to DateRangePicker components (#10629) @michelengelen
|
|
95
|
+
- [docs] Add reference links to DateTimePicker components (#10628) @michelengelen
|
|
96
|
+
- [docs] Add reference links to picker field components (#10631) @michelengelen
|
|
97
|
+
- [docs] Added reference links to TimePicker components (#10627) @michelengelen
|
|
98
|
+
- [docs] Avoid Pickers playground error due to empty views (#10654) @LukasTy
|
|
99
|
+
- [docs] Fix DataGrid[Pro/Premium] reference links (#10620) @michelengelen
|
|
100
|
+
|
|
101
|
+
### Core
|
|
102
|
+
|
|
103
|
+
- [core] Bump monorepo (#10619) @alexfauquette
|
|
104
|
+
- [core] Update `no-response` workflow (#10491) @MBilalShafi
|
|
105
|
+
- [core] Update the issue templates to reflect the new support workflow (#10651) @MBilalShafi
|
|
106
|
+
- [test] Fix `testEval` not invoking test assertions (#10587) @cherniavskii
|
|
107
|
+
- [test] Fix dev mode warning (#10610) @oliviertassinari
|
|
108
|
+
- [test] Set UUID chance seed in visual tests (#10609) @oliviertassinari
|
|
109
|
+
|
|
110
|
+
## 6.16.1
|
|
111
|
+
|
|
112
|
+
_Oct 6, 2023_
|
|
113
|
+
|
|
114
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
115
|
+
|
|
116
|
+
- 🥧 Support interaction with pie chart
|
|
117
|
+
- 🐞 Bugfixes
|
|
118
|
+
- 📚 Documentation improvements
|
|
119
|
+
|
|
120
|
+
### Data Grid
|
|
121
|
+
|
|
122
|
+
#### `@mui/x-data-grid@6.16.1`
|
|
123
|
+
|
|
124
|
+
- [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
|
|
125
|
+
- [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
|
|
126
|
+
- [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
|
|
127
|
+
|
|
128
|
+
#### `@mui/x-data-grid-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
129
|
+
|
|
130
|
+
Same changes as in `@mui/x-data-grid@6.16.1`.
|
|
131
|
+
|
|
132
|
+
#### `@mui/x-data-grid-premium@6.16.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
133
|
+
|
|
134
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.1`.
|
|
135
|
+
|
|
136
|
+
### Date Pickers
|
|
137
|
+
|
|
138
|
+
#### `@mui/x-date-pickers@6.16.1`
|
|
139
|
+
|
|
140
|
+
- [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
|
|
141
|
+
- [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
|
|
142
|
+
- [pickers] Improve customization playground examples (#10544) @noraleonte
|
|
143
|
+
|
|
144
|
+
#### `@mui/x-date-pickers-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
145
|
+
|
|
146
|
+
Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
147
|
+
|
|
148
|
+
- [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
|
|
149
|
+
|
|
150
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.14`
|
|
151
|
+
|
|
152
|
+
- [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
|
|
153
|
+
- [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
|
|
154
|
+
- [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
|
|
155
|
+
|
|
156
|
+
### Docs
|
|
157
|
+
|
|
158
|
+
- [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
|
|
159
|
+
- [docs] Add section about disabling columns panel (#10328) @MBilalShafi
|
|
160
|
+
- [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
|
|
161
|
+
- [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
|
|
162
|
+
- [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
|
|
163
|
+
|
|
164
|
+
### Core
|
|
165
|
+
|
|
166
|
+
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
167
|
+
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
168
|
+
- [CHANGELOG] Polish image @oliviertassinari
|
|
169
|
+
|
|
6
170
|
## 6.16.0
|
|
7
171
|
|
|
8
172
|
_Sep 29, 2023_
|
|
@@ -13,7 +177,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
13
177
|
|
|
14
178
|
The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
|
|
15
179
|
|
|
16
|
-
<img width="
|
|
180
|
+
<img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
|
|
17
181
|
|
|
18
182
|
- 💫 Add Date Picker customization playground (#9581) @noraleonte
|
|
19
183
|
|
package/index.js
CHANGED
package/legacy/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Chance } from 'chance';
|
|
2
2
|
import { COLORS, COMMODITY_OPTIONS, CONTRACT_TYPE_OPTIONS, COUNTRY_ISO_OPTIONS, CURRENCY_OPTIONS, INCOTERM_OPTIONS, RATE_TYPE_OPTIONS, STATUS_OPTIONS, TAXCODE_OPTIONS } from './static-data';
|
|
3
|
-
var chanceId = globalChance();
|
|
4
3
|
var chance;
|
|
4
|
+
var chanceGuid;
|
|
5
5
|
if (typeof DISABLE_CHANCE_RANDOM !== 'undefined' && DISABLE_CHANCE_RANDOM) {
|
|
6
|
-
chance =
|
|
6
|
+
chance = new Chance(function () {
|
|
7
7
|
return 0.5;
|
|
8
8
|
});
|
|
9
|
+
chanceGuid = new Chance(42);
|
|
9
10
|
} else {
|
|
10
|
-
chance =
|
|
11
|
+
chance = new Chance();
|
|
12
|
+
chanceGuid = chance;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Wrap a data generator that returns a string and add a prefix if the value generated has already been given
|
|
@@ -108,7 +110,7 @@ export var randomColor = function randomColor() {
|
|
|
108
110
|
return randomArrayItem(COLORS);
|
|
109
111
|
};
|
|
110
112
|
export var randomId = function randomId() {
|
|
111
|
-
return
|
|
113
|
+
return chanceGuid.guid();
|
|
112
114
|
};
|
|
113
115
|
export var randomDesk = function randomDesk() {
|
|
114
116
|
return "D-".concat(chance.integer({
|
package/modern/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Chance } from 'chance';
|
|
2
2
|
import { COLORS, COMMODITY_OPTIONS, CONTRACT_TYPE_OPTIONS, COUNTRY_ISO_OPTIONS, CURRENCY_OPTIONS, INCOTERM_OPTIONS, RATE_TYPE_OPTIONS, STATUS_OPTIONS, TAXCODE_OPTIONS } from './static-data';
|
|
3
|
-
const chanceId = globalChance();
|
|
4
3
|
let chance;
|
|
4
|
+
let chanceGuid;
|
|
5
5
|
if (typeof DISABLE_CHANCE_RANDOM !== 'undefined' && DISABLE_CHANCE_RANDOM) {
|
|
6
|
-
chance =
|
|
6
|
+
chance = new Chance(() => 0.5);
|
|
7
|
+
chanceGuid = new Chance(42);
|
|
7
8
|
} else {
|
|
8
|
-
chance =
|
|
9
|
+
chance = new Chance();
|
|
10
|
+
chanceGuid = chance;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Wrap a data generator that returns a string and add a prefix if the value generated has already been given
|
|
@@ -84,7 +86,7 @@ export const randomDate = (start, end) => new Date(start.getTime() + chance.floa
|
|
|
84
86
|
export const randomArrayItem = arr => arr[randomInt(0, arr.length - 1)];
|
|
85
87
|
export const randomBoolean = () => randomArrayItem([true, false]);
|
|
86
88
|
export const randomColor = () => randomArrayItem(COLORS);
|
|
87
|
-
export const randomId = () =>
|
|
89
|
+
export const randomId = () => chanceGuid.guid();
|
|
88
90
|
export const randomDesk = () => `D-${chance.integer({
|
|
89
91
|
min: 0,
|
|
90
92
|
max: 10000
|
package/node/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const Link = (0, _styles.styled)('a')({
|
|
|
16
16
|
overflow: 'hidden',
|
|
17
17
|
color: 'inherit'
|
|
18
18
|
});
|
|
19
|
-
const DemoLink = /*#__PURE__*/React.memo(function DemoLink(props) {
|
|
19
|
+
const DemoLink = exports.DemoLink = /*#__PURE__*/React.memo(function DemoLink(props) {
|
|
20
20
|
const handleClick = event => {
|
|
21
21
|
event.preventDefault();
|
|
22
22
|
event.stopPropagation();
|
|
@@ -28,7 +28,6 @@ const DemoLink = /*#__PURE__*/React.memo(function DemoLink(props) {
|
|
|
28
28
|
children: props.children
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
|
-
exports.DemoLink = DemoLink;
|
|
32
31
|
function renderLink(params) {
|
|
33
32
|
if (params.value == null) {
|
|
34
33
|
return '';
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getBasicGridData = exports.currencyPairs = void 0;
|
|
7
|
-
const currencyPairs = ['USDGBP', 'USDEUR', 'GBPEUR', 'JPYUSD', 'MXNUSD', 'BTCUSD', 'USDCAD', 'EURJPY', 'EURUSD', 'EURCHF', 'USDCHF', 'EURGBP', 'GBPUSD', 'AUDCAD', 'NZDUSD', 'GBPCHF', 'AUDUSD', 'GBPJPY', 'USDJPY', 'CHFJPY', 'EURCAD', 'AUDJPY', 'EURAUD', 'AUDNZD', 'CADEUR', 'CHFMXN', 'ETHUSD', 'BCHUSD', 'ETHBTC', 'XRPUSD', 'XRPBTC', 'USDLTC', 'USDXRP', 'USDDSH', 'USDBCH', 'JPYEUR', 'JPYUSD', 'JPYGBP', 'JPYCAD', 'JPYCHF', 'JPYAUD', 'JPYNZD', 'JPYSGD', 'JPYNOK', 'JPYRUB', 'JPYSEK', 'JPYTRY', 'JPYZAR', 'JPYHKD', 'JPYCNH', 'JPYDKK', 'JPYMXN', 'JPYPLN', 'JPYXAG', 'JPYXAU', 'JPYBTC', 'JPYETH', 'JPYLTC', 'JPYXRP', 'JPYDSH', 'JPYBCH', 'GBPEUR', 'GBPRUB', 'GBPTRY'];
|
|
8
|
-
exports.currencyPairs = currencyPairs;
|
|
7
|
+
const currencyPairs = exports.currencyPairs = ['USDGBP', 'USDEUR', 'GBPEUR', 'JPYUSD', 'MXNUSD', 'BTCUSD', 'USDCAD', 'EURJPY', 'EURUSD', 'EURCHF', 'USDCHF', 'EURGBP', 'GBPUSD', 'AUDCAD', 'NZDUSD', 'GBPCHF', 'AUDUSD', 'GBPJPY', 'USDJPY', 'CHFJPY', 'EURCAD', 'AUDJPY', 'EURAUD', 'AUDNZD', 'CADEUR', 'CHFMXN', 'ETHUSD', 'BCHUSD', 'ETHBTC', 'XRPUSD', 'XRPBTC', 'USDLTC', 'USDXRP', 'USDDSH', 'USDBCH', 'JPYEUR', 'JPYUSD', 'JPYGBP', 'JPYCAD', 'JPYCHF', 'JPYAUD', 'JPYNZD', 'JPYSGD', 'JPYNOK', 'JPYRUB', 'JPYSEK', 'JPYTRY', 'JPYZAR', 'JPYHKD', 'JPYCNH', 'JPYDKK', 'JPYMXN', 'JPYPLN', 'JPYXAG', 'JPYXAU', 'JPYBTC', 'JPYETH', 'JPYLTC', 'JPYXRP', 'JPYDSH', 'JPYBCH', 'GBPEUR', 'GBPRUB', 'GBPTRY'];
|
|
9
8
|
const getBasicGridData = (rowLength, colLength) => {
|
|
10
9
|
const data = [];
|
|
11
10
|
const pricesColLength = colLength - 2;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.randomUserName = exports.randomUrl = exports.randomUpdatedDate = exports.randomUnitPriceCurrency = exports.randomUnitPrice = exports.randomTraderName = exports.randomTradeDate = exports.randomTaxCode = exports.randomStatusOptions = exports.randomRating = exports.randomRateType = exports.randomRate = exports.randomQuantity = exports.randomPrice = exports.randomPnL = exports.randomPhoneNumber = exports.randomName = exports.randomMaturityDate = exports.randomJobTitle = exports.randomInt = exports.randomIncoterm = exports.randomId = exports.randomFeeRate = exports.randomEmail = exports.randomDesk = exports.randomDate = exports.randomCurrency = exports.randomCreatedDate = exports.randomCountry = exports.randomContractType = exports.randomCompanyName = exports.randomCommodity = exports.randomColor = exports.randomCity = exports.randomBrokerId = exports.randomBoolean = exports.randomArrayItem = exports.randomAddress = exports.random = exports.generateIsFilled = exports.generateFilledQuantity = void 0;
|
|
8
|
-
var _chance =
|
|
7
|
+
var _chance = require("chance");
|
|
9
8
|
var _staticData = require("./static-data");
|
|
10
|
-
const chanceId = (0, _chance.default)();
|
|
11
9
|
let chance;
|
|
10
|
+
let chanceGuid;
|
|
12
11
|
if (typeof DISABLE_CHANCE_RANDOM !== 'undefined' && DISABLE_CHANCE_RANDOM) {
|
|
13
|
-
chance =
|
|
12
|
+
chance = new _chance.Chance(() => 0.5);
|
|
13
|
+
chanceGuid = new _chance.Chance(42);
|
|
14
14
|
} else {
|
|
15
|
-
chance =
|
|
15
|
+
chance = new _chance.Chance();
|
|
16
|
+
chanceGuid = chance;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* Wrap a data generator that returns a string and add a prefix if the value generated has already been given
|
|
@@ -99,7 +100,7 @@ const randomBoolean = () => randomArrayItem([true, false]);
|
|
|
99
100
|
exports.randomBoolean = randomBoolean;
|
|
100
101
|
const randomColor = () => randomArrayItem(_staticData.COLORS);
|
|
101
102
|
exports.randomColor = randomColor;
|
|
102
|
-
const randomId = () =>
|
|
103
|
+
const randomId = () => chanceGuid.guid();
|
|
103
104
|
exports.randomId = randomId;
|
|
104
105
|
const randomDesk = () => `D-${chance.integer({
|
|
105
106
|
min: 0,
|
|
@@ -162,8 +163,7 @@ const randomJobTitle = () => chance.profession();
|
|
|
162
163
|
exports.randomJobTitle = randomJobTitle;
|
|
163
164
|
const randomRating = () => randomInt(1, 5);
|
|
164
165
|
exports.randomRating = randomRating;
|
|
165
|
-
const randomName = uniquenessHandler(() => chance.name());
|
|
166
|
-
exports.randomName = randomName;
|
|
166
|
+
const randomName = exports.randomName = uniquenessHandler(() => chance.name());
|
|
167
167
|
const generateFilledQuantity = data => Number((data.quantity * randomRate()).toFixed()) / data.quantity;
|
|
168
168
|
exports.generateFilledQuantity = generateFilledQuantity;
|
|
169
169
|
const generateIsFilled = data => data.quantity === data.filledQuantity;
|
|
@@ -5,25 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TAXCODE_OPTIONS = exports.STATUS_OPTIONS = exports.RATE_TYPE_OPTIONS = exports.INCOTERM_OPTIONS = exports.CURRENCY_OPTIONS = exports.COUNTRY_OPTIONS = exports.COUNTRY_ISO_OPTIONS_SORTED = exports.COUNTRY_ISO_OPTIONS = exports.CONTRACT_TYPE_OPTIONS = exports.COMMODITY_OPTIONS = exports.COLORS = void 0;
|
|
7
7
|
var _colors = require("@mui/material/colors");
|
|
8
|
-
const COLORS = [_colors.pink[500], _colors.blue[500], _colors.orange[500], _colors.red[500], _colors.green[500], _colors.lightBlue[500], _colors.purple[500]];
|
|
9
|
-
exports.
|
|
10
|
-
const
|
|
11
|
-
exports.
|
|
12
|
-
const
|
|
13
|
-
exports.
|
|
14
|
-
const
|
|
15
|
-
exports.
|
|
16
|
-
const
|
|
17
|
-
exports.
|
|
18
|
-
const INCOTERM_OPTIONS = ['EXW (Ex Works)', 'FAS (Free Alongside Ship)', 'FCA (Free Carrier)', 'CPT (Carriage Paid To)', 'DAP (Delivered at Place)', 'DPU (Delivered at Place Unloaded)', 'DDP (Delivered Duty Paid)'];
|
|
19
|
-
exports.INCOTERM_OPTIONS = INCOTERM_OPTIONS;
|
|
20
|
-
const COMMODITY_OPTIONS = ['Corn', 'Oats', 'Rough Rice', 'Soybeans', 'Rapeseed', 'Soybeans', 'Soybean Meal', 'Soybean Oil', 'Wheat', 'Milk', 'Cocoa', 'Coffee C', 'Cotton No.2', 'Sugar No.11', 'Sugar No.14', 'Frozen Concentrated Orange Juice', 'Adzuki bean', 'Robusta coffee'];
|
|
21
|
-
exports.COMMODITY_OPTIONS = COMMODITY_OPTIONS;
|
|
22
|
-
const CURRENCY_OPTIONS = ['USD', 'GBP', 'JPY', 'EUR', 'BRL', 'MXN', 'AUD', 'CAD', 'NZD', 'ARS', 'CHF', 'THB', 'HKD', 'TRY'];
|
|
23
|
-
exports.CURRENCY_OPTIONS = CURRENCY_OPTIONS;
|
|
24
|
-
const COUNTRY_OPTIONS = ['United States', 'United Kingdom', 'Japan', 'France', 'Brazil', 'Mexico', 'Australia', 'Canada', 'New Zealand', 'Argentina', 'Switzerland', 'Thailand', 'Hong Kong', 'Turkey'];
|
|
25
|
-
exports.COUNTRY_OPTIONS = COUNTRY_OPTIONS;
|
|
26
|
-
const COUNTRY_ISO_OPTIONS = [{
|
|
8
|
+
const COLORS = exports.COLORS = [_colors.pink[500], _colors.blue[500], _colors.orange[500], _colors.red[500], _colors.green[500], _colors.lightBlue[500], _colors.purple[500]];
|
|
9
|
+
const STATUS_OPTIONS = exports.STATUS_OPTIONS = ['Open', 'PartiallyFilled', 'Filled', 'Rejected'];
|
|
10
|
+
const TAXCODE_OPTIONS = exports.TAXCODE_OPTIONS = ['BR', '1250L', '20G', 'BC45', 'IGN179'];
|
|
11
|
+
const RATE_TYPE_OPTIONS = exports.RATE_TYPE_OPTIONS = ['Fixed', 'Floating'];
|
|
12
|
+
const CONTRACT_TYPE_OPTIONS = exports.CONTRACT_TYPE_OPTIONS = ['FP', 'TM', 'CR'];
|
|
13
|
+
const INCOTERM_OPTIONS = exports.INCOTERM_OPTIONS = ['EXW (Ex Works)', 'FAS (Free Alongside Ship)', 'FCA (Free Carrier)', 'CPT (Carriage Paid To)', 'DAP (Delivered at Place)', 'DPU (Delivered at Place Unloaded)', 'DDP (Delivered Duty Paid)'];
|
|
14
|
+
const COMMODITY_OPTIONS = exports.COMMODITY_OPTIONS = ['Corn', 'Oats', 'Rough Rice', 'Soybeans', 'Rapeseed', 'Soybeans', 'Soybean Meal', 'Soybean Oil', 'Wheat', 'Milk', 'Cocoa', 'Coffee C', 'Cotton No.2', 'Sugar No.11', 'Sugar No.14', 'Frozen Concentrated Orange Juice', 'Adzuki bean', 'Robusta coffee'];
|
|
15
|
+
const CURRENCY_OPTIONS = exports.CURRENCY_OPTIONS = ['USD', 'GBP', 'JPY', 'EUR', 'BRL', 'MXN', 'AUD', 'CAD', 'NZD', 'ARS', 'CHF', 'THB', 'HKD', 'TRY'];
|
|
16
|
+
const COUNTRY_OPTIONS = exports.COUNTRY_OPTIONS = ['United States', 'United Kingdom', 'Japan', 'France', 'Brazil', 'Mexico', 'Australia', 'Canada', 'New Zealand', 'Argentina', 'Switzerland', 'Thailand', 'Hong Kong', 'Turkey'];
|
|
17
|
+
const COUNTRY_ISO_OPTIONS = exports.COUNTRY_ISO_OPTIONS = [{
|
|
27
18
|
value: 'AD',
|
|
28
19
|
code: 'AD',
|
|
29
20
|
label: 'Andorra',
|
|
@@ -1270,6 +1261,4 @@ const COUNTRY_ISO_OPTIONS = [{
|
|
|
1270
1261
|
label: 'Zimbabwe',
|
|
1271
1262
|
phone: '263'
|
|
1272
1263
|
}];
|
|
1273
|
-
exports.
|
|
1274
|
-
const COUNTRY_ISO_OPTIONS_SORTED = [...COUNTRY_ISO_OPTIONS].sort((v1, v2) => v1.label.localeCompare(v2.label));
|
|
1275
|
-
exports.COUNTRY_ISO_OPTIONS_SORTED = COUNTRY_ISO_OPTIONS_SORTED;
|
|
1264
|
+
const COUNTRY_ISO_OPTIONS_SORTED = exports.COUNTRY_ISO_OPTIONS_SORTED = [...COUNTRY_ISO_OPTIONS].sort((v1, v2) => v1.label.localeCompare(v2.label));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "6.16.
|
|
3
|
+
"version": "6.16.2",
|
|
4
4
|
"description": "Generate fake data for demo purposes only.",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"directory": "packages/grid/x-data-grid-generator"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@babel/runtime": "^7.
|
|
23
|
-
"@mui/base": "^5.0.0-beta.
|
|
24
|
-
"@mui/x-data-grid-premium": "6.16.
|
|
22
|
+
"@babel/runtime": "^7.23.1",
|
|
23
|
+
"@mui/base": "^5.0.0-beta.17",
|
|
24
|
+
"@mui/x-data-grid-premium": "6.16.2",
|
|
25
25
|
"chance": "^1.1.11",
|
|
26
26
|
"clsx": "^2.0.0",
|
|
27
27
|
"lru-cache": "^7.18.3"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Chance } from 'chance';
|
|
2
2
|
import { COLORS, COMMODITY_OPTIONS, CONTRACT_TYPE_OPTIONS, COUNTRY_ISO_OPTIONS, CURRENCY_OPTIONS, INCOTERM_OPTIONS, RATE_TYPE_OPTIONS, STATUS_OPTIONS, TAXCODE_OPTIONS } from './static-data';
|
|
3
|
-
const chanceId = globalChance();
|
|
4
3
|
let chance;
|
|
4
|
+
let chanceGuid;
|
|
5
5
|
if (typeof DISABLE_CHANCE_RANDOM !== 'undefined' && DISABLE_CHANCE_RANDOM) {
|
|
6
|
-
chance =
|
|
6
|
+
chance = new Chance(() => 0.5);
|
|
7
|
+
chanceGuid = new Chance(42);
|
|
7
8
|
} else {
|
|
8
|
-
chance =
|
|
9
|
+
chance = new Chance();
|
|
10
|
+
chanceGuid = chance;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Wrap a data generator that returns a string and add a prefix if the value generated has already been given
|
|
@@ -85,7 +87,7 @@ export const randomDate = (start, end) => new Date(start.getTime() + chance.floa
|
|
|
85
87
|
export const randomArrayItem = arr => arr[randomInt(0, arr.length - 1)];
|
|
86
88
|
export const randomBoolean = () => randomArrayItem([true, false]);
|
|
87
89
|
export const randomColor = () => randomArrayItem(COLORS);
|
|
88
|
-
export const randomId = () =>
|
|
90
|
+
export const randomId = () => chanceGuid.guid();
|
|
89
91
|
export const randomDesk = () => `D-${chance.integer({
|
|
90
92
|
min: 0,
|
|
91
93
|
max: 10000
|
|
@@ -8,12 +8,12 @@ export interface AddPathToDemoDataOptions {
|
|
|
8
8
|
groupingField?: string;
|
|
9
9
|
/**
|
|
10
10
|
* The depth of the tree
|
|
11
|
-
* @default
|
|
11
|
+
* @default 1
|
|
12
12
|
*/
|
|
13
13
|
maxDepth?: number;
|
|
14
14
|
/**
|
|
15
15
|
* The average amount of children in a node
|
|
16
|
-
* @default
|
|
16
|
+
* @default 2
|
|
17
17
|
*/
|
|
18
18
|
averageChildren?: number;
|
|
19
19
|
}
|