@darajs/ui-widgets 1.0.0-a.1 → 1.0.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/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -15
- package/dist/feature-list-editor/feature-dict-editor.d.ts +0 -40
- package/dist/feature-list-editor/feature-dict-editor.d.ts.map +0 -1
- package/dist/feature-list-editor/feature-dict-editor.js +0 -179
- package/dist/feature-list-editor/feature-dict-editor.js.map +0 -1
- package/dist/feature-list-editor/feature-list-editor.d.ts +0 -34
- package/dist/feature-list-editor/feature-list-editor.d.ts.map +0 -1
- package/dist/feature-list-editor/feature-list-editor.js +0 -69
- package/dist/feature-list-editor/feature-list-editor.js.map +0 -1
- package/dist/feature-list-editor/state.d.ts +0 -73
- package/dist/feature-list-editor/state.d.ts.map +0 -1
- package/dist/feature-list-editor/state.js +0 -102
- package/dist/feature-list-editor/state.js.map +0 -1
- package/dist/feature-list-editor/utils.d.ts +0 -23
- package/dist/feature-list-editor/utils.d.ts.map +0 -1
- package/dist/feature-list-editor/utils.js +0 -14
- package/dist/feature-list-editor/utils.js.map +0 -1
- package/dist/types.d.ts +0 -26
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export { default as FeatureListEditor } from './feature-list-editor/feature-list-editor';
|
|
18
17
|
export { default as ConfirmationModal } from './confirmation-modal/confirmation-modal';
|
|
19
|
-
export type { Operation, FeatureDict } from './types';
|
|
20
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yCAAyC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,5 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export { default as FeatureListEditor } from './feature-list-editor/feature-list-editor';
|
|
18
17
|
export { default as ConfirmationModal } from './confirmation-modal/confirmation-modal';
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yCAAyC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darajs/ui-widgets",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "The UI widgets built on top of UI components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"lint": "eslint src --ext .tsx --max-warnings 0 && stylelint './src/**/*.tsx'",
|
|
11
11
|
"lint:fix": "eslint src --ext .tsx --max-warnings 0 --fix",
|
|
12
12
|
"package": "yarn build && yarn publish --no-git-tag-version",
|
|
13
|
-
"test": "jest",
|
|
14
13
|
"test-watch": "jest --watch",
|
|
15
14
|
"storybook": "start-storybook -p 6006",
|
|
16
15
|
"build-storybook": "build-storybook"
|
|
@@ -21,9 +20,9 @@
|
|
|
21
20
|
"@babel/preset-env": "^7.15.6",
|
|
22
21
|
"@babel/preset-react": "^7.14.5",
|
|
23
22
|
"@babel/preset-typescript": "^7.15.0",
|
|
24
|
-
"@darajs/eslint-config": "1.0.0
|
|
25
|
-
"@darajs/prettier-config": "1.0.0
|
|
26
|
-
"@darajs/stylelint-config": "1.0.0
|
|
23
|
+
"@darajs/eslint-config": "^1.0.0",
|
|
24
|
+
"@darajs/prettier-config": "^1.0.0",
|
|
25
|
+
"@darajs/stylelint-config": "^1.0.0",
|
|
27
26
|
"@storybook/addon-a11y": "^6.5.16",
|
|
28
27
|
"@storybook/addon-actions": "^6.5.16",
|
|
29
28
|
"@storybook/addon-essentials": "^6.5.16",
|
|
@@ -37,27 +36,22 @@
|
|
|
37
36
|
"@testing-library/jest-dom": "^5.16.5",
|
|
38
37
|
"@testing-library/react": "^14.0.0",
|
|
39
38
|
"@testing-library/user-event": "^13.2.1",
|
|
40
|
-
"@types/jest": "^27.0.0",
|
|
41
39
|
"@types/styled-components": "^5.1.26",
|
|
42
40
|
"babel-jest": "^29.5.0",
|
|
43
41
|
"babel-loader": "^8.2.2",
|
|
44
42
|
"babel-plugin-styled-components": "^1.13.2",
|
|
45
43
|
"eslint": "^7.2.0",
|
|
46
|
-
"jest": "^29.5.0",
|
|
47
|
-
"jest-css-modules": "^2.1.0",
|
|
48
|
-
"jest-environment-jsdom": "^29.5.0",
|
|
49
44
|
"prettier": "2.4.1",
|
|
50
|
-
"react-test-renderer": "^17.0",
|
|
51
45
|
"rimraf": "^3.0.2",
|
|
52
46
|
"storybook-dark-mode": "^1.0.8",
|
|
53
47
|
"stylelint": "^13.5.0",
|
|
54
48
|
"typescript": "^5.0.4"
|
|
55
49
|
},
|
|
56
50
|
"dependencies": {
|
|
57
|
-
"@darajs/styled-components": "1.0.0
|
|
58
|
-
"@darajs/ui-components": "1.0.0
|
|
59
|
-
"@darajs/ui-icons": "1.0.0
|
|
60
|
-
"@darajs/ui-utils": "1.0.0
|
|
51
|
+
"@darajs/styled-components": "^1.0.0",
|
|
52
|
+
"@darajs/ui-components": "^1.0.0",
|
|
53
|
+
"@darajs/ui-icons": "^1.0.0",
|
|
54
|
+
"@darajs/ui-utils": "^1.0.0",
|
|
61
55
|
"immer": "^9.0.6",
|
|
62
56
|
"lodash": "4.17.21",
|
|
63
57
|
"nanoid": "^3.3.0",
|
|
@@ -73,5 +67,5 @@
|
|
|
73
67
|
"publishConfig": {
|
|
74
68
|
"access": "public"
|
|
75
69
|
},
|
|
76
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "05ad550a4dd61828edf6da2607ee969430f38d31"
|
|
77
71
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023 Impulse Innovations Limited
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { Dispatch } from 'react';
|
|
18
|
-
import { FeatureDict } from '../types';
|
|
19
|
-
import { FeatureListActions } from './state';
|
|
20
|
-
export interface FeatureDictEditorProps {
|
|
21
|
-
/**
|
|
22
|
-
* All available operations
|
|
23
|
-
*/
|
|
24
|
-
availableOperations: string[];
|
|
25
|
-
/**
|
|
26
|
-
* Dispatch callback for the reducer
|
|
27
|
-
*/
|
|
28
|
-
dispatch: Dispatch<FeatureListActions>;
|
|
29
|
-
/**
|
|
30
|
-
* Feature Dictionary being edited
|
|
31
|
-
*/
|
|
32
|
-
featureDict: FeatureDict;
|
|
33
|
-
/**
|
|
34
|
-
* UID of the feauture dict edited
|
|
35
|
-
*/
|
|
36
|
-
uid: string;
|
|
37
|
-
}
|
|
38
|
-
declare function FeatureDictEditor(props: FeatureDictEditorProps): JSX.Element;
|
|
39
|
-
export default FeatureDictEditor;
|
|
40
|
-
//# sourceMappingURL=feature-dict-editor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature-dict-editor.d.ts","sourceRoot":"","sources":["../../src/feature-list-editor/feature-dict-editor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAqB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAkIhE,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACvC;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAmJrE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from '@darajs/styled-components';
|
|
3
|
-
import { ComboBox, Input, NumericInput } from '@darajs/ui-components';
|
|
4
|
-
import { ArrowDown, ArrowUp, Cross, Plus } from '@darajs/ui-icons';
|
|
5
|
-
import { FeatureListAction } from './state';
|
|
6
|
-
import { ButtonRow, IconButton } from './utils';
|
|
7
|
-
const FeatureListWrapper = styled.div `
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
width: 100%;
|
|
11
|
-
`;
|
|
12
|
-
const FeatureDictProperties = styled.div `
|
|
13
|
-
display: flex;
|
|
14
|
-
gap: 2rem;
|
|
15
|
-
align-items: center;
|
|
16
|
-
|
|
17
|
-
width: 100%;
|
|
18
|
-
margin-bottom: 1px;
|
|
19
|
-
padding: 1rem;
|
|
20
|
-
|
|
21
|
-
background-color: ${(props) => props.theme.colors.grey1};
|
|
22
|
-
border-radius: 0.25rem;
|
|
23
|
-
`;
|
|
24
|
-
const OperationsWrapper = styled.div `
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: 1rem;
|
|
28
|
-
|
|
29
|
-
padding: 1rem;
|
|
30
|
-
|
|
31
|
-
background-color: ${(props) => props.theme.colors.grey1};
|
|
32
|
-
border-radius: 0.25rem;
|
|
33
|
-
`;
|
|
34
|
-
const OperationsHeader = styled.div `
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
|
|
39
|
-
h3 {
|
|
40
|
-
font-size: ${(props) => props.theme.font.size};
|
|
41
|
-
font-weight: normal;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
const ArrowUpButton = styled(ArrowUp) `
|
|
45
|
-
cursor: ${(props) => (props.$disabled ? 'not-allowed' : 'pointer')};
|
|
46
|
-
color: ${(props) => (props.$disabled ? props.theme.colors.grey3 : props.theme.colors.grey5)};
|
|
47
|
-
|
|
48
|
-
:hover {
|
|
49
|
-
color: ${(props) => (props.$disabled ? props.theme.colors.grey3 : props.theme.colors.grey6)};
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
const ArrowDownButton = styled(ArrowDown) `
|
|
53
|
-
cursor: ${(props) => (props.$disabled ? 'not-allowed' : 'pointer')};
|
|
54
|
-
color: ${(props) => (props.$disabled ? props.theme.colors.grey3 : props.theme.colors.grey5)};
|
|
55
|
-
|
|
56
|
-
:hover {
|
|
57
|
-
color: ${(props) => (props.$disabled ? props.theme.colors.grey3 : props.theme.colors.grey6)};
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
|
-
const OperationWrapper = styled.div `
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
gap: 1.5rem;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
|
|
66
|
-
padding: 1rem;
|
|
67
|
-
|
|
68
|
-
background-color: ${(props) => props.theme.colors.blue1};
|
|
69
|
-
border-radius: 0.5rem;
|
|
70
|
-
`;
|
|
71
|
-
const OperationEntries = styled.div `
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
gap: 1.5rem;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
|
|
77
|
-
width: 100%;
|
|
78
|
-
`;
|
|
79
|
-
const OperationHeader = styled.div `
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: space-between;
|
|
83
|
-
|
|
84
|
-
padding-bottom: 1rem;
|
|
85
|
-
|
|
86
|
-
border-bottom: 2px dashed ${(props) => props.theme.colors.grey3};
|
|
87
|
-
`;
|
|
88
|
-
const OperationControls = styled.div `
|
|
89
|
-
display: flex;
|
|
90
|
-
gap: 1rem;
|
|
91
|
-
align-items: center;
|
|
92
|
-
`;
|
|
93
|
-
const OperationParamRow = styled.div `
|
|
94
|
-
display: flex;
|
|
95
|
-
gap: 1rem;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
`;
|
|
99
|
-
const OperationParam = styled.div `
|
|
100
|
-
display: flex;
|
|
101
|
-
gap: 2rem;
|
|
102
|
-
align-items: center;
|
|
103
|
-
`;
|
|
104
|
-
const KeyValueWrapper = styled.div `
|
|
105
|
-
display: flex;
|
|
106
|
-
gap: 0.5rem;
|
|
107
|
-
align-items: center;
|
|
108
|
-
|
|
109
|
-
label {
|
|
110
|
-
flex: 0;
|
|
111
|
-
min-width: 50px;
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
114
|
-
function opToItem(op) {
|
|
115
|
-
return {
|
|
116
|
-
label: op,
|
|
117
|
-
value: op,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function FeatureDictEditor(props) {
|
|
121
|
-
function updateFdProperty(key, value) {
|
|
122
|
-
props.dispatch({ key, type: FeatureListAction.UPDATE_FD_PROPERTY, uid: props.uid, value });
|
|
123
|
-
}
|
|
124
|
-
function moveOperation(operationIndex, direction) {
|
|
125
|
-
props.dispatch({ direction, operationIndex, type: FeatureListAction.MOVE_OPERATION, uid: props.uid });
|
|
126
|
-
}
|
|
127
|
-
function updateOperationPropertyValue(operationIndex, key, value) {
|
|
128
|
-
props.dispatch({
|
|
129
|
-
key,
|
|
130
|
-
operationIndex,
|
|
131
|
-
type: FeatureListAction.UPDATE_OPERATION_PROPERTY_VALUE,
|
|
132
|
-
uid: props.uid,
|
|
133
|
-
value,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function updateOperationPropertyKey(operationIndex, previousKey, newKey) {
|
|
137
|
-
props.dispatch({
|
|
138
|
-
newKey,
|
|
139
|
-
operationIndex,
|
|
140
|
-
previousKey,
|
|
141
|
-
type: FeatureListAction.UPDATE_OPERATION_PROPERTY_KEY,
|
|
142
|
-
uid: props.uid,
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function removeOperationProperty(operationIndex, key) {
|
|
146
|
-
props.dispatch({
|
|
147
|
-
key,
|
|
148
|
-
operationIndex,
|
|
149
|
-
type: FeatureListAction.DELETE_OPERATION_PROPERTY,
|
|
150
|
-
uid: props.uid,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
function addOperation() {
|
|
154
|
-
props.dispatch({
|
|
155
|
-
operationType: props.availableOperations[0],
|
|
156
|
-
type: FeatureListAction.ADD_OPERATION,
|
|
157
|
-
uid: props.uid,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
function removeOperation(idx) {
|
|
161
|
-
props.dispatch({
|
|
162
|
-
operationIndex: idx,
|
|
163
|
-
type: FeatureListAction.DELETE_OPERATION,
|
|
164
|
-
uid: props.uid,
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
function addOperationProperty(operationIndex) {
|
|
168
|
-
props.dispatch({
|
|
169
|
-
operationIndex,
|
|
170
|
-
type: FeatureListAction.ADD_OPERATION_PROPERTY,
|
|
171
|
-
uid: props.uid,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
return (_jsxs(FeatureListWrapper, { children: [_jsxs(FeatureDictProperties, { children: [_jsxs(KeyValueWrapper, { children: [_jsx("label", { children: "Column" }), _jsx(Input, { initialValue: props.featureDict.column, onChange: (v) => updateFdProperty('column', v) })] }), _jsxs(KeyValueWrapper, { children: [_jsx("label", { children: "Name" }), _jsx(Input, { initialValue: props.featureDict.name, onChange: (v) => updateFdProperty('name', v) })] })] }), _jsxs(OperationsWrapper, { children: [_jsxs(OperationsHeader, { children: [_jsx("h3", { children: "Operations:" }), _jsxs(IconButton, { onClick: addOperation, children: [_jsx(Plus, {}), "Add Operation"] })] }), props.featureDict.ops.map((op, idx) => (_jsxs(OperationWrapper, { children: [_jsxs(OperationHeader, { children: [_jsxs(KeyValueWrapper, { children: [_jsx("label", { children: "type" }), _jsx(ComboBox, { initialValue: opToItem(props.featureDict.ops[idx].type), items: props.availableOperations.map((o) => opToItem(o)), onSelect: (it) => updateOperationPropertyValue(idx, 'type', it.value), style: { minWidth: '200px' } })] }), _jsxs(OperationControls, { children: [_jsx(ArrowUpButton, { "$disabled": idx === 0, asButton: true, onClick: () => moveOperation(idx, 'up'), size: "lg" }), _jsx(ArrowDownButton, { "$disabled": idx === props.featureDict.ops.length - 1, asButton: true, onClick: () => moveOperation(idx, 'down'), size: "lg" }), _jsx(Cross, { asButton: true, onClick: () => removeOperation(idx), size: "lg" })] })] }), _jsxs(OperationEntries, { children: [Object.entries(op)
|
|
175
|
-
.filter(([k]) => k !== 'type')
|
|
176
|
-
.map(([key, val], paramIdx) => (_jsxs(OperationParamRow, { children: [_jsxs(OperationParam, { children: [_jsxs(KeyValueWrapper, { children: [_jsx("label", { children: "key" }), _jsx(Input, { onChange: (v) => updateOperationPropertyKey(idx, key, v), value: key })] }), _jsxs(KeyValueWrapper, { children: [_jsx("label", { children: "value" }), _jsx(NumericInput, { initialValue: Number(val), onChange: (v) => updateOperationPropertyValue(idx, key, v) })] }, key)] }), _jsx(Cross, { asButton: true, onClick: () => removeOperationProperty(idx, key), size: "lg" })] }, paramIdx))), _jsx(ButtonRow, { children: _jsxs(IconButton, { onClick: () => addOperationProperty(idx), children: [_jsx(Plus, {}), "Add Parameter"] }) })] })] }, `${op.type}-${idx}`)))] })] }));
|
|
177
|
-
}
|
|
178
|
-
export default FeatureDictEditor;
|
|
179
|
-
//# sourceMappingURL=feature-dict-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature-dict-editor.js","sourceRoot":"","sources":["../../src/feature-list-editor/feature-dict-editor.tsx"],"names":[],"mappings":";AAmBA,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAQ,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAsB,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,kBAAkB,GAAG,MAAM,C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,GACZ,IACY,EAElB,MAAC,eAAe,eACZ,oCAAoB,EACpB,KAAC,YAAY,IACT,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,EACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,4BAA4B,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAC5D,KALgB,GAAG,CAMP,IACL,EACjB,KAAC,KAAK,IAAC,QAAQ,QAAC,OAAO,EAAE,GAAG,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAC,IAAI,GAAG,KAlB1D,QAAQ,CAmBZ,CACvB,CAAC,EACN,KAAC,SAAS,cACN,MAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,aAChD,KAAC,IAAI,KAAG,qBAEC,GACL,IACG,KA1DA,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,EAAE,CA2DvB,CACtB,CAAC,IACc,IACH,CACxB,CAAC;AACN,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FeatureDict } from '../types';
|
|
3
|
-
export interface FeatureListEditorProps {
|
|
4
|
-
/**
|
|
5
|
-
* List of available operations
|
|
6
|
-
*/
|
|
7
|
-
availableOperations: string[];
|
|
8
|
-
/**
|
|
9
|
-
* Standard classname property
|
|
10
|
-
*/
|
|
11
|
-
className?: string;
|
|
12
|
-
/**
|
|
13
|
-
* List of FeatureDicts to edit
|
|
14
|
-
*/
|
|
15
|
-
featureList: FeatureDict[];
|
|
16
|
-
/**
|
|
17
|
-
* Optionally override initially open item. Accepts an index of the item.
|
|
18
|
-
*/
|
|
19
|
-
initialOpenItem?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Handler called whenever a part of the data is edited
|
|
22
|
-
*/
|
|
23
|
-
onUpdate?: (featureList: FeatureDict[]) => void | Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Standard styling prop
|
|
26
|
-
*/
|
|
27
|
-
style?: React.CSSProperties;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* FeatureListEditor allows user to edit a list of FeatureDicts
|
|
31
|
-
*/
|
|
32
|
-
declare function FeatureListEditor(props: FeatureListEditorProps): JSX.Element;
|
|
33
|
-
export default FeatureListEditor;
|
|
34
|
-
//# sourceMappingURL=feature-list-editor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature-list-editor.d.ts","sourceRoot":"","sources":["../../src/feature-list-editor/feature-list-editor.tsx"],"names":[],"mappings":";AA0BA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAmBvC,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AAID;;GAEG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA4DrE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright 2023 Impulse Innovations Limited
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
import { enableMapSet } from 'immer';
|
|
19
|
-
import debounce from 'lodash/debounce';
|
|
20
|
-
import { nanoid } from 'nanoid';
|
|
21
|
-
import { useCallback, useEffect, useMemo } from 'react';
|
|
22
|
-
import { useImmerReducer } from 'use-immer';
|
|
23
|
-
import styled from '@darajs/styled-components';
|
|
24
|
-
import { Accordion } from '@darajs/ui-components';
|
|
25
|
-
import { Cross, Plus } from '@darajs/ui-icons';
|
|
26
|
-
import FeatureDictEditor from './feature-dict-editor';
|
|
27
|
-
import { FeatureListAction, FeatureListReducer } from './state';
|
|
28
|
-
import { ButtonRow, IconButton } from './utils';
|
|
29
|
-
const HeaderWrapper = styled.div `
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: space-between;
|
|
33
|
-
|
|
34
|
-
width: 100%;
|
|
35
|
-
padding-right: 2rem;
|
|
36
|
-
`;
|
|
37
|
-
const EditorWrapper = styled.div `
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
gap: 2rem;
|
|
41
|
-
`;
|
|
42
|
-
enableMapSet();
|
|
43
|
-
/**
|
|
44
|
-
* FeatureListEditor allows user to edit a list of FeatureDicts
|
|
45
|
-
*/
|
|
46
|
-
function FeatureListEditor(props) {
|
|
47
|
-
var _a;
|
|
48
|
-
const [data, dispatch] = useImmerReducer(FeatureListReducer, props.featureList.reduce((acc, fd) => acc.set(nanoid(), fd), new Map()));
|
|
49
|
-
const debouncedUpdate = useMemo(() => (props.onUpdate ? debounce(props.onUpdate, 300) : null), [props.onUpdate]);
|
|
50
|
-
function deleteFeatureDict(uid) {
|
|
51
|
-
dispatch({ type: FeatureListAction.DELETE_FD, uid });
|
|
52
|
-
}
|
|
53
|
-
function addFeatureDict() {
|
|
54
|
-
dispatch({ type: FeatureListAction.ADD_FD });
|
|
55
|
-
}
|
|
56
|
-
const HeaderRenderer = useCallback((item) => {
|
|
57
|
-
return (_jsxs(HeaderWrapper, { children: [item.content.name, _jsx(Cross, { asButton: true, onClick: () => deleteFeatureDict(item.uid) })] }));
|
|
58
|
-
}, []);
|
|
59
|
-
const InnerRenderer = useCallback((item) => {
|
|
60
|
-
return (_jsx(FeatureDictEditor, { availableOperations: props.availableOperations, dispatch: dispatch, featureDict: item.content, uid: item.uid }));
|
|
61
|
-
}, [props.availableOperations]);
|
|
62
|
-
// Send updates to parent
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
debouncedUpdate === null || debouncedUpdate === void 0 ? void 0 : debouncedUpdate(Array.from(data.values()));
|
|
65
|
-
}, [data]);
|
|
66
|
-
return (_jsxs(EditorWrapper, { className: props.className, style: props.style, children: [_jsx(Accordion, { headerRenderer: HeaderRenderer, initialOpenItems: (_a = props.initialOpenItem) !== null && _a !== void 0 ? _a : -1, innerRenderer: InnerRenderer, items: Array.from(data).map(([uid, fd]) => ({ content: fd, label: uid, uid })) }), _jsx(ButtonRow, { children: _jsxs(IconButton, { onClick: () => addFeatureDict(), children: [_jsx(Plus, {}), "Add Feature Dict"] }) })] }));
|
|
67
|
-
}
|
|
68
|
-
export default FeatureListEditor;
|
|
69
|
-
//# sourceMappingURL=feature-list-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature-list-editor.js","sourceRoot":"","sources":["../../src/feature-list-editor/feature-list-editor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC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Aa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAChF,EACF,KAAC,SAAS,cACN,MAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,aACvC,KAAC,IAAI,KAAG,wBAEC,GACL,IACA,CACnB,CAAC;AACN,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Reducer } from 'use-immer';
|
|
2
|
-
import { FeatureDict } from '../types';
|
|
3
|
-
export declare enum FeatureListAction {
|
|
4
|
-
ADD_FD = "ADD_FD",
|
|
5
|
-
ADD_OPERATION = "ADD_OPERATION",
|
|
6
|
-
ADD_OPERATION_PROPERTY = "ADD_OPERATION_PROPERTY",
|
|
7
|
-
DELETE_FD = "DELETE_FD",
|
|
8
|
-
DELETE_OPERATION = "DELETE_OPERATION",
|
|
9
|
-
DELETE_OPERATION_PROPERTY = "DELETE_OPERATION_PROPERTY",
|
|
10
|
-
MOVE_OPERATION = "MOVE_OPERATION",
|
|
11
|
-
UPDATE_FD_PROPERTY = "UPDATE_FD_PROPERTY",
|
|
12
|
-
UPDATE_OPERATION_PROPERTY_KEY = "UPDATE_OPERATION_PROPERTY_KEY",
|
|
13
|
-
UPDATE_OPERATION_PROPERTY_VALUE = "UPDATE_OPERATION_PROPERTY_VALUE"
|
|
14
|
-
}
|
|
15
|
-
interface AddFeatureDictAction {
|
|
16
|
-
type: FeatureListAction.ADD_FD;
|
|
17
|
-
}
|
|
18
|
-
interface DeleteFeatureDictAction {
|
|
19
|
-
type: FeatureListAction.DELETE_FD;
|
|
20
|
-
uid: string;
|
|
21
|
-
}
|
|
22
|
-
interface UpdateFeatureDictPropertyAction {
|
|
23
|
-
key: Exclude<keyof FeatureDict, 'ops'>;
|
|
24
|
-
type: FeatureListAction.UPDATE_FD_PROPERTY;
|
|
25
|
-
uid: string;
|
|
26
|
-
value: string;
|
|
27
|
-
}
|
|
28
|
-
interface AddOperationAction {
|
|
29
|
-
operationType: string;
|
|
30
|
-
type: FeatureListAction.ADD_OPERATION;
|
|
31
|
-
uid: string;
|
|
32
|
-
}
|
|
33
|
-
interface DeleteOperationAction {
|
|
34
|
-
operationIndex: number;
|
|
35
|
-
type: FeatureListAction.DELETE_OPERATION;
|
|
36
|
-
uid: string;
|
|
37
|
-
}
|
|
38
|
-
interface MoveOperationAction {
|
|
39
|
-
direction: 'up' | 'down';
|
|
40
|
-
operationIndex: number;
|
|
41
|
-
type: FeatureListAction.MOVE_OPERATION;
|
|
42
|
-
uid: string;
|
|
43
|
-
}
|
|
44
|
-
interface UpdateOperationPropertyKeyAction {
|
|
45
|
-
newKey: string;
|
|
46
|
-
operationIndex: number;
|
|
47
|
-
previousKey: string;
|
|
48
|
-
type: FeatureListAction.UPDATE_OPERATION_PROPERTY_KEY;
|
|
49
|
-
uid: string;
|
|
50
|
-
}
|
|
51
|
-
interface UpdateOperationPropertyValueAction {
|
|
52
|
-
key: string;
|
|
53
|
-
operationIndex: number;
|
|
54
|
-
type: FeatureListAction.UPDATE_OPERATION_PROPERTY_VALUE;
|
|
55
|
-
uid: string;
|
|
56
|
-
value: string | number;
|
|
57
|
-
}
|
|
58
|
-
interface DeleteOperationPropertyAction {
|
|
59
|
-
key: string;
|
|
60
|
-
operationIndex: number;
|
|
61
|
-
type: FeatureListAction.DELETE_OPERATION_PROPERTY;
|
|
62
|
-
uid: string;
|
|
63
|
-
}
|
|
64
|
-
interface AddOperationPropertyAction {
|
|
65
|
-
operationIndex: number;
|
|
66
|
-
type: FeatureListAction.ADD_OPERATION_PROPERTY;
|
|
67
|
-
uid: string;
|
|
68
|
-
}
|
|
69
|
-
export type FeatureListActions = AddFeatureDictAction | DeleteFeatureDictAction | UpdateFeatureDictPropertyAction | AddOperationAction | DeleteOperationAction | MoveOperationAction | UpdateOperationPropertyKeyAction | UpdateOperationPropertyValueAction | DeleteOperationPropertyAction | AddOperationPropertyAction;
|
|
70
|
-
type FeatureListReducerState = Readonly<Map<string, FeatureDict>>;
|
|
71
|
-
export declare const FeatureListReducer: Reducer<FeatureListReducerState, FeatureListActions>;
|
|
72
|
-
export {};
|
|
73
|
-
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/feature-list-editor/state.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,aAAa,kBAAkB;IAC/B,sBAAsB,2BAA2B;IACjD,SAAS,cAAc;IACvB,gBAAgB,qBAAqB;IACrC,yBAAyB,8BAA8B;IACvD,cAAc,mBAAmB;IACjC,kBAAkB,uBAAuB;IACzC,6BAA6B,kCAAkC;IAC/D,+BAA+B,oCAAoC;CACtE;AAED,UAAU,oBAAoB;IAC1B,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC;CAClC;AAED,UAAU,uBAAuB;IAC7B,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACf;AAED,UAAU,+BAA+B;IACrC,GAAG,EAAE,OAAO,CAAC,MAAM,WAAW,EAAE,KAAK,CAAC,CAAC;IACvC,IAAI,EAAE,iBAAiB,CAAC,kBAAkB,CAAC;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,kBAAkB;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,iBAAiB,CAAC,aAAa,CAAC;IACtC,GAAG,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C,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAElE,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,uBAAuB,EAAE,kBAAkB,CAiGnF,CAAC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023 Impulse Innovations Limited
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { nanoid } from 'nanoid';
|
|
18
|
-
export var FeatureListAction;
|
|
19
|
-
(function (FeatureListAction) {
|
|
20
|
-
FeatureListAction["ADD_FD"] = "ADD_FD";
|
|
21
|
-
FeatureListAction["ADD_OPERATION"] = "ADD_OPERATION";
|
|
22
|
-
FeatureListAction["ADD_OPERATION_PROPERTY"] = "ADD_OPERATION_PROPERTY";
|
|
23
|
-
FeatureListAction["DELETE_FD"] = "DELETE_FD";
|
|
24
|
-
FeatureListAction["DELETE_OPERATION"] = "DELETE_OPERATION";
|
|
25
|
-
FeatureListAction["DELETE_OPERATION_PROPERTY"] = "DELETE_OPERATION_PROPERTY";
|
|
26
|
-
FeatureListAction["MOVE_OPERATION"] = "MOVE_OPERATION";
|
|
27
|
-
FeatureListAction["UPDATE_FD_PROPERTY"] = "UPDATE_FD_PROPERTY";
|
|
28
|
-
FeatureListAction["UPDATE_OPERATION_PROPERTY_KEY"] = "UPDATE_OPERATION_PROPERTY_KEY";
|
|
29
|
-
FeatureListAction["UPDATE_OPERATION_PROPERTY_VALUE"] = "UPDATE_OPERATION_PROPERTY_VALUE";
|
|
30
|
-
})(FeatureListAction || (FeatureListAction = {}));
|
|
31
|
-
export const FeatureListReducer = (draft, action) => {
|
|
32
|
-
switch (action.type) {
|
|
33
|
-
case FeatureListAction.ADD_FD: {
|
|
34
|
-
const newId = nanoid();
|
|
35
|
-
draft.set(newId, { column: 'new_column', name: 'new_name', ops: [] });
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case FeatureListAction.DELETE_FD: {
|
|
39
|
-
draft.delete(action.uid);
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
case FeatureListAction.UPDATE_FD_PROPERTY: {
|
|
43
|
-
draft.get(action.uid)[action.key] = action.value;
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
case FeatureListAction.ADD_OPERATION: {
|
|
47
|
-
draft.get(action.uid).ops.push({
|
|
48
|
-
type: action.operationType,
|
|
49
|
-
});
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case FeatureListAction.DELETE_OPERATION: {
|
|
53
|
-
draft.get(action.uid).ops.splice(action.operationIndex, 1);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
case FeatureListAction.MOVE_OPERATION: {
|
|
57
|
-
if (action.operationIndex === 0 && action.direction === 'up')
|
|
58
|
-
return;
|
|
59
|
-
if (action.operationIndex === draft.size - 1 && action.direction === 'down')
|
|
60
|
-
return;
|
|
61
|
-
const newIndex = action.direction === 'up' ? action.operationIndex - 1 : action.operationIndex + 1;
|
|
62
|
-
const [movedItem] = draft.get(action.uid).ops.splice(action.operationIndex, 1);
|
|
63
|
-
draft.get(action.uid).ops.splice(newIndex, 0, movedItem);
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
case FeatureListAction.UPDATE_OPERATION_PROPERTY_KEY: {
|
|
67
|
-
const featureDict = draft.get(action.uid);
|
|
68
|
-
const previousValue = featureDict.ops[action.operationIndex][action.previousKey];
|
|
69
|
-
delete featureDict.ops[action.operationIndex][action.previousKey];
|
|
70
|
-
featureDict.ops[action.operationIndex][action.newKey] = previousValue;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
case FeatureListAction.UPDATE_OPERATION_PROPERTY_VALUE: {
|
|
74
|
-
if (!(action.key in draft.get(action.uid).ops[action.operationIndex])) {
|
|
75
|
-
throw new Error(`Key ${action.key} not found in edited operation!`);
|
|
76
|
-
}
|
|
77
|
-
draft.get(action.uid).ops[action.operationIndex][action.key] = action.value;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case FeatureListAction.DELETE_OPERATION_PROPERTY: {
|
|
81
|
-
if (!(action.key in draft.get(action.uid).ops[action.operationIndex])) {
|
|
82
|
-
throw new Error(`Key ${action.key} not found in edited operation!`);
|
|
83
|
-
}
|
|
84
|
-
if (action.key === 'type') {
|
|
85
|
-
throw new Error('DeleteOperationProperty action cannot delete the "type" property');
|
|
86
|
-
}
|
|
87
|
-
delete draft.get(action.uid).ops[action.operationIndex][action.key];
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
case FeatureListAction.ADD_OPERATION_PROPERTY: {
|
|
91
|
-
const existingKeys = Object.keys(draft.get(action.uid).ops[action.operationIndex]);
|
|
92
|
-
const newKey = 'key';
|
|
93
|
-
let keySuffix = 1;
|
|
94
|
-
while (existingKeys.includes(`${newKey}${keySuffix}`)) {
|
|
95
|
-
keySuffix++;
|
|
96
|
-
}
|
|
97
|
-
draft.get(action.uid).ops[action.operationIndex][`${newKey}${keySuffix}`] = 0;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
//# sourceMappingURL=state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/feature-list-editor/state.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GA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AG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;YAEnF,MAAM,MAAM,GAAG,KAAK,CAAC;YACrB,IAAI,SAAS,GAAG,CAAC,CAAC;YAElB,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG,SAAS,EAAE,CAAC,EAAE;gBACnD,SAAS,EAAE,CAAC;aACf;YAED,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,GAAG,MAAM,GAAG,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC;YAE9E,MAAM;SACT;KACJ;AACL,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023 Impulse Innovations Limited
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import type { ComponentProps } from 'react';
|
|
18
|
-
import type { StyledComponent } from 'styled-components';
|
|
19
|
-
import { DefaultTheme } from '@darajs/styled-components';
|
|
20
|
-
import { Button } from '@darajs/ui-components';
|
|
21
|
-
export declare const IconButton: StyledComponent<React.ForwardRefExoticComponent<ComponentProps<typeof Button> & React.RefAttributes<HTMLButtonElement>>, DefaultTheme>;
|
|
22
|
-
export declare const ButtonRow: StyledComponent<"div", DefaultTheme, {}, never>;
|
|
23
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/feature-list-editor/utils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,eAAO,MAAM,UAAU,EAAE,eAAe,CACpC,KAAK,CAAC,yBAAyB,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,EACvG,YAAY,CAMf,CAAC;AAEF,eAAO,MAAM,SAAS,iDAIrB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import styled from '@darajs/styled-components';
|
|
2
|
-
import { Button } from '@darajs/ui-components';
|
|
3
|
-
export const IconButton = styled(Button) `
|
|
4
|
-
svg {
|
|
5
|
-
margin-right: 0.5rem;
|
|
6
|
-
color: ${(props) => props.theme.colors.background};
|
|
7
|
-
}
|
|
8
|
-
`;
|
|
9
|
-
export const ButtonRow = styled.div `
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: flex-end;
|
|
13
|
-
`;
|
|
14
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/feature-list-editor/utils.tsx"],"names":[],"mappings":"AAmBA,OAAO,MAAwB,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAGnB,MAAM,CAAC,MAAM,CAAC,CAAA;;;iBAGD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU;;CAExD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIlC,CAAC"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023 Impulse Innovations Limited
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export interface Operation {
|
|
18
|
-
[key: string]: number | string;
|
|
19
|
-
type: string;
|
|
20
|
-
}
|
|
21
|
-
export interface FeatureDict {
|
|
22
|
-
column: string;
|
|
23
|
-
name: string;
|
|
24
|
-
ops: Operation[];
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,SAAS,EAAE,CAAC;CACpB"}
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.tsx"],"names":[],"mappings":""}
|