react-bootstrap-table-ng-example 4.19.0 → 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/.storybook/main.ts +24 -5
- package/.storybook/preview.ts +1 -1
- package/README.md +1 -1
- package/package.json +14 -14
- package/src/components/common/code-block.tsx +2 -4
- package/src/stories/BasicTable.stories.tsx +1 -1
- package/src/stories/Bootstrap4.stories.tsx +1 -1
- package/src/stories/CellEditing.stories.tsx +11 -11
- package/src/stories/ColumnFilter.stories.tsx +19 -23
- package/src/stories/ColumnToggle.stories.tsx +1 -1
- package/src/stories/Data.stories.tsx +1 -1
- package/src/stories/ExportCSV.stories.tsx +1 -1
- package/src/stories/Footer.stories.tsx +1 -1
- package/src/stories/Pagination.stories.tsx +1 -1
- package/src/stories/Remote.stories.tsx +9 -1
- package/src/stories/Remote.tsx +519 -48
- package/src/stories/RowExpand.stories.tsx +1 -1
- package/src/stories/RowSelection.stories.tsx +1 -1
- package/src/stories/SortTable.stories.tsx +1 -1
- package/src/stories/TableOverlay.stories.tsx +1 -1
- package/src/stories/TableOverlay.tsx +28 -26
- package/src/stories/TableSearch.stories.tsx +1 -1
- package/src/stories/Welcome.stories.ts +1 -1
- package/src/stories/WorkOnColumns.stories.tsx +1 -1
- package/src/stories/WorkOnHeaderColumns.stories.tsx +1 -1
- package/src/stories/WorkOnRows.stories.tsx +1 -1
- package/src/stories/bootstrap-style.tsx +2 -5
- package/tsconfig.json +1 -1
- package/sb_output.txt +0 -382
package/.storybook/main.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
// This file has been automatically migrated to valid ESM format by Storybook.
|
|
1
2
|
import type { StorybookConfig } from "@storybook/react-webpack5";
|
|
2
|
-
import path from "path";
|
|
3
|
+
import path, { dirname } from "path";
|
|
3
4
|
import { fileURLToPath } from "url";
|
|
4
5
|
import * as sass from "sass";
|
|
5
6
|
|
|
@@ -10,19 +11,30 @@ const config: StorybookConfig = {
|
|
|
10
11
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
11
12
|
|
|
12
13
|
addons: [
|
|
13
|
-
"@storybook/addon-links",
|
|
14
|
-
"@storybook/addon-onboarding",
|
|
15
|
-
"@storybook/addon-docs",
|
|
14
|
+
getAbsolutePath("@storybook/addon-links"),
|
|
15
|
+
//getAbsolutePath("@storybook/addon-onboarding"),
|
|
16
|
+
getAbsolutePath("@storybook/addon-docs"),
|
|
16
17
|
],
|
|
17
18
|
|
|
18
19
|
framework: {
|
|
19
|
-
name: "@storybook/react-webpack5",
|
|
20
|
+
name: getAbsolutePath("@storybook/react-webpack5"),
|
|
20
21
|
options: {},
|
|
21
22
|
},
|
|
22
23
|
|
|
23
24
|
staticDirs: ["../public"],
|
|
25
|
+
managerHead: (head) => `
|
|
26
|
+
${process.env.NODE_ENV === "production"
|
|
27
|
+
? `<base href="/react-bootstrap-table-ng/storybook/">`
|
|
28
|
+
: ""
|
|
29
|
+
}
|
|
30
|
+
${head}
|
|
31
|
+
`,
|
|
24
32
|
|
|
25
33
|
previewHead: (head) => `
|
|
34
|
+
${process.env.NODE_ENV === "production"
|
|
35
|
+
? `<base href="/react-bootstrap-table-ng/storybook/">`
|
|
36
|
+
: ""
|
|
37
|
+
}
|
|
26
38
|
${head}
|
|
27
39
|
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
|
|
28
40
|
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous"> -->
|
|
@@ -105,8 +117,15 @@ const config: StorybookConfig = {
|
|
|
105
117
|
...(config.resolve.modules || []),
|
|
106
118
|
];
|
|
107
119
|
}
|
|
120
|
+
if (config.output && process.env.NODE_ENV === "production") {
|
|
121
|
+
config.output.publicPath = "../storybook/";
|
|
122
|
+
}
|
|
108
123
|
return config;
|
|
109
124
|
},
|
|
110
125
|
};
|
|
111
126
|
|
|
112
127
|
export default config;
|
|
128
|
+
|
|
129
|
+
function getAbsolutePath(value: string): any {
|
|
130
|
+
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
|
131
|
+
}
|
package/.storybook/preview.ts
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# react-bootstrap-table-ng-example
|
|
2
2
|
Next generation of [`react-bootstrap-table`](https://github.com/jeff-k-zhou/react-bootstrap-table-ng)
|
|
3
3
|
|
|
4
|
-
**[Live Demo](https://
|
|
4
|
+
**[Live Demo](https://jeff-k-zhou.github.io/react-bootstrap-table-ng/storybook/index.html)**
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap-table-ng-example",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.2",
|
|
4
4
|
"description": "Storybook for react-bootstrap-table-ng",
|
|
5
|
+
"homepage": "http://jeff-k-zhou.github.io/react-bootstrap-table-ng",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
9
|
"storybook": "storybook dev -p 6006",
|
|
9
10
|
"gh-pages:clean": "rimraf ./storybook-static",
|
|
10
|
-
"gh-pages:build": "storybook build"
|
|
11
|
+
"gh-pages:build": "storybook build -o ./storybook-static/storybook",
|
|
12
|
+
"gh-pages:deploy": "gh-pages -d storybook-static"
|
|
11
13
|
},
|
|
12
14
|
"eslintConfig": {
|
|
13
15
|
"extends": [
|
|
@@ -40,30 +42,29 @@
|
|
|
40
42
|
}
|
|
41
43
|
],
|
|
42
44
|
"peerDependencies": {
|
|
43
|
-
"prop-types": "^15.8.1",
|
|
44
45
|
"react": "^18.0 || ^18.0.0 || ^19.0 || ^19.0.0",
|
|
45
46
|
"react-dom": "^18.0 || ^18.0.0 || ^19.0 || ^19.0.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
|
49
|
-
"@storybook/addon-docs": "^10.2.
|
|
50
|
-
"@storybook/addon-links": "^10.2.
|
|
51
|
-
"@storybook/addon-onboarding": "^10.2.
|
|
52
|
-
"@storybook/preset-create-react-app": "^10.2.
|
|
53
|
-
"@storybook/react": "^10.2.
|
|
54
|
-
"@storybook/react-webpack5": "^10.2.1",
|
|
50
|
+
"@storybook/addon-docs": "^10.2.7",
|
|
51
|
+
"@storybook/addon-links": "^10.2.7",
|
|
52
|
+
"@storybook/addon-onboarding": "^10.2.7",
|
|
53
|
+
"@storybook/preset-create-react-app": "^10.2.7",
|
|
54
|
+
"@storybook/react-webpack5": "^10.2.7",
|
|
55
55
|
"@types/file-saver": "^2.0.7",
|
|
56
56
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
57
57
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
|
58
58
|
"babel-preset-env": "^1.7.0",
|
|
59
|
-
"eslint-plugin-storybook": "^10.2.
|
|
59
|
+
"eslint-plugin-storybook": "^10.2.7",
|
|
60
60
|
"file-saver": "^2.0.5",
|
|
61
|
+
"gh-pages": "^6.3.0",
|
|
61
62
|
"react-redux": "^9.2.0",
|
|
62
63
|
"redux": "^5.0.1",
|
|
63
64
|
"redux-thunk": "^3.1.0",
|
|
64
65
|
"rimraf": "^6.1.2",
|
|
65
66
|
"sass": "^1.97.3",
|
|
66
|
-
"storybook": "^10.2.
|
|
67
|
+
"storybook": "^10.2.7",
|
|
67
68
|
"typed.js": "^3.0.0",
|
|
68
69
|
"webpack": "^5.104.1"
|
|
69
70
|
},
|
|
@@ -75,13 +76,12 @@
|
|
|
75
76
|
"@types/node": "^22.10.5",
|
|
76
77
|
"@types/react": "^19.2.10",
|
|
77
78
|
"@types/react-dom": "^19.2.3",
|
|
78
|
-
"prop-types": "^15.8.1",
|
|
79
79
|
"react": "^19.2.4",
|
|
80
|
-
"react-bootstrap-table-ng": "^4.19.
|
|
80
|
+
"react-bootstrap-table-ng": "^4.19.2",
|
|
81
81
|
"react-dom": "^19.2.4",
|
|
82
82
|
"react-scripts": "^5.0.1",
|
|
83
83
|
"typescript": "^5.9.3",
|
|
84
84
|
"web-vitals": "^5.1.0"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "b1271954a204909d708b6f4f78d12bab5631a489"
|
|
87
87
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
10
|
-
children: PropTypes.string,
|
|
11
|
-
};
|
|
9
|
+
|
|
12
10
|
|
|
13
11
|
static defaultProps = {
|
|
14
12
|
children: "",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
4
4
|
|
|
5
5
|
// import bootstrap style by given version
|
|
6
6
|
import cellEditFactory, { Type } from '../../../react-bootstrap-table-ng-editor';
|
|
@@ -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
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
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
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
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
|
-
|
|
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
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
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
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
// import bootstrap style by given version
|
|
4
4
|
import BootstrapTable from './Remote';
|
|
@@ -68,3 +68,11 @@ export const RemoteAll: Story = {
|
|
|
68
68
|
mode: "all",
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
+
|
|
72
|
+
export const RemoteAllCustom: Story = {
|
|
73
|
+
name: "Remote all + custom toolbars",
|
|
74
|
+
args: {
|
|
75
|
+
mode: "all-custom",
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|