@corpsmap/corpsmap 3.2.83 → 3.2.90

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": "@corpsmap/corpsmap",
3
- "version": "3.2.83",
3
+ "version": "3.2.90",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,15 +25,14 @@
25
25
  "cross-env": "^5.2.0",
26
26
  "react": "^16.9.0",
27
27
  "react-dom": "^16.9.0",
28
- "rollup": "^2.0.0",
29
- "@rollup/plugin-babel": "^5.0.0",
30
- "@rollup/plugin-commonjs": "^24.1.0",
31
- "rollup-plugin-css-only": "^2.0.0",
32
- "@rollup/plugin-json": "^6.0.0",
33
- "@rollup/plugin-node-resolve": "^15.0.2",
28
+ "rollup": "^1.20.2",
29
+ "rollup-plugin-babel": "^4.3.3",
30
+ "rollup-plugin-commonjs": "^10.1.0",
31
+ "rollup-plugin-css-only": "^1.0.0",
32
+ "rollup-plugin-json": "^4.0.0",
33
+ "rollup-plugin-node-resolve": "^5.2.0",
34
34
  "rollup-plugin-postcss": "^2.0.3",
35
35
  "rollup-plugin-replace": "^2.2.0",
36
- "rollup-plugin-peer-deps-external": "^2.0.0",
37
36
  "styled-jsx": "^3.2.1",
38
37
  "wait-on": "^5.2.1"
39
38
  },
@@ -43,17 +42,17 @@
43
42
  },
44
43
  "dependencies": {
45
44
  "@mapbox/togeojson": "^0.16.0",
46
- "@turf/bbox": "^6.5.0",
45
+ "@turf/bbox": "^6.0.1",
47
46
  "@turf/bbox-polygon": "^6.0.1",
48
47
  "@turf/boolean-crosses": "^6.0.1",
49
- "@turf/boolean-disjoint": "^6.5.0",
48
+ "@turf/boolean-disjoint": "^6.0.2",
50
49
  "@turf/boolean-point-in-polygon": "^6.0.1",
51
50
  "@turf/buffer": "^5.1.5",
52
- "@turf/center-of-mass": "^6.5.0",
51
+ "@turf/center-of-mass": "^6.0.1",
53
52
  "@turf/centroid": "^6.0.2",
54
53
  "@turf/distance": "^6.0.1",
55
54
  "@turf/flatten": "^5.1.5",
56
- "@turf/helpers": "^6.5.0",
55
+ "@turf/helpers": "^6.1.4",
57
56
  "@turf/length": "^6.0.2",
58
57
  "@turf/line-slice": "^5.1.5",
59
58
  "async": "^2.6.1",
package/rollup.config.js CHANGED
@@ -1,11 +1,12 @@
1
- import babel from "@rollup/plugin-babel";
2
- import commonjs from "@rollup/plugin-commonjs";
3
- import resolve from "@rollup/plugin-node-resolve";
1
+ import babel from "rollup-plugin-babel";
2
+ import commonjs from "rollup-plugin-commonjs";
3
+ import resolve from "rollup-plugin-node-resolve";
4
4
  import replace from "rollup-plugin-replace";
5
5
  import css from "rollup-plugin-css-only";
6
- import postcss from "rollup-plugin-postcss";
7
- import json from "@rollup/plugin-json";
8
- import pkg from "./package.json";
6
+ import postcss from 'rollup-plugin-postcss';
7
+ import json from 'rollup-plugin-json';
8
+ import pkg from './package.json';
9
+
9
10
 
10
11
  const NODE_ENV = process.env.NODE_ENV || "development";
11
12
  const outputFile = NODE_ENV === "production" ? "./lib/prod.js" : "./lib/dev.js";
@@ -14,38 +15,36 @@ export default {
14
15
  input: "./src/index.js",
15
16
  output: {
16
17
  file: outputFile,
17
- format: "cjs",
18
+ format: "cjs"
18
19
  },
19
20
  plugins: [
20
21
  replace({
21
- "process.env.NODE_ENV": JSON.stringify(NODE_ENV),
22
+ "process.env.NODE_ENV": JSON.stringify(NODE_ENV)
22
23
  }),
23
24
  babel({
24
- plugins: [["import", { libraryName: "antd", style: true }]],
25
- extensions: [".js", ".jsx", ".ts", ".tsx"],
26
- exclude: "node_modules/**",
27
- babelHelpers: "bundled",
28
- // presets: ['@babel/preset-env'] This may be needed
25
+ plugins:[['import', { libraryName: 'antd', style: true }]],
26
+ extensions: ['.js', '.jsx', '.ts', '.tsx'],
27
+ exclude: "node_modules/**"
29
28
  }),
30
29
  css({
31
- output: "./css/corpsmap.css",
30
+ output: "./css/corpsmap.css"
32
31
  }),
33
32
  resolve({
34
33
  module: true,
35
34
  jsnext: true,
36
35
  customResolveOptions: {
37
- moduleDirectory: "node_modules",
38
- },
36
+ moduleDirectory: 'node_modules'
37
+ }
39
38
  }),
40
39
  json(),
41
40
  commonjs(),
42
41
  postcss({
43
- extensions: [".css", ".scss", ".less"],
44
- use: ["sass", ["less", { javascriptEnabled: true }]],
45
- }),
42
+ extensions: ['.css', '.scss', '.less'],
43
+ use: ['sass', ['less', { javascriptEnabled: true }]],
44
+ })
46
45
  ],
47
46
  external: [
48
47
  ...Object.keys(pkg.devDependencies || {}),
49
- ...Object.keys(pkg.peerDependencies || {}),
50
- ],
48
+ ...Object.keys(pkg.peerDependencies || {})
49
+ ]
51
50
  };
@@ -1,195 +1,197 @@
1
- import React from "react";
2
- import { connect } from "redux-bundler-react";
3
- import { SearchInput, SearchResultsList } from "../../application-controls";
4
- import SelectDistrict from "./select-district";
5
-
6
- class ChangeLogModal extends React.Component {
7
- constructor(props) {
8
- super(props);
9
-
10
- this.handleChange = this.handleChange.bind(this);
11
- this.close = this.close.bind(this);
12
- this.fomatDate = this.formatDate.bind(this);
13
- }
14
-
15
- handleChange(event) {
16
- const { doSetSearchBarFilter } = this.props;
17
- doSetSearchBarFilter(event.target.value);
18
- }
19
-
20
- close() {
21
- const { doModalClose } = this.props;
22
- doModalClose();
23
- }
24
-
25
- formatDate(oldDate) {
26
- let newDate = new Date(oldDate);
27
- newDate = newDate.toLocaleDateString("default", {
28
- month: "long",
29
- day: "numeric",
30
- year: "numeric",
31
- });
32
- return newDate;
33
- }
34
-
35
- render() {
36
- const {
37
- theme,
38
- doGetChangeLogData,
39
- changeLogItems,
40
- allChangeLogItems,
41
- searchBarFilter,
42
- } = this.props;
43
- const loginDataWk = changeLogItems;
44
- let districtCodes = [
45
- ...new Set(allChangeLogItems.map((feature) => feature.district_code)),
46
- ];
47
- let options = [];
48
-
49
- districtCodes.sort().forEach((item, index) => {
50
- if (item) {
51
- options.push({
52
- label: `${item}`,
53
- value: `${item}`,
54
- });
55
- }
56
- });
57
-
58
- options.unshift({ label: "All Districts", value: "All" });
59
-
60
- const arrayDataItems = loginDataWk.map((data) => (
61
- <div
62
- key={data.id + data.id + 9876}
63
- style={
64
- Object.keys(data).length > 0
65
- ? { listStyleType: "disc" }
66
- : { listStyleType: "none" }
67
- }
68
- >
69
- {data.change_date ? (
70
- <li key={data.change_date + data.id}>
71
- <b>{this.formatDate(data.change_date)}</b>
72
- </li>
73
- ) : null}
74
- {data.environment ? (
75
- <li
76
- key={data.environment + data.id}
77
- style={{ listStyleType: "none" }}
78
- >
79
- <b>Environment:</b> {data.environment}{" "}
80
- </li>
81
- ) : null}
82
- {data.change_type ? (
83
- <li
84
- key={data.change_type + data.id}
85
- style={{ listStyleType: "none" }}
86
- >
87
- <b>Change Type:</b> {data.change_type}
88
- </li>
89
- ) : null}
90
- {data.district_code ? (
91
- <li
92
- key={data.district_code + data.id}
93
- style={{ listStyleType: "none" }}
94
- >
95
- <b>District:</b> {data.district_code}
96
- </li>
97
- ) : null}
98
- {data.description ? (
99
- <li
100
- key={data.description + data.id}
101
- style={{ listStyleType: "none" }}
102
- >
103
- <b>Description:</b> {data.description}
104
- </li>
105
- ) : null}
106
- <br></br>
107
- </div>
108
- ));
109
-
110
- const filterStyle = {
111
- // paddingLeft: "25px",
112
- display: "flex",
113
- justifyContent: "center",
114
- alignItems: "center",
115
- gap: "40px",
116
- width: "700px",
117
- alignItems: "flex-end",
118
- // textAlign: "right",
119
- // alignItems: "flex-end" /* Aligns content to the right */,
120
- // width: 300px; /* Example width for the container */
121
- // border: "1px solid lightgray" /* For visualization */,
122
- padding: "5px",
123
- };
124
-
125
- return (
126
- <div>
127
- <div className={"cm-modal-header " + theme}>Change Log</div>
128
-
129
- <div className="cm-modal-body">
130
- <div style={filterStyle}>
131
- <label style={{ fontSize: "18px", fontWeight: "bold" }}>
132
- Change Log
133
- </label>
134
- </div>
135
-
136
- <div style={filterStyle}>
137
- <label htmlFor="select-district">
138
- <b>Filter by District:</b>
139
- </label>
140
- <SelectDistrict options={options} />
141
- </div>
142
-
143
- <div style={filterStyle}>
144
- <label htmlFor="select-district">
145
- <b>Search:</b>
146
- </label>
147
-
148
- <input
149
- placeholder="Change Log Search..."
150
- style={{ width: "200px" }}
151
- value={searchBarFilter}
152
- onChange={this.handleChange}
153
- ></input>
154
- </div>
155
- <div
156
- style={{
157
- overflow: "auto scroll",
158
- width: "875px",
159
- height: "400px",
160
- whiteSpace: "pre-wrap",
161
- }}
162
- >
163
- <ul>{arrayDataItems}</ul>
164
- </div>
165
- </div>
166
- <div className="cm-modal-footer">
167
- <br></br>
168
- <br></br>
169
- <br></br>
170
- <button
171
- style={{ textAlign: "left" }}
172
- type="Close"
173
- className={"cm-btn cm-btn-theme " + theme}
174
- onClick={this.close}
175
- >
176
- Close
177
- </button>
178
- </div>
179
- </div>
180
- );
181
- }
182
- }
183
-
184
- export default connect(
185
- "selectTheme",
186
- "selectChangeLogItems",
187
- "selectAllChangeLogItems",
188
- "selectSearchBarFilter",
189
- "doModalClose",
190
- "doSubmitNotification",
191
- "doGetChangeLogData",
192
- "doSearchChangeLogData",
193
- "doSetSearchBarFilter",
194
- ChangeLogModal
195
- );
1
+ import React from "react";
2
+ import { connect } from "redux-bundler-react";
3
+ import { SearchInput, SearchResultsList } from "../../application-controls";
4
+ import SelectDistrict from "./select-district";
5
+
6
+ class ChangeLogModal extends React.Component {
7
+ constructor(props) {
8
+ super(props);
9
+
10
+ this.handleChange = this.handleChange.bind(this);
11
+ this.close = this.close.bind(this);
12
+ this.fomatDate = this.formatDate.bind(this);
13
+ }
14
+
15
+ handleChange(event) {
16
+ const { doSetSearchBarFilter } = this.props;
17
+ doSetSearchBarFilter(event.target.value);
18
+ }
19
+
20
+ close() {
21
+ const { doModalClose } = this.props;
22
+ doModalClose();
23
+ }
24
+
25
+ formatDate(oldDate) {
26
+ let newDate = new Date(oldDate);
27
+ let offset = newDate.getTimezoneOffset() * 60000;
28
+ let newDate2 = new Date(newDate.getTime() + offset);
29
+ newDate2 = newDate2.toLocaleDateString("default", {
30
+ month: "long",
31
+ day: "numeric",
32
+ year: "numeric",
33
+ });
34
+ return newDate2;
35
+ }
36
+
37
+ render() {
38
+ const {
39
+ theme,
40
+ doGetChangeLogData,
41
+ changeLogItems,
42
+ allChangeLogItems,
43
+ searchBarFilter,
44
+ } = this.props;
45
+ const loginDataWk = changeLogItems;
46
+ let districtCodes = [
47
+ ...new Set(allChangeLogItems.map((feature) => feature.district_code)),
48
+ ];
49
+ let options = [];
50
+
51
+ districtCodes.sort().forEach((item, index) => {
52
+ if (item) {
53
+ options.push({
54
+ label: `${item}`,
55
+ value: `${item}`,
56
+ });
57
+ }
58
+ });
59
+
60
+ options.unshift({ label: "All Districts", value: "All" });
61
+
62
+ const arrayDataItems = loginDataWk.map((data) => (
63
+ <div
64
+ key={data.id + data.id + 9876}
65
+ style={
66
+ Object.keys(data).length > 0
67
+ ? { listStyleType: "disc" }
68
+ : { listStyleType: "none" }
69
+ }
70
+ >
71
+ {data.change_date ? (
72
+ <li key={data.change_date + data.id}>
73
+ <b>{this.formatDate(data.change_date)}</b>
74
+ </li>
75
+ ) : null}
76
+ {data.environment ? (
77
+ <li
78
+ key={data.environment + data.id}
79
+ style={{ listStyleType: "none" }}
80
+ >
81
+ <b>Environment:</b> {data.environment}{" "}
82
+ </li>
83
+ ) : null}
84
+ {data.change_type ? (
85
+ <li
86
+ key={data.change_type + data.id}
87
+ style={{ listStyleType: "none" }}
88
+ >
89
+ <b>Change Type:</b> {data.change_type}
90
+ </li>
91
+ ) : null}
92
+ {data.district_code ? (
93
+ <li
94
+ key={data.district_code + data.id}
95
+ style={{ listStyleType: "none" }}
96
+ >
97
+ <b>District:</b> {data.district_code}
98
+ </li>
99
+ ) : null}
100
+ {data.description ? (
101
+ <li
102
+ key={data.description + data.id}
103
+ style={{ listStyleType: "none" }}
104
+ >
105
+ <b>Description:</b> {data.description}
106
+ </li>
107
+ ) : null}
108
+ <br></br>
109
+ </div>
110
+ ));
111
+
112
+ const filterStyle = {
113
+ // paddingLeft: "25px",
114
+ display: "flex",
115
+ justifyContent: "center",
116
+ alignItems: "center",
117
+ gap: "40px",
118
+ width: "700px",
119
+ alignItems: "flex-end",
120
+ // textAlign: "right",
121
+ // alignItems: "flex-end" /* Aligns content to the right */,
122
+ // width: 300px; /* Example width for the container */
123
+ // border: "1px solid lightgray" /* For visualization */,
124
+ padding: "5px",
125
+ };
126
+
127
+ return (
128
+ <div>
129
+ <div className={"cm-modal-header " + theme}>Change Log</div>
130
+
131
+ <div className="cm-modal-body">
132
+ <div style={filterStyle}>
133
+ <label style={{ fontSize: "18px", fontWeight: "bold" }}>
134
+ Change Log
135
+ </label>
136
+ </div>
137
+
138
+ <div style={filterStyle}>
139
+ <label htmlFor="select-district">
140
+ <b>Filter by District:</b>
141
+ </label>
142
+ <SelectDistrict options={options} />
143
+ </div>
144
+
145
+ <div style={filterStyle}>
146
+ <label htmlFor="select-district">
147
+ <b>Search:</b>
148
+ </label>
149
+
150
+ <input
151
+ placeholder="Change Log Search..."
152
+ style={{ width: "200px" }}
153
+ value={searchBarFilter}
154
+ onChange={this.handleChange}
155
+ ></input>
156
+ </div>
157
+ <div
158
+ style={{
159
+ overflow: "auto scroll",
160
+ width: "875px",
161
+ height: "400px",
162
+ whiteSpace: "pre-wrap",
163
+ }}
164
+ >
165
+ <ul>{arrayDataItems}</ul>
166
+ </div>
167
+ </div>
168
+ <div className="cm-modal-footer">
169
+ <br></br>
170
+ <br></br>
171
+ <br></br>
172
+ <button
173
+ style={{ textAlign: "left" }}
174
+ type="Close"
175
+ className={"cm-btn cm-btn-theme " + theme}
176
+ onClick={this.close}
177
+ >
178
+ Close
179
+ </button>
180
+ </div>
181
+ </div>
182
+ );
183
+ }
184
+ }
185
+
186
+ export default connect(
187
+ "selectTheme",
188
+ "selectChangeLogItems",
189
+ "selectAllChangeLogItems",
190
+ "selectSearchBarFilter",
191
+ "doModalClose",
192
+ "doSubmitNotification",
193
+ "doGetChangeLogData",
194
+ "doSearchChangeLogData",
195
+ "doSetSearchBarFilter",
196
+ ChangeLogModal
197
+ );