@rh-support/components 2.0.4 → 2.0.5

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.
Files changed (89) hide show
  1. package/lib/cjs/AlertMessage/index.d.ts +0 -1
  2. package/lib/cjs/AlertMessage/index.d.ts.map +1 -1
  3. package/lib/cjs/AlertMessage/index.js +1 -1
  4. package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.d.ts +0 -6
  5. package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.d.ts.map +1 -1
  6. package/lib/cjs/ConfirmationModal/ConfirmationModal.stories.js +29 -69
  7. package/lib/cjs/CustomContentLoader/CustomContentLoader.d.ts.map +1 -1
  8. package/lib/cjs/CustomContentLoader/CustomContentLoader.js +23 -23
  9. package/lib/cjs/CustomTextInput/CustomTextInput.js +3 -3
  10. package/lib/cjs/DropDownList/SearchableList.d.ts.map +1 -1
  11. package/lib/cjs/DropDownList/SearchableList.js +2 -0
  12. package/lib/cjs/DropDownList/dropdownUtils.d.ts.map +1 -1
  13. package/lib/cjs/DropDownList/dropdownUtils.js +1 -0
  14. package/lib/cjs/Functional/CaseContactsSelectorExternal.js +2 -2
  15. package/lib/cjs/InlineEdit/InlineEdit.js +2 -2
  16. package/lib/cjs/InlineEdit/NewInlineEdit.js +2 -2
  17. package/lib/cjs/LoadingDots/index.d.ts +0 -1
  18. package/lib/cjs/LoadingDots/index.d.ts.map +1 -1
  19. package/lib/cjs/LoadingDots/index.js +1 -1
  20. package/lib/cjs/TextAreaResizable/TextAreaResizable.js +5 -2
  21. package/lib/esm/AlertMessage/index.d.ts +0 -1
  22. package/lib/esm/AlertMessage/index.d.ts.map +1 -1
  23. package/lib/esm/AlertMessage/index.js +1 -1
  24. package/lib/esm/ConfirmationModal/ConfirmationModal.stories.d.ts +0 -6
  25. package/lib/esm/ConfirmationModal/ConfirmationModal.stories.d.ts.map +1 -1
  26. package/lib/esm/ConfirmationModal/ConfirmationModal.stories.js +19 -18
  27. package/lib/esm/CustomContentLoader/CustomContentLoader.d.ts.map +1 -1
  28. package/lib/esm/CustomContentLoader/CustomContentLoader.js +23 -23
  29. package/lib/esm/CustomTextInput/CustomTextInput.js +1 -1
  30. package/lib/esm/DropDownList/SearchableList.d.ts.map +1 -1
  31. package/lib/esm/DropDownList/SearchableList.js +2 -0
  32. package/lib/esm/DropDownList/dropdownUtils.d.ts.map +1 -1
  33. package/lib/esm/DropDownList/dropdownUtils.js +1 -0
  34. package/lib/esm/Functional/CaseContactsSelectorExternal.js +1 -1
  35. package/lib/esm/InlineEdit/InlineEdit.js +1 -1
  36. package/lib/esm/InlineEdit/NewInlineEdit.js +1 -1
  37. package/lib/esm/LoadingDots/index.d.ts +0 -1
  38. package/lib/esm/LoadingDots/index.d.ts.map +1 -1
  39. package/lib/esm/LoadingDots/index.js +1 -1
  40. package/lib/esm/TextAreaResizable/TextAreaResizable.js +1 -1
  41. package/package.json +7 -23
  42. package/lib/cjs/AlertMessage/AlertMessage.stories.d.ts +0 -12
  43. package/lib/cjs/AlertMessage/AlertMessage.stories.d.ts.map +0 -1
  44. package/lib/cjs/AlertMessage/AlertMessage.stories.js +0 -29
  45. package/lib/cjs/DropDownList/Dropdownlist.stories.d.ts +0 -17
  46. package/lib/cjs/DropDownList/Dropdownlist.stories.d.ts.map +0 -1
  47. package/lib/cjs/DropDownList/Dropdownlist.stories.js +0 -253
  48. package/lib/cjs/LoadingDots/LoadingDots.stories.d.ts +0 -10
  49. package/lib/cjs/LoadingDots/LoadingDots.stories.d.ts.map +0 -1
  50. package/lib/cjs/LoadingDots/LoadingDots.stories.js +0 -16
  51. package/lib/cjs/LoadingIndicator/LoadingIndicator.stories.d.ts +0 -11
  52. package/lib/cjs/LoadingIndicator/LoadingIndicator.stories.d.ts.map +0 -1
  53. package/lib/cjs/LoadingIndicator/LoadingIndicator.stories.js +0 -18
  54. package/lib/cjs/Table/PFTable.stories.d.ts +0 -20
  55. package/lib/cjs/Table/PFTable.stories.d.ts.map +0 -1
  56. package/lib/cjs/Table/PFTable.stories.js +0 -81
  57. package/lib/cjs/demo/Demo.css +0 -3
  58. package/lib/cjs/demo/Demo.d.ts +0 -13
  59. package/lib/cjs/demo/Demo.d.ts.map +0 -1
  60. package/lib/cjs/demo/Demo.js +0 -42
  61. package/lib/cjs/demo/Demo.md +0 -0
  62. package/lib/cjs/demo/Demo.scss +0 -3
  63. package/lib/cjs/demo/index.d.ts +0 -3
  64. package/lib/cjs/demo/index.d.ts.map +0 -1
  65. package/lib/cjs/demo/index.js +0 -23
  66. package/lib/esm/AlertMessage/AlertMessage.stories.d.ts +0 -12
  67. package/lib/esm/AlertMessage/AlertMessage.stories.d.ts.map +0 -1
  68. package/lib/esm/AlertMessage/AlertMessage.stories.js +0 -20
  69. package/lib/esm/DropDownList/Dropdownlist.stories.d.ts +0 -17
  70. package/lib/esm/DropDownList/Dropdownlist.stories.d.ts.map +0 -1
  71. package/lib/esm/DropDownList/Dropdownlist.stories.js +0 -156
  72. package/lib/esm/LoadingDots/LoadingDots.stories.d.ts +0 -10
  73. package/lib/esm/LoadingDots/LoadingDots.stories.d.ts.map +0 -1
  74. package/lib/esm/LoadingDots/LoadingDots.stories.js +0 -8
  75. package/lib/esm/LoadingIndicator/LoadingIndicator.stories.d.ts +0 -11
  76. package/lib/esm/LoadingIndicator/LoadingIndicator.stories.d.ts.map +0 -1
  77. package/lib/esm/LoadingIndicator/LoadingIndicator.stories.js +0 -9
  78. package/lib/esm/Table/PFTable.stories.d.ts +0 -20
  79. package/lib/esm/Table/PFTable.stories.d.ts.map +0 -1
  80. package/lib/esm/Table/PFTable.stories.js +0 -73
  81. package/lib/esm/demo/Demo.css +0 -3
  82. package/lib/esm/demo/Demo.d.ts +0 -13
  83. package/lib/esm/demo/Demo.d.ts.map +0 -1
  84. package/lib/esm/demo/Demo.js +0 -26
  85. package/lib/esm/demo/Demo.md +0 -0
  86. package/lib/esm/demo/Demo.scss +0 -3
  87. package/lib/esm/demo/index.d.ts +0 -3
  88. package/lib/esm/demo/index.d.ts.map +0 -1
  89. package/lib/esm/demo/index.js +0 -2
@@ -20,10 +20,10 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  };
21
21
  import { accounts } from '@cee-eng/hydrajs';
22
22
  import { getApiResourceObject, sortHydraContacts } from '@rh-support/utils';
23
- import { sortBy } from 'lodash';
24
23
  import differenceBy from 'lodash/differenceBy';
25
24
  import isArray from 'lodash/isArray';
26
25
  import isEmpty from 'lodash/isEmpty';
26
+ import sortBy from 'lodash/sortBy';
27
27
  import React, { useEffect, useRef, useState } from 'react';
28
28
  import { Highlighter, Menu, MenuItem, Typeahead } from 'react-bootstrap-typeahead';
29
29
  import { Trans } from 'react-i18next';
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import './inlineEdit.css';
11
11
  import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
12
- import { isEmpty } from 'lodash';
12
+ import isEmpty from 'lodash/isEmpty';
13
13
  import React, { useState } from 'react';
14
14
  import { Trans } from 'react-i18next';
15
15
  const defaultProps = {
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import './newInlineEdit.css';
11
11
  import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
12
- import { isEmpty } from 'lodash';
12
+ import isEmpty from 'lodash/isEmpty';
13
13
  import React, { useEffect, useState } from 'react';
14
14
  import { Trans } from 'react-i18next';
15
15
  const defaultProps = {
@@ -1,3 +1,2 @@
1
1
  export * from './LoadingDots';
2
- export * from './LoadingDots.stories';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/LoadingDots/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/LoadingDots/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export * from './LoadingDots';
2
- export * from './LoadingDots.stories';
2
+ //export * from './LoadingDots.stories';
@@ -1,5 +1,5 @@
1
1
  import { TextArea } from '@patternfly/react-core';
2
- import { isEmpty } from 'lodash';
2
+ import isEmpty from 'lodash/isEmpty';
3
3
  import React, { useState } from 'react';
4
4
  export const TextAreaResizable = (props) => {
5
5
  // To set defaultProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Contains all reusabel components for support app",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -44,7 +44,7 @@
44
44
  "test:watch": "./../../node_modules/.bin/jest --watchAll -c ./../../configs/tests/jest.config.unit.js",
45
45
  "test:unit": "../../node_modules/.bin/jest -c ../../configs/tests/jest.config.unit.js",
46
46
  "test:snap": "../../node_modules/.bin/jest -c ../../configs/tests/jest.config.snapshot.js",
47
- "test:coverage": "../../node_modules/.bin/jest -c ../../configs/tests/jest.config.coverage.js",
47
+ "test:coverage": "../../node_modules/.bin/jest --all -c ../../configs/tests/jest.config.coverage.js",
48
48
  "test:changes": "./../../node_modules/.bin/jest --passWithNoTests -c ./../../configs/tests/jest-only-changed-from-upstream.js",
49
49
  "test": "npm run test:changes",
50
50
  "watch:css": "./../../node_modules/.bin/chokidar 'src/**/*.(css|scss)' -c '../../node_modules/.bin/copyfiles -V -u 1 -a {path} lib/esm'",
@@ -52,19 +52,11 @@
52
52
  "prepublishOnly": "npm run build"
53
53
  },
54
54
  "peerDependencies": {
55
- "@cee-eng/hydrajs": "4.15.72",
55
+ "@cee-eng/hydrajs": "4.15.78",
56
56
  "@cee-eng/ui-toolkit": "1.1.6",
57
57
  "@patternfly/patternfly": "4.196.7",
58
58
  "@patternfly/react-core": "4.264.0",
59
59
  "@patternfly/react-table": "4.111.33",
60
- "@rh-support/types": "0.1.21",
61
- "@rh-support/user-permissions": "0.1.46",
62
- "@rh-support/utils": "0.1.45",
63
- "@storybook/addon-actions": "^5.3.19",
64
- "@storybook/addon-knobs": "^5.3.19",
65
- "@storybook/addon-notes": "^5.3.19",
66
- "@storybook/addons": "^5.3.19",
67
- "@storybook/react": "^5.3.19",
68
60
  "dompurify": "^2.2.6",
69
61
  "downshift": "^6.0.5",
70
62
  "js-worker-search": "^1.4.1",
@@ -79,21 +71,14 @@
79
71
  "use-deep-compare-effect": "^1.6.1"
80
72
  },
81
73
  "dependencies": {
82
- "@cee-eng/hydrajs": "4.15.72",
74
+ "@cee-eng/hydrajs": "4.15.78",
83
75
  "@cee-eng/ui-toolkit": "1.1.6",
84
76
  "@patternfly/patternfly": "4.196.7",
85
77
  "@patternfly/react-core": "4.264.0",
86
78
  "@patternfly/react-table": "4.111.33",
87
79
  "@rh-support/types": "2.0.1",
88
- "@rh-support/user-permissions": "2.0.4",
89
- "@rh-support/utils": "2.0.4",
90
- "@storybook/addon-a11y": "^5.3.19",
91
- "@storybook/addon-actions": "^5.3.19",
92
- "@storybook/addon-docs": "^5.3.19",
93
- "@storybook/addon-knobs": "^5.3.19",
94
- "@storybook/addon-notes": "^5.3.19",
95
- "@storybook/addons": "^5.3.19",
96
- "@storybook/react": "^5.3.19",
80
+ "@rh-support/user-permissions": "2.0.5",
81
+ "@rh-support/utils": "2.0.5",
97
82
  "dompurify": "^2.2.6",
98
83
  "downshift": "^6.0.5",
99
84
  "js-worker-search": "^1.4.1",
@@ -107,7 +92,6 @@
107
92
  "react-router-dom": "^5.1.2",
108
93
  "react-toastify": "^5.4.1",
109
94
  "resize-observer-polyfill": "^1.5.1",
110
- "storybook-readme": "^5.0.8",
111
95
  "use-deep-compare-effect": "^1.6.1"
112
96
  },
113
97
  "resolutions": {
@@ -131,5 +115,5 @@
131
115
  "not ie <= 11",
132
116
  "not op_mini all"
133
117
  ],
134
- "gitHead": "30c2ea68d7e31306b5bce11d448f45070f97f7cd"
118
+ "gitHead": "f4106bdae110f32d4968b2a9544fc4bbf76ce11e"
135
119
  }
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { AlertMessage } from './AlertMessage';
3
- declare const _default: {
4
- title: string;
5
- component: typeof AlertMessage;
6
- decorators: ((...args: any) => any)[];
7
- };
8
- export default _default;
9
- export declare const Alert: () => JSX.Element;
10
- export declare const DangerAlert: () => JSX.Element;
11
- export declare const WarningAlert: () => JSX.Element;
12
- //# sourceMappingURL=AlertMessage.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AlertMessage.stories.d.ts","sourceRoot":"","sources":["../../../src/AlertMessage/AlertMessage.stories.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAa,MAAM,gBAAgB,CAAC;;;;;;AAEzD,wBAIE;AAYF,eAAO,MAAM,KAAK,mBAOjB,CAAC;AACF,eAAO,MAAM,WAAW,mBAOvB,CAAC;AACF,eAAO,MAAM,YAAY,mBAExB,CAAC"}
@@ -1,29 +0,0 @@
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.WarningAlert = exports.DangerAlert = exports.Alert = void 0;
7
- var addon_actions_1 = require("@storybook/addon-actions");
8
- var addon_knobs_1 = require("@storybook/addon-knobs");
9
- var react_1 = __importDefault(require("react"));
10
- var AlertMessage_1 = require("./AlertMessage");
11
- exports.default = {
12
- title: 'Components/AlertMessage',
13
- component: AlertMessage_1.AlertMessage,
14
- decorators: [addon_knobs_1.withKnobs],
15
- };
16
- var options = {
17
- Warning: AlertMessage_1.AlertType.WARNING,
18
- Danger: AlertMessage_1.AlertType.DANGER,
19
- Info: AlertMessage_1.AlertType.INFO,
20
- Success: AlertMessage_1.AlertType.SUCCESS,
21
- };
22
- var label = 'Type';
23
- var defaultValue = AlertMessage_1.AlertType.WARNING;
24
- var Alert = function () { return (react_1.default.createElement(AlertMessage_1.AlertMessage, { show: true, title: addon_knobs_1.text('Title', 'This is an alert'), onClose: addon_actions_1.action('Close button clicked'), variant: addon_knobs_1.select(label, options, defaultValue) })); };
25
- exports.Alert = Alert;
26
- var DangerAlert = function () { return (react_1.default.createElement(AlertMessage_1.AlertMessage, { show: true, title: addon_knobs_1.text('Title', 'This is a danger alert'), onClose: addon_actions_1.action('Close button clicked'), variant: AlertMessage_1.AlertType.DANGER })); };
27
- exports.DangerAlert = DangerAlert;
28
- var WarningAlert = function () { return (react_1.default.createElement(AlertMessage_1.AlertMessage, { show: true, title: addon_knobs_1.text('Title', 'This is a warning alert'), variant: AlertMessage_1.AlertType.WARNING })); };
29
- exports.WarningAlert = WarningAlert;
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: {
3
- title: string;
4
- decorators: ((...args: any) => any)[];
5
- };
6
- export default _default;
7
- export declare const AsyncDropdown: () => JSX.Element;
8
- export declare const AsyncMultiDropdown: () => JSX.Element;
9
- export declare const DropdownList: () => JSX.Element;
10
- export declare const Searchable: () => JSX.Element;
11
- export declare const DropdownListInvalid: () => JSX.Element;
12
- export declare const SearchableInvalid: () => JSX.Element;
13
- export declare const SearchableMultiSelect: () => JSX.Element;
14
- export declare const MultiSelectDropdownList: () => JSX.Element;
15
- export declare const MultiSelectSearchableDropdownList: () => JSX.Element;
16
- export declare const MultiSelectSearchableDropdownListWithChip: () => JSX.Element;
17
- //# sourceMappingURL=Dropdownlist.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dropdownlist.stories.d.ts","sourceRoot":"","sources":["../../../src/DropDownList/Dropdownlist.stories.tsx"],"names":[],"mappings":";;;;;AASA,wBAGE;AAwPF,eAAO,MAAM,aAAa,mBAA2B,CAAC;AAEtD,eAAO,MAAM,kBAAkB,mBAAgC,CAAC;AAEhE,eAAO,MAAM,YAAY,mBAKxB,CAAC;AAEF,eAAO,MAAM,UAAU,mBAEtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBAM/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAM7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAMjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,mBAAiC,CAAC;AAEtE,eAAO,MAAM,iCAAiC,mBAA2C,CAAC;AAE1F,eAAO,MAAM,yCAAyC,mBAAoD,CAAC"}
@@ -1,253 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
- return new (P || (P = Promise))(function (resolve, reject) {
24
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- var __generator = (this && this.__generator) || function (thisArg, body) {
31
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33
- function verb(n) { return function (v) { return step([n, v]); }; }
34
- function step(op) {
35
- if (f) throw new TypeError("Generator is already executing.");
36
- while (_) try {
37
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
38
- if (y = 0, t) op = [op[0] & 2, t.value];
39
- switch (op[0]) {
40
- case 0: case 1: t = op; break;
41
- case 4: _.label++; return { value: op[1], done: false };
42
- case 5: _.label++; y = op[1]; op = [0]; continue;
43
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
44
- default:
45
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
46
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
47
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49
- if (t[2]) _.ops.pop();
50
- _.trys.pop(); continue;
51
- }
52
- op = body.call(thisArg, _);
53
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
55
- }
56
- };
57
- var __read = (this && this.__read) || function (o, n) {
58
- var m = typeof Symbol === "function" && o[Symbol.iterator];
59
- if (!m) return o;
60
- var i = m.call(o), r, ar = [], e;
61
- try {
62
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
63
- }
64
- catch (error) { e = { error: error }; }
65
- finally {
66
- try {
67
- if (r && !r.done && (m = i["return"])) m.call(i);
68
- }
69
- finally { if (e) throw e.error; }
70
- }
71
- return ar;
72
- };
73
- Object.defineProperty(exports, "__esModule", { value: true });
74
- exports.MultiSelectSearchableDropdownListWithChip = exports.MultiSelectSearchableDropdownList = exports.MultiSelectDropdownList = exports.SearchableMultiSelect = exports.SearchableInvalid = exports.DropdownListInvalid = exports.Searchable = exports.DropdownList = exports.AsyncMultiDropdown = exports.AsyncDropdown = void 0;
75
- var react_core_1 = require("@patternfly/react-core");
76
- var utils_1 = require("@rh-support/utils");
77
- var addon_knobs_1 = require("@storybook/addon-knobs");
78
- var react_1 = __importStar(require("react"));
79
- var AsyncDropDownList_1 = require("./AsyncDropDownList");
80
- var DropDownList_1 = require("./DropDownList");
81
- var MultiSelectDropdownList_1 = require("./MultiSelectDropdownList");
82
- exports.default = {
83
- title: 'Components/Dropdown',
84
- decorators: [addon_knobs_1.withKnobs],
85
- };
86
- var PER_PAGE = 50;
87
- var SEARCH_URI = 'https://api.github.com/search/users';
88
- function makeAndHandleRequest(query, page) {
89
- if (page === void 0) { page = 1; }
90
- return fetch(SEARCH_URI + "?q=" + query + "+in:login&page=" + page + "&per_page=" + PER_PAGE)
91
- .then(function (resp) { return resp.json(); })
92
- .then(function (_a) {
93
- var items = _a.items, total_count = _a.total_count;
94
- /* eslint-disable-line camelcase */
95
- var options = items.map(function (i) { return ({
96
- avatar_url: i.avatar_url,
97
- id: i.id,
98
- login: i.login,
99
- }); });
100
- return { options: options, total_count: total_count };
101
- });
102
- }
103
- function AsyncComponent() {
104
- var _this = this;
105
- var _a = __read(react_1.useState([]), 2), items = _a[0], setItems = _a[1];
106
- var _b = __read(react_1.useState(false), 2), isFetching = _b[0], setIsFetching = _b[1];
107
- var _c = __read(react_1.useState({ login: 'karan' }), 2), selectedItem = _c[0], setSelectedItem = _c[1];
108
- var fetchUsers = function (inputVal) { return __awaiter(_this, void 0, void 0, function () {
109
- var userResponse, e_1;
110
- return __generator(this, function (_a) {
111
- switch (_a.label) {
112
- case 0:
113
- _a.trys.push([0, 2, 3, 4]);
114
- setIsFetching(true);
115
- return [4 /*yield*/, makeAndHandleRequest(inputVal)];
116
- case 1:
117
- userResponse = _a.sent();
118
- setItems(userResponse);
119
- return [3 /*break*/, 4];
120
- case 2:
121
- e_1 = _a.sent();
122
- return [3 /*break*/, 4];
123
- case 3:
124
- setIsFetching(false);
125
- return [7 /*endfinally*/];
126
- case 4: return [2 /*return*/];
127
- }
128
- });
129
- }); };
130
- var onDropdownChange = function (item) {
131
- setSelectedItem(item.label);
132
- };
133
- var onPaginate = function (shownResults, inputVal, e) {
134
- console.log(inputVal);
135
- // fetch more results here
136
- };
137
- var onOuterClick = function () {
138
- // optional if you don't want to show the last results if user focuses out of dropdown
139
- setItems({ options: [] });
140
- };
141
- var onDropdownClear = function () {
142
- setSelectedItem({ login: '' });
143
- };
144
- // this is the most important part to memoize the selected item. If you don't then every time
145
- // new results are fetched the dropdown will render and toOption always create a new object
146
- // forcing dropdown to render and overriding the input value
147
- var memoizedSelectedItem = react_1.useMemo(function () { return utils_1.toOption(selectedItem, { labelKey: 'login' }); }, [selectedItem]);
148
- return (react_1.default.createElement(AsyncDropDownList_1.AsyncDropDownList, { placeholder: addon_knobs_1.text('Placeholder', 'Select a user'), id: "user-async-selector", selectedItem: memoizedSelectedItem, list: items
149
- ? utils_1.toOptions(items.options, {
150
- labelKey: 'login',
151
- childrenKey: 'children',
152
- })
153
- : [], title: "Select a Cluster", onOuterClick: onOuterClick, onChange: onDropdownChange, onSearch: fetchUsers, delay: addon_knobs_1.number('Delay', 300), useCache: addon_knobs_1.boolean('Use Cache', true), isLoadingList: isFetching, paginate: addon_knobs_1.boolean('Paginate', true), onPaginate: onPaginate, maxResults: addon_knobs_1.number('Max Results', PER_PAGE - 1), emptyListLabel: addon_knobs_1.text('Empty Label', 'No results found'), onClearSelection: onDropdownClear }));
154
- }
155
- function AsyncMultiComponent() {
156
- var _this = this;
157
- var _a = __read(react_1.useState([]), 2), items = _a[0], setItems = _a[1];
158
- var _b = __read(react_1.useState(false), 2), isFetching = _b[0], setIsFetching = _b[1];
159
- var _c = __read(react_1.useState([{ login: 'karan' }]), 2), selectedItems = _c[0], setSelectedItems = _c[1];
160
- var fetchUsers = function (inputVal) { return __awaiter(_this, void 0, void 0, function () {
161
- var userResponse, e_2;
162
- return __generator(this, function (_a) {
163
- switch (_a.label) {
164
- case 0:
165
- _a.trys.push([0, 2, 3, 4]);
166
- setIsFetching(true);
167
- return [4 /*yield*/, makeAndHandleRequest(inputVal)];
168
- case 1:
169
- userResponse = _a.sent();
170
- setItems(userResponse);
171
- return [3 /*break*/, 4];
172
- case 2:
173
- e_2 = _a.sent();
174
- return [3 /*break*/, 4];
175
- case 3:
176
- setIsFetching(false);
177
- return [7 /*endfinally*/];
178
- case 4: return [2 /*return*/];
179
- }
180
- });
181
- }); };
182
- var onDropdownChange = function (item) {
183
- setSelectedItems(item.map(function (i) { return i.value; }));
184
- };
185
- var onPaginate = function (shownResults, inputVal, e) {
186
- console.log(inputVal);
187
- // fetch more results here
188
- };
189
- var onOuterClick = function () {
190
- // optional if you don't want to show the last results if user focuses out of dropdown
191
- setItems({ options: [] });
192
- };
193
- var onDropdownClear = function () {
194
- setSelectedItems([]);
195
- };
196
- // this is the most important part to memoize the selected item. If you don't then every time
197
- // new results are fetched the dropdown will render and toOption always create a new object
198
- // forcing dropdown to render and overriding the input value
199
- var memoizedSelectedItems = react_1.useMemo(function () { return utils_1.toOptions(selectedItems, { labelKey: 'login' }); }, [selectedItems]);
200
- return (react_1.default.createElement(AsyncDropDownList_1.AsyncMultiDropDownList, { placeholder: addon_knobs_1.text('PlaceHolder', 'Select multiple users'), id: "user-async-selector", selectedItems: memoizedSelectedItems, list: items
201
- ? utils_1.toOptions(items.options, {
202
- labelKey: 'login',
203
- childrenKey: 'children',
204
- })
205
- : [], title: "Select a Cluster", onOuterClick: onOuterClick, onChange: onDropdownChange, onSearch: fetchUsers, delay: addon_knobs_1.number('Delay', 300), useCache: addon_knobs_1.boolean('Use Cache', true), isLoadingList: isFetching, paginate: addon_knobs_1.boolean('Paginate', true), onPaginate: onPaginate, maxResults: addon_knobs_1.number('Max Results', PER_PAGE - 1), emptyListLabel: addon_knobs_1.text('Empty Label', 'No results found'), onClearSelection: onDropdownClear }));
206
- }
207
- function MultiSelectComponent() {
208
- var _a = __read(react_1.useState([]), 2), selectedItems = _a[0], setSelectedItems = _a[1];
209
- var onChange = function (newItems) {
210
- setSelectedItems(newItems.map(function (item) { return item.label; }));
211
- };
212
- return (react_1.default.createElement(MultiSelectDropdownList_1.MultiSelectDropDownList, { title: "Multi", selectedItems: utils_1.toOptions(selectedItems), placeholder: utils_1.getDropdownBtnPlaceholder(addon_knobs_1.text('Placeholder', 'Choose a color'), selectedItems, 'colors', 3, 'All colors selected'), onChange: onChange, list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), searchable: addon_knobs_1.boolean('Searchable', false) }));
213
- }
214
- function MultiSelectSearchableComponent() {
215
- var _a = __read(react_1.useState([]), 2), selectedItems = _a[0], setSelectedItems = _a[1];
216
- var onChange = function (newItems) {
217
- setSelectedItems(newItems.map(function (item) { return item.label; }));
218
- };
219
- return (react_1.default.createElement(MultiSelectDropdownList_1.MultiSelectDropDownList, { title: "Multi", selectedItems: utils_1.toOptions(selectedItems), placeholder: utils_1.getDropdownBtnPlaceholder(addon_knobs_1.text('Placeholder', 'Choose a color'), selectedItems, 'colors', 3, 'All colors selected'), onChange: onChange, list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), searchable: addon_knobs_1.boolean('Searchable', true) }));
220
- }
221
- function MultiSelectSearchableComponentWithChips() {
222
- var _a = __read(react_1.useState([]), 2), selectedItems = _a[0], setSelectedItems = _a[1];
223
- var onChange = function (newItems) {
224
- setSelectedItems(newItems.map(function (item) { return item.label; }));
225
- };
226
- var removeSelectedItem = function (item) {
227
- setSelectedItems(selectedItems.filter(function (i) { return i !== item; }));
228
- };
229
- var chipGroupComponent = function () {
230
- return (react_1.default.createElement(react_core_1.ChipGroup, null, (selectedItems || []).map(function (currentChip, index) { return (react_1.default.createElement(react_core_1.Chip, { isReadOnly: index === 0 ? true : false, key: currentChip, onClick: function (ev) { return removeSelectedItem(currentChip); } }, currentChip)); })));
231
- };
232
- return (react_1.default.createElement(MultiSelectDropdownList_1.MultiSelectDropDownList, { title: "Multi", selectedItems: utils_1.toOptions(selectedItems), placeholder: utils_1.getDropdownBtnPlaceholder(addon_knobs_1.text('Placeholder', 'Choose a color'), selectedItems, 'colors', 3, 'All colors selected'), onChange: onChange, list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), searchable: addon_knobs_1.boolean('Searchable', true), chipGroupComponent: chipGroupComponent() }));
233
- }
234
- var AsyncDropdown = function () { return react_1.default.createElement(AsyncComponent, null); };
235
- exports.AsyncDropdown = AsyncDropdown;
236
- var AsyncMultiDropdown = function () { return react_1.default.createElement(AsyncMultiComponent, null); };
237
- exports.AsyncMultiDropdown = AsyncMultiDropdown;
238
- var DropdownList = function () { return (react_1.default.createElement(DropDownList_1.Dropdown, { list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), placeholder: addon_knobs_1.text('Placeholder', 'Choose a color') })); };
239
- exports.DropdownList = DropdownList;
240
- var Searchable = function () { return (react_1.default.createElement(DropDownList_1.Dropdown, { list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), searchable: addon_knobs_1.boolean('Searchable', true) })); };
241
- exports.Searchable = Searchable;
242
- var DropdownListInvalid = function () { return (react_1.default.createElement(DropDownList_1.Dropdown, { list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), placeholder: addon_knobs_1.text('Placeholder', 'Choose a color'), isInValid: addon_knobs_1.boolean('Is invalid', true) })); };
243
- exports.DropdownListInvalid = DropdownListInvalid;
244
- var SearchableInvalid = function () { return (react_1.default.createElement(DropDownList_1.Dropdown, { list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), searchable: addon_knobs_1.boolean('Searchable', true), isInValid: addon_knobs_1.boolean('Is invalid', true) })); };
245
- exports.SearchableInvalid = SearchableInvalid;
246
- var SearchableMultiSelect = function () { return (react_1.default.createElement(DropDownList_1.Dropdown, { list: utils_1.toOptions(addon_knobs_1.array('List', ['Green', 'Red', 'Blue'])), searchable: addon_knobs_1.boolean('Searchable', true), isInValid: addon_knobs_1.boolean('Is invalid', true) })); };
247
- exports.SearchableMultiSelect = SearchableMultiSelect;
248
- var MultiSelectDropdownList = function () { return react_1.default.createElement(MultiSelectComponent, null); };
249
- exports.MultiSelectDropdownList = MultiSelectDropdownList;
250
- var MultiSelectSearchableDropdownList = function () { return react_1.default.createElement(MultiSelectSearchableComponent, null); };
251
- exports.MultiSelectSearchableDropdownList = MultiSelectSearchableDropdownList;
252
- var MultiSelectSearchableDropdownListWithChip = function () { return react_1.default.createElement(MultiSelectSearchableComponentWithChips, null); };
253
- exports.MultiSelectSearchableDropdownListWithChip = MultiSelectSearchableDropdownListWithChip;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { LoadingDots } from './LoadingDots';
3
- declare const _default: {
4
- title: string;
5
- component: typeof LoadingDots;
6
- };
7
- export default _default;
8
- export declare const Default: () => JSX.Element;
9
- export declare const withLoadingText: () => JSX.Element;
10
- //# sourceMappingURL=LoadingDots.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingDots.stories.d.ts","sourceRoot":"","sources":["../../../src/LoadingDots/LoadingDots.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;;;;AAE5C,wBAGE;AAEF,eAAO,MAAM,OAAO,mBAAwB,CAAC;AAE7C,eAAO,MAAM,eAAe,mBAAuD,CAAC"}
@@ -1,16 +0,0 @@
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.withLoadingText = exports.Default = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var LoadingDots_1 = require("./LoadingDots");
9
- exports.default = {
10
- title: 'Components/Loading Dots',
11
- component: LoadingDots_1.LoadingDots,
12
- };
13
- var Default = function () { return react_1.default.createElement(LoadingDots_1.LoadingDots, null); };
14
- exports.Default = Default;
15
- var withLoadingText = function () { return react_1.default.createElement(LoadingDots_1.LoadingDots, { message: "Some basic text here" }); };
16
- exports.withLoadingText = withLoadingText;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { LoadingIndicator } from './LoadingIndicator';
3
- declare const _default: {
4
- title: string;
5
- Component: typeof LoadingIndicator;
6
- };
7
- export default _default;
8
- export declare const ExtraSmall: () => JSX.Element;
9
- export declare const Small: () => JSX.Element;
10
- export declare const Large: () => JSX.Element;
11
- //# sourceMappingURL=LoadingIndicator.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingIndicator.stories.d.ts","sourceRoot":"","sources":["../../../src/LoadingIndicator/LoadingIndicator.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;;;;;AAEtD,wBAGE;AAEF,eAAO,MAAM,UAAU,mBAAmD,CAAC;AAC3E,eAAO,MAAM,KAAK,mBAAmD,CAAC;AACtE,eAAO,MAAM,KAAK,mBAAmD,CAAC"}
@@ -1,18 +0,0 @@
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.Large = exports.Small = exports.ExtraSmall = void 0;
7
- var react_1 = __importDefault(require("react"));
8
- var LoadingIndicator_1 = require("./LoadingIndicator");
9
- exports.default = {
10
- title: 'Components/LoadingIndicator',
11
- Component: LoadingIndicator_1.LoadingIndicator,
12
- };
13
- var ExtraSmall = function () { return react_1.default.createElement(LoadingIndicator_1.LoadingIndicator, { show: true, size: "xs" }); };
14
- exports.ExtraSmall = ExtraSmall;
15
- var Small = function () { return react_1.default.createElement(LoadingIndicator_1.LoadingIndicator, { show: true, size: "sm" }); };
16
- exports.Small = Small;
17
- var Large = function () { return react_1.default.createElement(LoadingIndicator_1.LoadingIndicator, { show: true, size: "lg" }); };
18
- exports.Large = Large;
@@ -1,20 +0,0 @@
1
- /// <reference types="react" />
2
- import { PFTable } from './index';
3
- declare const _default: {
4
- title: string;
5
- component: typeof PFTable;
6
- decorators: ((...args: any) => any)[];
7
- };
8
- export default _default;
9
- export declare const Default: {
10
- (): JSX.Element;
11
- story: {
12
- parameters: {
13
- notes: {
14
- markdown: any;
15
- };
16
- };
17
- };
18
- };
19
- export declare const empty: () => JSX.Element;
20
- //# sourceMappingURL=PFTable.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PFTable.stories.d.ts","sourceRoot":"","sources":["../../../src/Table/PFTable.stories.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAW,OAAO,EAAS,MAAM,SAAS,CAAC;;;;;;AAIlD,wBAIE;AAqDF,eAAO,MAAM,OAAO;;;;;;;;;CAanB,CAAC;AAEF,eAAO,MAAM,KAAK,mBAajB,CAAC"}
@@ -1,81 +0,0 @@
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.empty = exports.Default = void 0;
7
- var addon_actions_1 = require("@storybook/addon-actions");
8
- var addon_knobs_1 = require("@storybook/addon-knobs");
9
- var react_1 = __importDefault(require("react"));
10
- var index_1 = require("./index");
11
- // @ts-ignore
12
- var README_md_1 = __importDefault(require("./README.md"));
13
- exports.default = {
14
- title: 'Components/PFTable',
15
- component: index_1.PFTable,
16
- decorators: [addon_knobs_1.withKnobs],
17
- };
18
- var columnsData = [
19
- {
20
- id: 'repo',
21
- title: 'Repositories',
22
- sortable: true,
23
- accessor: function (data) { return data.repo; },
24
- },
25
- {
26
- id: 'branch',
27
- title: 'Branches',
28
- accessor: function (data) { return data.branch; },
29
- },
30
- {
31
- id: 'pr',
32
- title: 'Pull requests',
33
- accessor: function (data) { return data.pr; },
34
- },
35
- {
36
- id: 'workspace',
37
- title: 'Workspaces',
38
- accessor: function (data) { return data.workspace; },
39
- },
40
- ];
41
- var tableData = [
42
- {
43
- repo: 'Repo one',
44
- branch: 'Branch one',
45
- pr: ' Pull Request one',
46
- workspace: 'Workspace one',
47
- },
48
- {
49
- repo: 'Repo two',
50
- branch: 'Branch two',
51
- pr: ' Pull Request two',
52
- workspace: 'Workspace two',
53
- },
54
- {
55
- repo: 'Repo three',
56
- branch: 'Branch three',
57
- pr: ' Pull Request three',
58
- workspace: 'Workspace three',
59
- },
60
- {
61
- repo: 'Repo four',
62
- branch: 'Branch four',
63
- pr: ' Pull Request four',
64
- workspace: 'Workspace four',
65
- },
66
- ];
67
- var Default = function () { return (react_1.default.createElement(react_1.default.Fragment, null,
68
- react_1.default.createElement(index_1.Table, { columns: columnsData, data: tableData },
69
- react_1.default.createElement(index_1.PFTable, { "aria-label": "case-list", className: "case-list-table", pagination: false, onRowClick: addon_actions_1.action('row clicked'), onSortChange: addon_actions_1.action('sort clicked'), onSelect: addon_actions_1.action('on Select') })))); };
70
- exports.Default = Default;
71
- var empty = function () { return (react_1.default.createElement(react_1.default.Fragment, null,
72
- react_1.default.createElement(index_1.Table, { columns: columnsData, data: [] },
73
- react_1.default.createElement(index_1.PFTable, { "aria-label": "case-list", className: "case-list-table", pagination: false, onRowClick: addon_actions_1.action('row clicked'), onSortChange: addon_actions_1.action('sort clicked'), onSelect: addon_actions_1.action('on Select') })))); };
74
- exports.empty = empty;
75
- exports.Default.story = {
76
- parameters: {
77
- notes: {
78
- markdown: README_md_1.default,
79
- },
80
- },
81
- };
@@ -1,3 +0,0 @@
1
- .demo-class {
2
- color: red;
3
- }