@_linked/shape-ui 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/columns.d.ts +58 -0
- package/lib/esm/columns.js +173 -0
- package/lib/esm/columns.js.map +1 -0
- package/lib/esm/components/AddInstanceForms.d.ts +38 -0
- package/lib/esm/components/AddInstanceForms.js +143 -0
- package/lib/esm/components/AddInstanceForms.js.map +1 -0
- package/lib/esm/components/AddInstanceForms.module.css +12 -0
- package/lib/esm/components/BatchEditDrawer.d.ts +13 -0
- package/lib/esm/components/BatchEditDrawer.js +122 -0
- package/lib/esm/components/BatchEditDrawer.js.map +1 -0
- package/lib/esm/components/BatchEditDrawer.module.css +193 -0
- package/lib/esm/components/CustomMultiSelect.d.ts +26 -0
- package/lib/esm/components/CustomMultiSelect.js +344 -0
- package/lib/esm/components/CustomMultiSelect.js.map +1 -0
- package/lib/esm/components/CustomMultiSelect.module.css +291 -0
- package/lib/esm/components/DynamicFormField.d.ts +21 -0
- package/lib/esm/components/DynamicFormField.js +149 -0
- package/lib/esm/components/DynamicFormField.js.map +1 -0
- package/lib/esm/components/DynamicFormField.module.css +169 -0
- package/lib/esm/components/EditInstanceForms.d.ts +15 -0
- package/lib/esm/components/EditInstanceForms.js +118 -0
- package/lib/esm/components/EditInstanceForms.js.map +1 -0
- package/lib/esm/components/FilterBadge.d.ts +20 -0
- package/lib/esm/components/FilterBadge.js +26 -0
- package/lib/esm/components/FilterBadge.js.map +1 -0
- package/lib/esm/components/FilterBadge.module.css +25 -0
- package/lib/esm/components/FormField.d.ts +18 -0
- package/lib/esm/components/FormField.js +9 -0
- package/lib/esm/components/FormField.js.map +1 -0
- package/lib/esm/components/FormField.module.css +57 -0
- package/lib/esm/components/InstanceDeletionDialog.d.ts +17 -0
- package/lib/esm/components/InstanceDeletionDialog.js +83 -0
- package/lib/esm/components/InstanceDeletionDialog.js.map +1 -0
- package/lib/esm/components/InstanceDeletionDialog.module.css +59 -0
- package/lib/esm/components/InstanceOverview.d.ts +37 -0
- package/lib/esm/components/InstanceOverview.js +233 -0
- package/lib/esm/components/InstanceOverview.js.map +1 -0
- package/lib/esm/components/InstanceOverview.module.css +35 -0
- package/lib/esm/components/InstanceView.d.ts +29 -0
- package/lib/esm/components/InstanceView.js +97 -0
- package/lib/esm/components/InstanceView.js.map +1 -0
- package/lib/esm/components/InstanceView.module.css +157 -0
- package/lib/esm/components/NodeBadge.d.ts +25 -0
- package/lib/esm/components/NodeBadge.js +29 -0
- package/lib/esm/components/NodeBadge.js.map +1 -0
- package/lib/esm/components/NodeValuesEditor.d.ts +15 -0
- package/lib/esm/components/NodeValuesEditor.js +29 -0
- package/lib/esm/components/NodeValuesEditor.js.map +1 -0
- package/lib/esm/components/NodeValuesEditor.module.css +4 -0
- package/lib/esm/components/ReactTable.d.ts +50 -0
- package/lib/esm/components/ReactTable.js +370 -0
- package/lib/esm/components/ReactTable.js.map +1 -0
- package/lib/esm/components/ReactTable.module.css +950 -0
- package/lib/esm/components/TextfieldEditor.d.ts +1 -2
- package/lib/esm/components/TextfieldEditor.js +2 -2
- package/lib/esm/components/TextfieldEditor.js.map +1 -1
- package/lib/esm/components/forms.module.css +96 -0
- package/lib/esm/host.d.ts +196 -0
- package/lib/esm/host.js +25 -0
- package/lib/esm/host.js.map +1 -0
- package/lib/esm/hostContext.d.ts +34 -0
- package/lib/esm/hostContext.js +95 -0
- package/lib/esm/hostContext.js.map +1 -0
- package/lib/esm/index.d.ts +64 -10
- package/lib/esm/index.js +63 -14
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/read.d.ts +48 -0
- package/lib/esm/read.js +96 -0
- package/lib/esm/read.js.map +1 -0
- package/lib/esm/search.d.ts +32 -0
- package/lib/esm/search.js +87 -0
- package/lib/esm/search.js.map +1 -0
- package/lib/esm/shape/contracts.d.ts +58 -0
- package/lib/esm/shape/contracts.js +15 -0
- package/lib/esm/shape/contracts.js.map +1 -0
- package/lib/esm/shape/naming.d.ts +30 -0
- package/lib/esm/shape/naming.js +52 -0
- package/lib/esm/shape/naming.js.map +1 -0
- package/lib/esm/shape/nodeDisplay.d.ts +36 -0
- package/lib/esm/shape/nodeDisplay.js +117 -0
- package/lib/esm/shape/nodeDisplay.js.map +1 -0
- package/lib/esm/shape/propertyTypes.d.ts +12 -0
- package/lib/esm/shape/propertyTypes.js +60 -0
- package/lib/esm/shape/propertyTypes.js.map +1 -0
- package/lib/esm/shape/propertyVisibility.d.ts +56 -0
- package/lib/esm/shape/propertyVisibility.js +112 -0
- package/lib/esm/shape/propertyVisibility.js.map +1 -0
- package/lib/esm/shape/shapeDependencies.d.ts +41 -0
- package/lib/esm/shape/shapeDependencies.js +141 -0
- package/lib/esm/shape/shapeDependencies.js.map +1 -0
- package/lib/esm/shape/tableFilters.d.ts +35 -0
- package/lib/esm/shape/tableFilters.js +171 -0
- package/lib/esm/shape/tableFilters.js.map +1 -0
- package/lib/esm/shape/useFormDependencies.d.ts +38 -0
- package/lib/esm/shape/useFormDependencies.js +178 -0
- package/lib/esm/shape/useFormDependencies.js.map +1 -0
- package/lib/esm/shape/validation.d.ts +15 -0
- package/lib/esm/shape/validation.js +106 -0
- package/lib/esm/shape/validation.js.map +1 -0
- package/lib/esm/tokens.css +25 -0
- package/lib/esm/types.d.ts +22 -0
- package/lib/esm/types.js +1 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/write.d.ts +51 -0
- package/lib/esm/write.js +99 -0
- package/lib/esm/write.js.map +1 -0
- package/package.json +44 -18
- package/src/backend.ts +1 -0
- package/src/columns.regression.test.ts +143 -0
- package/src/columns.test.ts +200 -0
- package/src/columns.ts +228 -0
- package/src/components/AddInstanceForms.module.css +12 -0
- package/src/components/AddInstanceForms.tsx +321 -0
- package/src/components/AvatarEditor.tsx +34 -0
- package/src/components/BatchEditDrawer.module.css +193 -0
- package/src/components/BatchEditDrawer.tsx +295 -0
- package/src/components/CheckboxEditor.module.css +6 -0
- package/src/components/CheckboxEditor.tsx +86 -0
- package/src/components/CustomMultiSelect.module.css +291 -0
- package/src/components/CustomMultiSelect.tsx +527 -0
- package/src/components/DateEditor.tsx +50 -0
- package/src/components/DynamicFormField.module.css +169 -0
- package/src/components/DynamicFormField.tsx +357 -0
- package/src/components/EditInstanceForms.tsx +260 -0
- package/src/components/FilterBadge.module.css +25 -0
- package/src/components/FilterBadge.tsx +70 -0
- package/src/components/FormField.module.css +57 -0
- package/src/components/FormField.tsx +59 -0
- package/src/components/ImageValueEditor.module.css +3 -0
- package/src/components/ImageValueEditor.tsx +82 -0
- package/src/components/InstanceDeletionDialog.module.css +59 -0
- package/src/components/InstanceDeletionDialog.tsx +175 -0
- package/src/components/InstanceOverview.module.css +35 -0
- package/src/components/InstanceOverview.tsx +374 -0
- package/src/components/InstanceView.module.css +157 -0
- package/src/components/InstanceView.tsx +212 -0
- package/src/components/NodeBadge.tsx +60 -0
- package/src/components/NodeValuesEditor.module.css +4 -0
- package/src/components/NodeValuesEditor.tsx +64 -0
- package/src/components/RadioButtonEditor.module.css +22 -0
- package/src/components/RadioButtonEditor.tsx +96 -0
- package/src/components/ReactTable.module.css +950 -0
- package/src/components/ReactTable.tsx +991 -0
- package/src/components/SelectEditor.tsx +85 -0
- package/src/components/ShapeTable.module.css +394 -0
- package/src/components/SwitchEditor.tsx +60 -0
- package/src/components/TextareaEditor.tsx +55 -0
- package/src/components/TextfieldEditor.tsx +67 -0
- package/src/components/ToggleEditor.tsx +63 -0
- package/src/components/forms.module.css +96 -0
- package/src/host.ts +226 -0
- package/src/hostContext.tsx +114 -0
- package/src/index.ts +99 -0
- package/src/package.ts +21 -0
- package/src/read.ts +148 -0
- package/src/search.test.ts +174 -0
- package/src/search.ts +108 -0
- package/src/shape/contracts.ts +66 -0
- package/src/shape/naming.ts +52 -0
- package/src/shape/nodeDisplay.ts +114 -0
- package/src/shape/propertyTypes.ts +86 -0
- package/src/shape/propertyVisibility.ts +180 -0
- package/src/shape/shapeDependencies.ts +183 -0
- package/src/shape/tableFilters.ts +223 -0
- package/src/shape/types.ts +1158 -0
- package/src/shape/useFormDependencies.ts +257 -0
- package/src/shape/validation.ts +121 -0
- package/src/tokens.css +25 -0
- package/src/types.ts +20 -0
- package/src/utils/helper.ts +35 -0
- package/src/write.test.ts +174 -0
- package/src/write.ts +114 -0
- package/.changeset/README.md +0 -20
- package/.changeset/config.json +0 -14
- package/.github/workflows/changeset-check.yml +0 -44
- package/.github/workflows/ci.yml +0 -43
- package/.github/workflows/publish.yml +0 -158
- package/CHANGELOG.md +0 -30
- package/lib/esm/components/AvatarEditor.d.ts +0 -20
- package/lib/esm/components/AvatarEditor.js +0 -7
- package/lib/esm/components/AvatarEditor.js.map +0 -1
- package/lib/esm/components/CheckboxEditor.d.ts +0 -21
- package/lib/esm/components/CheckboxEditor.js +0 -44
- package/lib/esm/components/CheckboxEditor.js.map +0 -1
- package/lib/esm/components/DateEditor.d.ts +0 -20
- package/lib/esm/components/DateEditor.js +0 -22
- package/lib/esm/components/DateEditor.js.map +0 -1
- package/lib/esm/components/RadioButtonEditor.d.ts +0 -23
- package/lib/esm/components/RadioButtonEditor.js +0 -41
- package/lib/esm/components/RadioButtonEditor.js.map +0 -1
- package/lib/esm/components/SelectEditor.d.ts +0 -21
- package/lib/esm/components/SelectEditor.js +0 -30
- package/lib/esm/components/SelectEditor.js.map +0 -1
- package/lib/esm/components/SwitchEditor.d.ts +0 -21
- package/lib/esm/components/SwitchEditor.js +0 -23
- package/lib/esm/components/SwitchEditor.js.map +0 -1
- package/lib/esm/components/TextareaEditor.d.ts +0 -23
- package/lib/esm/components/TextareaEditor.js +0 -15
- package/lib/esm/components/TextareaEditor.js.map +0 -1
- package/lib/esm/components/ToggleEditor.d.ts +0 -22
- package/lib/esm/components/ToggleEditor.js +0 -23
- package/lib/esm/components/ToggleEditor.js.map +0 -1
- package/lib/esm/ontologies/lincd-ui.d.ts +0 -6
- package/lib/esm/ontologies/lincd-ui.js +0 -18
- package/lib/esm/ontologies/lincd-ui.js.map +0 -1
- package/lib/esm/package.d.ts +0 -3
- package/lib/esm/package.js +0 -4
- package/lib/esm/package.js.map +0 -1
- package/tsconfig-cjs.json +0 -8
- package/tsconfig-esm.json +0 -9
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
|
|
3
|
+
import {
|
|
4
|
+
Root,
|
|
5
|
+
Group,
|
|
6
|
+
Value,
|
|
7
|
+
Trigger,
|
|
8
|
+
Content,
|
|
9
|
+
Label,
|
|
10
|
+
Item,
|
|
11
|
+
Separator,
|
|
12
|
+
ScrollUpButton,
|
|
13
|
+
ScrollDownButton,
|
|
14
|
+
} from '@_linked/primitives/components/Select';
|
|
15
|
+
|
|
16
|
+
export interface SelectEditorProps {
|
|
17
|
+
onValueChange?: (e) => void;
|
|
18
|
+
of?: Record<string, any>;
|
|
19
|
+
property?: PropertyShapeWire;
|
|
20
|
+
/**
|
|
21
|
+
* Converts the value returned by the shape, to the input string for the select
|
|
22
|
+
* @param shapePropertyValue
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Converts the value of the select to a value that can be provided to the set method of the shape
|
|
28
|
+
* @param inputValue
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// interface RootSelectProps extend {
|
|
35
|
+
// of?: Record<string, any>;
|
|
36
|
+
// property?: PropertyShapeWire;
|
|
37
|
+
// }
|
|
38
|
+
// const RootSelect = () => {
|
|
39
|
+
// return <Root></Root>;
|
|
40
|
+
// };
|
|
41
|
+
|
|
42
|
+
export const SelectEditor = ({
|
|
43
|
+
onValueChange,
|
|
44
|
+
of,
|
|
45
|
+
property,
|
|
46
|
+
preConvertValueFn,
|
|
47
|
+
postConvertValueFn,
|
|
48
|
+
...restProps
|
|
49
|
+
}: SelectEditorProps) => {
|
|
50
|
+
const onChangeHandler = (value) => {
|
|
51
|
+
console.log(value, 'value select');
|
|
52
|
+
if (!of) return;
|
|
53
|
+
if (postConvertValueFn) {
|
|
54
|
+
value = postConvertValueFn(value);
|
|
55
|
+
}
|
|
56
|
+
of[property.label] = value;
|
|
57
|
+
console.log(of[property.label], 'of[property.label] switch');
|
|
58
|
+
|
|
59
|
+
if (onValueChange) {
|
|
60
|
+
onValueChange(value);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Root
|
|
66
|
+
value={of[property.label]}
|
|
67
|
+
onValueChange={onChangeHandler}
|
|
68
|
+
defaultValue={
|
|
69
|
+
of
|
|
70
|
+
? preConvertValueFn
|
|
71
|
+
? preConvertValueFn(of[property.label])
|
|
72
|
+
: of[property.label]
|
|
73
|
+
: ''
|
|
74
|
+
}
|
|
75
|
+
{...restProps}
|
|
76
|
+
>
|
|
77
|
+
{/* <Trigger className="SelectTrigger" aria-label="Food">
|
|
78
|
+
<Select.Value placeholder="Select a fruit…" />
|
|
79
|
+
<Select.Icon className="SelectIcon">
|
|
80
|
+
<ChevronDownIcon />
|
|
81
|
+
</Select.Icon>
|
|
82
|
+
</Trigger> */}
|
|
83
|
+
</Root>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
.action {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: flex-start;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
margin: 20px 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.filterButton {
|
|
9
|
+
justify-content: flex-start !important;
|
|
10
|
+
width: fit-content !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tableWrapper {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
|
|
17
|
+
.deleteDataButton {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 3px;
|
|
22
|
+
width: auto;
|
|
23
|
+
border-radius: 0;
|
|
24
|
+
padding: none;
|
|
25
|
+
--ld-button-filled-primary-background-color: #eb3223;
|
|
26
|
+
--ld-button-filled-primary-hover-background-color: #eb3223;
|
|
27
|
+
--ld-button-filled-primary-border-color: none;
|
|
28
|
+
--ld-button-filled-primary-font-color: rgb(255, 255, 255);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tableBar {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
gap: 10px;
|
|
36
|
+
border-top: 1px solid #d6d6d6;
|
|
37
|
+
border-bottom: 1px solid #d6d6d6;
|
|
38
|
+
padding: 15px 0;
|
|
39
|
+
/* height: 200px;*/
|
|
40
|
+
|
|
41
|
+
.filterBar {
|
|
42
|
+
display: flex;
|
|
43
|
+
gap: 10px;
|
|
44
|
+
align-items: center;
|
|
45
|
+
width: 85%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
/* flex: 1;*/
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.actionTableButton {
|
|
53
|
+
--ld-button-filled-primary-background-color: transparent;
|
|
54
|
+
--ld-button-filled-primary-hover-background-color: transparent;
|
|
55
|
+
--ld-button-filled-primary-border-color: none;
|
|
56
|
+
--ld-button-filled-primary-font-color: black;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pagination {
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: flex-end;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 15px;
|
|
64
|
+
margin: 10px 0;
|
|
65
|
+
|
|
66
|
+
.pageInfo {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
gap: 5px;
|
|
71
|
+
|
|
72
|
+
.goToPageForm {
|
|
73
|
+
box-shadow: none;
|
|
74
|
+
width: 80px;
|
|
75
|
+
border: 1px solid var(--ld-input-placeholder);
|
|
76
|
+
--ld-input-border-radius: 5px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.selectPageRows {
|
|
81
|
+
position: relative;
|
|
82
|
+
width: 120px; /* Adjust width as needed */
|
|
83
|
+
padding: 11px 10px;
|
|
84
|
+
border-radius: 5px;
|
|
85
|
+
appearance: none; /* Remove default arrow appearance */
|
|
86
|
+
-webkit-appearance: none; /* Remove default arrow appearance for Safari */
|
|
87
|
+
-moz-appearance: none; /* Remove default arrow appearance for Firefox */
|
|
88
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24"><path d="M7 10l5 5 5-5z"/></svg>')
|
|
89
|
+
no-repeat;
|
|
90
|
+
background-position: right 3px center; /* Adjust right position to move arrow left */
|
|
91
|
+
background-size: 30px 30px;
|
|
92
|
+
border: 1px solid var(--ld-input-placeholder);
|
|
93
|
+
background-color: white; /* Adjust as needed */
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.paginationButton {
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
align-items: center;
|
|
102
|
+
background-color: transparent;
|
|
103
|
+
border-radius: 5px;
|
|
104
|
+
--ld-button-border-radius: 5px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.content {
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.tableContainer {
|
|
114
|
+
width: 100%; /* Adjust as needed */
|
|
115
|
+
max-height: 450px; /* Set the height you need */
|
|
116
|
+
overflow: auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.table {
|
|
120
|
+
width: 100%;
|
|
121
|
+
table-layout: auto;
|
|
122
|
+
border-collapse: collapse;
|
|
123
|
+
border-spacing: 0;
|
|
124
|
+
}
|
|
125
|
+
.th,
|
|
126
|
+
.td {
|
|
127
|
+
border-bottom: 1px solid #d6d6d6;
|
|
128
|
+
/* vertical-align: middle;*/
|
|
129
|
+
padding: 8px; /* Adjust padding as needed */
|
|
130
|
+
white-space: nowrap; /* Prevents text wrapping, ensuring the content fits in the cell */
|
|
131
|
+
/* display: flex;*/
|
|
132
|
+
/* flex-direction: row;*/
|
|
133
|
+
/* align-items: center;*/
|
|
134
|
+
/* justify-content: center;*/
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
thead th {
|
|
138
|
+
position: sticky;
|
|
139
|
+
top: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.tbodyContainer {
|
|
143
|
+
display: block;
|
|
144
|
+
max-height: 350px; /* Adjust as needed */
|
|
145
|
+
overflow-y: auto;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.tbodyContainer tbody {
|
|
149
|
+
display: block;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.tbodyContainer tr {
|
|
153
|
+
display: table;
|
|
154
|
+
width: 100%;
|
|
155
|
+
table-layout: fixed;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.tbodyContainer td {
|
|
159
|
+
display: table-cell;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.th:first-child {
|
|
163
|
+
z-index: 1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.th:last-child {
|
|
167
|
+
z-index: 1;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.th:first-child,
|
|
171
|
+
.td:first-child {
|
|
172
|
+
text-align: center;
|
|
173
|
+
vertical-align: middle;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.th:last-child,
|
|
177
|
+
.td:last-child {
|
|
178
|
+
width: 120px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* .th:first-child,*/
|
|
182
|
+
/* .td:first-child {*/
|
|
183
|
+
/* width: 50px;*/
|
|
184
|
+
/* }*/
|
|
185
|
+
|
|
186
|
+
.th {
|
|
187
|
+
text-align: left;
|
|
188
|
+
background-color: #ffffff;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
|
|
191
|
+
.canSort {
|
|
192
|
+
display: flex;
|
|
193
|
+
justify-content: flex-start;
|
|
194
|
+
align-items: center;
|
|
195
|
+
gap: 10px;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
.tr {
|
|
199
|
+
background-color: #f7f7f7;
|
|
200
|
+
height: 40px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.sticky {
|
|
204
|
+
position: -webkit-sticky; /* For Safari */
|
|
205
|
+
position: sticky;
|
|
206
|
+
background: white; /* Or the background color of your table */
|
|
207
|
+
/* z-index: 1; /* Ensure it stays above other content */
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.stickyLeft {
|
|
211
|
+
left: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.stickyRight {
|
|
215
|
+
right: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.modalContainer {
|
|
219
|
+
right: 0;
|
|
220
|
+
min-height: 100vh;
|
|
221
|
+
background-color: #ffffff;
|
|
222
|
+
z-index: 1;
|
|
223
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
224
|
+
--dialog-animation-name: none;
|
|
225
|
+
--dialog-position-left: auto;
|
|
226
|
+
--dialog-transform: translate(0, -50%);
|
|
227
|
+
--dialog-width: 300px;
|
|
228
|
+
--ld-border-radius: 5px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.modalHeader {
|
|
232
|
+
border-bottom: 1px solid #ddd;
|
|
233
|
+
padding-bottom: 10px;
|
|
234
|
+
margin-bottom: 10px;
|
|
235
|
+
|
|
236
|
+
h1 {
|
|
237
|
+
font-size: 25px;
|
|
238
|
+
font-weight: 500;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.modalHeader h2 {
|
|
243
|
+
margin: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.modalBody {
|
|
247
|
+
display: flex;
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
align-items: center;
|
|
251
|
+
padding-bottom: 20px;
|
|
252
|
+
|
|
253
|
+
img {
|
|
254
|
+
width: 80%;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.form {
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
width: 100%;
|
|
261
|
+
gap: 20px;
|
|
262
|
+
|
|
263
|
+
.formSection {
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
gap: 8px;
|
|
267
|
+
|
|
268
|
+
p {
|
|
269
|
+
text-align: center;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.formFilter {
|
|
273
|
+
border: 1px solid var(--ld-input-placeholder);
|
|
274
|
+
--ld-input-border-radius: 5px;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.filter {
|
|
279
|
+
display: flex;
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
gap: 10px;
|
|
282
|
+
|
|
283
|
+
button {
|
|
284
|
+
padding: 8px 20px;
|
|
285
|
+
background-color: #007bff;
|
|
286
|
+
color: #fff;
|
|
287
|
+
border: none;
|
|
288
|
+
border-radius: 3px;
|
|
289
|
+
cursor: pointer;
|
|
290
|
+
width: 100%;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/* justify-content: center;*/
|
|
294
|
+
|
|
295
|
+
/* .input {*/
|
|
296
|
+
/* width: 100%;*/
|
|
297
|
+
/* }*/
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.modalFooter {
|
|
302
|
+
display: flex;
|
|
303
|
+
text-align: right;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.buttonFilter {
|
|
307
|
+
width: 100%;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.modalFooter button {
|
|
311
|
+
padding: 8px 20px;
|
|
312
|
+
background-color: #007bff;
|
|
313
|
+
color: #fff;
|
|
314
|
+
border: none;
|
|
315
|
+
border-radius: 3px;
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
width: 100%;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.modalFooter button:hover {
|
|
321
|
+
background-color: #0056b3;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.badge {
|
|
325
|
+
display: inline-flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
background-color: transparent;
|
|
328
|
+
color: #007bff; /* Text color*/
|
|
329
|
+
border: 1px solid #007bff;
|
|
330
|
+
padding: 4px 8px;
|
|
331
|
+
border-radius: 5px;
|
|
332
|
+
font-size: 14px;
|
|
333
|
+
padding: 10px 12px;
|
|
334
|
+
/* margin-right: 8px;*/
|
|
335
|
+
|
|
336
|
+
.badgeText {
|
|
337
|
+
margin-right: 4px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.badgeCloseButton {
|
|
341
|
+
border: none;
|
|
342
|
+
background: none;
|
|
343
|
+
color: inherit;
|
|
344
|
+
font-size: inherit;
|
|
345
|
+
cursor: pointer;
|
|
346
|
+
margin-left: 4px;
|
|
347
|
+
|
|
348
|
+
&:hover {
|
|
349
|
+
color: #ff0000; /* Change color on hover*/
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* Hide the default checkbox */
|
|
355
|
+
input[type='checkbox'] {
|
|
356
|
+
position: relative;
|
|
357
|
+
appearance: none;
|
|
358
|
+
width: 22px;
|
|
359
|
+
height: 22px;
|
|
360
|
+
background-color: #eee;
|
|
361
|
+
border: 2px solid #ddd;
|
|
362
|
+
border-radius: 4px;
|
|
363
|
+
cursor: pointer;
|
|
364
|
+
transition: all 0.3s ease;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* Custom checkmark */
|
|
368
|
+
input[type='checkbox']:after {
|
|
369
|
+
content: '';
|
|
370
|
+
position: absolute;
|
|
371
|
+
display: none;
|
|
372
|
+
left: 7px;
|
|
373
|
+
top: 2px;
|
|
374
|
+
width: 6px;
|
|
375
|
+
height: 12px;
|
|
376
|
+
border: solid white;
|
|
377
|
+
border-width: 0 2px 2px 0;
|
|
378
|
+
transform: rotate(45deg);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Show the checkmark when checked */
|
|
382
|
+
input[type='checkbox']:checked {
|
|
383
|
+
background-color: #4caf50;
|
|
384
|
+
border-color: #4caf50;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
input[type='checkbox']:checked:after {
|
|
388
|
+
display: block;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* Hover effect */
|
|
392
|
+
input[type='checkbox']:hover {
|
|
393
|
+
background-color: #ccc;
|
|
394
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
|
|
3
|
+
import { Switch } from '@_linked/primitives/components/Switch';
|
|
4
|
+
|
|
5
|
+
export interface SwitchEditorProps {
|
|
6
|
+
onCheckedChange?: (e) => void;
|
|
7
|
+
of?: Record<string, any>;
|
|
8
|
+
property?: PropertyShapeWire;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Converts the value returned by the shape, to the input string for the switch
|
|
12
|
+
* @param shapePropertyValue
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts the value of the switch to a value that can be provided to the set method of the shape
|
|
18
|
+
* @param inputValue
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const SwitchEditor = ({
|
|
25
|
+
onCheckedChange,
|
|
26
|
+
of,
|
|
27
|
+
property,
|
|
28
|
+
preConvertValueFn,
|
|
29
|
+
postConvertValueFn,
|
|
30
|
+
...restProps
|
|
31
|
+
}: SwitchEditorProps) => {
|
|
32
|
+
const onChangeHandler = (value) => {
|
|
33
|
+
console.log(value, 'value switch');
|
|
34
|
+
if (!of) return;
|
|
35
|
+
if (postConvertValueFn) {
|
|
36
|
+
value = postConvertValueFn(value);
|
|
37
|
+
}
|
|
38
|
+
of[property.label] = value;
|
|
39
|
+
console.log(of[property.label], 'of[property.label] switch');
|
|
40
|
+
|
|
41
|
+
if (onCheckedChange) {
|
|
42
|
+
onCheckedChange(value);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Switch
|
|
48
|
+
value={of[property.label]}
|
|
49
|
+
onCheckedChange={onChangeHandler}
|
|
50
|
+
defaultChecked={
|
|
51
|
+
of
|
|
52
|
+
? preConvertValueFn
|
|
53
|
+
? preConvertValueFn(of[property.label])
|
|
54
|
+
: of[property.label]
|
|
55
|
+
: ''
|
|
56
|
+
}
|
|
57
|
+
{...restProps}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Textarea } from '@_linked/primitives/components/Textarea';
|
|
3
|
+
|
|
4
|
+
export interface TextareaEditorProps {
|
|
5
|
+
onChange?: (e) => void;
|
|
6
|
+
value?: string[];
|
|
7
|
+
of?: Record<string, any>;
|
|
8
|
+
property?: string;
|
|
9
|
+
children?;
|
|
10
|
+
className?;
|
|
11
|
+
/**
|
|
12
|
+
* Converts the value returned by the shape, to the text area string for the text area
|
|
13
|
+
* @param shapePropertyValue
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Converts the value of the text area to a value that can be provided to the set method of the shape
|
|
19
|
+
* @param textAreaValue
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
postConvertValueFn?: (textAreaValue: string) => any;
|
|
23
|
+
}
|
|
24
|
+
export const TextareaEditor = ({
|
|
25
|
+
onChange,
|
|
26
|
+
value,
|
|
27
|
+
of,
|
|
28
|
+
property,
|
|
29
|
+
preConvertValueFn,
|
|
30
|
+
postConvertValueFn,
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: TextareaEditorProps) => {
|
|
35
|
+
const onChangeHandler = (e) => {
|
|
36
|
+
if (onChange) {
|
|
37
|
+
onChange(e);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Textarea
|
|
43
|
+
onChange={onChangeHandler}
|
|
44
|
+
defaultValue={
|
|
45
|
+
of
|
|
46
|
+
? preConvertValueFn
|
|
47
|
+
? preConvertValueFn(of[property])
|
|
48
|
+
: of[property]
|
|
49
|
+
: ''
|
|
50
|
+
}
|
|
51
|
+
value={value}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Input, InputProps } from '@_linked/primitives/components/Input';
|
|
3
|
+
|
|
4
|
+
export interface TextfieldProps extends InputProps {
|
|
5
|
+
onChange?: (e) => void;
|
|
6
|
+
value?: number | string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
of?: Record<string, any>;
|
|
9
|
+
valueProperty?: string;
|
|
10
|
+
property?;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Converts the value returned by the shape, to the input string for the input field
|
|
14
|
+
* @param shapePropertyValue
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Converts the value of the input field to a value that can be provided to the set method of the shape
|
|
20
|
+
* @param inputValue
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
24
|
+
}
|
|
25
|
+
export const TextfieldEditor = ({
|
|
26
|
+
onChange,
|
|
27
|
+
value,
|
|
28
|
+
of,
|
|
29
|
+
property,
|
|
30
|
+
valueProperty,
|
|
31
|
+
preConvertValueFn,
|
|
32
|
+
postConvertValueFn,
|
|
33
|
+
...restProps
|
|
34
|
+
}: TextfieldProps) => {
|
|
35
|
+
const onBlur = (e) => {
|
|
36
|
+
let value = e.currentTarget.value;
|
|
37
|
+
if (!of) return;
|
|
38
|
+
if (postConvertValueFn) {
|
|
39
|
+
value = postConvertValueFn(value);
|
|
40
|
+
}
|
|
41
|
+
of[property.label] = value;
|
|
42
|
+
console.log('of', of);
|
|
43
|
+
console.log('value', value);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const onChangeHandler = (e) => {
|
|
47
|
+
if (onChange) {
|
|
48
|
+
onChange(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Input
|
|
54
|
+
value={value}
|
|
55
|
+
onChange={onChangeHandler}
|
|
56
|
+
defaultValue={
|
|
57
|
+
of
|
|
58
|
+
? preConvertValueFn
|
|
59
|
+
? preConvertValueFn(of[property.label])
|
|
60
|
+
: of[property.label]
|
|
61
|
+
: ''
|
|
62
|
+
}
|
|
63
|
+
onBlur={onBlur}
|
|
64
|
+
{...restProps}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import type { PropertyShapeWire } from '@_linked/core/shapes/nodeShapeWire';
|
|
3
|
+
import { Root as Toggle } from '@_linked/primitives/components/Toggle';
|
|
4
|
+
|
|
5
|
+
export interface ToggleEditorProps {
|
|
6
|
+
onPressedChange?: (e) => void;
|
|
7
|
+
of?: Record<string, any>;
|
|
8
|
+
property?: PropertyShapeWire;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Converts the value returned by the shape, to the input string for the toggle
|
|
12
|
+
* @param shapePropertyValue
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts the value of the toggle to a value that can be provided to the set method of the shape
|
|
18
|
+
* @param inputValue
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const ToggleEditor = ({
|
|
25
|
+
onPressedChange,
|
|
26
|
+
of,
|
|
27
|
+
property,
|
|
28
|
+
children,
|
|
29
|
+
preConvertValueFn,
|
|
30
|
+
postConvertValueFn,
|
|
31
|
+
...restProps
|
|
32
|
+
}: ToggleEditorProps) => {
|
|
33
|
+
const onChangeHandler = (value) => {
|
|
34
|
+
console.log(value, 'value toggle');
|
|
35
|
+
if (!of) return;
|
|
36
|
+
if (postConvertValueFn) {
|
|
37
|
+
value = postConvertValueFn(value);
|
|
38
|
+
}
|
|
39
|
+
of[property.label] = value;
|
|
40
|
+
console.log(of[property.label], 'of[property.label] toggle');
|
|
41
|
+
|
|
42
|
+
if (onPressedChange) {
|
|
43
|
+
onPressedChange(value);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Toggle
|
|
49
|
+
pressed={of[property.label]}
|
|
50
|
+
onPressedChange={onChangeHandler}
|
|
51
|
+
defaultPressed={
|
|
52
|
+
of
|
|
53
|
+
? preConvertValueFn
|
|
54
|
+
? preConvertValueFn(of[property.label])
|
|
55
|
+
: of[property.label]
|
|
56
|
+
: ''
|
|
57
|
+
}
|
|
58
|
+
{...restProps}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
</Toggle>
|
|
62
|
+
);
|
|
63
|
+
};
|