quantum-component-library 0.0.1 → 1.0.0-alpha.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/README.md +115 -69
- package/dist/babel-vendor-BOM86iTb.js +221 -0
- package/dist/babel-vendor-cKvSpnBp.cjs +3 -0
- package/dist/components/activity-list/index.d.ts +19 -0
- package/dist/components/copy-activity-form/index.d.ts +30 -0
- package/dist/components/copy-activity-form/index.stories.d.ts +6 -0
- package/dist/components/copy-module-form/index.d.ts +30 -0
- package/dist/components/copy-module-form/index.stories.d.ts +6 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/module-form/index.d.ts +15 -0
- package/dist/components/parameter-edit-list/index.d.ts +13 -0
- package/dist/components/parameter-edit-select/index.d.ts +16 -0
- package/dist/components/test-filter-panel/index.d.ts +7 -0
- package/dist/components/ui/form/index.d.ts +4 -0
- package/dist/components/ui/form/label/index.d.ts +4 -0
- package/dist/components/ui/form/list-order-input/index.d.ts +14 -0
- package/dist/components/ui/form/radio-buttons/index.d.ts +16 -0
- package/dist/components/ui/form/range-slider-input/index.d.ts +17 -0
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/tag-group/index.d.ts +7 -0
- package/dist/components/upsert-activity-form/index.d.ts +18 -0
- package/dist/components/upsert-activity-form/index.stories.d.ts +6 -0
- package/dist/components/upsert-module-form/index.d.ts +17 -0
- package/dist/components/upsert-module-form/index.stories.d.ts +6 -0
- package/dist/components.cjs +13 -0
- package/dist/components.js +2078 -0
- package/dist/dnd-core-vendor-bgjKfDi6.cjs +1 -0
- package/dist/dnd-core-vendor-q7mfiuVu.js +750 -0
- package/dist/generated/fragment-masking.d.ts +19 -0
- package/dist/generated/gql.d.ts +271 -0
- package/dist/generated/graphql.d.ts +2326 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated-ChsGaiYd.cjs +1 -0
- package/dist/generated-GfcSQz21.js +65 -0
- package/dist/graphql/fragments/actions.d.ts +1 -0
- package/dist/graphql/fragments/analysis.d.ts +12 -0
- package/dist/graphql/fragments/groups.d.ts +1 -0
- package/dist/graphql/fragments/index.d.ts +6 -0
- package/dist/graphql/fragments/modules.d.ts +3 -0
- package/dist/graphql/fragments/playback.d.ts +11 -0
- package/dist/graphql/fragments/session.d.ts +3 -0
- package/dist/graphql/index.d.ts +3 -0
- package/dist/graphql/mutations/actions.d.ts +7 -0
- package/dist/graphql/mutations/index.d.ts +2 -0
- package/dist/graphql/mutations/modules.d.ts +13 -0
- package/dist/graphql/queries/actions.d.ts +19 -0
- package/dist/graphql/queries/groups.d.ts +9 -0
- package/dist/graphql/queries/index.d.ts +3 -0
- package/dist/graphql/queries/modules.d.ts +9 -0
- package/dist/graphql-CqPvuCvr.cjs +679 -0
- package/dist/graphql-DiUes2Np.js +735 -0
- package/dist/graphql-vendor-JsvuUrRs.cjs +14 -0
- package/dist/graphql-vendor-YnA_qhJA.js +669 -0
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.js +84 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +132 -3159
- package/dist/lib/hooks/index.d.ts +7 -0
- package/dist/lib/hooks/use-graphql-client.d.ts +5 -0
- package/dist/lib/hooks/use-joints-for-limb-ids.d.ts +2 -0
- package/dist/lib/hooks/use-joints-for-sensor-locations.d.ts +2 -0
- package/dist/lib/hooks/use-limbs-for-sensor-locations.d.ts +2 -0
- package/dist/lib/hooks/use-part-options-for-joints.d.ts +3 -0
- package/dist/lib/hooks/use-part-options-for-limbs.d.ts +3 -0
- package/dist/lib/hooks/use-part-options-for-sensor-locations.d.ts +3 -0
- package/dist/lib/services/human.d.ts +69 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/rom.json.d.ts +226 -0
- package/dist/lib/types/activity.d.ts +19 -0
- package/dist/lib/types/analysis.d.ts +115 -0
- package/dist/lib/types/athlete.d.ts +8 -0
- package/dist/lib/types/catalog.d.ts +35 -0
- package/dist/lib/types/error.d.ts +4 -0
- package/dist/lib/types/human-part.d.ts +23 -0
- package/dist/lib/types/human.d.ts +147 -0
- package/dist/lib/types/index.d.ts +14 -0
- package/dist/lib/types/parameters.d.ts +10 -0
- package/dist/lib/types/playback.d.ts +20 -0
- package/dist/lib/types/recording.d.ts +5 -0
- package/dist/lib/types/sensor-info.d.ts +105 -0
- package/dist/lib/types/threshold.d.ts +30 -0
- package/dist/lib/types/tracking.d.ts +82 -0
- package/dist/lib/types/upload.d.ts +28 -0
- package/dist/lib/utils/conversion.d.ts +27 -0
- package/dist/lib/utils/index.d.ts +6 -0
- package/dist/lib/utils/memo.d.ts +7 -0
- package/dist/lib/utils/parameters.d.ts +6 -0
- package/dist/lib/utils/text.d.ts +2 -0
- package/dist/lodash-vendor-D5A6v3mw.cjs +1 -0
- package/dist/lodash-vendor-Dz4vW7Gd.js +1120 -0
- package/dist/other-CmpBz5tg.js +15 -0
- package/dist/other-TR0ap-t4.cjs +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/quantum-library-provider.d.ts +8 -0
- package/dist/providers.cjs +1 -0
- package/dist/providers.js +11 -0
- package/dist/quantum-component-library.css +1 -0
- package/dist/react-dnd-vendor-BWqlt2EC.cjs +2 -0
- package/dist/react-dnd-vendor-BZs2igAJ.js +1375 -0
- package/dist/react-icons-vendor-D2s8zw9h.cjs +1 -0
- package/dist/react-icons-vendor-TETORdU9.js +119 -0
- package/dist/react-select-vendor-By3h6JjH.cjs +4 -0
- package/dist/react-select-vendor-eBH7yy3O.js +2801 -0
- package/dist/services.cjs +1 -0
- package/dist/services.js +810 -0
- package/dist/styled-components-vendor-Bvwhddj9.js +1154 -0
- package/dist/styled-components-vendor-D09ATioU.cjs +60 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +316 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +128 -0
- package/dist/vendor-BeqUcSbw.cjs +45 -0
- package/dist/vendor-DvX9OX-j.js +7876 -0
- package/package.json +118 -60
- package/dist/components/ui/button.d.ts +0 -10
- package/dist/index.css +0 -1
- package/dist/index.umd.cjs +0 -22
- package/dist/lib/utils.d.ts +0 -2
package/README.md
CHANGED
|
@@ -1,69 +1,115 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
# Quantum Component Library
|
|
2
|
+
|
|
3
|
+
A modular React component library built with TypeScript and Vite, featuring code splitting for optimal bundle sizes.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install quantum-component-library
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Full Library Import (Default)
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// Import everything (not recommended for production)
|
|
17
|
+
import * from 'quantum-component-library';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Modular Imports (Recommended)
|
|
21
|
+
|
|
22
|
+
The library is split into several modules for optimal tree-shaking and bundle sizes:
|
|
23
|
+
|
|
24
|
+
#### Components
|
|
25
|
+
```typescript
|
|
26
|
+
// Import only UI components
|
|
27
|
+
import { UpsertActivityForm, ParameterEditList } from 'quantum-component-library/components';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Hooks
|
|
31
|
+
```typescript
|
|
32
|
+
// Import only custom hooks
|
|
33
|
+
import { useGraphqlClient, useJointsForLimbIds } from 'quantum-component-library/hooks';
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Types
|
|
37
|
+
```typescript
|
|
38
|
+
// Import only type definitions
|
|
39
|
+
import type { Activity, Analysis, Human } from 'quantum-component-library/types';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Authentication
|
|
43
|
+
```typescript
|
|
44
|
+
// Import only auth utilities
|
|
45
|
+
import { useAuthContext, useIsAuthenticated } from 'quantum-component-library/auth';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### GraphQL
|
|
49
|
+
```typescript
|
|
50
|
+
// Import only GraphQL fragments and operations
|
|
51
|
+
import { ActivityFragment, SessionQueries } from 'quantum-component-library/graphql';
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Generated GraphQL Code
|
|
55
|
+
```typescript
|
|
56
|
+
// Import only generated GraphQL types and utilities
|
|
57
|
+
import { FragmentMasking, gql } from 'quantum-component-library/generated';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Utilities
|
|
61
|
+
```typescript
|
|
62
|
+
// Import only utility functions
|
|
63
|
+
import { convertUnits, memoizeWithExpiry } from 'quantum-component-library/utils';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Services
|
|
67
|
+
```typescript
|
|
68
|
+
// Import only service functions
|
|
69
|
+
import { humanService } from 'quantum-component-library/services';
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Code Splitting Benefits
|
|
73
|
+
|
|
74
|
+
- **Reduced Bundle Size**: Import only what you need
|
|
75
|
+
- **Better Tree Shaking**: Webpack and other bundlers can eliminate unused code more effectively
|
|
76
|
+
- **Faster Loading**: Smaller initial bundles load faster
|
|
77
|
+
- **Better Caching**: Changes to one module don't invalidate others
|
|
78
|
+
|
|
79
|
+
## Build Configuration
|
|
80
|
+
|
|
81
|
+
This library uses Vite with multiple entry points and manual chunk splitting:
|
|
82
|
+
|
|
83
|
+
- **Multiple Entry Points**: Each module has its own entry point for granular imports
|
|
84
|
+
- **Manual Chunk Splitting**: Vendor dependencies are split into logical chunks (UI, GraphQL, React, etc.)
|
|
85
|
+
- **Automatic Type Generation**: TypeScript definitions are generated for all entry points
|
|
86
|
+
|
|
87
|
+
### Available Modules
|
|
88
|
+
|
|
89
|
+
| Module | Entry Point | Description |
|
|
90
|
+
|--------|-------------|-------------|
|
|
91
|
+
| `components` | `src/components/index.ts` | UI components |
|
|
92
|
+
| `hooks` | `src/lib/hooks/index.ts` | Custom React hooks |
|
|
93
|
+
| `types` | `src/lib/types/index.ts` | TypeScript type definitions |
|
|
94
|
+
| `auth` | `src/lib/auth/index.ts` | Authentication utilities |
|
|
95
|
+
| `graphql` | `src/graphql/index.ts` | GraphQL fragments and operations |
|
|
96
|
+
| `generated` | `src/generated/index.ts` | Generated GraphQL code |
|
|
97
|
+
| `utils` | `src/lib/utils/index.ts` | Utility functions |
|
|
98
|
+
| `services` | `src/lib/services/index.ts` | Service functions |
|
|
99
|
+
|
|
100
|
+
## Development
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Install dependencies
|
|
104
|
+
npm install
|
|
105
|
+
|
|
106
|
+
# Start development server
|
|
107
|
+
npm run dev
|
|
108
|
+
|
|
109
|
+
# Build the library
|
|
110
|
+
npm run build
|
|
111
|
+
|
|
112
|
+
# Build for specific environments
|
|
113
|
+
npm run build:admin-prod
|
|
114
|
+
npm run build:client-qa
|
|
115
|
+
```
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
function i(t) {
|
|
2
|
+
"@babel/helpers - typeof";
|
|
3
|
+
return i = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
4
|
+
return typeof e;
|
|
5
|
+
} : function(e) {
|
|
6
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
7
|
+
}, i(t);
|
|
8
|
+
}
|
|
9
|
+
function g(t, e) {
|
|
10
|
+
if (i(t) != "object" || !t) return t;
|
|
11
|
+
var r = t[Symbol.toPrimitive];
|
|
12
|
+
if (r !== void 0) {
|
|
13
|
+
var n = r.call(t, e);
|
|
14
|
+
if (i(n) != "object") return n;
|
|
15
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16
|
+
}
|
|
17
|
+
return (e === "string" ? String : Number)(t);
|
|
18
|
+
}
|
|
19
|
+
function v(t) {
|
|
20
|
+
var e = g(t, "string");
|
|
21
|
+
return i(e) == "symbol" ? e : e + "";
|
|
22
|
+
}
|
|
23
|
+
function _(t, e, r) {
|
|
24
|
+
return (e = v(e)) in t ? Object.defineProperty(t, e, {
|
|
25
|
+
value: r,
|
|
26
|
+
enumerable: !0,
|
|
27
|
+
configurable: !0,
|
|
28
|
+
writable: !0
|
|
29
|
+
}) : t[e] = r, t;
|
|
30
|
+
}
|
|
31
|
+
function p(t, e) {
|
|
32
|
+
var r = Object.keys(t);
|
|
33
|
+
if (Object.getOwnPropertySymbols) {
|
|
34
|
+
var n = Object.getOwnPropertySymbols(t);
|
|
35
|
+
e && (n = n.filter(function(o) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(t, o).enumerable;
|
|
37
|
+
})), r.push.apply(r, n);
|
|
38
|
+
}
|
|
39
|
+
return r;
|
|
40
|
+
}
|
|
41
|
+
function x(t) {
|
|
42
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
43
|
+
var r = arguments[e] != null ? arguments[e] : {};
|
|
44
|
+
e % 2 ? p(Object(r), !0).forEach(function(n) {
|
|
45
|
+
_(t, n, r[n]);
|
|
46
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : p(Object(r)).forEach(function(n) {
|
|
47
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return t;
|
|
51
|
+
}
|
|
52
|
+
function w(t) {
|
|
53
|
+
if (Array.isArray(t)) return t;
|
|
54
|
+
}
|
|
55
|
+
function P(t, e) {
|
|
56
|
+
var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
57
|
+
if (r != null) {
|
|
58
|
+
var n, o, a, l, f = [], u = !0, b = !1;
|
|
59
|
+
try {
|
|
60
|
+
if (a = (r = r.call(t)).next, e === 0) {
|
|
61
|
+
if (Object(r) !== r) return;
|
|
62
|
+
u = !1;
|
|
63
|
+
} else for (; !(u = (n = a.call(r)).done) && (f.push(n.value), f.length !== e); u = !0) ;
|
|
64
|
+
} catch (j) {
|
|
65
|
+
b = !0, o = j;
|
|
66
|
+
} finally {
|
|
67
|
+
try {
|
|
68
|
+
if (!u && r.return != null && (l = r.return(), Object(l) !== l)) return;
|
|
69
|
+
} finally {
|
|
70
|
+
if (b) throw o;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return f;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function s(t, e) {
|
|
77
|
+
(e == null || e > t.length) && (e = t.length);
|
|
78
|
+
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
79
|
+
return n;
|
|
80
|
+
}
|
|
81
|
+
function d(t, e) {
|
|
82
|
+
if (t) {
|
|
83
|
+
if (typeof t == "string") return s(t, e);
|
|
84
|
+
var r = {}.toString.call(t).slice(8, -1);
|
|
85
|
+
return r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set" ? Array.from(t) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? s(t, e) : void 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function S() {
|
|
89
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
90
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
91
|
+
}
|
|
92
|
+
function k(t, e) {
|
|
93
|
+
return w(t) || P(t, e) || d(t, e) || S();
|
|
94
|
+
}
|
|
95
|
+
function A(t, e) {
|
|
96
|
+
if (t == null) return {};
|
|
97
|
+
var r = {};
|
|
98
|
+
for (var n in t) if ({}.hasOwnProperty.call(t, n)) {
|
|
99
|
+
if (e.indexOf(n) !== -1) continue;
|
|
100
|
+
r[n] = t[n];
|
|
101
|
+
}
|
|
102
|
+
return r;
|
|
103
|
+
}
|
|
104
|
+
function D(t, e) {
|
|
105
|
+
if (t == null) return {};
|
|
106
|
+
var r, n, o = A(t, e);
|
|
107
|
+
if (Object.getOwnPropertySymbols) {
|
|
108
|
+
var a = Object.getOwnPropertySymbols(t);
|
|
109
|
+
for (n = 0; n < a.length; n++) r = a[n], e.indexOf(r) === -1 && {}.propertyIsEnumerable.call(t, r) && (o[r] = t[r]);
|
|
110
|
+
}
|
|
111
|
+
return o;
|
|
112
|
+
}
|
|
113
|
+
function m() {
|
|
114
|
+
return m = Object.assign ? Object.assign.bind() : function(t) {
|
|
115
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
116
|
+
var r = arguments[e];
|
|
117
|
+
for (var n in r) ({}).hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
118
|
+
}
|
|
119
|
+
return t;
|
|
120
|
+
}, m.apply(null, arguments);
|
|
121
|
+
}
|
|
122
|
+
function L(t, e) {
|
|
123
|
+
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
124
|
+
}
|
|
125
|
+
function O(t, e) {
|
|
126
|
+
for (var r = 0; r < e.length; r++) {
|
|
127
|
+
var n = e[r];
|
|
128
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, v(n.key), n);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function W(t, e, r) {
|
|
132
|
+
return e && O(t.prototype, e), r && O(t, r), Object.defineProperty(t, "prototype", {
|
|
133
|
+
writable: !1
|
|
134
|
+
}), t;
|
|
135
|
+
}
|
|
136
|
+
function y(t, e) {
|
|
137
|
+
return y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, n) {
|
|
138
|
+
return r.__proto__ = n, r;
|
|
139
|
+
}, y(t, e);
|
|
140
|
+
}
|
|
141
|
+
function z(t, e) {
|
|
142
|
+
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
143
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
144
|
+
constructor: {
|
|
145
|
+
value: t,
|
|
146
|
+
writable: !0,
|
|
147
|
+
configurable: !0
|
|
148
|
+
}
|
|
149
|
+
}), Object.defineProperty(t, "prototype", {
|
|
150
|
+
writable: !1
|
|
151
|
+
}), e && y(t, e);
|
|
152
|
+
}
|
|
153
|
+
function c(t) {
|
|
154
|
+
return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
155
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
156
|
+
}, c(t);
|
|
157
|
+
}
|
|
158
|
+
function h() {
|
|
159
|
+
try {
|
|
160
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
161
|
+
}));
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
164
|
+
return (h = function() {
|
|
165
|
+
return !!t;
|
|
166
|
+
})();
|
|
167
|
+
}
|
|
168
|
+
function T(t) {
|
|
169
|
+
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
170
|
+
return t;
|
|
171
|
+
}
|
|
172
|
+
function E(t, e) {
|
|
173
|
+
if (e && (i(e) == "object" || typeof e == "function")) return e;
|
|
174
|
+
if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
175
|
+
return T(t);
|
|
176
|
+
}
|
|
177
|
+
function N(t) {
|
|
178
|
+
var e = h();
|
|
179
|
+
return function() {
|
|
180
|
+
var r, n = c(t);
|
|
181
|
+
if (e) {
|
|
182
|
+
var o = c(this).constructor;
|
|
183
|
+
r = Reflect.construct(n, arguments, o);
|
|
184
|
+
} else r = n.apply(this, arguments);
|
|
185
|
+
return E(this, r);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function I(t) {
|
|
189
|
+
if (Array.isArray(t)) return s(t);
|
|
190
|
+
}
|
|
191
|
+
function C(t) {
|
|
192
|
+
if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
|
|
193
|
+
}
|
|
194
|
+
function R() {
|
|
195
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
196
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
197
|
+
}
|
|
198
|
+
function B(t) {
|
|
199
|
+
return I(t) || C(t) || d(t) || R();
|
|
200
|
+
}
|
|
201
|
+
function H(t, e) {
|
|
202
|
+
return e || (e = t.slice(0)), Object.freeze(Object.defineProperties(t, {
|
|
203
|
+
raw: {
|
|
204
|
+
value: Object.freeze(e)
|
|
205
|
+
}
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
export {
|
|
209
|
+
D as _,
|
|
210
|
+
k as a,
|
|
211
|
+
x as b,
|
|
212
|
+
i as c,
|
|
213
|
+
_ as d,
|
|
214
|
+
m as e,
|
|
215
|
+
H as f,
|
|
216
|
+
z as g,
|
|
217
|
+
N as h,
|
|
218
|
+
W as i,
|
|
219
|
+
L as j,
|
|
220
|
+
B as k
|
|
221
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";function i(e){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(e)}function g(e,t){if(i(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d(e){var t=g(e,"string");return i(t)=="symbol"?t:t+""}function _(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(n){_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w(e){if(Array.isArray(e))return e}function S(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,u,l,f=[],a=!0,b=!1;try{if(u=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=u.call(r)).done)&&(f.push(n.value),f.length!==t);a=!0);}catch(j){b=!0,o=j}finally{try{if(!a&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(b)throw o}}return f}}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){if(e){if(typeof e=="string")return s(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function A(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(e,t){return w(e)||S(e,t)||v(e,t)||A()}function C(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function E(e,t){if(e==null)return{};var r,n,o=C(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(null,arguments)}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d(n.key),n)}}function R(e,t,r){return t&&O(e.prototype,t),r&&O(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},p(e,t)}function x(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h=function(){return!!e})()}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e,t){if(t&&(i(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k(e)}function L(e){var t=h();return function(){var r,n=c(e);if(t){var o=c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function W(e){if(Array.isArray(e))return s(e)}function z(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e){return W(e)||z(e)||v(e)||N()}function H(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}exports._classCallCheck=I;exports._createClass=R;exports._createSuper=L;exports._defineProperty=_;exports._extends=y;exports._inherits=x;exports._objectSpread2=P;exports._objectWithoutProperties=E;exports._slicedToArray=T;exports._taggedTemplateLiteral=H;exports._toConsumableArray=B;exports._typeof=i;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AssessmentActionFragment } from '../../generated/graphql';
|
|
2
|
+
import { BoxProps, TableContainerProps } from '@chakra-ui/react';
|
|
3
|
+
export type ActivityListProps = {
|
|
4
|
+
actions: Array<AssessmentActionFragment & {
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
totalActions?: number;
|
|
8
|
+
onCreate?: () => void;
|
|
9
|
+
onEdit?: (id: string) => void;
|
|
10
|
+
onDelete?: (ids: string[]) => void;
|
|
11
|
+
onSelected?: (action: AssessmentActionFragment, selected: boolean) => void;
|
|
12
|
+
onDuplicate?: (ids: string[]) => void;
|
|
13
|
+
disableMultiSelect?: boolean;
|
|
14
|
+
disableDelete?: boolean;
|
|
15
|
+
disableEdit?: boolean;
|
|
16
|
+
disableCreate?: boolean;
|
|
17
|
+
tableProps?: TableContainerProps;
|
|
18
|
+
} & BoxProps;
|
|
19
|
+
export declare const ActivityList: ({ actions, totalActions, onCreate, onDelete, onEdit, onSelected, onDuplicate, disableMultiSelect, disableDelete, disableEdit, disableCreate, tableProps, ...containerProps }: ActivityListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CopyActivityFormProps {
|
|
3
|
+
/** Callback when activity is successfully copied */
|
|
4
|
+
onSave?: () => void;
|
|
5
|
+
/** Callback when user cancels the operation */
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
/** Callback when an error occurs */
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
/** Hide the built-in action buttons */
|
|
10
|
+
hideButtons?: boolean;
|
|
11
|
+
/** Custom button configurations */
|
|
12
|
+
setButtonDisabled?: (config: {
|
|
13
|
+
cancelButton: boolean;
|
|
14
|
+
saveButton: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
setButtonOnClick?: (config: {
|
|
17
|
+
cancelButton: () => void;
|
|
18
|
+
saveButton: () => void;
|
|
19
|
+
}) => void;
|
|
20
|
+
quantumOwned?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Form component for copying activities (actions) from one group.
|
|
24
|
+
*
|
|
25
|
+
* The workflow is:
|
|
26
|
+
* 1. Select a source group
|
|
27
|
+
* 2. Select activities from available actions to copy
|
|
28
|
+
* 3. Copy creates new activities with same fields but no ID
|
|
29
|
+
*/
|
|
30
|
+
export declare const CopyActivityForm: React.FC<CopyActivityFormProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CopyModuleFormProps {
|
|
3
|
+
/** Callback when module is successfully copied */
|
|
4
|
+
onSave?: () => void;
|
|
5
|
+
/** Callback when user cancels the operation */
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
/** Callback when an error occurs */
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
/** Hide the built-in action buttons */
|
|
10
|
+
hideButtons?: boolean;
|
|
11
|
+
/** Custom button configurations */
|
|
12
|
+
setButtonDisabled?: (config: {
|
|
13
|
+
cancelButton: boolean;
|
|
14
|
+
saveButton: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
setButtonOnClick?: (config: {
|
|
17
|
+
cancelButton: () => void;
|
|
18
|
+
saveButton: () => void;
|
|
19
|
+
}) => void;
|
|
20
|
+
quantumOwned?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Form component for copying modules from one group.
|
|
24
|
+
*
|
|
25
|
+
* The workflow is:
|
|
26
|
+
* 1. Select a source group
|
|
27
|
+
* 2. Select a module from that group to copy
|
|
28
|
+
* 3. Copy creates a new module with same fields but no ID
|
|
29
|
+
*/
|
|
30
|
+
export declare const CopyModuleForm: React.FC<CopyModuleFormProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './activity-list';
|
|
2
|
+
export * from './copy-activity-form';
|
|
3
|
+
export * from './copy-module-form';
|
|
4
|
+
export * from './module-form';
|
|
5
|
+
export * from './parameter-edit-list';
|
|
6
|
+
export * from './parameter-edit-select';
|
|
7
|
+
export * from './upsert-activity-form';
|
|
8
|
+
export * from './upsert-module-form';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AssessmentActionFragment, LibraryModuleCategoryFragment } from '../../generated/graphql';
|
|
2
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
3
|
+
export type ModuleFormProps = {
|
|
4
|
+
name?: string;
|
|
5
|
+
setName: (name: string) => void;
|
|
6
|
+
actions: AssessmentActionFragment[];
|
|
7
|
+
selectedActionIds: string[];
|
|
8
|
+
setSelectedActionIds: (ids: string[]) => void;
|
|
9
|
+
availableCategories: LibraryModuleCategoryFragment[];
|
|
10
|
+
selectedCategoryIds: string[];
|
|
11
|
+
setSelectedCategoryIds: (ids: string[]) => void;
|
|
12
|
+
description?: string;
|
|
13
|
+
setDescription?: (description: string) => void;
|
|
14
|
+
} & BoxProps;
|
|
15
|
+
export declare const ModuleForm: ({ name, setName, actions, selectedActionIds, setSelectedActionIds, availableCategories, selectedCategoryIds, setSelectedCategoryIds, description, setDescription, ...containerProps }: ModuleFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ThresholdKind } from '../../generated/graphql';
|
|
2
|
+
import { PartParameter } from '../../lib/types/parameters';
|
|
3
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
4
|
+
type Props = Omit<BoxProps, "value" | "onChange"> & {
|
|
5
|
+
value: PartParameter[];
|
|
6
|
+
forceKind?: ThresholdKind;
|
|
7
|
+
disableKind?: boolean;
|
|
8
|
+
disableRemove?: boolean;
|
|
9
|
+
lockRanges?: boolean;
|
|
10
|
+
onChange: (v: PartParameter[]) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const ParameterEditList: ({ value, onChange, forceKind, disableRemove, disableKind, lockRanges, ...container }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ThresholdKind } from '../../generated/graphql';
|
|
2
|
+
import { PartParameter } from '../../lib/types/parameters';
|
|
3
|
+
import { BoxProps } from '@chakra-ui/react';
|
|
4
|
+
type Props = Omit<BoxProps, "value" | "onChange"> & {
|
|
5
|
+
options: Omit<PartParameter, "kind">[];
|
|
6
|
+
value: PartParameter[];
|
|
7
|
+
forceKind?: ThresholdKind;
|
|
8
|
+
disableKind?: boolean;
|
|
9
|
+
editOnly?: boolean;
|
|
10
|
+
singleValue?: boolean;
|
|
11
|
+
singleValueSideless?: boolean;
|
|
12
|
+
maxParameters?: number;
|
|
13
|
+
onChange: (v: PartParameter[]) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const ParameterEditSelect: ({ options, value, onChange, forceKind, singleValue, singleValueSideless, editOnly, disableKind, maxParameters: maxParametersProp, ...containerProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Action } from '../../generated/graphql';
|
|
2
|
+
export interface ITestFilterPanelProps {
|
|
3
|
+
setSearch: (e: string) => void;
|
|
4
|
+
actions: Action[] | undefined;
|
|
5
|
+
updateUseCases: (ids: string[]) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TestFilterPanel: ({ setSearch, actions, updateUseCases, }: ITestFilterPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Item = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export type Props = {
|
|
6
|
+
value: Item[];
|
|
7
|
+
onChange: (cb: (prev: Item[]) => Item[]) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A component that allows adjusting the order of a list of items.
|
|
11
|
+
* It provides a drag-and-drop interface to reorder the items.
|
|
12
|
+
* This uses the react-dnd library to handle drag-and-drop functionality.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ListOrderInput: ({ value, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonProps } from '@chakra-ui/react';
|
|
2
|
+
export interface IRadioItem<T> {
|
|
3
|
+
label: string;
|
|
4
|
+
value: T;
|
|
5
|
+
tooltip?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface RadioButtonsProps<T> {
|
|
9
|
+
items: IRadioItem<T>[];
|
|
10
|
+
onChange: (item: IRadioItem<T>, index: number) => void;
|
|
11
|
+
selectedItem?: IRadioItem<T> | T;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
selectedProps?: ButtonProps;
|
|
14
|
+
buttonProps?: ButtonProps;
|
|
15
|
+
}
|
|
16
|
+
export declare const RadioButtons: <T>({ items, onChange, selectedItem, isDisabled, selectedProps, buttonProps, }: RadioButtonsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FlexProps, NumberInputProps, ResponsiveValue } from '@chakra-ui/react';
|
|
2
|
+
export type InputProps = Omit<NumberInputProps, "onChange" | "onFocus" | "min" | "max" | "value" | "size">;
|
|
3
|
+
export type RangeSliderInputProps = {
|
|
4
|
+
isReversed?: boolean;
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
onChange: (range: [number, number]) => void;
|
|
8
|
+
value?: [number, number];
|
|
9
|
+
size?: ResponsiveValue<string>;
|
|
10
|
+
inputProps?: InputProps;
|
|
11
|
+
zeroMarker?: boolean;
|
|
12
|
+
formatValue?: (value: number) => string;
|
|
13
|
+
valueLabel?: (value: number) => string;
|
|
14
|
+
positiveNegativeLabels?: [string, string];
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
} & Omit<FlexProps, "onChange">;
|
|
17
|
+
export declare const RangeSliderInput: React.FC<RangeSliderInputProps>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './form';
|
|
2
|
+
export * from './tag-group';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StackProps, TagProps } from '@chakra-ui/react';
|
|
2
|
+
export type TagGroupProps = Omit<TagProps & {
|
|
3
|
+
tags: string[];
|
|
4
|
+
}, "children"> & {
|
|
5
|
+
containerProps?: StackProps;
|
|
6
|
+
};
|
|
7
|
+
export declare const TagGroup: ({ tags, containerProps, ...rest }: TagGroupProps) => import("react/jsx-runtime").JSX.Element;
|