@dataloop-ai/components 0.16.7 → 0.16.9
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/README.md
CHANGED
|
@@ -1,45 +1,38 @@
|
|
|
1
1
|
# [Dataloop Components Library](https://dataloop-ai.github.io/components/)  
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Welcome to the Dataloop Components Library, which contains custom-made Vue components for the Dataloop platform and apps use. The Vue components are written using the Vue3 composition API and can be used in Vue2 projects as well, as long as you install vue-demi. You can find our documentation with our Storybook link [here](https://dataloop-ai.github.io/components/).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
You can see our documentation with our storybook link [here](https://dataloop-ai.github.io/components/)
|
|
5
|
+
## Release Status
|
|
6
|
+
The current release status is beta. You can check the latest library version by looking at the shield above or by visiting our npm page.
|
|
8
7
|
|
|
9
8
|
## Development
|
|
10
9
|
|
|
11
|
-
Working
|
|
12
|
-
|
|
13
|
-
The repository has automatic lint on staged files and run tests. if any were to fail then the commit itself will fail too.
|
|
10
|
+
Working with this repository is straightforward, as it already has hooks set up to guarantee high code quality. The repository has automatic linting on staged files and runs tests. If any tests fail, the commit itself will fail too
|
|
14
11
|
|
|
15
12
|
### Using Components in other projects
|
|
16
|
-
|
|
13
|
+
Using our components is simple: just install the npm package and import them normally into your Vue app. If you're working on a Vue2 project, make sure to install @vue/composition-api.
|
|
17
14
|
|
|
18
|
-
make sure you if you are on vue2 project to install @vue/composition-api
|
|
19
15
|
|
|
20
16
|
### Adding new Components
|
|
21
|
-
|
|
22
|
-
the pull request must contain the following in order for it to be approved
|
|
17
|
+
To add new components, you are required to open a pull request. The pull request must contain the following to be approved:
|
|
23
18
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
19
|
+
- The component Vue file
|
|
20
|
+
- The story relating to the component (for Storybook integration)
|
|
21
|
+
- Tests for the component
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
Any pull requests with missing requirements will not be approved.
|
|
29
24
|
|
|
30
25
|
## Scripts
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
the launch.json file contains 3 main configs
|
|
26
|
+
The work environment is set up to be used on Visual Studio Code.
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
2. running a storybook server to view the stories
|
|
37
|
-
3. running tests
|
|
28
|
+
The launch.json file contains three main configurations:
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
1. Running a Vite server to simulate the Vue3 environment
|
|
31
|
+
2. Running a Storybook server to view the stories
|
|
32
|
+
3. Running tests
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
2. npm run storybook ( for storybook server )
|
|
43
|
-
3. npm run test ( for tests )
|
|
34
|
+
You can also access these commands by running the following:
|
|
44
35
|
|
|
45
|
-
|
|
36
|
+
1. npm run dev (for the Vite server)
|
|
37
|
+
2. npm run storybook (for the Storybook server)
|
|
38
|
+
3. npm run test (for running tests)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.9",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"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"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dataloop-ai/icons": "^3.0.
|
|
25
|
+
"@dataloop-ai/icons": "^3.0.6",
|
|
26
26
|
"@types/lodash": "^4.14.184",
|
|
27
27
|
"chart.js": "^3.9.1",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
40
|
<div
|
|
41
|
-
v-if="
|
|
41
|
+
v-if="progress"
|
|
42
42
|
class="kpi_box__progress_bar"
|
|
43
43
|
>
|
|
44
44
|
<dl-progress-bar
|
|
@@ -107,14 +107,9 @@ export default defineComponent({
|
|
|
107
107
|
},
|
|
108
108
|
progress: {
|
|
109
109
|
type: Object as PropType<DlKpiProgressType>,
|
|
110
|
-
default:
|
|
110
|
+
default: null
|
|
111
111
|
},
|
|
112
|
-
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: false,
|
|
115
|
-
required: false
|
|
116
|
-
},
|
|
117
|
-
withProgressBar: {
|
|
112
|
+
bordered: {
|
|
118
113
|
type: Boolean,
|
|
119
114
|
default: false,
|
|
120
115
|
required: false
|
|
@@ -127,6 +122,9 @@ export default defineComponent({
|
|
|
127
122
|
},
|
|
128
123
|
setup(props) {
|
|
129
124
|
const progressValue = (progress: DlKpiProgressType) => {
|
|
125
|
+
if (!progress) {
|
|
126
|
+
return null
|
|
127
|
+
}
|
|
130
128
|
return progress?.value ? progress.value / 100 : null
|
|
131
129
|
}
|
|
132
130
|
|
|
@@ -136,7 +134,7 @@ export default defineComponent({
|
|
|
136
134
|
|
|
137
135
|
const cssVars = computed(() => {
|
|
138
136
|
return {
|
|
139
|
-
'--dl-kpi-border': props.
|
|
137
|
+
'--dl-kpi-border': props.bordered ? '1px solid #e4e4e4' : '',
|
|
140
138
|
'--dl-kpi-title-max-width': isSingleWord(props.title)
|
|
141
139
|
? '100%'
|
|
142
140
|
: '90%', // todo: caused a bug with single words
|