@dataloop-ai/components 0.18.145 → 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 +3 -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
|
@@ -265,16 +265,13 @@ export default defineComponent({
|
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
const log = console.log
|
|
269
|
-
|
|
270
268
|
return {
|
|
271
269
|
heavyList,
|
|
272
270
|
basicList,
|
|
273
271
|
horizontalList,
|
|
274
272
|
customList,
|
|
275
273
|
columns,
|
|
276
|
-
cardData
|
|
277
|
-
log
|
|
274
|
+
cardData
|
|
278
275
|
}
|
|
279
276
|
}
|
|
280
277
|
})
|
package/src/demos/index.ts
CHANGED
|
@@ -66,6 +66,7 @@ import DlJsonEditorDemo from './DlJsonEditorDemo.vue'
|
|
|
66
66
|
import DlThumbnailGallery from './DlThumbnailGalleryDemo.vue'
|
|
67
67
|
import DlLayoutDemo from './DlLayoutDemo.vue'
|
|
68
68
|
import { DlCodeEditorDemo } from './DlCodeEditor'
|
|
69
|
+
import DlLabelPickerDemo from './DlLabelPickerDemo.vue'
|
|
69
70
|
|
|
70
71
|
export default {
|
|
71
72
|
AvatarDemo,
|
|
@@ -132,5 +133,6 @@ export default {
|
|
|
132
133
|
DlJsonEditorDemo,
|
|
133
134
|
DlThumbnailGallery,
|
|
134
135
|
DlCodeEditorDemo,
|
|
135
|
-
DlLayoutDemo
|
|
136
|
+
DlLayoutDemo,
|
|
137
|
+
DlLabelPickerDemo
|
|
136
138
|
}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
watch,
|
|
3
|
-
nextTick,
|
|
4
|
-
onMounted,
|
|
5
|
-
getCurrentInstance,
|
|
6
|
-
Ref,
|
|
7
|
-
PropType,
|
|
8
|
-
isVue2
|
|
9
|
-
} from 'vue-demi'
|
|
10
|
-
|
|
11
|
-
const modelValueNaming = isVue2 ? 'model-value' : 'modelValue'
|
|
12
|
-
|
|
13
|
-
const staticUseModelToggleProps: any = {
|
|
14
|
-
modelValue: {
|
|
15
|
-
type: Boolean as PropType<boolean>,
|
|
16
|
-
default: false
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import { watch, nextTick, onMounted, getCurrentInstance, Ref } from 'vue-demi'
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export const useModelToggleProps = staticUseModelToggleProps as {
|
|
23
|
-
modelValue: {
|
|
24
|
-
type: PropType<boolean>
|
|
25
|
-
default: boolean
|
|
26
|
-
}
|
|
27
|
-
'onUpdate:model-value': (FunctionConstructor | ArrayConstructor)[]
|
|
3
|
+
export const useModelToggleProps = {
|
|
4
|
+
modelValue: Boolean
|
|
28
5
|
}
|
|
29
6
|
|
|
30
7
|
export const useModelToggleEmits = [
|
|
@@ -32,15 +9,13 @@ export const useModelToggleEmits = [
|
|
|
32
9
|
'show',
|
|
33
10
|
'before-hide',
|
|
34
11
|
'hide',
|
|
35
|
-
'update:
|
|
12
|
+
'update:model-value'
|
|
36
13
|
]
|
|
37
14
|
|
|
38
15
|
export interface AnchorEvent extends KeyboardEvent {
|
|
39
16
|
dlAnchorHandled?: boolean
|
|
40
17
|
}
|
|
41
18
|
|
|
42
|
-
// handleShow/handleHide -> removeTick(), self (& emit show)
|
|
43
|
-
|
|
44
19
|
export default function useModelToggle({
|
|
45
20
|
showing,
|
|
46
21
|
canShow, // optional
|
|
@@ -76,22 +51,16 @@ export default function useModelToggle({
|
|
|
76
51
|
return
|
|
77
52
|
}
|
|
78
53
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
(vm!.proxy! as any)?.$listeners?.[`update:${modelValueNaming}`]
|
|
82
|
-
|
|
83
|
-
if (listener) {
|
|
84
|
-
emit(`update:${modelValueNaming}`, true)
|
|
85
|
-
payload = evt
|
|
54
|
+
emit(`update:model-value`, true)
|
|
55
|
+
payload = evt
|
|
86
56
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
57
|
+
nextTick(() => {
|
|
58
|
+
if (payload === evt) {
|
|
59
|
+
payload = null
|
|
60
|
+
}
|
|
61
|
+
})
|
|
93
62
|
|
|
94
|
-
if (!props.modelValue
|
|
63
|
+
if (!props.modelValue) {
|
|
95
64
|
processShow(evt)
|
|
96
65
|
}
|
|
97
66
|
}
|
|
@@ -117,21 +86,15 @@ export default function useModelToggle({
|
|
|
117
86
|
return
|
|
118
87
|
}
|
|
119
88
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
nextTick(() => {
|
|
128
|
-
if (payload === evt) {
|
|
129
|
-
payload = null
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
}
|
|
89
|
+
emit(`update:model-value`, false)
|
|
90
|
+
payload = evt
|
|
91
|
+
nextTick(() => {
|
|
92
|
+
if (payload === evt) {
|
|
93
|
+
payload = null
|
|
94
|
+
}
|
|
95
|
+
})
|
|
133
96
|
|
|
134
|
-
if (!props.modelValue
|
|
97
|
+
if (!props.modelValue) {
|
|
135
98
|
processHide(evt)
|
|
136
99
|
}
|
|
137
100
|
}
|
|
@@ -154,16 +117,17 @@ export default function useModelToggle({
|
|
|
154
117
|
|
|
155
118
|
function processModelChange(val: boolean) {
|
|
156
119
|
if (props.disabled === true && val === true) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
} else if ((val === true) !== showing.value) {
|
|
120
|
+
emit(`update:model-value`, false)
|
|
121
|
+
} else if (val !== showing.value) {
|
|
161
122
|
const fn = val === true ? processShow : processHide
|
|
162
123
|
fn(payload as AnchorEvent)
|
|
163
124
|
}
|
|
164
125
|
}
|
|
165
126
|
|
|
166
|
-
watch(
|
|
127
|
+
watch(
|
|
128
|
+
() => props.modelValue as boolean,
|
|
129
|
+
(val) => processModelChange(val)
|
|
130
|
+
)
|
|
167
131
|
|
|
168
132
|
if (processOnMount) {
|
|
169
133
|
onMounted(() => {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function browseNestedNodes(
|
|
2
|
+
element: HTMLElement | null,
|
|
3
|
+
ifCondition: (el: HTMLElement) => boolean,
|
|
4
|
+
thenOperation: (el: HTMLElement) => void,
|
|
5
|
+
elseCondition?: (el: HTMLElement) => boolean,
|
|
6
|
+
elseOperation?: (el: HTMLElement) => void
|
|
7
|
+
) {
|
|
8
|
+
if (element && element.nodeType === Node.ELEMENT_NODE) {
|
|
9
|
+
for (let i = element.children.length - 1; i >= 0; i--) {
|
|
10
|
+
const child = element.children[i] as HTMLElement
|
|
11
|
+
browseNestedNodes(
|
|
12
|
+
child,
|
|
13
|
+
ifCondition,
|
|
14
|
+
thenOperation,
|
|
15
|
+
elseCondition,
|
|
16
|
+
elseOperation
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (ifCondition(element as HTMLElement)) {
|
|
21
|
+
thenOperation(element)
|
|
22
|
+
} else if (elseCondition?.(element as HTMLElement)) {
|
|
23
|
+
elseOperation?.(element)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|