@dataloop-ai/components 0.18.144 → 0.19.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/package.json +4 -1
- package/src/assets/constants.scss +25 -26
- package/src/assets/globals.scss +58 -56
- package/src/assets/grid.css +1 -1
- package/src/assets/grid.scss +4 -4
- package/src/components/basic/DlAccordion/DlAccordion.vue +10 -3
- package/src/components/basic/DlEmptyState/types.ts +1 -1
- package/src/components/basic/DlGrid/DlGrid.vue +2 -1
- package/src/components/basic/DlPopup/DlPopup.vue +159 -396
- package/src/components/basic/DlWidget/DlWidget.vue +2 -1
- package/src/components/basic/utils.ts +0 -9
- package/src/components/blocks/DlLabelPicker/DlLabelPicker.vue +127 -0
- package/src/components/blocks/DlLabelPicker/index.ts +3 -0
- package/src/components/blocks/DlLabelPicker/types.ts +6 -0
- package/src/components/blocks/index.ts +1 -0
- package/src/components/blocks/types.ts +1 -0
- package/src/components/compound/DlCodeEditor/README.md +5 -4
- package/src/components/compound/DlCodeEditor/styles/themes-base16.css +16934 -11289
- package/src/components/compound/DlCodeEditor/styles/themes.css +5122 -3448
- package/src/components/compound/DlInput/DlInput.vue +609 -178
- package/src/components/compound/DlInput/components/InputFileElement.vue +97 -0
- package/src/components/compound/DlInput/types.ts +12 -0
- package/src/components/compound/DlInput/utils.ts +117 -0
- package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +10 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +12 -3
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +1 -1
- package/src/components/compound/DlSlider/sliderStyles.scss +92 -92
- package/src/components/compound/DlTable/DlTable.vue +701 -358
- package/src/components/compound/DlTable/components/DlTd.vue +11 -9
- package/src/components/compound/DlTable/components/DlTh.vue +22 -21
- package/src/components/compound/DlTable/components/SortableJS.vue +33 -0
- package/src/components/compound/DlTable/hooks/tableActions.ts +3 -3
- package/src/components/compound/DlTable/hooks/tableColumnSelection.ts +3 -4
- package/src/components/compound/DlTable/hooks/use-sortable.ts +152 -0
- package/src/components/compound/DlTable/styles/dl-table-styles.scss +372 -377
- package/src/components/compound/DlTable/types.ts +6 -0
- package/src/components/compound/DlTable/utils/getCellValue.ts +27 -0
- package/src/components/compound/DlTable/utils/insertAtIndex.ts +22 -0
- package/src/components/compound/DlTable/utils/tableClasses.ts +22 -0
- package/src/components/compound/DlToast/api/useToast.ts +10 -4
- package/src/components/compound/DlToast/components/ToastComponent.vue +26 -21
- package/src/components/compound/DlToast/utils/render.ts +15 -8
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +708 -323
- package/src/components/compound/DlTreeTable/components/DlTdTree.vue +10 -9
- package/src/components/compound/DlTreeTable/components/DlTrTree.vue +13 -0
- package/src/components/compound/DlTreeTable/emits.ts +2 -2
- package/src/components/compound/DlTreeTable/utils/index.ts +6 -0
- package/src/components/compound/DlTreeTable/utils/moveNestedRow.ts +95 -0
- package/src/components/compound/DlTreeTable/utils/trSpacing.ts +12 -1
- package/src/components/compound/DlTreeTable/utils/treeTableRowSelection.ts +10 -7
- package/src/components/compound/DlTreeTable/views/DlTrTreeView.vue +52 -58
- package/src/components/essential/DlMenu/DlMenu.vue +25 -0
- package/src/components/index.ts +1 -0
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +2 -1
- package/src/components/shared/DlVirtualScroll/styles/dl-virtual-scroll-styles.scss +62 -41
- package/src/components/types.ts +1 -0
- package/src/demos/DlAccordionDemo.vue +32 -0
- package/src/demos/DlButtonDemo.vue +7 -0
- package/src/demos/DlDemoPage.vue +1 -0
- package/src/demos/DlInputDemo.vue +122 -64
- package/src/demos/DlLabelPickerDemo.vue +46 -0
- package/src/demos/DlPopupDemo.vue +94 -4
- package/src/demos/DlSearchDemo.vue +0 -1
- package/src/demos/DlTableDemo.vue +261 -162
- package/src/demos/DlToastDemo.vue +28 -1
- package/src/demos/DlTreeTableDemo.vue +266 -262
- package/src/demos/DlVirtualScrollDemo.vue +1 -4
- package/src/demos/index.ts +3 -1
- package/src/hooks/use-model-toggle.ts +26 -62
- package/src/utils/browse-nested-nodes.ts +26 -0
- package/src/utils/draggable-table.ts +100 -488
- package/src/utils/get-element-above.ts +8 -0
- package/src/utils/getSlotByVersion.ts +11 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/keyCodes.ts +1 -1
- package/src/utils/remove-child-nodes.ts +5 -0
- package/src/utils/render-fn.ts +46 -0
- package/src/utils/resizable-table.ts +110 -0
- package/src/utils/selection.ts +196 -0
- package/src/utils/swap-nodes.ts +11 -0
- package/src/utils/table-columns.ts +209 -0
- package/src/components/compound/DlTable/utils/ResizableManager.ts +0 -236
- package/src/components/compound/DlTable/utils/index.ts +0 -1
- package/src/components/compound/DlTable/utils/props.ts +0 -120
- package/src/components/compound/DlTreeTable/props.ts +0 -134
- package/src/components/compound/DlTreeTable/utils/flatTreeData.ts +0 -19
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
import { v4 } from 'uuid'
|
|
67
67
|
import { computed, defineComponent, ref, toRef, PropType } from 'vue-demi'
|
|
68
68
|
import { DlIcon } from '../../essential'
|
|
69
|
-
import {
|
|
69
|
+
import { addMouseEnter, removeMouseEnter } from '../utils'
|
|
70
|
+
import { getElementAbove } from '../../../utils'
|
|
70
71
|
import { DlEmptyStateProps } from '../DlEmptyState/types'
|
|
71
72
|
import DlEmptyState from '../DlEmptyState/DlEmptyState.vue'
|
|
72
73
|
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export function getElementAbove(el: HTMLElement, className: string) {
|
|
2
|
-
//@ts-ignore
|
|
3
|
-
for (; el && el !== document; el = el.parentNode) {
|
|
4
|
-
if (el.classList.contains(className)) {
|
|
5
|
-
return el
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
1
|
export function addMouseEnter(className: string, method: EventListenerObject) {
|
|
11
2
|
Array.from(document.getElementsByClassName(className)).forEach((widget) => {
|
|
12
3
|
widget.addEventListener('mouseenter', method)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="width: 200px">
|
|
3
|
+
<dl-input
|
|
4
|
+
v-model="inputValue"
|
|
5
|
+
:placeholder="placeHolderText"
|
|
6
|
+
size="l"
|
|
7
|
+
has-prepend
|
|
8
|
+
padding-prop="0px 0px 0px 0px"
|
|
9
|
+
:style="inputStyles"
|
|
10
|
+
>
|
|
11
|
+
<template #prepend>
|
|
12
|
+
<dl-icon
|
|
13
|
+
style="margin-bottom: 5px"
|
|
14
|
+
icon="icon-dl-search"
|
|
15
|
+
size="12px"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
</dl-input>
|
|
19
|
+
<dl-tree-table
|
|
20
|
+
draggable="none"
|
|
21
|
+
separator="none"
|
|
22
|
+
:hide-pagination="true"
|
|
23
|
+
:hide-header="true"
|
|
24
|
+
:bordered="false"
|
|
25
|
+
:columns="columns"
|
|
26
|
+
selection="none"
|
|
27
|
+
:loading="false"
|
|
28
|
+
:filter="inputValue"
|
|
29
|
+
:rows="items"
|
|
30
|
+
row-key="name"
|
|
31
|
+
color="dl-color-secondary"
|
|
32
|
+
@row-click="handleRowClick"
|
|
33
|
+
>
|
|
34
|
+
<template #body-cell-displayLabel="item">
|
|
35
|
+
<DlLabel
|
|
36
|
+
:text="item.row.displayLabel"
|
|
37
|
+
:indicator-color="item.row.color"
|
|
38
|
+
class="dl-label-picker-item"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
|
+
</dl-tree-table>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts">
|
|
46
|
+
import { ref, PropType, defineComponent, computed } from 'vue-demi'
|
|
47
|
+
import { DlLabel, DlIcon } from '../../essential'
|
|
48
|
+
import { DlInput, DlTreeTable } from '../../compound'
|
|
49
|
+
import { DlTableColumn } from '../../types'
|
|
50
|
+
import { DlLabelPickerItem } from './types'
|
|
51
|
+
|
|
52
|
+
export default defineComponent({
|
|
53
|
+
name: 'DlLabelPicker',
|
|
54
|
+
components: {
|
|
55
|
+
DlInput,
|
|
56
|
+
DlIcon,
|
|
57
|
+
DlLabel,
|
|
58
|
+
DlTreeTable
|
|
59
|
+
},
|
|
60
|
+
props: {
|
|
61
|
+
items: {
|
|
62
|
+
type: Array as PropType<DlLabelPickerItem[]>,
|
|
63
|
+
default: () => [] as PropType<DlLabelPickerItem[]>
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
emits: ['selectedLabel'],
|
|
67
|
+
setup(props, { emit, slots }) {
|
|
68
|
+
const columns: DlTableColumn[] = [
|
|
69
|
+
{
|
|
70
|
+
name: 'displayLabel',
|
|
71
|
+
label: '',
|
|
72
|
+
required: false,
|
|
73
|
+
align: 'left',
|
|
74
|
+
field: 'displayLabel',
|
|
75
|
+
sortable: false,
|
|
76
|
+
style: `cursor: pointer;`
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
const inputValue = ref('')
|
|
81
|
+
const isInputActive = ref(false)
|
|
82
|
+
const inputBorderLeft = ref('2px solid transparent')
|
|
83
|
+
const currentSelectedLabel = ref<DlLabelPickerItem>(null)
|
|
84
|
+
|
|
85
|
+
const handleRowClick = (_: MouseEvent, item: DlLabelPickerItem) => {
|
|
86
|
+
currentSelectedLabel.value = item
|
|
87
|
+
emit('selectedLabel', item)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const placeHolderText = computed(() => {
|
|
91
|
+
if (!currentSelectedLabel.value) {
|
|
92
|
+
return `No items selected`
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return currentSelectedLabel.value.displayLabel
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const selectedColor = computed(() => {
|
|
99
|
+
if (!currentSelectedLabel.value) {
|
|
100
|
+
return null
|
|
101
|
+
}
|
|
102
|
+
return currentSelectedLabel.value.color
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
const inputStyles = computed(() => {
|
|
106
|
+
return { 'border-left': `2px solid ${selectedColor.value}` }
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
handleRowClick,
|
|
111
|
+
inputValue,
|
|
112
|
+
inputBorderLeft,
|
|
113
|
+
isInputActive,
|
|
114
|
+
columns,
|
|
115
|
+
selectedColor,
|
|
116
|
+
placeHolderText,
|
|
117
|
+
inputStyles
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style scope>
|
|
124
|
+
.dl-label-picker-item {
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DlLabelPicker'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DlLabelPicker/types'
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# DlCodeEditor
|
|
1
|
+
# DlCodeEditor
|
|
2
2
|
|
|
3
3
|
The DlCodeEditor component is based off the [simple-code-editor](https://github.com/justcaliturner/simple-code-editor) written by [Vic](https://github.com/justcaliturner)
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
#### Modifications
|
|
7
|
-
|
|
6
|
+
|
|
7
|
+
The code itself was modified a bit to support vue 2.6 and vue3 together using the library vue-demi and general vue changes.
|
|
8
|
+
|
|
8
9
|
1. moved to composition api
|
|
9
10
|
2. used vue-demi to support transition between library versions
|
|
10
11
|
3. used library version agnostic terms and behaviors
|
|
11
|
-
4. use custom components for the header and other elements
|
|
12
|
+
4. use custom components for the header and other elements
|