react-bootstrap-table-ng-example 4.19.1 → 4.19.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap-table-ng-example",
3
- "version": "4.19.1",
3
+ "version": "4.19.2",
4
4
  "description": "Storybook for react-bootstrap-table-ng",
5
5
  "homepage": "http://jeff-k-zhou.github.io/react-bootstrap-table-ng",
6
6
  "main": "index.js",
@@ -42,7 +42,6 @@
42
42
  }
43
43
  ],
44
44
  "peerDependencies": {
45
- "prop-types": ">=15.8.1",
46
45
  "react": "^18.0 || ^18.0.0 || ^19.0 || ^19.0.0",
47
46
  "react-dom": "^18.0 || ^18.0.0 || ^19.0 || ^19.0.0"
48
47
  },
@@ -77,13 +76,12 @@
77
76
  "@types/node": "^22.10.5",
78
77
  "@types/react": "^19.2.10",
79
78
  "@types/react-dom": "^19.2.3",
80
- "prop-types": "^15.8.1",
81
79
  "react": "^19.2.4",
82
- "react-bootstrap-table-ng": "^4.19.1",
80
+ "react-bootstrap-table-ng": "^4.19.2",
83
81
  "react-dom": "^19.2.4",
84
82
  "react-scripts": "^5.0.1",
85
83
  "typescript": "^5.9.3",
86
84
  "web-vitals": "^5.1.0"
87
85
  },
88
- "gitHead": "24022dc8281117b928db32c4a90bcc9edc402edf"
86
+ "gitHead": "b1271954a204909d708b6f4f78d12bab5631a489"
89
87
  }
@@ -1,4 +1,4 @@
1
- import PropTypes from "prop-types";
1
+
2
2
  import React from "react";
3
3
 
4
4
  interface DefaultComponentProps {
@@ -6,9 +6,7 @@ interface DefaultComponentProps {
6
6
  }
7
7
 
8
8
  export default class DefaultComponent extends React.Component<DefaultComponentProps> {
9
- static propTypes = {
10
- children: PropTypes.string,
11
- };
9
+
12
10
 
13
11
  static defaultProps = {
14
12
  children: "",
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
2
+
3
3
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
4
4
 
5
5
  // import bootstrap style by given version
@@ -1216,10 +1216,6 @@ interface QualityRangerState { }
1216
1216
  class QualityRanger extends React.Component<QualityRangerProps, QualityRangerState> {
1217
1217
  range: HTMLInputElement | null = null;
1218
1218
 
1219
- static propTypes = {
1220
- value: PropTypes.number,
1221
- onUpdate: PropTypes.func.isRequired,
1222
- };
1223
1219
 
1224
1220
  static defaultProps = {
1225
1221
  value: 0,
@@ -1281,11 +1277,15 @@ export const CustomEditor: Story = {
1281
1277
  import BootstrapTable from 'react-bootstrap-table-ng';
1282
1278
  import cellEditFactory from 'react-bootstrap-table-ng-editor';
1283
1279
 
1284
- class QualityRanger extends React.Component {
1285
- static propTypes = {
1286
- value: PropTypes.number,
1287
- onUpdate: PropTypes.func.isRequired
1288
- }
1280
+ interface QualityRangerProps {
1281
+ value?: number;
1282
+ onUpdate: (value: number) => void;
1283
+ }
1284
+
1285
+ interface QualityRangerState { }
1286
+
1287
+ class QualityRanger extends React.Component<QualityRangerProps, QualityRangerState> {
1288
+
1289
1289
  static defaultProps = {
1290
1290
  value: 0
1291
1291
  }
@@ -1,5 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
- import PropTypes from "prop-types";
2
+
3
3
  import React from "react";
4
4
 
5
5
  // import bootstrap style by given version
@@ -1568,11 +1568,7 @@ interface PriceFilterProps {
1568
1568
  }
1569
1569
 
1570
1570
  class PriceFilter extends React.Component<PriceFilterProps> {
1571
- static propTypes = {
1572
- column: PropTypes.object.isRequired,
1573
- onFilter: PropTypes.func.isRequired,
1574
- };
1575
-
1571
+
1576
1572
  private input: HTMLInputElement | null;
1577
1573
 
1578
1574
  constructor(props: PriceFilterProps) {
@@ -1633,12 +1629,14 @@ export const CustomFilter: Story = {
1633
1629
  import BootstrapTable from 'react-bootstrap-table-ng';
1634
1630
  import filterFactory, { textFilter, customFilter } from 'react-bootstrap-table-ng-filter';
1635
1631
 
1636
- class PriceFilter extends React.Component {
1637
- static propTypes = {
1638
- column: PropTypes.object.isRequired,
1639
- onFilter: PropTypes.func.isRequired
1640
- }
1641
- constructor(props) {
1632
+ interface PriceFilterProps {
1633
+ column: any;
1634
+ onFilter: (value: string) => void;
1635
+ }
1636
+
1637
+ class PriceFilter extends React.Component<PriceFilterProps> {
1638
+
1639
+ constructor(props: PriceFilterProps) {
1642
1640
  super(props);
1643
1641
  this.filter = this.filter.bind(this);
1644
1642
  this.getValue = this.getValue.bind(this);
@@ -1695,10 +1693,6 @@ interface AdvancePriceFilterProps {
1695
1693
  }
1696
1694
 
1697
1695
  class AdvancePriceFilter extends React.Component<AdvancePriceFilterProps, { value: number }> {
1698
- static propTypes = {
1699
- column: PropTypes.object.isRequired,
1700
- onFilter: PropTypes.func.isRequired,
1701
- };
1702
1696
 
1703
1697
  private range: HTMLInputElement | null;
1704
1698
  private showValue: HTMLParagraphElement | null;
@@ -1798,12 +1792,14 @@ export const AdvanceCustomFilter: Story = {
1798
1792
  import BootstrapTable from 'react-bootstrap-table-ng';
1799
1793
  import filterFactory, { textFilter, customFilter, Comparator, FILTER_TYPES } from 'react-bootstrap-table-ng-filter';
1800
1794
 
1801
- class PriceFilter extends React.Component {
1802
- static propTypes = {
1803
- column: PropTypes.object.isRequired,
1804
- onFilter: PropTypes.func.isRequired
1805
- }
1806
- constructor(props) {
1795
+ interface PriceFilterProps {
1796
+ column: any;
1797
+ onFilter: (value: string) => void;
1798
+ }
1799
+
1800
+ class PriceFilter extends React.Component<PriceFilterProps> {
1801
+
1802
+ constructor(props: PriceFilterProps) {
1807
1803
  super(props);
1808
1804
  this.filter = this.filter.bind(this);
1809
1805
  this.getValue = this.getValue.bind(this);
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import PropTypes from "prop-types";
2
+
3
3
  import React from "react";
4
4
 
5
5
  import BootstrapTable from "../../../react-bootstrap-table-ng";
@@ -121,7 +121,12 @@ class Container extends React.Component {
121
121
  }
122
122
  `;
123
123
 
124
- const RemoteSort = (props: any) => (
124
+ interface RemoteSortProps {
125
+ data: any[];
126
+ onTableChange: (type: any, context: any) => void;
127
+ }
128
+
129
+ const RemoteSort = (props: RemoteSortProps) => (
125
130
  <div>
126
131
  <BootstrapTable
127
132
  remote={{ sort: true }}
@@ -134,10 +139,6 @@ const RemoteSort = (props: any) => (
134
139
  </div>
135
140
  );
136
141
 
137
- RemoteSort.propTypes = {
138
- data: PropTypes.array.isRequired,
139
- onTableChange: PropTypes.func.isRequired,
140
- };
141
142
 
142
143
  interface RemoteSortState {
143
144
  data: any;
@@ -282,7 +283,12 @@ class Container extends React.Component {
282
283
  }
283
284
  `;
284
285
 
285
- const RemoteFilter = (props: any) => (
286
+ interface RemoteFilterProps {
287
+ data: any[];
288
+ onTableChange: (type: any, context: any) => void;
289
+ }
290
+
291
+ const RemoteFilter = (props: RemoteFilterProps) => (
286
292
  <div>
287
293
  <BootstrapTable
288
294
  remote={{ filter: true }}
@@ -296,10 +302,6 @@ const RemoteFilter = (props: any) => (
296
302
  </div>
297
303
  );
298
304
 
299
- RemoteFilter.propTypes = {
300
- data: PropTypes.array.isRequired,
301
- onTableChange: PropTypes.func.isRequired,
302
- };
303
305
 
304
306
  interface RemoteFilterState {
305
307
  data: any;
@@ -403,13 +405,21 @@ class Container extends React.Component {
403
405
  }
404
406
  `;
405
407
 
408
+ interface RemotePaginationProps {
409
+ data: any[];
410
+ page: number;
411
+ totalSize: number;
412
+ sizePerPage: number;
413
+ onTableChange: (type: any, context: any) => void;
414
+ }
415
+
406
416
  const RemotePagination = ({
407
417
  data,
408
418
  page,
409
419
  sizePerPage,
410
420
  onTableChange,
411
421
  totalSize,
412
- }: any) => (
422
+ }: RemotePaginationProps) => (
413
423
  <div>
414
424
  <BootstrapTable
415
425
  remote
@@ -436,13 +446,6 @@ const RemotePagination = ({
436
446
  </div>
437
447
  );
438
448
 
439
- RemotePagination.propTypes = {
440
- data: PropTypes.array.isRequired,
441
- page: PropTypes.number.isRequired,
442
- totalSize: PropTypes.number.isRequired,
443
- sizePerPage: PropTypes.number.isRequired,
444
- onTableChange: PropTypes.func.isRequired,
445
- };
446
449
 
447
450
  interface RemotePaginationState {
448
451
  data: any;
@@ -589,7 +592,12 @@ class Container extends React.Component {
589
592
  }
590
593
  `;
591
594
 
592
- const RemoteSearch = (props: any) => (
595
+ interface RemoteSearchProps {
596
+ data: any[];
597
+ onTableChange: (type: any, context: any) => void;
598
+ }
599
+
600
+ const RemoteSearch = (props: RemoteSearchProps) => (
593
601
  <div>
594
602
  <ToolkitProvider
595
603
  keyField="id"
@@ -612,10 +620,6 @@ const RemoteSearch = (props: any) => (
612
620
  </div>
613
621
  );
614
622
 
615
- RemoteSearch.propTypes = {
616
- data: PropTypes.array.isRequired,
617
- onTableChange: PropTypes.func.isRequired,
618
- };
619
623
 
620
624
  interface RemoteSearchState {
621
625
  data: any;
@@ -733,7 +737,13 @@ class Container extends React.Component {
733
737
  }
734
738
  `;
735
739
 
736
- const RemoteCellEdit = (props: any) => {
740
+ interface RemoteCellEditProps {
741
+ data: any[];
742
+ onTableChange: (type: any, context: any) => void;
743
+ errorMessage: string;
744
+ }
745
+
746
+ const RemoteCellEdit = (props: RemoteCellEditProps) => {
737
747
  const cellEdit = {
738
748
  mode: "click",
739
749
  errorMessage: props.errorMessage,
@@ -767,11 +777,6 @@ const RemoteCellEdit = (props: any) => {
767
777
  );
768
778
  };
769
779
 
770
- RemoteCellEdit.propTypes = {
771
- data: PropTypes.array.isRequired,
772
- onTableChange: PropTypes.func.isRequired,
773
- errorMessage: PropTypes.string.isRequired,
774
- };
775
780
 
776
781
  interface RemoteCellEditState {
777
782
  data: any;
@@ -876,13 +881,6 @@ const RemoteAll = ({ data, page, sizePerPage, onTableChange, totalSize }) => (
876
881
  </div>
877
882
  );
878
883
 
879
- RemoteAll.propTypes = {
880
- data: PropTypes.array.isRequired,
881
- page: PropTypes.number.isRequired,
882
- totalSize: PropTypes.number.isRequired,
883
- sizePerPage: PropTypes.number.isRequired,
884
- onTableChange: PropTypes.func.isRequired
885
- };
886
884
 
887
885
  class Container extends React.Component {
888
886
  constructor(props) {
@@ -974,13 +972,21 @@ class Container extends React.Component {
974
972
  }
975
973
  `;
976
974
 
975
+ interface RemoteAllProps {
976
+ data: any[];
977
+ page: number;
978
+ totalSize: number;
979
+ sizePerPage: number;
980
+ onTableChange: (type: any, context: any) => void;
981
+ }
982
+
977
983
  const RemoteAll = ({
978
984
  data,
979
985
  page,
980
986
  sizePerPage,
981
987
  onTableChange,
982
988
  totalSize,
983
- }: any) => (
989
+ }: RemoteAllProps) => (
984
990
  <div>
985
991
  <h3>
986
992
  When <code>remote.pagination</code> is enabled, the filtering, sorting and
@@ -1028,14 +1034,6 @@ const RemoteAll = ({
1028
1034
  </div>
1029
1035
  );
1030
1036
 
1031
- RemoteAll.propTypes = {
1032
- data: PropTypes.array.isRequired,
1033
- page: PropTypes.number.isRequired,
1034
- totalSize: PropTypes.number.isRequired,
1035
- sizePerPage: PropTypes.number.isRequired,
1036
- onTableChange: PropTypes.func.isRequired,
1037
- };
1038
-
1039
1037
  let products = productsGenerator(87);
1040
1038
 
1041
1039
  interface RemoteAllState {
@@ -1286,8 +1284,8 @@ class RemoteAllExportComponent extends React.Component {
1286
1284
  }, 2000);
1287
1285
  };
1288
1286
 
1289
- handleExport = onExport => e => {
1290
- onExport(this.state.allData);
1287
+ handleExport = (onExport: any) => (e: any) => {
1288
+ onExport((this.state as any).allData);
1291
1289
  };
1292
1290
 
1293
1291
  render() {
@@ -1397,7 +1395,18 @@ const productColumns = [
1397
1395
  const { ExportCSVButton } = CSVExport;
1398
1396
 
1399
1397
  //leslint-disable-next-line react/proprtypes
1400
- const CustomToggleList = ({ columns, onColumnToggle, toggles }) => (
1398
+ interface CustomToggleListProps {
1399
+ columns: any[];
1400
+ onColumnToggle: (dataField: string) => void;
1401
+ toggles: any;
1402
+ }
1403
+
1404
+ const CustomToggleList = ({
1405
+ columns,
1406
+ onColumnToggle,
1407
+ toggles,
1408
+ }: CustomToggleListProps) => (
1409
+
1401
1410
  <div className="btn-group btn-group-toggle" data-toggle="buttons" style={{ marginBottom: '10px' }}>
1402
1411
  {columns
1403
1412
  .filter(column => !(column.toggleHidden === true))
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import PropTypes from "prop-types";
2
+
3
3
  import React from "react";
4
4
 
5
5
  import BootstrapTable from "../../../react-bootstrap-table-ng";
@@ -93,13 +93,21 @@ class EmptyTableOverlay extends React.Component {
93
93
  }
94
94
  `;
95
95
 
96
+ interface TableProps {
97
+ data: any[];
98
+ page: number;
99
+ totalSize: number;
100
+ sizePerPage: number;
101
+ onTableChange: (type: any, context: any) => void;
102
+ }
103
+
96
104
  const Table = ({
97
105
  data,
98
106
  page,
99
107
  sizePerPage,
100
108
  onTableChange,
101
109
  totalSize,
102
- }: any) => (
110
+ }: TableProps) => (
103
111
  <div>
104
112
  <BootstrapTable
105
113
  remote
@@ -127,13 +135,6 @@ const Table = ({
127
135
  </div>
128
136
  );
129
137
 
130
- Table.propTypes = {
131
- data: PropTypes.array.isRequired,
132
- page: PropTypes.number.isRequired,
133
- totalSize: PropTypes.number.isRequired,
134
- sizePerPage: PropTypes.number.isRequired,
135
- onTableChange: PropTypes.func.isRequired,
136
- };
137
138
 
138
139
  interface EmptyTableOverlayState {
139
140
  data: any;
@@ -201,14 +202,14 @@ const RemotePagination = ({ loading, data, page, sizePerPage, onTableChange, tot
201
202
  </div>
202
203
  );
203
204
 
204
- RemotePagination.propTypes = {
205
- data: PropTypes.array.isRequired,
206
- page: PropTypes.number.isRequired,
207
- loading: PropTypes.bool.isRequired,
208
- totalSize: PropTypes.number.isRequired,
209
- sizePerPage: PropTypes.number.isRequired,
210
- onTableChange: PropTypes.func.isRequired
211
- };
205
+ interface RemotePaginationProps {
206
+ data: any[];
207
+ page: number;
208
+ loading: boolean;
209
+ totalSize: number;
210
+ sizePerPage: number;
211
+ onTableChange: (type: any, context: any) => void;
212
+ }
212
213
 
213
214
  class Container extends React.Component {
214
215
  constructor(props) {
@@ -250,6 +251,15 @@ class Container extends React.Component {
250
251
  }
251
252
  `;
252
253
 
254
+ interface RemotePaginationProps {
255
+ data: any[];
256
+ page: number;
257
+ loading: boolean;
258
+ totalSize: number;
259
+ sizePerPage: number;
260
+ onTableChange: (type: any, context: any) => void;
261
+ }
262
+
253
263
  const RemotePagination = ({
254
264
  loading,
255
265
  data,
@@ -257,7 +267,7 @@ const RemotePagination = ({
257
267
  sizePerPage,
258
268
  onTableChange,
259
269
  totalSize,
260
- }: any) => (
270
+ }: RemotePaginationProps) => (
261
271
  <div>
262
272
  <BootstrapTable
263
273
  remote
@@ -294,14 +304,6 @@ const RemotePagination = ({
294
304
  </div>
295
305
  );
296
306
 
297
- RemotePagination.propTypes = {
298
- data: PropTypes.array.isRequired,
299
- page: PropTypes.number.isRequired,
300
- loading: PropTypes.bool.isRequired,
301
- totalSize: PropTypes.number.isRequired,
302
- sizePerPage: PropTypes.number.isRequired,
303
- onTableChange: PropTypes.func.isRequired,
304
- };
305
307
 
306
308
  interface TableOverlayState {
307
309
  data: any;
@@ -1,5 +1,5 @@
1
1
  /* eslint no-return-assign: 0 */
2
- import PropTypes from "prop-types";
2
+
3
3
  import React, { Fragment, PureComponent } from "react";
4
4
 
5
5
  interface WithBootstrapStyleProps {
@@ -17,10 +17,7 @@ export const BOOTSTRAP_VERSION = {
17
17
  };
18
18
 
19
19
  class WithBootstrapStyle extends PureComponent<WithBootstrapStyleProps, WithBootstrapStyleState> {
20
- static propTypes = {
21
- version: PropTypes.string.isRequired,
22
- render: PropTypes.func.isRequired,
23
- };
20
+
24
21
 
25
22
  style: HTMLLinkElement | null = null;
26
23
 
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2021",
3
+ "target": "ES2023",
4
4
  "lib": [
5
5
  "dom",
6
6
  "dom.iterable",