@neo4j-ndl/react 0.3.1 → 0.4.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/lib/cjs/{input/Input.js → _common/input/RadioAndCheckboxWrapper.js} +6 -6
- package/lib/cjs/_common/input/RadioAndCheckboxWrapper.js.map +1 -0
- package/lib/cjs/_common/input/types.js +3 -0
- package/lib/cjs/_common/input/types.js.map +1 -0
- package/lib/cjs/_common/utilts.js +31 -0
- package/lib/cjs/_common/utilts.js.map +1 -0
- package/lib/cjs/button/Button.js +4 -8
- package/lib/cjs/button/Button.js.map +1 -1
- package/lib/cjs/button/IconButton.js +85 -0
- package/lib/cjs/button/IconButton.js.map +1 -0
- package/lib/cjs/button/IconButtonArray.js +52 -0
- package/lib/cjs/button/IconButtonArray.js.map +1 -0
- package/lib/cjs/button/index.js +2 -0
- package/lib/cjs/button/index.js.map +1 -1
- package/lib/cjs/checkbox/Checkbox.js +2 -2
- package/lib/cjs/checkbox/Checkbox.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/radio/Radio.js +2 -2
- package/lib/cjs/radio/Radio.js.map +1 -1
- package/lib/cjs/switch/Switch.js +2 -2
- package/lib/cjs/switch/Switch.js.map +1 -1
- package/lib/cjs/table/Table.js +5 -5
- package/lib/cjs/table/Table.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +72 -0
- package/lib/cjs/text-input/TextInput.js.map +1 -0
- package/lib/cjs/{input → text-input}/index.js +3 -3
- package/lib/cjs/text-input/index.js.map +1 -0
- package/lib/esm/{input/Input.js → _common/input/RadioAndCheckboxWrapper.js} +6 -6
- package/lib/esm/_common/input/RadioAndCheckboxWrapper.js.map +1 -0
- package/lib/esm/_common/input/types.js +2 -0
- package/lib/esm/_common/input/types.js.map +1 -0
- package/lib/esm/_common/utilts.js +25 -0
- package/lib/esm/_common/utilts.js.map +1 -0
- package/lib/esm/button/Button.js +2 -4
- package/lib/esm/button/Button.js.map +1 -1
- package/lib/esm/button/IconButton.js +79 -0
- package/lib/esm/button/IconButton.js.map +1 -0
- package/lib/esm/button/IconButtonArray.js +46 -0
- package/lib/esm/button/IconButtonArray.js.map +1 -0
- package/lib/esm/button/index.js +2 -0
- package/lib/esm/button/index.js.map +1 -1
- package/lib/esm/checkbox/Checkbox.js +2 -2
- package/lib/esm/checkbox/Checkbox.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/radio/Radio.js +2 -2
- package/lib/esm/radio/Radio.js.map +1 -1
- package/lib/esm/switch/Switch.js +2 -2
- package/lib/esm/switch/Switch.js.map +1 -1
- package/lib/esm/table/Table.js +5 -5
- package/lib/esm/table/Table.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +67 -0
- package/lib/esm/text-input/TextInput.js.map +1 -0
- package/lib/esm/{input → text-input}/index.js +1 -1
- package/lib/esm/text-input/index.js.map +1 -0
- package/lib/types/_common/input/RadioAndCheckboxWrapper.d.ts +37 -0
- package/lib/types/_common/input/types.d.ts +31 -0
- package/lib/types/_common/utilts.d.ts +24 -0
- package/lib/types/button/Button.d.ts +1 -4
- package/lib/types/button/IconButton.d.ts +47 -0
- package/lib/types/button/IconButtonArray.d.ts +37 -0
- package/lib/types/button/index.d.ts +2 -0
- package/lib/types/checkbox/Checkbox.d.ts +2 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/radio/Radio.d.ts +2 -2
- package/lib/types/switch/Switch.d.ts +2 -2
- package/lib/types/table/Table.d.ts +1 -8
- package/lib/types/text-input/TextInput.d.ts +55 -0
- package/lib/types/{input → text-input}/index.d.ts +1 -1
- package/package.json +2 -2
- package/lib/cjs/input/Input.js.map +0 -1
- package/lib/cjs/input/index.js.map +0 -1
- package/lib/esm/input/Input.js.map +0 -1
- package/lib/esm/input/index.js.map +0 -1
- package/lib/types/input/Input.d.ts +0 -44
|
@@ -45,16 +45,16 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
45
45
|
*
|
|
46
46
|
*
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
49
|
-
const { label, fluid, labelBefore } = props, otherInputProps = __rest(props, ["label", "fluid", "labelBefore"]);
|
|
50
|
-
const containerWrappingClass = (0, classnames_1.default)(
|
|
48
|
+
const RadioAndCheckboxWrapper = (props, ref) => {
|
|
49
|
+
const { label, fluid, labelBefore, type = 'text' } = props, otherInputProps = __rest(props, ["label", "fluid", "labelBefore", "type"]);
|
|
50
|
+
const containerWrappingClass = (0, classnames_1.default)(`ndl-form-item ndl-type-${type}`, {
|
|
51
51
|
disabled: otherInputProps.disabled,
|
|
52
52
|
});
|
|
53
53
|
const labelWrappingClass = (0, classnames_1.default)(`form-item-label`, {
|
|
54
54
|
fluid,
|
|
55
55
|
'label-before': labelBefore,
|
|
56
56
|
});
|
|
57
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: containerWrappingClass }, { children: (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: labelWrappingClass }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, otherInputProps, { ref: ref })), label] })) })));
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: containerWrappingClass }, { children: (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: labelWrappingClass }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, otherInputProps, { ref: ref, type: type })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "form-label-text" }, { children: label }))] })) })));
|
|
58
58
|
};
|
|
59
|
-
exports.default = (0, react_1.forwardRef)(
|
|
60
|
-
//# sourceMappingURL=
|
|
59
|
+
exports.default = (0, react_1.forwardRef)(RadioAndCheckboxWrapper);
|
|
60
|
+
//# sourceMappingURL=RadioAndCheckboxWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioAndCheckboxWrapper.js","sourceRoot":"","sources":["../../../../src/_common/input/RadioAndCheckboxWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,iCAAiD;AACjD,4DAAoC;AAmBpC,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,uBAAuB,GAAG,CAC9B,KAA4B,EAC5B,GAAmC,EACnC,EAAE;IACF,MAAM,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,GAAG,MAAM,KAEX,KAAK,EADJ,eAAe,UAChB,KAAK,EANH,yCAML,CAAQ,CAAC;IAEV,MAAM,sBAAsB,GAAG,IAAA,oBAAU,EAAC,0BAA0B,IAAI,EAAE,EAAE;QAC1E,QAAQ,EAAE,eAAe,CAAC,QAAQ;KACnC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE;QACvD,KAAK;QACL,cAAc,EAAE,WAAW;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,8CAAK,SAAS,EAAE,sBAAsB,gBAGpC,iDAAO,SAAS,EAAE,kBAAkB,iBAClC,kDAAW,eAAe,IAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,EACpD,+CAAM,SAAS,EAAC,iBAAiB,gBAAE,KAAK,IAAQ,KAC1C,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,IAAA,kBAAU,EAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.needleWarningMessage = exports.removeSpaces = exports.removeNewlines = void 0;
|
|
24
|
+
const removeNewlines = (input) => input.replace(/(\r\n|\n|\r)/gm, '');
|
|
25
|
+
exports.removeNewlines = removeNewlines;
|
|
26
|
+
/** Remove extra spaces from sting */
|
|
27
|
+
const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
|
|
28
|
+
exports.removeSpaces = removeSpaces;
|
|
29
|
+
const needleWarningMessage = (message) => console.warn(`[🪡 Needle]: ${message}`);
|
|
30
|
+
exports.needleWarningMessage = needleWarningMessage;
|
|
31
|
+
//# sourceMappingURL=utilts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilts.js","sourceRoot":"","sources":["../../../src/_common/utilts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEI,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AADzB,QAAA,cAAc,kBACW;AAEtC,qCAAqC;AAC9B,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AADvB,QAAA,YAAY,gBACW;AAE7B,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAE,EAAE,CACtD,OAAO,CAAC,IAAI,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;AAD9B,QAAA,oBAAoB,wBACU"}
|
package/lib/cjs/button/Button.js
CHANGED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Button =
|
|
17
|
+
exports.Button = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
/**
|
|
20
20
|
*
|
|
@@ -39,13 +39,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
39
39
|
const react_1 = __importDefault(require("react"));
|
|
40
40
|
const classnames_1 = __importDefault(require("classnames"));
|
|
41
41
|
const loading_spinner_1 = require("../loading-spinner");
|
|
42
|
-
const
|
|
43
|
-
exports.removeNewlines = removeNewlines;
|
|
44
|
-
/** Remove extra spaces from sting */
|
|
45
|
-
const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
|
|
46
|
-
exports.removeSpaces = removeSpaces;
|
|
42
|
+
const utilts_1 = require("../_common/utilts");
|
|
47
43
|
exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
|
|
48
|
-
var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = '
|
|
44
|
+
var { children, as, type = 'button', loading = false, color = 'primary', disabled = false, fill = 'filled', rectangle = false, buttonSize = 'medium', className, onClick, floating = false, tabIndex = 0 } = _a, props = __rest(_a, ["children", "as", "type", "loading", "color", "disabled", "fill", "rectangle", "buttonSize", "className", "onClick", "floating", "tabIndex"]);
|
|
49
45
|
let Component = as || 'button';
|
|
50
46
|
if (!as && props.href) {
|
|
51
47
|
Component = 'a';
|
|
@@ -100,7 +96,7 @@ exports.Button = react_1.default.forwardRef(function Button(_a, ref) {
|
|
|
100
96
|
${interactable && `hover:n-bg-light-neutral-bg-default`}
|
|
101
97
|
`]: fill === 'text' && color == 'neutral',
|
|
102
98
|
});
|
|
103
|
-
const sanitisedClasses = (0,
|
|
99
|
+
const sanitisedClasses = (0, utilts_1.removeSpaces)((0, utilts_1.removeNewlines)(classes));
|
|
104
100
|
const handleClick = (e) => {
|
|
105
101
|
if (!interactable) {
|
|
106
102
|
// By default, a <button /> element with disabled set to true will not get its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,4DAAoC;AAEpC,wDAAoD;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,4DAAoC;AAEpC,wDAAoD;AAEpD,8CAAiE;AAgCpD,QAAA,MAAM,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CACpD,EAec,EACd,GAAG;QAhBH,EACE,QAAQ,EACR,EAAE,EACF,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,SAAS,EACjB,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,QAAQ,EACf,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,QAAQ,EACrB,SAAS,EACT,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,CAAC,OAEA,EADT,KAAK,cAdV,6IAeC,CADS;IAIV,IAAI,SAAS,GAAG,EAAE,IAAI,QAAQ,CAAC;IAE/B,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,E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A8E;YAC9E,yEAAyE;YACzE,iFAAiF;YACjF,4CAA4C;YAC5C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,OAAO;SACR;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;aAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC;IAEF,OAAO,CACL,wBAAC,SAAS;IACR,uEAAuE;wBACnE,KAAK,EAEL,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAC5C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,YAAY,EACvB,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAClD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,iBAEtC,OAAO,CAAC,CAAC,CAAC,CACT,uBAAC,gCAAc,IAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO,GAAG,CAC7D,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,KACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.IconButton = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) "Neo4j"
|
|
22
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
23
|
+
*
|
|
24
|
+
* This file is part of Neo4j.
|
|
25
|
+
*
|
|
26
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
27
|
+
* it under the terms of the GNU General Public License as published by
|
|
28
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
29
|
+
* (at your option) any later version.
|
|
30
|
+
*
|
|
31
|
+
* This program is distributed in the hope that it will be useful,
|
|
32
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
33
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
34
|
+
* GNU General Public License for more details.
|
|
35
|
+
*
|
|
36
|
+
* You should have received a copy of the GNU General Public License
|
|
37
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
38
|
+
*/
|
|
39
|
+
const react_1 = __importDefault(require("react"));
|
|
40
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
41
|
+
const loading_spinner_1 = require("../loading-spinner");
|
|
42
|
+
const utilts_1 = require("../_common/utilts");
|
|
43
|
+
exports.IconButton = react_1.default.forwardRef(function Button(_a, ref) {
|
|
44
|
+
var { children, as, type = 'button', loading = false, disabled = false, buttonSize = 'medium', className, onClick, grouped, floating = false, danger, clean } = _a, props = __rest(_a, ["children", "as", "type", "loading", "disabled", "buttonSize", "className", "onClick", "grouped", "floating", "danger", "clean"]);
|
|
45
|
+
let Component = as || 'button';
|
|
46
|
+
if (!as && props.href) {
|
|
47
|
+
Component = 'a';
|
|
48
|
+
}
|
|
49
|
+
const interactable = !disabled && !loading;
|
|
50
|
+
const classes = (0, classnames_1.default)(`ndl-icon-btn ${buttonSize} ${className}`, {
|
|
51
|
+
grouped,
|
|
52
|
+
disabled,
|
|
53
|
+
loading,
|
|
54
|
+
floating,
|
|
55
|
+
danger,
|
|
56
|
+
clean,
|
|
57
|
+
});
|
|
58
|
+
if (clean && floating) {
|
|
59
|
+
(0, utilts_1.needleWarningMessage)("Can't have 'clean' and 'floating' props true at the same time");
|
|
60
|
+
}
|
|
61
|
+
if (!props['aria-label']) {
|
|
62
|
+
(0, utilts_1.needleWarningMessage)('Icon buttons do not have text, be sure to include one for screen readers link: https://dequeuniversity.com/rules/axe/4.4/button-name?application=axeAPI');
|
|
63
|
+
}
|
|
64
|
+
const handleClick = (e) => {
|
|
65
|
+
if (!interactable) {
|
|
66
|
+
// By default, a <button /> element with disabled set to true will not get its
|
|
67
|
+
// on click handler called. To support the same behavior on <a /> tags we
|
|
68
|
+
// swallow the event here when disabled, since the <a /> tag with disabled set to
|
|
69
|
+
// true will have its onClick handler called
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (onClick) {
|
|
75
|
+
onClick(e);
|
|
76
|
+
}
|
|
77
|
+
else if (!props.href) {
|
|
78
|
+
console.error('onClick was not provided');
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return ((0, jsx_runtime_1.jsx)(Component
|
|
82
|
+
/** First props and then className to avoid overriding in classNames */
|
|
83
|
+
, Object.assign({}, props, (Component === 'button' ? { type } : {}), { onClick: handleClick, disabled: !interactable, className: classes, ref: ref }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ndl-icon" }, { children: loading ? ((0, jsx_runtime_1.jsx)(loading_spinner_1.LoadingSpinner, { className: "n-my-auto n-mr-1", size: "small" })) : (children) })) })));
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=IconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../src/button/IconButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,4DAAoC;AACpC,wDAAoD;AAEpD,8CAAyD;AAmC5C,QAAA,UAAU,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CACxD,EAckB,EAClB,GAAG;QAfH,EACE,QAAQ,EACR,EAAE,EACF,IAAI,GAAG,QAAQ,EACf,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,UAAU,GAAG,QAAQ,EACrB,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,MAAM,EACN,KAAK,OAEW,EADb,KAAK,cAbV,iIAcC,CADS;IAIV,IAAI,SAAS,GAAG,EAAE,IAAI,QAAQ,CAAC;IAE/B,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE;QACrB,SAAS,GAAG,GAAG,CAAC;KACjB;IAED,MAAM,YAAY,GAAG,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC;IAE3C,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,gBAAgB,UAAU,IAAI,SAAS,EAAE,EAAE;QACpE,OAAO;QACP,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,MAAM;QACN,KAAK;KACN,CAAC,CAAC;IAEH,IAAI,KAAK,IAAI,QAAQ,EAAE;QACrB,IAAA,6BAAoB,EAClB,+DAA+D,CAChE,CAAC;KACH;IAED,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QACxB,IAAA,6BAAoB,EAClB,yJAAyJ,CAC1J,CAAC;KACH;IAED,MAAM,WAAW,GAAG,CAAC,CAAkD,EAAE,EAAE;QACzE,IAAI,CAAC,YAAY,EAAE;YACjB,8EAA8E;YAC9E,yEAAyE;YACzE,iFAAiF;YACjF,4CAA4C;YAC5C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,OAAO;SACR;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,CAAC,CAAC,CAAC;SACZ;aAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YACtB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,SAAS;IACR,uEAAuE;wBACnE,KAAK,EAEL,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAC5C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,YAAY,EACvB,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,GAAG,gBAER,8CAAK,SAAS,EAAC,UAAU,gBACtB,OAAO,CAAC,CAAC,CAAC,CACT,uBAAC,gCAAc,IAAC,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAC,OAAO,GAAG,CAC7D,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,IACG,IACI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.IconButtonArray = void 0;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) "Neo4j"
|
|
22
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
23
|
+
*
|
|
24
|
+
* This file is part of Neo4j.
|
|
25
|
+
*
|
|
26
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
27
|
+
* it under the terms of the GNU General Public License as published by
|
|
28
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
29
|
+
* (at your option) any later version.
|
|
30
|
+
*
|
|
31
|
+
* This program is distributed in the hope that it will be useful,
|
|
32
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
33
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
34
|
+
* GNU General Public License for more details.
|
|
35
|
+
*
|
|
36
|
+
* You should have received a copy of the GNU General Public License
|
|
37
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
38
|
+
*/
|
|
39
|
+
const react_1 = __importDefault(require("react"));
|
|
40
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
41
|
+
exports.IconButtonArray = react_1.default.forwardRef(function Button(_a, ref) {
|
|
42
|
+
var { children, as, className, floating = false, orientation = 'horizontal' } = _a, props = __rest(_a, ["children", "as", "className", "floating", "orientation"]);
|
|
43
|
+
const Component = as || 'div';
|
|
44
|
+
const classes = (0, classnames_1.default)(`ndl-icon-btn-array`, {
|
|
45
|
+
'n-flex-row': orientation === 'horizontal',
|
|
46
|
+
'n-flex-col': orientation === 'vertical',
|
|
47
|
+
'array-floating': floating,
|
|
48
|
+
[`${className}`]: className,
|
|
49
|
+
});
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({}, props, { className: classes, ref: ref }, { children: children })));
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=IconButtonArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButtonArray.js","sourceRoot":"","sources":["../../../src/button/IconButtonArray.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,4DAAoC;AAqBvB,QAAA,eAAe,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7D,EAOuB,EACvB,GAAG;QARH,EACE,QAAQ,EACR,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,WAAW,GAAG,YAAY,OAEL,EADlB,KAAK,cANV,0DAOC,CADS;IAIV,MAAM,SAAS,GAAG,EAAE,IAAI,KAAK,CAAC;IAE9B,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,oBAAoB,EAAE;QAC/C,YAAY,EAAE,WAAW,KAAK,YAAY;QAC1C,YAAY,EAAE,WAAW,KAAK,UAAU;QACxC,gBAAgB,EAAE,QAAQ;QAC1B,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,uBAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,gBAC/C,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/lib/cjs/button/index.js
CHANGED
|
@@ -35,4 +35,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
__exportStar(require("./Button"), exports);
|
|
38
|
+
__exportStar(require("./IconButton"), exports);
|
|
39
|
+
__exportStar(require("./IconButtonArray"), exports);
|
|
38
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,+CAA6B;AAC7B,oDAAkC"}
|
|
@@ -25,7 +25,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
25
25
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
27
|
const react_1 = __importDefault(require("react"));
|
|
28
|
-
const
|
|
28
|
+
const RadioAndCheckboxWrapper_1 = __importDefault(require("../_common/input/RadioAndCheckboxWrapper"));
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
*
|
|
@@ -45,7 +45,7 @@ const Checkbox = react_1.default.forwardRef((props, ref) => {
|
|
|
45
45
|
if (!props['aria-label'] && !props.label) {
|
|
46
46
|
console.warn('To be accesible the input component requires either `aria-label` or `label` prop: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI');
|
|
47
47
|
}
|
|
48
|
-
return (0, jsx_runtime_1.jsx)(
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(RadioAndCheckboxWrapper_1.default, Object.assign({}, props, { ref: ref, type: "checkbox", role: "checkbox" })));
|
|
49
49
|
});
|
|
50
50
|
Checkbox.displayName = 'Checkbox';
|
|
51
51
|
exports.default = Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/checkbox/Checkbox.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,uGAEkD;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,eAAK,CAAC,UAAU,CAC/B,CAAC,KAA4B,EAAE,GAAyC,EAAE,EAAE;IAC1E,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QACxC,OAAO,CAAC,IAAI,CACV,sJAAsJ,CACvJ,CAAC;KACH;IAED,OAAO,CACL,uBAAC,iCAAuB,oBAClB,KAAK,IACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,UAAU,IACf,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,kBAAe,QAAQ,CAAC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -50,4 +50,5 @@ __exportStar(require("./icons"), exports);
|
|
|
50
50
|
__exportStar(require("./progress-bar"), exports);
|
|
51
51
|
__exportStar(require("./table"), exports);
|
|
52
52
|
__exportStar(require("./drag-and-drop"), exports);
|
|
53
|
+
__exportStar(require("./text-input"), exports);
|
|
53
54
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,oDAAkC;AAClC,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,iDAA+B;AAC/B,0CAAwB;AACxB,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,0CAAwB;AACxB,iDAA+B;AAC/B,oDAAkC;AAClC,yCAAuB;AACvB,kDAAgC;AAChC,4CAA0B;AAC1B,0CAAwB;AACxB,iDAA+B;AAC/B,0CAAwB;AACxB,kDAAgC;AAChC,+CAA6B"}
|
package/lib/cjs/radio/Radio.js
CHANGED
|
@@ -25,7 +25,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
25
25
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
27
|
const react_1 = __importDefault(require("react"));
|
|
28
|
-
const
|
|
28
|
+
const RadioAndCheckboxWrapper_1 = __importDefault(require("../_common/input/RadioAndCheckboxWrapper"));
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
*
|
|
@@ -42,7 +42,7 @@ const input_1 = require("../input");
|
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
44
|
const Radio = react_1.default.forwardRef(function Radio(props, ref) {
|
|
45
|
-
return (0, jsx_runtime_1.jsx)(
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(RadioAndCheckboxWrapper_1.default, Object.assign({}, props, { type: "radio", role: "radio", ref: ref })));
|
|
46
46
|
});
|
|
47
47
|
exports.default = Radio;
|
|
48
48
|
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../../src/radio/Radio.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,uGAEkD;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,KAAK,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,KAAK,CAC3C,KAA4B,EAC5B,GAAyC;IAEzC,OAAO,CACL,uBAAC,iCAAuB,oBAAK,KAAK,IAAE,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,IAAI,CAC3E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,KAAK,CAAC"}
|
package/lib/cjs/switch/Switch.js
CHANGED
|
@@ -25,7 +25,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
25
25
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
27
|
const react_1 = __importDefault(require("react"));
|
|
28
|
-
const
|
|
28
|
+
const RadioAndCheckboxWrapper_1 = __importDefault(require("../_common/input/RadioAndCheckboxWrapper"));
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
*
|
|
@@ -42,7 +42,7 @@ const input_1 = require("../input");
|
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
44
|
const Switch = react_1.default.forwardRef(function Switch(props, ref) {
|
|
45
|
-
return (0, jsx_runtime_1.jsx)(
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(RadioAndCheckboxWrapper_1.default, Object.assign({}, props, { ref: ref, type: "checkbox", role: "switch" })));
|
|
46
46
|
});
|
|
47
47
|
exports.default = Switch;
|
|
48
48
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA0B;AAC1B,uGAEkD;AAElD;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,MAAM,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,MAAM,CAC7C,KAA4B,EAC5B,GAAyC;IAEzC,OAAO,CACL,uBAAC,iCAAuB,oBAClB,KAAK,IACT,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,QAAQ,IACb,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
package/lib/cjs/table/Table.js
CHANGED
|
@@ -64,7 +64,7 @@ const DefaultHeader = ({ headerGroups, }) => ((0, jsx_runtime_1.jsx)("thead", {
|
|
|
64
64
|
// Apply the header cell props
|
|
65
65
|
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
66
66
|
// eslint-disable-next-line react/jsx-key
|
|
67
|
-
(0, jsx_runtime_1.jsxs)("th", Object.assign({ style: Object.assign(Object.assign({}, castedColumn.getHeaderProps().style), {
|
|
67
|
+
(0, jsx_runtime_1.jsxs)("th", Object.assign({}, castedColumn.getHeaderProps(), { style: Object.assign(Object.assign({}, castedColumn.getHeaderProps().style), {
|
|
68
68
|
/** 0.25px */
|
|
69
69
|
letterSpacing: '0.25px' }), scope: "col", className: headerClasses }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "table-header-cell" }, { children: [castedColumn.render('Header'), castedColumn.canSort && ((0, jsx_runtime_1.jsx)(helpers_1.SortIcon, Object.assign({}, castedColumn.getSortByToggleProps(), { isSortedDesc: castedColumn.isSortedDesc })))] })), 'canResize' in castedColumn &&
|
|
70
70
|
'getResizerProps' in castedColumn && ((0, jsx_runtime_1.jsx)(helpers_1.ResizingBar, Object.assign({}, castedColumn.getResizerProps())))] })));
|
|
@@ -78,10 +78,10 @@ const DefaultBody = ({ getTableBodyProps, page, prepareRow, actionsButtons, rows
|
|
|
78
78
|
return (
|
|
79
79
|
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
80
80
|
// eslint-disable-next-line react/jsx-key
|
|
81
|
-
(0, jsx_runtime_1.jsxs)("tr", Object.assign({ className: "table-row" }, row.getRowProps(), { children: [row.cells.map((cell) => (
|
|
81
|
+
(0, jsx_runtime_1.jsxs)("tr", Object.assign({ className: "ndl-table-row" }, row.getRowProps(), { children: [row.cells.map((cell) => (
|
|
82
82
|
// Key is defined from getHeaderGroupProps so we can ignore the false-negative
|
|
83
83
|
// eslint-disable-next-line react/jsx-key
|
|
84
|
-
(0, jsx_runtime_1.jsx)("td", Object.assign({ className: "table-cell" }, cell.getCellProps(), { children: cell.render('Cell') })))), actionsButtons && actionsButtons(row)] })));
|
|
84
|
+
(0, jsx_runtime_1.jsx)("td", Object.assign({ className: "ndl-table-cell" }, cell.getCellProps(), { children: cell.render('Cell') })))), actionsButtons && actionsButtons(row)] })));
|
|
85
85
|
}) }))) : ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("h6", Object.assign({ className: "n-my-5 n-w-full n-text-center n-h-10 n-relative n-left-full n-flex n-justify-center n-items-center" }, { children: "No data present" })) })) }));
|
|
86
86
|
};
|
|
87
87
|
const DefaultNavigation = ({ state, rows, page, canPreviousPage, nextPage, pageOptions, pageCount, gotoPage, canNextPage, previousPage, setPageSize, }) => {
|
|
@@ -114,11 +114,11 @@ const DefaultNavigation = ({ state, rows, page, canPreviousPage, nextPage, pageO
|
|
|
114
114
|
const Table = (props
|
|
115
115
|
// props: any
|
|
116
116
|
) => {
|
|
117
|
-
const { controls, getTableProps, header, body, navigation,
|
|
117
|
+
const { controls, getTableProps, header, body, navigation, className = '', style = {}, role, } = props;
|
|
118
118
|
if (!getTableProps) {
|
|
119
119
|
throw new Error('getTableProps is required');
|
|
120
120
|
}
|
|
121
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('ndl-table n-
|
|
121
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)('ndl-table n-overflow-hidden n-flex n-flex-col n-divide-y n-divide-light-neutral-border-weak n-bg-light-neutral-bg-weak n-shadow-l3', className), style: style, role: role }, { children: [controls && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "n-px-7 n-py-6 n-flex n-flex-row n-items-center" }, { children: controls }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "n-overflow-x-auto" }, { children: (0, jsx_runtime_1.jsxs)("table", Object.assign({}, getTableProps(), { className: "n-w-full n-min-w-full n-divide-y n-divide-light-neutral-border-weak n-bg-light-neutral-bg-weak" }, { children: [header || (0, jsx_runtime_1.jsx)(DefaultHeader, Object.assign({}, props)), body || (0, jsx_runtime_1.jsx)(DefaultBody, Object.assign({}, props))] })) })), navigation || ((0, jsx_runtime_1.jsx)(DefaultNavigation, Object.assign({}, props)))] })));
|
|
122
122
|
};
|
|
123
123
|
exports.default = Table;
|
|
124
124
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4DAAoC;AAiBpC,uCAAgE;AAChE,wEAAgD;AAGhD,sEAAsE;AACtE,MAAM,aAAa,GAAG;IACpB,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;CACjB,CAA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gBAEhC,mDACM,aAAa,EAAE,IACnB,SAAS,EAAC,gGAAgG,iBAGzG,MAAM,IAAI,uBAAC,aAAa,oBAAM,KAA+B,EAAI,EAEjE,IAAI,IAAI,uBAAC,WAAW,oBAAM,KAA6B,EAAI,KACtD,IACJ,EAEL,UAAU,IAAI,CACb,uBAAC,iBAAiB,oBAAM,KAAmC,EAAI,CAChE,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) "Neo4j"
|
|
21
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
22
|
+
*
|
|
23
|
+
* This file is part of Neo4j.
|
|
24
|
+
*
|
|
25
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
26
|
+
* it under the terms of the GNU General Public License as published by
|
|
27
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
28
|
+
* (at your option) any later version.
|
|
29
|
+
*
|
|
30
|
+
* This program is distributed in the hope that it will be useful,
|
|
31
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
32
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
33
|
+
* GNU General Public License for more details.
|
|
34
|
+
*
|
|
35
|
+
* You should have received a copy of the GNU General Public License
|
|
36
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
37
|
+
*/
|
|
38
|
+
const react_1 = __importDefault(require("react"));
|
|
39
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
40
|
+
const icons_1 = require("../icons");
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* Helpers
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
/** Add any helper functions here. */
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
*
|
|
52
|
+
* TextInput Component
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
const TextInput = react_1.default.forwardRef(function TextInput(props, ref) {
|
|
57
|
+
const { label, fluid, errorText, helpText, leftIcon, rightIcon, type = 'text', containerSize = 'small' } = props, otherInputProps = __rest(props, ["label", "fluid", "errorText", "helpText", "leftIcon", "rightIcon", "type", "containerSize"]);
|
|
58
|
+
const containerWrappingClass = (0, classnames_1.default)(`ndl-form-item ndl-type-text`, {
|
|
59
|
+
disabled: otherInputProps.disabled,
|
|
60
|
+
[containerSize]: containerSize,
|
|
61
|
+
'has-error': errorText,
|
|
62
|
+
'has-left-icon': leftIcon,
|
|
63
|
+
'has-right-icon': rightIcon || errorText,
|
|
64
|
+
'has-icon': leftIcon || rightIcon || errorText,
|
|
65
|
+
});
|
|
66
|
+
const labelWrappingClass = (0, classnames_1.default)(`form-item-label`, {
|
|
67
|
+
fluid,
|
|
68
|
+
});
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: containerWrappingClass }, { children: [(0, jsx_runtime_1.jsxs)("label", Object.assign({ className: labelWrappingClass }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "input-wrapper" }, { children: [leftIcon && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "icon left-icon" }, { children: leftIcon })), (0, jsx_runtime_1.jsx)("input", Object.assign({}, otherInputProps, { type: type, ref: ref })), rightIcon && !errorText && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "icon right-icon" }, { children: rightIcon }))), errorText && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "icon right-icon error-icon" }, { children: (0, jsx_runtime_1.jsx)(icons_1.HeroIcon, { iconName: "ExclamationCircleIcon", type: "solid" }) })))] })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "form-label-text" }, { children: label }))] })), (errorText || helpText) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "form-msg" }, { children: errorText || helpText })))] })));
|
|
70
|
+
});
|
|
71
|
+
exports.default = TextInput;
|
|
72
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,kDAA4C;AAC5C,4DAAoC;AAEpC,oCAAoC;AAyBpC;;;;;;GAMG;AAEH,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,SAAS,GAAG,eAAK,CAAC,UAAU,CAAC,SAAS,SAAS,CACnD,KAA0B,EAC1B,GAAmC;IAEnC,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,MAAM,EACb,aAAa,GAAG,OAAO,KAErB,KAAK,EADJ,eAAe,UAChB,KAAK,EAVH,6FAUL,CAAQ,CAAC;IAEV,MAAM,sBAAsB,GAAG,IAAA,oBAAU,EAAC,6BAA6B,EAAE;QACvE,QAAQ,EAAE,eAAe,CAAC,QAAQ;QAClC,CAAC,aAAa,CAAC,EAAE,aAAa;QAC9B,WAAW,EAAE,SAAS;QACtB,eAAe,EAAE,QAAQ;QACzB,gBAAgB,EAAE,SAAS,IAAI,SAAS;QACxC,UAAU,EAAE,QAAQ,IAAI,SAAS,IAAI,SAAS;KAC/C,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,IAAA,oBAAU,EAAC,iBAAiB,EAAE;QACvD,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,CACL,+CAAK,SAAS,EAAE,sBAAsB,iBAGpC,iDAAO,SAAS,EAAE,kBAAkB,iBAClC,+CAAK,SAAS,EAAC,eAAe,iBAC3B,QAAQ,IAAI,8CAAK,SAAS,EAAC,gBAAgB,gBAAE,QAAQ,IAAO,EAC7D,kDAAW,eAAe,IAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAU,EACzD,SAAS,IAAI,CAAC,SAAS,IAAI,CAC1B,8CAAK,SAAS,EAAC,iBAAiB,gBAAE,SAAS,IAAO,CACnD,EACA,SAAS,IAAI,CACZ,8CAAK,SAAS,EAAC,4BAA4B,gBACzC,uBAAC,gBAAQ,IAAC,QAAQ,EAAC,uBAAuB,EAAC,IAAI,EAAC,OAAO,GAAG,IACtD,CACP,KACG,EAEN,+CAAM,SAAS,EAAC,iBAAiB,gBAAE,KAAK,IAAQ,KAC1C,EACP,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,CAC1B,8CAAK,SAAS,EAAC,UAAU,gBAAE,SAAS,IAAI,QAAQ,IAAO,CACxD,KACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAe,SAAS,CAAC"}
|
|
@@ -23,7 +23,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
var
|
|
28
|
-
Object.defineProperty(exports, "
|
|
26
|
+
exports.TextInput = void 0;
|
|
27
|
+
var TextInput_1 = require("./TextInput");
|
|
28
|
+
Object.defineProperty(exports, "TextInput", { enumerable: true, get: function () { return __importDefault(TextInput_1).default; } });
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/text-input/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,yCAAmD;AAA1C,uHAAA,OAAO,OAAa"}
|
|
@@ -40,16 +40,16 @@ import classnames from 'classnames';
|
|
|
40
40
|
*
|
|
41
41
|
*
|
|
42
42
|
*/
|
|
43
|
-
const
|
|
44
|
-
const { label, fluid, labelBefore } = props, otherInputProps = __rest(props, ["label", "fluid", "labelBefore"]);
|
|
45
|
-
const containerWrappingClass = classnames(
|
|
43
|
+
const RadioAndCheckboxWrapper = (props, ref) => {
|
|
44
|
+
const { label, fluid, labelBefore, type = 'text' } = props, otherInputProps = __rest(props, ["label", "fluid", "labelBefore", "type"]);
|
|
45
|
+
const containerWrappingClass = classnames(`ndl-form-item ndl-type-${type}`, {
|
|
46
46
|
disabled: otherInputProps.disabled,
|
|
47
47
|
});
|
|
48
48
|
const labelWrappingClass = classnames(`form-item-label`, {
|
|
49
49
|
fluid,
|
|
50
50
|
'label-before': labelBefore,
|
|
51
51
|
});
|
|
52
|
-
return (_jsx("div", Object.assign({ className: containerWrappingClass }, { children: _jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsx("input", Object.assign({}, otherInputProps, { ref: ref })), label] })) })));
|
|
52
|
+
return (_jsx("div", Object.assign({ className: containerWrappingClass }, { children: _jsxs("label", Object.assign({ className: labelWrappingClass }, { children: [_jsx("input", Object.assign({}, otherInputProps, { ref: ref, type: type })), _jsx("span", Object.assign({ className: "form-label-text" }, { children: label }))] })) })));
|
|
53
53
|
};
|
|
54
|
-
export default forwardRef(
|
|
55
|
-
//# sourceMappingURL=
|
|
54
|
+
export default forwardRef(RadioAndCheckboxWrapper);
|
|
55
|
+
//# sourceMappingURL=RadioAndCheckboxWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioAndCheckboxWrapper.js","sourceRoot":"","sources":["../../../../src/_common/input/RadioAndCheckboxWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,UAAU,MAAM,YAAY,CAAC;AAmBpC,qCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,uBAAuB,GAAG,CAC9B,KAA4B,EAC5B,GAAmC,EACnC,EAAE;IACF,MAAM,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,GAAG,MAAM,KAEX,KAAK,EADJ,eAAe,UAChB,KAAK,EANH,yCAML,CAAQ,CAAC;IAEV,MAAM,sBAAsB,GAAG,UAAU,CAAC,0BAA0B,IAAI,EAAE,EAAE;QAC1E,QAAQ,EAAE,eAAe,CAAC,QAAQ;KACnC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,UAAU,CAAC,iBAAiB,EAAE;QACvD,KAAK;QACL,cAAc,EAAE,WAAW;KAC5B,CAAC,CAAC;IAEH,OAAO,CACL,4BAAK,SAAS,EAAE,sBAAsB,gBAGpC,+BAAO,SAAS,EAAE,kBAAkB,iBAClC,gCAAW,eAAe,IAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,EACpD,6BAAM,SAAS,EAAC,iBAAiB,gBAAE,KAAK,IAAQ,KAC1C,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/_common/input/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 const removeNewlines = (input) => input.replace(/(\r\n|\n|\r)/gm, '');
|
|
22
|
+
/** Remove extra spaces from sting */
|
|
23
|
+
export const removeSpaces = (input) => input.replace(/\s+/g, ' ').trim();
|
|
24
|
+
export const needleWarningMessage = (message) => console.warn(`[🪡 Needle]: ${message}`);
|
|
25
|
+
//# sourceMappingURL=utilts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilts.js","sourceRoot":"","sources":["../../../src/_common/utilts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAC9C,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtC,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAC5C,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAEpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAE,EAAE,CACtD,OAAO,CAAC,IAAI,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC"}
|