@dataloop-ai/components 0.13.19 → 0.14.4
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/.nvmrc +1 -0
- package/README.md +3 -1
- package/package.json +19 -17
- package/src/assets/globals.scss +38 -3
- package/src/assets/grid.scss +9 -0
- package/src/components/DlAccordion/DlAccordion.vue +4 -4
- package/src/components/DlAlert.vue +6 -6
- package/src/components/DlChart/BrushThumb.vue +83 -0
- package/src/components/DlChart/DlBarChart.vue +545 -0
- package/src/components/DlChart/DlBrush.vue +475 -0
- package/src/components/DlChart/DlChartLabels.vue +279 -0
- package/src/components/DlChart/DlChartLegend.vue +141 -0
- package/src/components/DlChart/DlColumnChart.vue +555 -0
- package/src/components/DlChart/DlLineChart.vue +644 -0
- package/src/components/DlChart/DlScrollBar.vue +147 -0
- package/src/components/DlChart/Doughnut/DlDoughnutChart.vue +448 -0
- package/src/components/DlChart/Doughnut/DlDoughnutChartLegend.vue +281 -0
- package/src/components/DlChart/Doughnut/DlDoughnutChartWidget.vue +64 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartAnimation.ts +4 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartData.ts +16 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartOptions.ts +11 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartProps.ts +8 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutWithOriginalColor.ts +13 -0
- package/src/components/DlChart/chart.ts +122 -0
- package/src/components/DlChart/index.ts +36 -0
- package/src/components/DlChart/props.ts +348 -0
- package/src/components/DlChart/typedCharts.ts +88 -0
- package/src/components/DlChart/types.ts +63 -0
- package/src/components/DlChart/utils.ts +153 -0
- package/src/components/DlChip/DlChip.vue +40 -13
- package/src/components/DlCounters.vue +31 -7
- package/src/components/DlDatePicker/DlCalendar.vue +22 -10
- package/src/components/DlDatePicker/DlDatePicker.vue +8 -5
- package/src/components/DlDateTimeRange/types.ts +2 -2
- package/src/components/DlDropdownButton.vue +5 -3
- package/src/components/DlMenu/DlMenu.vue +4 -2
- package/src/components/DlPagination/RowsSelector.vue +15 -2
- package/src/components/DlPopup/DlPopup.vue +0 -1
- package/src/components/DlRange/DlRange.vue +3 -2
- package/src/components/DlSearch.vue +1 -1
- package/src/components/DlSelect/DlSelect.vue +3 -2
- package/src/components/DlSlider/sliderStyles.scss +4 -0
- package/src/components/DlSlider/useSlider.ts +39 -12
- package/src/components/DlSmartSearch/DlSuggestionsDropdown.vue +1 -1
- package/src/components/DlSpinner.vue +259 -0
- package/src/components/DlTable/DlTable.vue +4 -1
- package/src/components/DlTable/hooks/tablePagination.ts +8 -2
- package/src/components/DlTextArea.vue +9 -0
- package/src/components/DlTextInput.vue +4 -2
- package/src/components/DlThemeProvider.vue +22 -13
- package/src/components/DlToastMessage/api/useToast.ts +23 -0
- package/src/components/DlToastMessage/components/ToastComponent.vue +279 -0
- package/src/components/DlToastMessage/index.ts +5 -0
- package/src/components/DlToastMessage/types.ts +4 -0
- package/src/components/DlToastMessage/utils/config.ts +17 -0
- package/src/components/DlToastMessage/utils/render.ts +56 -0
- package/src/components/DlTypography.vue +1 -1
- package/src/components/DlWidget/DlGrid.vue +33 -0
- package/src/components/DlWidget/DlGridRow.vue +32 -0
- package/src/components/DlWidget/DlWidget.vue +202 -11
- package/src/components/DlWidget/index.ts +2 -2
- package/src/components/DlWidget/utils.ts +26 -19
- package/src/components/index.ts +8 -3
- package/src/demo/BarChartDemo.vue +77 -0
- package/src/demo/ColumnChartDemo.vue +230 -0
- package/src/demo/DlButtonDemo.vue +1 -1
- package/src/demo/DlChartDoughnutDemo.vue +229 -0
- package/src/demo/DlChipDemo.vue +42 -18
- package/src/demo/DlDialogBoxDemo.vue +4 -4
- package/src/demo/DlDropdownButtonDemo.vue +1 -1
- package/src/demo/DlLineChartDemo.vue +375 -0
- package/src/demo/DlMenuDemo.vue +1 -1
- package/src/demo/DlOptionGroupDemo.vue +1 -1
- package/src/demo/DlSelectDemo.vue +1 -1
- package/src/demo/DlSpinnerDemo.vue +20 -0
- package/src/demo/DlTableDemo.vue +13 -94
- package/src/demo/DlToastMessageDemo.vue +143 -0
- package/src/demo/DlWidgetDemo.vue +105 -143
- package/src/demo/index.ts +20 -2
- package/src/hooks/use-theme.ts +19 -0
- package/src/utils/abbreviate-to-string.ts +14 -0
- package/src/utils/colors.ts +47 -0
- package/src/utils/getRootStyles.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/position-engine.ts +11 -2
- package/src/utils/swapNodes.ts +30 -0
- package/src/utils/update-key.ts +90 -0
- package/tsconfig.json +0 -1
- package/vite.config.ts +17 -0
- package/Dockerfile +0 -12
- package/jest.config.js +0 -16
- package/jest.setup.js +0 -59
- package/src/components/DlWidget/DlWidgetGrid.vue +0 -360
- package/storybook.js +0 -8
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v16.14.2
|
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
# Dataloop Components Library  
|
|
1
|
+
# [Dataloop Components Library](https://dataloop-ai.github.io/components/)  
|
|
2
2
|
|
|
3
3
|
This repository contains custom made vue components for Dataloop platform and apps use
|
|
4
4
|
|
|
5
5
|
The vue components are written in vue3 composition api and can be used in vue 2 projects as well as long as you install vue-demi
|
|
6
6
|
|
|
7
|
+
You can see our documentation with our storybook link [here](https://dataloop-ai.github.io/components/)
|
|
8
|
+
|
|
7
9
|
## Development
|
|
8
10
|
|
|
9
11
|
Working on this repo is simple as it already has hooks set up to guarantee high code quality
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -11,18 +11,19 @@
|
|
|
11
11
|
"dev:2": "./misc/packAndRunV2.sh",
|
|
12
12
|
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
|
|
13
13
|
"preview": "vite preview",
|
|
14
|
-
"storybook": "
|
|
15
|
-
"build:storybook": "build
|
|
14
|
+
"storybook": "storybook dev -p 6006",
|
|
15
|
+
"build:storybook": "storybook build",
|
|
16
16
|
"lint": "eslint ./src --ext .ts,.vue ",
|
|
17
17
|
"lint:fix": "eslint ./src --ext .ts,.vue --fix",
|
|
18
18
|
"format": "prettier --write ./src",
|
|
19
19
|
"lint-staged": "lint-staged",
|
|
20
|
-
"test": "
|
|
20
|
+
"test": "vitest run --coverage",
|
|
21
21
|
"check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@dataloop-ai/icons": "^2.0.13",
|
|
25
25
|
"@types/lodash": "^4.14.184",
|
|
26
|
+
"chart.js": "^3.9.1",
|
|
26
27
|
"lodash": "^4.17.21",
|
|
27
28
|
"moment": "^2.29.4",
|
|
28
29
|
"sass": "^1.51.0",
|
|
@@ -36,13 +37,13 @@
|
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@babel/core": "^7.17.9",
|
|
38
39
|
"@mdx-js/react": "^2.1.1",
|
|
39
|
-
"@storybook/addon-actions": "^
|
|
40
|
-
"@storybook/addon-essentials": "^
|
|
41
|
-
"@storybook/addon-links": "^
|
|
42
|
-
"@storybook/
|
|
43
|
-
"@storybook/client-api": "^
|
|
44
|
-
"@storybook/vue3": "^
|
|
45
|
-
"@
|
|
40
|
+
"@storybook/addon-actions": "^7.0.0-rc.5",
|
|
41
|
+
"@storybook/addon-essentials": "^7.0.0-rc.5",
|
|
42
|
+
"@storybook/addon-links": "^7.0.0-rc.5",
|
|
43
|
+
"@storybook/addon-mdx-gfm": "^7.0.0-rc.5",
|
|
44
|
+
"@storybook/client-api": "^7.0.0-rc.5",
|
|
45
|
+
"@storybook/vue3": "^7.0.0-rc.5",
|
|
46
|
+
"@storybook/vue3-vite": "^7.0.0-rc.5",
|
|
46
47
|
"@types/jsdom": "^16.2.14",
|
|
47
48
|
"@types/node": "^18.7.18",
|
|
48
49
|
"@types/resize-observer-browser": "^0.1.7",
|
|
@@ -50,32 +51,33 @@
|
|
|
50
51
|
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
51
52
|
"@typescript-eslint/parser": "^5.20.0",
|
|
52
53
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
54
|
+
"@vitest/coverage-c8": "^0.29.2",
|
|
53
55
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
54
56
|
"@vue/eslint-config-typescript": "^10.0.0",
|
|
55
57
|
"@vue/test-utils": "^2.0.0-rc.18",
|
|
56
58
|
"babel-loader": "^8.2.4",
|
|
57
|
-
"canvas": "^2.9.1",
|
|
58
59
|
"eslint": "^8.13.0",
|
|
59
60
|
"eslint-config-prettier": "^8.5.0",
|
|
60
61
|
"eslint-plugin-member-order": "^0.0.3",
|
|
61
62
|
"eslint-plugin-prettier": "^4.0.0",
|
|
62
63
|
"eslint-plugin-vue": "^8.6.0",
|
|
63
64
|
"html-webpack-plugin": "^5.5.0",
|
|
64
|
-
"
|
|
65
|
-
"jsdom": "^19.0.0",
|
|
65
|
+
"jsdom": "^21.1.0",
|
|
66
66
|
"lint-staged": "^12.3.8",
|
|
67
67
|
"pre-commit": "^1.2.2",
|
|
68
68
|
"prettier": "^2.6.2",
|
|
69
69
|
"react": "^18.1.0",
|
|
70
|
+
"react-dom": "^18.2.0",
|
|
71
|
+
"storybook": "^7.0.0-rc.5",
|
|
70
72
|
"storybook-addon-themes": "^6.1.0",
|
|
71
|
-
"ts-jest": "^27.1.4",
|
|
72
73
|
"typescript": "^4.5.4",
|
|
73
74
|
"vite": "^4.1.4",
|
|
75
|
+
"vitest": "^0.29.2",
|
|
76
|
+
"vitest-canvas-mock": "^0.2.2",
|
|
74
77
|
"vue": "^3.2.25",
|
|
75
78
|
"vue-composition-test-utils": "^1.0.3",
|
|
76
79
|
"vue-loader": "^16.8.3",
|
|
77
|
-
"vue-tsc": "^0.35.2"
|
|
78
|
-
"vue3-jest": "^27.0.0-alpha.2"
|
|
80
|
+
"vue-tsc": "^0.35.2"
|
|
79
81
|
},
|
|
80
82
|
"keywords": [],
|
|
81
83
|
"author": "fadi@dataloop.ai",
|
package/src/assets/globals.scss
CHANGED
|
@@ -147,7 +147,7 @@ body {
|
|
|
147
147
|
--dl-color-negative: #FF3434;
|
|
148
148
|
--dl-color-negative-background: #FFEAEA;
|
|
149
149
|
--dl-color-warning: #FFDA3A;
|
|
150
|
-
--dl-color-warning-background: #
|
|
150
|
+
--dl-color-warning-background: #FFF7D6;
|
|
151
151
|
--dl-color-positive: #039E49;
|
|
152
152
|
--dl-color-positive-background: #E1FFF0;
|
|
153
153
|
--dl-color-info-background: #F3F9FF;
|
|
@@ -160,7 +160,31 @@ body {
|
|
|
160
160
|
--q-color-positive: #38D079;
|
|
161
161
|
--q-color-warning: #E1B75B;
|
|
162
162
|
|
|
163
|
+
--dl-color-chart-brush: #EEF1FF;
|
|
164
|
+
|
|
163
165
|
--dl-date-picker-shadow: 0px 3px 6px #101e7326;
|
|
166
|
+
--dl-date-picker-selected-strip: rgb(52, 82, 255, 0.2);
|
|
167
|
+
|
|
168
|
+
// chart
|
|
169
|
+
--dl-color-chart-1: #4DB1D3;
|
|
170
|
+
--dl-color-chart-2: #FF2F7A;
|
|
171
|
+
--dl-color-chart-3: #D4E3FF;
|
|
172
|
+
--dl-color-chart-4: #BECB5D;
|
|
173
|
+
--dl-color-chart-5: #839E30;
|
|
174
|
+
--dl-color-chart-6: #6B5935;
|
|
175
|
+
--dl-color-chart-7: #752B86;
|
|
176
|
+
--dl-color-chart-8: #BB96A3;
|
|
177
|
+
--dl-color-chart-9: #870F49;
|
|
178
|
+
--dl-color-chart-10: #CC566C;
|
|
179
|
+
--dl-color-chart-11: #F0A18C;
|
|
180
|
+
--dl-color-chart-12: #EDAB55;
|
|
181
|
+
--dl-color-chart-13: #FF5934;
|
|
182
|
+
--dl-color-chart-14: #9CD2E3;
|
|
183
|
+
--dl-color-chart-15: #928F80;
|
|
184
|
+
--dl-color-chart-16: #575567;
|
|
185
|
+
--dl-color-chart-17: #979797;
|
|
186
|
+
--dl-color-chart-18: #D9D9D9;
|
|
187
|
+
//
|
|
164
188
|
|
|
165
189
|
// z-index
|
|
166
190
|
--dl-z-index-panel: 3000; // panel & panel contaiener content
|
|
@@ -195,7 +219,6 @@ body {
|
|
|
195
219
|
--dl-color-disabled: #ffffff40;
|
|
196
220
|
--dl-color-fill: #ffffff40;
|
|
197
221
|
--dl-color-fill-secondary: #F8F8F8;
|
|
198
|
-
|
|
199
222
|
--dl-color-fill-hover: #ffffff26;
|
|
200
223
|
--dl-color-separator: #ffffff26;
|
|
201
224
|
--dl-color-body-background: #24282D;
|
|
@@ -218,8 +241,10 @@ body {
|
|
|
218
241
|
--q-color-positive: #A1E5B6;
|
|
219
242
|
--q-color-warning: #F8D29A;
|
|
220
243
|
|
|
244
|
+
--dl-color-chart-brush: #475077;
|
|
221
245
|
|
|
222
246
|
--dl-date-picker-shadow: 0px 3px 6px #292e3580;
|
|
247
|
+
--dl-date-picker-selected-strip: rgb(124, 140, 255, 0.2);
|
|
223
248
|
}
|
|
224
249
|
|
|
225
250
|
// scrollbar
|
|
@@ -250,4 +275,14 @@ html {
|
|
|
250
275
|
-moz-user-select: none;
|
|
251
276
|
-webkit-user-select: none;
|
|
252
277
|
-ms-user-select: none;
|
|
253
|
-
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.flex-column {
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.flex-row {
|
|
285
|
+
flex-direction: row;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@import 'grid';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:class="identifierClass"
|
|
5
5
|
class="accordion"
|
|
6
6
|
>
|
|
7
|
-
<accordion-header
|
|
7
|
+
<dl-accordion-header
|
|
8
8
|
:additional-info="additionalInfo"
|
|
9
9
|
:default-opened="defaultOpened"
|
|
10
10
|
:title="title"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
>
|
|
22
22
|
<slot name="header" />
|
|
23
23
|
</template>
|
|
24
|
-
</accordion-header>
|
|
24
|
+
</dl-accordion-header>
|
|
25
25
|
<div
|
|
26
26
|
ref="dlAccordionContent"
|
|
27
27
|
class="accordion-content"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script lang="ts">
|
|
36
|
-
import
|
|
36
|
+
import DlAccordionHeader from './AccordionHeader.vue'
|
|
37
37
|
import { defineComponent } from 'vue-demi'
|
|
38
38
|
import { v4 } from 'uuid'
|
|
39
39
|
|
|
40
40
|
export default defineComponent({
|
|
41
41
|
name: 'DlAccordion',
|
|
42
42
|
components: {
|
|
43
|
-
|
|
43
|
+
DlAccordionHeader
|
|
44
44
|
},
|
|
45
45
|
model: {
|
|
46
46
|
prop: 'modelValue',
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<dl-icon
|
|
16
16
|
:icon="icon"
|
|
17
17
|
:color="iconColor"
|
|
18
|
-
size="
|
|
18
|
+
size="24px"
|
|
19
19
|
/>
|
|
20
20
|
</div>
|
|
21
21
|
<span
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
class="close-btn-icon"
|
|
33
33
|
data-test="close-btn-icon"
|
|
34
34
|
icon="icon-dl-close"
|
|
35
|
-
|
|
36
|
-
size="8px"
|
|
35
|
+
size="12px"
|
|
37
36
|
@click="handleClose"
|
|
38
37
|
/>
|
|
39
38
|
</div>
|
|
@@ -52,7 +51,7 @@ const typeToIconMap: Record<AlertType, string> = {
|
|
|
52
51
|
info: 'icon-dl-info-filled',
|
|
53
52
|
success: 'icon-dl-approve-filled',
|
|
54
53
|
warning: 'icon-dl-alert-filled',
|
|
55
|
-
error: 'icon-dl-
|
|
54
|
+
error: 'icon-dl-error-filled'
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
const typeToIconColorMap: Record<AlertType, string> = {
|
|
@@ -200,7 +199,7 @@ export default defineComponent({
|
|
|
200
199
|
> div {
|
|
201
200
|
display: flex;
|
|
202
201
|
flex-direction: row;
|
|
203
|
-
padding: 10px;
|
|
202
|
+
padding: 10px 10px 10px 16px;
|
|
204
203
|
}
|
|
205
204
|
|
|
206
205
|
.text {
|
|
@@ -213,7 +212,8 @@ export default defineComponent({
|
|
|
213
212
|
}
|
|
214
213
|
|
|
215
214
|
.close-btn {
|
|
216
|
-
padding:
|
|
215
|
+
padding-right: 16px;
|
|
216
|
+
padding-left: 10px;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
.icon-dl-close:hover {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="dl-thumb"
|
|
4
|
+
:style="rootStyles"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
>
|
|
7
|
+
<dl-icon
|
|
8
|
+
v-if="icon"
|
|
9
|
+
:color="iconColor"
|
|
10
|
+
:icon="icon"
|
|
11
|
+
:size="iconSize"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import { defineComponent, computed } from 'vue-demi'
|
|
18
|
+
import { getColor } from '../../utils'
|
|
19
|
+
|
|
20
|
+
import { DlIcon } from '../'
|
|
21
|
+
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
name: 'DlBrushThumb',
|
|
24
|
+
components: {
|
|
25
|
+
DlIcon
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
icon: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: null
|
|
31
|
+
},
|
|
32
|
+
iconSize: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: '18px'
|
|
35
|
+
},
|
|
36
|
+
iconColor: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: null
|
|
39
|
+
},
|
|
40
|
+
bgColor: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'dl-color-secondary'
|
|
43
|
+
},
|
|
44
|
+
hoverBgColor: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'dl-color-hover'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
setup(props, { emit }) {
|
|
50
|
+
const rootStyles = computed(() => {
|
|
51
|
+
return {
|
|
52
|
+
'--icon-color': getColor(
|
|
53
|
+
props.iconColor,
|
|
54
|
+
'dl-color-text-buttons'
|
|
55
|
+
),
|
|
56
|
+
'--bg-color': getColor(props.bgColor),
|
|
57
|
+
'--bg-color-hover': getColor(props.hoverBgColor)
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
rootStyles
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style scoped lang="scss">
|
|
69
|
+
.dl-thumb {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
background-color: var(--bg-color);
|
|
74
|
+
& > div {
|
|
75
|
+
display: flex !important;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
}
|
|
79
|
+
&:hover {
|
|
80
|
+
background-color: var(--bg-color-hover);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</style>
|