@dataloop-ai/components 0.18.28 → 0.18.30
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/package.json +1 -1
- package/src/assets/globals.scss +16 -0
- package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +31 -8
- package/src/components/compound/DlJsonEditor/types.ts +3 -4
- package/src/components/essential/DlLayout/DlLayout.vue +1 -1
- package/src/demos/DlJsonEditorDemo.vue +17 -3
- package/src/layouts/DlDatasetBrowserLayout/DlDatasetBrowserLayout.vue +26 -3
package/package.json
CHANGED
package/src/assets/globals.scss
CHANGED
|
@@ -200,6 +200,15 @@ body {
|
|
|
200
200
|
--dl-date-picker-shadow: 0px 3px 6px #101e7326;
|
|
201
201
|
--dl-date-picker-selected-strip: rgb(52, 82, 255, 0.2);
|
|
202
202
|
--dl-date-picker-selected-date: #8FA0FF;
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
// DlJsonEditor based on atom one themes
|
|
206
|
+
--dl-json-editor-key-color: #a626a4;
|
|
207
|
+
--dl-json-editor-background-color: #fafafa;
|
|
208
|
+
--dl-json-editor-panel-background: #fafafa;
|
|
209
|
+
--dl-json-editor-value-color-boolean: #0184bb;
|
|
210
|
+
--dl-json-editor-value-color-number: #c18401;
|
|
211
|
+
--dl-json-editor-value-color-string: #50a14f;
|
|
203
212
|
}
|
|
204
213
|
|
|
205
214
|
/* Define styles for the root window with dark - mode preference */
|
|
@@ -250,6 +259,13 @@ body {
|
|
|
250
259
|
--dl-date-picker-shadow: 0px 3px 6px #292e3580;
|
|
251
260
|
--dl-date-picker-selected-strip: rgb(124, 140, 255, 0.2);
|
|
252
261
|
--dl-date-picker-selected-date: #535E96;
|
|
262
|
+
|
|
263
|
+
--dl-json-editor-key-color: #c678dd;
|
|
264
|
+
--dl-json-editor-background-color: #282c34;
|
|
265
|
+
--dl-json-editor-panel-background: #282c34;
|
|
266
|
+
--dl-json-editor-value-color-boolean: #56b6c2;
|
|
267
|
+
--dl-json-editor-value-color-number: #d19a66;
|
|
268
|
+
--dl-json-editor-value-color-string: #98c379;
|
|
253
269
|
}
|
|
254
270
|
|
|
255
271
|
// scrollbar
|
|
@@ -6,7 +6,14 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
defineComponent,
|
|
11
|
+
onMounted,
|
|
12
|
+
PropType,
|
|
13
|
+
ref,
|
|
14
|
+
toRefs,
|
|
15
|
+
watch
|
|
16
|
+
} from 'vue-demi'
|
|
10
17
|
import {
|
|
11
18
|
Content,
|
|
12
19
|
ContentParseError,
|
|
@@ -41,11 +48,16 @@ export default defineComponent({
|
|
|
41
48
|
required: false,
|
|
42
49
|
type: Boolean,
|
|
43
50
|
default: false
|
|
51
|
+
},
|
|
52
|
+
mode: {
|
|
53
|
+
required: false,
|
|
54
|
+
type: String as PropType<Mode>,
|
|
55
|
+
default: Mode.text
|
|
44
56
|
}
|
|
45
57
|
},
|
|
46
58
|
emits: ['update:model-value', 'align-text', 'change'],
|
|
47
59
|
setup(props, { emit }) {
|
|
48
|
-
const { modelValue, indentation, readonly } = toRefs(props)
|
|
60
|
+
const { modelValue, indentation, readonly, mode } = toRefs(props)
|
|
49
61
|
|
|
50
62
|
const jsonEditorRef = ref(null)
|
|
51
63
|
const jsonEditor = ref<JSONEditor>(null as any)
|
|
@@ -62,6 +74,13 @@ export default defineComponent({
|
|
|
62
74
|
})
|
|
63
75
|
})
|
|
64
76
|
|
|
77
|
+
watch(mode, (val) => {
|
|
78
|
+
jsonEditor.value?.updateProps({
|
|
79
|
+
mode: val,
|
|
80
|
+
readOnly: val === Mode.tree
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
65
84
|
const handleJSONChange = (
|
|
66
85
|
content: Content,
|
|
67
86
|
previousContent: Content,
|
|
@@ -134,6 +153,7 @@ export default defineComponent({
|
|
|
134
153
|
jsonEditor.value?.set({
|
|
135
154
|
text: formatted
|
|
136
155
|
})
|
|
156
|
+
emit('align-text')
|
|
137
157
|
} catch (e) {
|
|
138
158
|
console.warn('[DlJsonEditor] Failed to format document', e)
|
|
139
159
|
return
|
|
@@ -155,17 +175,20 @@ export default defineComponent({
|
|
|
155
175
|
|
|
156
176
|
<style lang="scss" scoped>
|
|
157
177
|
.json-editor {
|
|
178
|
+
width: 100%;
|
|
179
|
+
height: 100%;
|
|
180
|
+
|
|
158
181
|
--jse-text-color: var(--dl-color-tooltip-background);
|
|
159
182
|
--jse-delimiter-color: var(--dl-color-tooltip-background);
|
|
160
|
-
--jse-key-color: var(--dl-color
|
|
161
|
-
--jse-background-color: var(--dl-
|
|
162
|
-
--jse-value-color-boolean:
|
|
163
|
-
--jse-value-color-string:
|
|
164
|
-
--jse-
|
|
183
|
+
--jse-key-color: var(--dl-json-editor-key-color);
|
|
184
|
+
--jse-background-color: var(--dl-json-editor-background-color);
|
|
185
|
+
--jse-value-color-boolean: var(--dl-json-editor-value-color-boolean);
|
|
186
|
+
--jse-value-color-string: var(--dl-json-editor-value-color-string);
|
|
187
|
+
--jse-value-color-number: var(--dl-json-editor-value-color-number);
|
|
188
|
+
--jse-panel-background: var(--dl-json-editor-panel-background);
|
|
165
189
|
--jse-panel-border: var(--dl-color-separator);
|
|
166
190
|
--jse-main-border: 1px solid var(--dl-color-separator);
|
|
167
191
|
|
|
168
|
-
height: 100%;
|
|
169
192
|
.jse-error {
|
|
170
193
|
display: none !important;
|
|
171
194
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { Mode as DlJsonEditorModes } from 'vanilla-jsoneditor'
|
|
2
|
+
|
|
3
|
+
export { DlJsonEditorModes }
|
|
@@ -14,11 +14,19 @@
|
|
|
14
14
|
v-model="readonly"
|
|
15
15
|
left-label="read only"
|
|
16
16
|
/>
|
|
17
|
+
<div style="height: 200px; width: 500px">
|
|
18
|
+
<dl-select
|
|
19
|
+
v-model="mode"
|
|
20
|
+
:options="['text', 'tree']"
|
|
21
|
+
title="Mode"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
17
24
|
<div style="height: 200px; width: 500px">
|
|
18
25
|
<dl-json-editor
|
|
19
26
|
ref="jsonEditorEl"
|
|
20
27
|
v-model="jsonModel"
|
|
21
28
|
:readonly="readonly"
|
|
29
|
+
:mode="mode"
|
|
22
30
|
/>
|
|
23
31
|
</div>
|
|
24
32
|
<span>JSON: {{ jsonModel }}</span>
|
|
@@ -54,15 +62,18 @@ import {
|
|
|
54
62
|
DlDialogBox,
|
|
55
63
|
DlDialogBoxHeader,
|
|
56
64
|
DlButton,
|
|
57
|
-
DlSwitch
|
|
65
|
+
DlSwitch,
|
|
66
|
+
DlSelect
|
|
58
67
|
} from '../components'
|
|
68
|
+
import { DlJsonEditorModes } from '../components/compound/DlJsonEditor/types'
|
|
59
69
|
export default defineComponent({
|
|
60
70
|
components: {
|
|
61
71
|
DlJsonEditor,
|
|
62
72
|
DlDialogBox,
|
|
63
73
|
DlDialogBoxHeader,
|
|
64
74
|
DlButton,
|
|
65
|
-
DlSwitch
|
|
75
|
+
DlSwitch,
|
|
76
|
+
DlSelect
|
|
66
77
|
},
|
|
67
78
|
setup() {
|
|
68
79
|
const jsonModel = ref('')
|
|
@@ -70,12 +81,15 @@ export default defineComponent({
|
|
|
70
81
|
const dialogState = ref(false)
|
|
71
82
|
const jsonEditorEl = ref(null)
|
|
72
83
|
const readonly = ref(false)
|
|
84
|
+
const mode = ref(DlJsonEditorModes.text)
|
|
85
|
+
|
|
73
86
|
return {
|
|
74
87
|
jsonModel,
|
|
75
88
|
dialogState,
|
|
76
89
|
dialogJsonModel,
|
|
77
90
|
jsonEditorEl,
|
|
78
|
-
readonly
|
|
91
|
+
readonly,
|
|
92
|
+
mode
|
|
79
93
|
}
|
|
80
94
|
}
|
|
81
95
|
})
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<dl-layout :template="template">
|
|
3
3
|
<template #header>
|
|
4
|
-
<slot name="header"
|
|
4
|
+
<slot name="header">
|
|
5
|
+
<dl-page-layout-header
|
|
6
|
+
:title="title"
|
|
7
|
+
:sub-title="subTitle"
|
|
8
|
+
:counters="counters"
|
|
9
|
+
/>
|
|
10
|
+
</slot>
|
|
5
11
|
</template>
|
|
6
12
|
<template #leftDrawer>
|
|
7
13
|
<slot name="leftDrawer" />
|
|
@@ -19,13 +25,30 @@
|
|
|
19
25
|
</template>
|
|
20
26
|
|
|
21
27
|
<script lang="ts">
|
|
22
|
-
import { defineComponent } from 'vue-demi'
|
|
28
|
+
import { defineComponent, PropType } from 'vue-demi'
|
|
23
29
|
import { DlLayout } from '../../components'
|
|
30
|
+
import { DlCounterItem } from '../../types'
|
|
31
|
+
import DlPageLayoutHeader from '../DlPageLayout/components/DlPageLayoutHeader/DlPageLayoutHeader.vue'
|
|
24
32
|
|
|
25
33
|
export default defineComponent({
|
|
26
34
|
name: 'DlDatasetBrowser',
|
|
27
35
|
components: {
|
|
28
|
-
DlLayout
|
|
36
|
+
DlLayout,
|
|
37
|
+
DlPageLayoutHeader
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
title: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ''
|
|
43
|
+
},
|
|
44
|
+
subTitle: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
counters: {
|
|
49
|
+
type: Array as PropType<DlCounterItem[]>,
|
|
50
|
+
default: () => [] as DlCounterItem[]
|
|
51
|
+
}
|
|
29
52
|
},
|
|
30
53
|
setup() {
|
|
31
54
|
const template = '"h h h" "l p r" "f f f"'
|