@_linked/shape-ui 2.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/.changeset/README.md +20 -0
- package/.changeset/config.json +14 -0
- package/.github/workflows/changeset-check.yml +44 -0
- package/.github/workflows/ci.yml +43 -0
- package/.github/workflows/publish.yml +158 -0
- package/CHANGELOG.md +30 -0
- package/README.md +35 -0
- package/lib/esm/backend.d.ts +0 -0
- package/lib/esm/backend.js +2 -0
- package/lib/esm/backend.js.map +1 -0
- package/lib/esm/components/AvatarEditor.d.ts +20 -0
- package/lib/esm/components/AvatarEditor.js +7 -0
- package/lib/esm/components/AvatarEditor.js.map +1 -0
- package/lib/esm/components/CheckboxEditor.d.ts +21 -0
- package/lib/esm/components/CheckboxEditor.js +44 -0
- package/lib/esm/components/CheckboxEditor.js.map +1 -0
- package/lib/esm/components/CheckboxEditor.module.css +6 -0
- package/lib/esm/components/DateEditor.d.ts +20 -0
- package/lib/esm/components/DateEditor.js +22 -0
- package/lib/esm/components/DateEditor.js.map +1 -0
- package/lib/esm/components/ImageValueEditor.module.css +3 -0
- package/lib/esm/components/RadioButtonEditor.d.ts +23 -0
- package/lib/esm/components/RadioButtonEditor.js +41 -0
- package/lib/esm/components/RadioButtonEditor.js.map +1 -0
- package/lib/esm/components/RadioButtonEditor.module.css +22 -0
- package/lib/esm/components/SelectEditor.d.ts +21 -0
- package/lib/esm/components/SelectEditor.js +30 -0
- package/lib/esm/components/SelectEditor.js.map +1 -0
- package/lib/esm/components/ShapeTable.module.css +394 -0
- package/lib/esm/components/SwitchEditor.d.ts +21 -0
- package/lib/esm/components/SwitchEditor.js +23 -0
- package/lib/esm/components/SwitchEditor.js.map +1 -0
- package/lib/esm/components/TextareaEditor.d.ts +23 -0
- package/lib/esm/components/TextareaEditor.js +15 -0
- package/lib/esm/components/TextareaEditor.js.map +1 -0
- package/lib/esm/components/TextfieldEditor.d.ts +24 -0
- package/lib/esm/components/TextfieldEditor.js +26 -0
- package/lib/esm/components/TextfieldEditor.js.map +1 -0
- package/lib/esm/components/ToggleEditor.d.ts +22 -0
- package/lib/esm/components/ToggleEditor.js +23 -0
- package/lib/esm/components/ToggleEditor.js.map +1 -0
- package/lib/esm/index.d.ts +10 -0
- package/lib/esm/index.js +15 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/ontologies/lincd-ui.d.ts +6 -0
- package/lib/esm/ontologies/lincd-ui.js +18 -0
- package/lib/esm/ontologies/lincd-ui.js.map +1 -0
- package/lib/esm/package.d.ts +3 -0
- package/lib/esm/package.js +4 -0
- package/lib/esm/package.js.map +1 -0
- package/package.json +75 -0
- package/tsconfig-cjs.json +8 -0
- package/tsconfig-esm.json +9 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Root, } from '@_linked/primitives/components/Select';
|
|
3
|
+
// interface RootSelectProps extend {
|
|
4
|
+
// of?: Shape;
|
|
5
|
+
// property?: PropertyShape;
|
|
6
|
+
// }
|
|
7
|
+
// const RootSelect = () => {
|
|
8
|
+
// return <Root></Root>;
|
|
9
|
+
// };
|
|
10
|
+
export const SelectEditor = ({ onValueChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
|
|
11
|
+
const onChangeHandler = (value) => {
|
|
12
|
+
console.log(value, 'value select');
|
|
13
|
+
if (!of)
|
|
14
|
+
return;
|
|
15
|
+
if (postConvertValueFn) {
|
|
16
|
+
value = postConvertValueFn(value);
|
|
17
|
+
}
|
|
18
|
+
of[property.label] = value;
|
|
19
|
+
console.log(of[property.label], 'of[property.label] switch');
|
|
20
|
+
if (onValueChange) {
|
|
21
|
+
onValueChange(value);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (React.createElement(Root, { value: of[property.label], onValueChange: onChangeHandler, defaultValue: of
|
|
25
|
+
? preConvertValueFn
|
|
26
|
+
? preConvertValueFn(of[property.label])
|
|
27
|
+
: of[property.label]
|
|
28
|
+
: '', ...restProps }));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=SelectEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectEditor.js","sourceRoot":"","sources":["../../../src/components/SelectEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,IAAI,GAUL,MAAM,uCAAuC,CAAC;AAqB/C,sCAAsC;AACtC,gBAAgB;AAChB,8BAA8B;AAC9B,IAAI;AACJ,6BAA6B;AAC7B,0BAA0B;AAC1B,KAAK;AAEL,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,aAAa,EACb,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE7D,IAAI,aAAa,EAAE,CAAC;YAClB,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,IAAI,IACH,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACzB,aAAa,EAAE,eAAe,EAC9B,YAAY,EACV,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,KAEJ,SAAS,GAQR,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -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,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Shape } from '@_linked/core/shapes/Shape';
|
|
3
|
+
import { PropertyDetails } from '@_linked/server/utils/Shapes';
|
|
4
|
+
export interface SwitchEditorProps {
|
|
5
|
+
onCheckedChange?: (e: any) => void;
|
|
6
|
+
of?: Shape;
|
|
7
|
+
property?: PropertyDetails;
|
|
8
|
+
/**
|
|
9
|
+
* Converts the value returned by the shape, to the input string for the switch
|
|
10
|
+
* @param shapePropertyValue
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Converts the value of the switch to a value that can be provided to the set method of the shape
|
|
16
|
+
* @param inputValue
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
20
|
+
}
|
|
21
|
+
export declare const SwitchEditor: ({ onCheckedChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }: SwitchEditorProps) => React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Switch } from '@_linked/primitives/components/Switch';
|
|
3
|
+
export const SwitchEditor = ({ onCheckedChange, of, property, preConvertValueFn, postConvertValueFn, ...restProps }) => {
|
|
4
|
+
const onChangeHandler = (value) => {
|
|
5
|
+
console.log(value, 'value switch');
|
|
6
|
+
if (!of)
|
|
7
|
+
return;
|
|
8
|
+
if (postConvertValueFn) {
|
|
9
|
+
value = postConvertValueFn(value);
|
|
10
|
+
}
|
|
11
|
+
of[property.label] = value;
|
|
12
|
+
console.log(of[property.label], 'of[property.label] switch');
|
|
13
|
+
if (onCheckedChange) {
|
|
14
|
+
onCheckedChange(value);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return (React.createElement(Switch, { value: of[property.label], onCheckedChange: onChangeHandler, defaultChecked: of
|
|
18
|
+
? preConvertValueFn
|
|
19
|
+
? preConvertValueFn(of[property.label])
|
|
20
|
+
: of[property.label]
|
|
21
|
+
: '', ...restProps }));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=SwitchEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchEditor.js","sourceRoot":"","sources":["../../../src/components/SwitchEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAsB/D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,eAAe,EACf,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE7D,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACzB,eAAe,EAAE,eAAe,EAChC,cAAc,EACZ,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,KAEJ,SAAS,GACb,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Shape } from '@_linked/core/shapes/Shape';
|
|
3
|
+
export interface TextareaEditorProps {
|
|
4
|
+
onChange?: (e: any) => void;
|
|
5
|
+
value?: string[];
|
|
6
|
+
of?: Shape;
|
|
7
|
+
property?: string;
|
|
8
|
+
children?: any;
|
|
9
|
+
className?: any;
|
|
10
|
+
/**
|
|
11
|
+
* Converts the value returned by the shape, to the text area string for the text area
|
|
12
|
+
* @param shapePropertyValue
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts the value of the text area to a value that can be provided to the set method of the shape
|
|
18
|
+
* @param textAreaValue
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
postConvertValueFn?: (textAreaValue: string) => any;
|
|
22
|
+
}
|
|
23
|
+
export declare const TextareaEditor: ({ onChange, value, of, property, preConvertValueFn, postConvertValueFn, children, className, ...props }: TextareaEditorProps) => React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Textarea } from '@_linked/primitives/components/Textarea';
|
|
3
|
+
export const TextareaEditor = ({ onChange, value, of, property, preConvertValueFn, postConvertValueFn, children, className, ...props }) => {
|
|
4
|
+
const onChangeHandler = (e) => {
|
|
5
|
+
if (onChange) {
|
|
6
|
+
onChange(e);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
return (React.createElement(Textarea, { onChange: onChangeHandler, defaultValue: of
|
|
10
|
+
? preConvertValueFn
|
|
11
|
+
? preConvertValueFn(of[property])
|
|
12
|
+
: of[property]
|
|
13
|
+
: '', value: value, ...props }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=TextareaEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextareaEditor.js","sourceRoot":"","sources":["../../../src/components/TextareaEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAsBnE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACY,EAAE,EAAE;IACxB,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE;QAC5B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,QAAQ,IACP,QAAQ,EAAE,eAAe,EACzB,YAAY,EACV,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;gBACjC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC;YAChB,CAAC,CAAC,EAAE,EAER,KAAK,EAAE,KAAK,KACR,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Shape } from '@_linked/core/shapes/Shape';
|
|
3
|
+
import { InputProps } from '@_linked/primitives/components/Input';
|
|
4
|
+
export interface TextfieldProps extends InputProps {
|
|
5
|
+
onChange?: (e: any) => void;
|
|
6
|
+
value?: number | string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
of: Shape;
|
|
9
|
+
valueProperty?: string;
|
|
10
|
+
property?: any;
|
|
11
|
+
/**
|
|
12
|
+
* Converts the value returned by the shape, to the input string for the input field
|
|
13
|
+
* @param shapePropertyValue
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Converts the value of the input field to a value that can be provided to the set method of the shape
|
|
19
|
+
* @param inputValue
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
23
|
+
}
|
|
24
|
+
export declare const TextfieldEditor: ({ onChange, value, of, property, valueProperty, preConvertValueFn, postConvertValueFn, ...restProps }: TextfieldProps) => React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Input } from '@_linked/primitives/components/Input';
|
|
3
|
+
export const TextfieldEditor = ({ onChange, value, of, property, valueProperty, preConvertValueFn, postConvertValueFn, ...restProps }) => {
|
|
4
|
+
const onBlur = (e) => {
|
|
5
|
+
let value = e.currentTarget.value;
|
|
6
|
+
if (!of)
|
|
7
|
+
return;
|
|
8
|
+
if (postConvertValueFn) {
|
|
9
|
+
value = postConvertValueFn(value);
|
|
10
|
+
}
|
|
11
|
+
of[property.label] = value;
|
|
12
|
+
console.log('of', of);
|
|
13
|
+
console.log('value', value);
|
|
14
|
+
};
|
|
15
|
+
const onChangeHandler = (e) => {
|
|
16
|
+
if (onChange) {
|
|
17
|
+
onChange(e);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return (React.createElement(Input, { value: value, onChange: onChangeHandler, defaultValue: of
|
|
21
|
+
? preConvertValueFn
|
|
22
|
+
? preConvertValueFn(of[property.label])
|
|
23
|
+
: of[property.label]
|
|
24
|
+
: '', onBlur: onBlur, ...restProps }));
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=TextfieldEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextfieldEditor.js","sourceRoot":"","sources":["../../../src/components/TextfieldEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,EAAc,MAAM,sCAAsC,CAAC;AAuBzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,EAAE,EACF,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACG,EAAE,EAAE;IACnB,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE;QACnB,IAAI,KAAK,GAAG,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;QAClC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,EAAE;QAC5B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,KAAK,IACJ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,eAAe,EACzB,YAAY,EACV,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,EAER,MAAM,EAAE,MAAM,KACV,SAAS,GACb,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Shape } from '@_linked/core/shapes/Shape';
|
|
3
|
+
import { PropertyShape } from '@_linked/core/shapes/SHACL';
|
|
4
|
+
export interface ToggleEditorProps {
|
|
5
|
+
onPressedChange?: (e: any) => void;
|
|
6
|
+
of?: Shape;
|
|
7
|
+
property?: PropertyShape;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Converts the value returned by the shape, to the input string for the toggle
|
|
11
|
+
* @param shapePropertyValue
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
preConvertValueFn?: (shapePropertyValue: any) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Converts the value of the toggle to a value that can be provided to the set method of the shape
|
|
17
|
+
* @param inputValue
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
postConvertValueFn?: (inputValue: string) => any;
|
|
21
|
+
}
|
|
22
|
+
export declare const ToggleEditor: ({ onPressedChange, of, property, children, preConvertValueFn, postConvertValueFn, ...restProps }: ToggleEditorProps) => React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Root as Toggle } from '@_linked/primitives/components/Toggle';
|
|
3
|
+
export const ToggleEditor = ({ onPressedChange, of, property, children, preConvertValueFn, postConvertValueFn, ...restProps }) => {
|
|
4
|
+
const onChangeHandler = (value) => {
|
|
5
|
+
console.log(value, 'value toggle');
|
|
6
|
+
if (!of)
|
|
7
|
+
return;
|
|
8
|
+
if (postConvertValueFn) {
|
|
9
|
+
value = postConvertValueFn(value);
|
|
10
|
+
}
|
|
11
|
+
of[property.label] = value;
|
|
12
|
+
console.log(of[property.label], 'of[property.label] toggle');
|
|
13
|
+
if (onPressedChange) {
|
|
14
|
+
onPressedChange(value);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return (React.createElement(Toggle, { pressed: of[property.label], onPressedChange: onChangeHandler, defaultPressed: of
|
|
18
|
+
? preConvertValueFn
|
|
19
|
+
? preConvertValueFn(of[property.label])
|
|
20
|
+
: of[property.label]
|
|
21
|
+
: '', ...restProps }, children));
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ToggleEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleEditor.js","sourceRoot":"","sources":["../../../src/components/ToggleEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAsBvE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,eAAe,EACf,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,GAAG,SAAS,EACM,EAAE,EAAE;IACtB,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACnC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE7D,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC3B,eAAe,EAAE,eAAe,EAChC,cAAc,EACZ,EAAE;YACA,CAAC,CAAC,iBAAiB;gBACjB,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;YACtB,CAAC,CAAC,EAAE,KAEJ,SAAS,IAEZ,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './ontologies/lincd-ui.js';
|
|
2
|
+
import './components/TextfieldEditor.js';
|
|
3
|
+
import './components/RadioButtonEditor.js';
|
|
4
|
+
import './components/TextareaEditor.js';
|
|
5
|
+
import './components/DateEditor.js';
|
|
6
|
+
import './components/SwitchEditor.js';
|
|
7
|
+
import './components/CheckboxEditor.js';
|
|
8
|
+
import './components/ToggleEditor.js';
|
|
9
|
+
import './components/SelectEditor.js';
|
|
10
|
+
import './components/AvatarEditor.js';
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import './ontologies/lincd-ui.js';
|
|
2
|
+
// lincd-ui package is for process the shape in the component
|
|
3
|
+
//SHAPES FIRST
|
|
4
|
+
// import './shapes/YourShape';
|
|
5
|
+
//THEN COMPONENTS
|
|
6
|
+
import './components/TextfieldEditor.js';
|
|
7
|
+
import './components/RadioButtonEditor.js';
|
|
8
|
+
import './components/TextareaEditor.js';
|
|
9
|
+
import './components/DateEditor.js';
|
|
10
|
+
import './components/SwitchEditor.js';
|
|
11
|
+
import './components/CheckboxEditor.js';
|
|
12
|
+
import './components/ToggleEditor.js';
|
|
13
|
+
import './components/SelectEditor.js';
|
|
14
|
+
import './components/AvatarEditor.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC;AAElC,6DAA6D;AAE7D,cAAc;AACd,+BAA+B;AAE/B,iBAAiB;AACjB,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,gCAAgC,CAAC;AACxC,OAAO,4BAA4B,CAAC;AACpC,OAAO,8BAA8B,CAAC;AACtC,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const loadData: () => Promise<any>;
|
|
2
|
+
export declare const ns: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
3
|
+
export declare const _self: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
4
|
+
export declare const lincdUi: {
|
|
5
|
+
_self: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
6
|
+
};
|