@neo4j-ndl/react 1.8.19 → 1.9.0

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 46bd73c: Added DatePicker component
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [46bd73c]
12
+ - @neo4j-ndl/base@1.9.0
13
+
14
+ ## 1.8.20
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [aec8342]
19
+ - @neo4j-ndl/base@1.8.14
20
+
3
21
  ## 1.8.19
4
22
 
5
23
  ### Patch Changes
package/lib/LICENSES.txt CHANGED
@@ -5210,7 +5210,7 @@ MIT License
5210
5210
 
5211
5211
  -----
5212
5212
 
5213
- The following software may be included in this product: @types/jest, @types/jest-axe, @types/node, @types/react, @types/react-dom, @types/react-resizable, @types/react-syntax-highlighter, @types/react-table, @types/tinycolor2. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest-axe), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-dom), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-resizable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-syntax-highlighter), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-table), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tinycolor2). This software contains the following license and notice below:
5213
+ The following software may be included in this product: @types/jest, @types/jest-axe, @types/node, @types/react, @types/react-datepicker, @types/react-dom, @types/react-resizable, @types/react-syntax-highlighter, @types/react-table, @types/tinycolor2. A copy of the source code may be downloaded from https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest-axe), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-datepicker), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-dom), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-resizable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-syntax-highlighter), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-table), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tinycolor2). This software contains the following license and notice below:
5214
5214
 
5215
5215
  MIT License
5216
5216
 
@@ -5529,6 +5529,32 @@ SOFTWARE.
5529
5529
 
5530
5530
  -----
5531
5531
 
5532
+ The following software may be included in this product: date-fns. A copy of the source code may be downloaded from https://github.com/date-fns/date-fns. This software contains the following license and notice below:
5533
+
5534
+ MIT License
5535
+
5536
+ Copyright (c) 2021 Sasha Koss and Lesha Koss https://kossnocorp.mit-license.org
5537
+
5538
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5539
+ of this software and associated documentation files (the "Software"), to deal
5540
+ in the Software without restriction, including without limitation the rights
5541
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5542
+ copies of the Software, and to permit persons to whom the Software is
5543
+ furnished to do so, subject to the following conditions:
5544
+
5545
+ The above copyright notice and this permission notice shall be included in all
5546
+ copies or substantial portions of the Software.
5547
+
5548
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5549
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5550
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5551
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5552
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5553
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5554
+ SOFTWARE.
5555
+
5556
+ -----
5557
+
5532
5558
  The following software may be included in this product: dedent. A copy of the source code may be downloaded from git://github.com/dmnd/dedent.git. This software contains the following license and notice below:
5533
5559
 
5534
5560
  The MIT License (MIT)
@@ -12268,6 +12294,32 @@ Apache License
12268
12294
 
12269
12295
  -----
12270
12296
 
12297
+ The following software may be included in this product: react-datepicker. A copy of the source code may be downloaded from git://github.com/Hacker0x01/react-datepicker.git. This software contains the following license and notice below:
12298
+
12299
+ The MIT License (MIT)
12300
+
12301
+ Copyright (c) 2014-2023 HackerOne Inc and individual contributors
12302
+
12303
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12304
+ of this software and associated documentation files (the "Software"), to deal
12305
+ in the Software without restriction, including without limitation the rights
12306
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12307
+ copies of the Software, and to permit persons to whom the Software is
12308
+ furnished to do so, subject to the following conditions:
12309
+
12310
+ The above copyright notice and this permission notice shall be included in all
12311
+ copies or substantial portions of the Software.
12312
+
12313
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12314
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12315
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12316
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12317
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12318
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12319
+ SOFTWARE.
12320
+
12321
+ -----
12322
+
12271
12323
  The following software may be included in this product: react-dropzone. A copy of the source code may be downloaded from https://github.com/react-dropzone/react-dropzone.git. This software contains the following license and notice below:
12272
12324
 
12273
12325
  The MIT License (MIT)
package/lib/NOTICE.txt CHANGED
@@ -117,6 +117,9 @@ Third-party licenses
117
117
  │ ├─ @types/react@npm:17.0.62 (via npm:^17.0.62)
118
118
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
119
119
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react
120
+ │ ├─ @types/react-datepicker@npm:4.11.2 (via npm:^4.11.2)
121
+ │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
122
+ │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-datepicker
120
123
  │ ├─ @types/react-dom@npm:17.0.18 (via npm:17.0.18)
121
124
  │ │ ├─ URL: https://github.com/DefinitelyTyped/DefinitelyTyped.git
122
125
  │ │ └─ VendorUrl: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom
@@ -160,6 +163,8 @@ Third-party licenses
160
163
  │ ├─ concurrently@npm:7.6.0 (via npm:^7.4.0)
161
164
  │ │ ├─ URL: https://github.com/open-cli-tools/concurrently.git
162
165
  │ │ └─ VendorName: Kimmo Brunfeldt
166
+ │ ├─ date-fns@npm:2.30.0 (via npm:^2.30.0)
167
+ │ │ └─ URL: https://github.com/date-fns/date-fns
163
168
  │ ├─ dedent@npm:0.7.0 (via npm:^0.7.0)
164
169
  │ │ ├─ URL: git://github.com/dmnd/dedent.git
165
170
  │ │ ├─ VendorName: Desmond Brand
@@ -223,6 +228,10 @@ Third-party licenses
223
228
  │ ├─ react@npm:17.0.2 (via npm:^17.0.2)
224
229
  │ │ ├─ URL: https://github.com/facebook/react.git
225
230
  │ │ └─ VendorUrl: https://reactjs.org/
231
+ │ ├─ react-datepicker@npm:4.14.1 [a2e03] (via npm:^4.14.1 [a2e03])
232
+ │ │ ├─ URL: git://github.com/Hacker0x01/react-datepicker.git
233
+ │ │ ├─ VendorName: HackerOne
234
+ │ │ └─ VendorUrl: https://github.com/Hacker0x01/react-datepicker
226
235
  │ ├─ react-dom@npm:17.0.2 [d75d7] (via npm:^17.0.2 [d75d7])
227
236
  │ │ ├─ URL: https://github.com/facebook/react.git
228
237
  │ │ └─ VendorUrl: https://reactjs.org/
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DatePicker = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ /**
9
+ *
10
+ * Copyright (c) "Neo4j"
11
+ * Neo4j Sweden AB [http://neo4j.com]
12
+ *
13
+ * This file is part of Neo4j.
14
+ *
15
+ * Neo4j is free software: you can redistribute it and/or modify
16
+ * it under the terms of the GNU General Public License as published by
17
+ * the Free Software Foundation, either version 3 of the License, or
18
+ * (at your option) any later version.
19
+ *
20
+ * This program is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License
26
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+ const react_1 = require("react");
29
+ const react_datepicker_1 = __importDefault(require("react-datepicker"));
30
+ const classnames_1 = __importDefault(require("classnames"));
31
+ const icons_1 = require("../icons");
32
+ const text_input_1 = require("../text-input");
33
+ const helpers_1 = require("../helpers");
34
+ const button_1 = require("../button");
35
+ const typography_1 = require("../typography");
36
+ const date_fns_1 = require("date-fns");
37
+ exports.DatePicker = (0, helpers_1.forwardRef)(function DatePicker(props, ref) {
38
+ const { reactDatePickerProps, textInputProps, disabled, className } = props;
39
+ const classes = (0, classnames_1.default)(`ndl-datepicker`, className, {});
40
+ const datetimeRef = (0, react_1.useRef)(null);
41
+ const [picker, setPicker] = (0, react_1.useState)('day');
42
+ const headerAction = (0, react_1.useCallback)((action) => {
43
+ picker === action ? setPicker('day') : setPicker(action);
44
+ }, [picker]);
45
+ const CustomHeader = (0, react_1.useCallback)((props) => {
46
+ const { decreaseMonth, increaseMonth, increaseYear, decreaseYear, nextMonthButtonDisabled, nextYearButtonDisabled, prevMonthButtonDisabled, prevYearButtonDisabled, } = props;
47
+ const prevCallback = picker === 'year' ? decreaseYear : decreaseMonth;
48
+ const nextCallback = picker === 'year' ? increaseYear : increaseMonth;
49
+ const prevDisabled = picker === 'year' ? prevYearButtonDisabled : prevMonthButtonDisabled;
50
+ const nextDisabled = picker === 'year' ? nextYearButtonDisabled : nextMonthButtonDisabled;
51
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-datepicker-header" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-datepicker-selects" }, { children: [(0, jsx_runtime_1.jsx)("button", Object.assign({ className: "ndl-datepicker-header", onClick: () => headerAction('month') }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "n-flex n-items-center" }, { children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ variant: "label", className: "n-p-2" }, { children: (0, date_fns_1.format)(props.date, 'MMMM') })), (0, jsx_runtime_1.jsx)(icons_1.ChevronUpIconOutline, { className: (0, classnames_1.default)('ndl-datepicker-chevron', {
52
+ 'n-rotate-180': picker === 'month',
53
+ }), "aria-label": "Chevron icon" })] })) })), (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "ndl-datepicker-header", onClick: () => headerAction('year') }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "n-flex n-items-center" }, { children: [(0, jsx_runtime_1.jsx)(typography_1.Typography, Object.assign({ variant: "label", className: "n-p-2" }, { children: (0, date_fns_1.format)(props.date, 'yyyy') })), (0, jsx_runtime_1.jsx)(icons_1.ChevronUpIconOutline, { className: (0, classnames_1.default)('ndl-datepicker-chevron', {
54
+ 'n-rotate-180': picker === 'year',
55
+ }), "aria-label": "Chevron icon" })] })) }))] })), picker !== 'month' && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(button_1.IconButton, Object.assign({ "aria-label": "Previous period", clean: true, onClick: prevCallback, disabled: prevDisabled }, { children: (0, jsx_runtime_1.jsx)(icons_1.ArrowLeftIconOutline, {}) })), (0, jsx_runtime_1.jsx)(button_1.IconButton, Object.assign({ "aria-label": "Next period", clean: true, onClick: nextCallback, disabled: nextDisabled }, { children: (0, jsx_runtime_1.jsx)(icons_1.ArrowRightIconOutline, {}) }))] }))] })));
56
+ }, [picker, headerAction]);
57
+ /**
58
+ * Intercept onChange so we can work with
59
+ * Month and Year pickers
60
+ */
61
+ const interceptedChange = (0, react_1.useCallback)((...args) => {
62
+ if (picker !== 'day') {
63
+ reactDatePickerProps === null || reactDatePickerProps === void 0 ? void 0 : reactDatePickerProps.onChange(...args);
64
+ setPicker('day');
65
+ }
66
+ else {
67
+ reactDatePickerProps === null || reactDatePickerProps === void 0 ? void 0 : reactDatePickerProps.onChange(...args);
68
+ }
69
+ }, [picker, reactDatePickerProps]);
70
+ /**
71
+ * Intercept onCalendarClose so we can
72
+ * switch to "day" picker if we close on "month" or "year"
73
+ * view
74
+ */
75
+ const interceptedOnCalendarClose = (0, react_1.useCallback)(() => {
76
+ var _a;
77
+ if (picker !== 'day') {
78
+ setPicker('day');
79
+ }
80
+ (_a = reactDatePickerProps === null || reactDatePickerProps === void 0 ? void 0 : reactDatePickerProps.onCalendarClose) === null || _a === void 0 ? void 0 : _a.call(reactDatePickerProps);
81
+ }, [picker, reactDatePickerProps]);
82
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes }, { children: (0, jsx_runtime_1.jsx)(react_datepicker_1.default, Object.assign({ ref: datetimeRef, customInput: (0, jsx_runtime_1.jsx)(text_input_1.TextInput, Object.assign({ ref: ref, "aria-label": "Date picker input", rightIcon: (0, jsx_runtime_1.jsx)(icons_1.CalendarIconOutline, { onClick: (e) => {
83
+ var _a;
84
+ if ((_a = datetimeRef.current) === null || _a === void 0 ? void 0 : _a.isCalendarOpen()) {
85
+ datetimeRef.current.setOpen(false);
86
+ e.preventDefault();
87
+ e.stopPropagation();
88
+ }
89
+ }, "aria-label": "Calender Icon" }) }, textInputProps, { disabled: disabled })), disabled: disabled, showMonthYearPicker: picker === 'month', showYearPicker: picker === 'year', shouldCloseOnSelect: picker === 'day', dayClassName: () => 'ndl-datepicker-day', renderCustomHeader: CustomHeader }, reactDatePickerProps, { onChange: interceptedChange, onCalendarClose: interceptedOnCalendarClose })) })));
90
+ });
91
+ //# sourceMappingURL=DatePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/date-picker/DatePicker.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAoE;AACpE,wEAG0B;AAC1B,4DAAoC;AACpC,oCAKkB;AAClB,8CAA0C;AAE1C,wCAAqD;AACrD,sCAAuC;AACvC,8CAA2C;AAC3C,uCAAkC;AAwBrB,QAAA,UAAU,GAAG,IAAA,oBAAU,EAAC,SAAS,UAAU,CACtD,KAAyB,EACzB,GAAmC;IAEnC,MAAM,EAAE,oBAAoB,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE5E,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,IAAA,cAAM,EAAkB,IAAI,CAAC,CAAC;IAClD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAa,KAAK,CAAC,CAAC;IAExD,MAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,CAAC,MAAkB,EAAE,EAAE;QACrB,MAAM,KAAK,MAAM,CA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
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ var desc = Object.getOwnPropertyDescriptor(m, k);
25
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26
+ desc = { enumerable: true, get: function() { return m[k]; } };
27
+ }
28
+ Object.defineProperty(o, k2, desc);
29
+ }) : (function(o, m, k, k2) {
30
+ if (k2 === undefined) k2 = k;
31
+ o[k2] = m[k];
32
+ }));
33
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ __exportStar(require("./DatePicker"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,+CAA6B"}
package/lib/cjs/index.js CHANGED
@@ -42,6 +42,7 @@ __exportStar(require("./checkbox"), exports);
42
42
  __exportStar(require("./switch"), exports);
43
43
  __exportStar(require("./radio"), exports);
44
44
  __exportStar(require("./context-menu"), exports);
45
+ __exportStar(require("./date-picker"), exports);
45
46
  __exportStar(require("./dialog"), exports);
46
47
  __exportStar(require("./modal"), exports);
47
48
  __exportStar(require("./loading-spinner"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,iDAA+B;AAC/B,qDAAmC;AACnC,0CAAwB;AACxB,kDAAgC;AAChC,+CAA6B;AAC7B,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,wCAAsB;AACtB,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,oDAAkC;AAClC,+CAA6B;AAC7B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,iDAA+B;AAC/B,qDAAmC;AACnC,0CAAwB;AACxB,kDAAgC;AAChC,+CAA6B;AAC7B,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,wCAAsB;AACtB,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B;AAC7B,sDAAoC;AACpC,qDAAmC;AACnC,oDAAkC;AAClC,+CAA6B;AAC7B,2CAAyB"}
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import { useRef, useState, useCallback } from 'react';
23
+ import ReactDatePicker from 'react-datepicker';
24
+ import classnames from 'classnames';
25
+ import { ArrowLeftIconOutline, ArrowRightIconOutline, CalendarIconOutline, ChevronUpIconOutline, } from '../icons';
26
+ import { TextInput } from '../text-input';
27
+ import { forwardRef } from '../helpers';
28
+ import { IconButton } from '../button';
29
+ import { Typography } from '../typography';
30
+ import { format } from 'date-fns';
31
+ export const DatePicker = forwardRef(function DatePicker(props, ref) {
32
+ const { reactDatePickerProps, textInputProps, disabled, className } = props;
33
+ const classes = classnames(`ndl-datepicker`, className, {});
34
+ const datetimeRef = useRef(null);
35
+ const [picker, setPicker] = useState('day');
36
+ const headerAction = useCallback((action) => {
37
+ picker === action ? setPicker('day') : setPicker(action);
38
+ }, [picker]);
39
+ const CustomHeader = useCallback((props) => {
40
+ const { decreaseMonth, increaseMonth, increaseYear, decreaseYear, nextMonthButtonDisabled, nextYearButtonDisabled, prevMonthButtonDisabled, prevYearButtonDisabled, } = props;
41
+ const prevCallback = picker === 'year' ? decreaseYear : decreaseMonth;
42
+ const nextCallback = picker === 'year' ? increaseYear : increaseMonth;
43
+ const prevDisabled = picker === 'year' ? prevYearButtonDisabled : prevMonthButtonDisabled;
44
+ const nextDisabled = picker === 'year' ? nextYearButtonDisabled : nextMonthButtonDisabled;
45
+ return (_jsxs("div", Object.assign({ className: "ndl-datepicker-header" }, { children: [_jsxs("div", Object.assign({ className: "ndl-datepicker-selects" }, { children: [_jsx("button", Object.assign({ className: "ndl-datepicker-header", onClick: () => headerAction('month') }, { children: _jsxs("div", Object.assign({ className: "n-flex n-items-center" }, { children: [_jsx(Typography, Object.assign({ variant: "label", className: "n-p-2" }, { children: format(props.date, 'MMMM') })), _jsx(ChevronUpIconOutline, { className: classnames('ndl-datepicker-chevron', {
46
+ 'n-rotate-180': picker === 'month',
47
+ }), "aria-label": "Chevron icon" })] })) })), _jsx("button", Object.assign({ className: "ndl-datepicker-header", onClick: () => headerAction('year') }, { children: _jsxs("div", Object.assign({ className: "n-flex n-items-center" }, { children: [_jsx(Typography, Object.assign({ variant: "label", className: "n-p-2" }, { children: format(props.date, 'yyyy') })), _jsx(ChevronUpIconOutline, { className: classnames('ndl-datepicker-chevron', {
48
+ 'n-rotate-180': picker === 'year',
49
+ }), "aria-label": "Chevron icon" })] })) }))] })), picker !== 'month' && (_jsxs("div", { children: [_jsx(IconButton, Object.assign({ "aria-label": "Previous period", clean: true, onClick: prevCallback, disabled: prevDisabled }, { children: _jsx(ArrowLeftIconOutline, {}) })), _jsx(IconButton, Object.assign({ "aria-label": "Next period", clean: true, onClick: nextCallback, disabled: nextDisabled }, { children: _jsx(ArrowRightIconOutline, {}) }))] }))] })));
50
+ }, [picker, headerAction]);
51
+ /**
52
+ * Intercept onChange so we can work with
53
+ * Month and Year pickers
54
+ */
55
+ const interceptedChange = useCallback((...args) => {
56
+ if (picker !== 'day') {
57
+ reactDatePickerProps === null || reactDatePickerProps === void 0 ? void 0 : reactDatePickerProps.onChange(...args);
58
+ setPicker('day');
59
+ }
60
+ else {
61
+ reactDatePickerProps === null || reactDatePickerProps === void 0 ? void 0 : reactDatePickerProps.onChange(...args);
62
+ }
63
+ }, [picker, reactDatePickerProps]);
64
+ /**
65
+ * Intercept onCalendarClose so we can
66
+ * switch to "day" picker if we close on "month" or "year"
67
+ * view
68
+ */
69
+ const interceptedOnCalendarClose = useCallback(() => {
70
+ var _a;
71
+ if (picker !== 'day') {
72
+ setPicker('day');
73
+ }
74
+ (_a = reactDatePickerProps === null || reactDatePickerProps === void 0 ? void 0 : reactDatePickerProps.onCalendarClose) === null || _a === void 0 ? void 0 : _a.call(reactDatePickerProps);
75
+ }, [picker, reactDatePickerProps]);
76
+ return (_jsx("div", Object.assign({ className: classes }, { children: _jsx(ReactDatePicker, Object.assign({ ref: datetimeRef, customInput: _jsx(TextInput, Object.assign({ ref: ref, "aria-label": "Date picker input", rightIcon: _jsx(CalendarIconOutline, { onClick: (e) => {
77
+ var _a;
78
+ if ((_a = datetimeRef.current) === null || _a === void 0 ? void 0 : _a.isCalendarOpen()) {
79
+ datetimeRef.current.setOpen(false);
80
+ e.preventDefault();
81
+ e.stopPropagation();
82
+ }
83
+ }, "aria-label": "Calender Icon" }) }, textInputProps, { disabled: disabled })), disabled: disabled, showMonthYearPicker: picker === 'month', showYearPicker: picker === 'year', shouldCloseOnSelect: picker === 'day', dayClassName: () => 'ndl-datepicker-day', renderCustomHeader: CustomHeader }, reactDatePickerProps, { onChange: interceptedChange, onCalendarClose: interceptedOnCalendarClose })) })));
84
+ });
85
+ //# sourceMappingURL=DatePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/date-picker/DatePicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAgB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,eAGN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,E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C,CAAC,EAAE,EAAE;;wBACb,IAAI,MAAA,WAAW,CAAC,OAAO,0CAAE,cAAc,EAAE,EAAE;4BACzC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;4BACnC,CAAC,CAAC,cAAc,EAAE,CAAC;4BACnB,CAAC,CAAC,eAAe,EAAE,CAAC;yBACrB;oBACH,CAAC,gBACU,eAAe,GAC1B,IAEA,cAAc,IAClB,QAAQ,EAAE,QAAQ,IAClB,EAEJ,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,MAAM,KAAK,OAAO,EACvC,cAAc,EAAE,MAAM,KAAK,MAAM,EACjC,mBAAmB,EAAE,MAAM,KAAK,KAAK,EACrC,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAoB,EACxC,kBAAkB,EAAE,YAAY,IAC5B,oBAAoB,IACxB,QAAQ,EAAE,iBAAiB,EAC3B,eAAe,EAAE,0BAA0B,IAC3C,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './DatePicker';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,cAAc,CAAC"}
package/lib/esm/index.js CHANGED
@@ -26,6 +26,7 @@ export * from './checkbox';
26
26
  export * from './switch';
27
27
  export * from './radio';
28
28
  export * from './context-menu';
29
+ export * from './date-picker';
29
30
  export * from './dialog';
30
31
  export * from './modal';
31
32
  export * from './loading-spinner';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ /// <reference types="react" />
22
+ import { ReactDatePickerProps } from 'react-datepicker';
23
+ import { TextInputProperties } from '../text-input/TextInput';
24
+ import { ElementBase } from '../helpers';
25
+ export interface DatePickerProps<WithRange extends boolean = false> extends ElementBase<'div'> {
26
+ /** Add Component type here */
27
+ textInputProps?: TextInputProperties;
28
+ disabled?: boolean;
29
+ /**
30
+ * Props passed to the react-datepicker component
31
+ * https://reactdatepicker.com/
32
+ */
33
+ reactDatePickerProps: ReactDatePickerProps<string, WithRange>;
34
+ }
35
+ export declare const DatePicker: <T extends boolean>(props: DatePickerProps<T> & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -0,0 +1,21 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export * from './DatePicker';
@@ -26,6 +26,7 @@ export * from './checkbox';
26
26
  export * from './switch';
27
27
  export * from './radio';
28
28
  export * from './context-menu';
29
+ export * from './date-picker';
29
30
  export * from './dialog';
30
31
  export * from './modal';
31
32
  export * from './loading-spinner';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react",
3
- "version": "1.8.19",
3
+ "version": "1.9.0",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of Neo4j Design System",
6
6
  "keywords": [
@@ -62,6 +62,7 @@
62
62
  "@testing-library/user-event": "^14.4.3",
63
63
  "@types/jest-axe": "^3.5.3",
64
64
  "@types/react": "17.0.62",
65
+ "@types/react-datepicker": "^4.11.2",
65
66
  "@types/react-dom": "17.0.18",
66
67
  "@types/react-syntax-highlighter": "^15.5.5",
67
68
  "@types/react-table": "^7.7.10",
@@ -92,12 +93,14 @@
92
93
  "@floating-ui/react": "^0.24.2",
93
94
  "@heroicons/react": "2.0.13",
94
95
  "@neo4j-cypher/react-codemirror": "^1.0.1",
95
- "@neo4j-ndl/base": "^1.8.13",
96
+ "@neo4j-ndl/base": "^1.9.0",
96
97
  "@tanstack/react-table": "^8.9.3",
97
98
  "classnames": "^2.3.1",
99
+ "date-fns": "^2.30.0",
98
100
  "detect-browser": "^5.3.0",
99
101
  "re-resizable": "^6.9.9",
100
102
  "react-aria": "^3.25.0",
103
+ "react-datepicker": "^4.14.1",
101
104
  "react-dropzone": "^14.0.0",
102
105
  "react-focus-lock": "^2.9.4",
103
106
  "react-select": "5.7.0",