@dataloop-ai/components 0.16.5 → 0.16.7

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/.eslintrc.js CHANGED
@@ -95,7 +95,7 @@ module.exports = {
95
95
  hoist: 'all'
96
96
  }
97
97
  ],
98
- '@typescript-eslint/no-unused-expressions': 'error',
98
+ '@typescript-eslint/no-unused-expressions': 'off',
99
99
  '@typescript-eslint/no-unused-vars': 'off',
100
100
  '@typescript-eslint/no-use-before-define': 'off',
101
101
  '@typescript-eslint/no-var-requires': 'off',
@@ -120,7 +120,7 @@ module.exports = {
120
120
  'no-trailing-spaces': 'warn',
121
121
  'no-undef-init': 'warn',
122
122
  'no-unsafe-finally': 'off',
123
- 'no-unused-expressions': 'error',
123
+ 'no-unused-expressions': 'off',
124
124
  'no-unused-labels': 'error',
125
125
  'no-use-before-define': 'off',
126
126
  'no-var': 'warn',
@@ -0,0 +1,53 @@
1
+ # Contributing Guidelines
2
+ Thank you for your interest in contributing to our project! We welcome contributions from everyone. Please take a moment to review these guidelines before submitting a pull request or issue.
3
+
4
+ ## Code of Conduct
5
+ Our project has a [Code of Conduct](./CODE_OF_CONDUCT.md) that we expect all contributors to follow. Please read it before making any contribution.
6
+
7
+ ## Issues
8
+ If you find any issues or bugs, please search the existing issues to see if the issue has already been reported. If it hasn't, please create a new issue with a clear and concise title and description. Be sure to include any relevant information, such as error messages or steps to reproduce the issue.
9
+
10
+ The repository provides base templates for create a bug/feature request type of issues. please fill the relevant information there.
11
+
12
+ If the issue is related to a specific component then please have in the title of the issue the name of the component and then a short description of the issue. Example: ``` DlButton > 'description of issue' ```
13
+
14
+ ## Pull Requests
15
+ We welcome contributions in the form of pull requests. Before submitting a pull request, please make sure that your code:
16
+
17
+ - Is well-tested
18
+ - Conforms to our coding style guidelines (see below)
19
+ - Includes any necessary documentation
20
+
21
+ ### Naming Convention
22
+ Each pull request should reflect the issue it is trying to close or have a short descriptive title.
23
+
24
+ If the pull request is working on a specific component please start the pull request title with the components name. Example: ``` DlButton > 'description of issue' ```
25
+
26
+ If a component / module or type that is being developed or introduced will not be exported it should not have the ```Dl``` prefix.
27
+ If it is being exported it is required for it to have the ```Dl``` prefix.
28
+
29
+ ### Coding Style Guidelines
30
+ Please follow these coding style guidelines when submitting a pull request:
31
+ - Use consistent indentation
32
+ - Use descriptive variable names
33
+ - Use comments to explain non-obvious code behavior
34
+ - Follow the provided linter configuration
35
+ - Please note that any build that does not pass the linter will fail. as part of our CI/CD
36
+ - When developing a component it should be assigned to the correct scope and have its own aligned code structure
37
+ - if the component has inner components they should be in the components directory under ```/components```
38
+ - every component should export index.ts and types.ts
39
+
40
+
41
+ Steps to submit a pull request:
42
+ 1. Fork the repository
43
+ 2. Clone the forked repository to your local machine
44
+ 3. Create a new branch for your changes
45
+ 4. Make your changes and commit them
46
+ 5. Push the changes to your forked repository
47
+ 6. Submit a pull request to the original repository
48
+ 7. Please make sure that your pull request clearly explains the problem you are trying to solve, the solution you have implemented, and any potential side effects of your changes.
49
+
50
+ ## License
51
+ By contributing to our project, you agree that your contributions will be licensed under the [project's license](./LICENSE.md).
52
+
53
+ Thank you for your contributions!
package/SECURITY.md ADDED
@@ -0,0 +1,15 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ We release patches for security vulnerabilities. Every new version of our project contains the latest security fixes and we will always push versions with the latest security fixes.
6
+
7
+ ## Reporting a Vulnerability
8
+
9
+ If you discover a security vulnerability within our project, please open an issue with the `security` tag. All security vulnerabilities will be promptly addressed.
10
+
11
+ ## Security Fixes and Resolutions
12
+
13
+ We take the security of our project seriously and strive to ensure that every version released includes the latest security fixes and resolutions. We regularly monitor and update our dependencies to ensure that they are up-to-date and secure.
14
+
15
+ If you have any questions or concerns about the security of our project, please do not hesitate to contact us.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.16.5",
3
+ "version": "0.16.7",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -17,7 +17,8 @@
17
17
  "lint:fix": "eslint ./src --ext .ts,.vue --fix",
18
18
  "format": "prettier --write ./src",
19
19
  "lint-staged": "lint-staged",
20
- "test": "vitest run --coverage",
20
+ "test": "vitest",
21
+ "test:coverage": "vitest run --coverage",
21
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"
22
23
  },
23
24
  "dependencies": {
@@ -100,7 +100,8 @@ export default defineComponent({
100
100
  validator: (value: string): boolean =>
101
101
  transformOptions.includes(value)
102
102
  },
103
- overflow: { type: Boolean, default: false }
103
+ overflow: { type: Boolean, default: false },
104
+ fit: { type: Boolean, default: false }
104
105
  },
105
106
  emits: ['remove'],
106
107
  setup() {
@@ -142,7 +143,9 @@ export default defineComponent({
142
143
  },
143
144
  cssChipVars(): Record<string, string | number> {
144
145
  return {
145
- '--dl-chip-max-width': setMaxWidth(this.maxWidth),
146
+ '--dl-chip-max-width': this.fit
147
+ ? 'fit-content'
148
+ : setMaxWidth(this.maxWidth),
146
149
  '--dl-chip-remove-icon-width': setRemoveIconWidth({
147
150
  hasLabel: this.hasLabel,
148
151
  removable: this.removable,
@@ -72,8 +72,8 @@ export default defineComponent({
72
72
  },
73
73
  props: {
74
74
  counter: {
75
- type: Object as PropType<DlKpiCounterType | number>,
76
- default: () => ({})
75
+ type: Object as PropType<DlKpiCounterType>,
76
+ default: () => ({} as DlKpiCounterType)
77
77
  },
78
78
  counterFontSize: {
79
79
  type: String,
@@ -107,7 +107,7 @@ export default defineComponent({
107
107
  },
108
108
  progress: {
109
109
  type: Object as PropType<DlKpiProgressType>,
110
- default: () => ({})
110
+ default: () => ({} as DlKpiProgressType)
111
111
  },
112
112
  withBorder: {
113
113
  type: Boolean,
@@ -119,7 +119,7 @@ export default defineComponent({
119
119
  default: false,
120
120
  required: false
121
121
  },
122
- isSmall: {
122
+ small: {
123
123
  type: Boolean,
124
124
  default: false,
125
125
  required: false
@@ -132,17 +132,25 @@ export default defineComponent({
132
132
 
133
133
  const emptyString = '---'
134
134
 
135
+ const isSingleWord = (text: string) => text.split(' ').length === 1
136
+
135
137
  const cssVars = computed(() => {
136
138
  return {
137
- '--dl-kpi-border': props.withBorder ? '1px solid #e4e4e4' : ''
139
+ '--dl-kpi-border': props.withBorder ? '1px solid #e4e4e4' : '',
140
+ '--dl-kpi-title-max-width': isSingleWord(props.title)
141
+ ? '100%'
142
+ : '90%', // todo: caused a bug with single words
143
+ '--dl-kpi-sub-title-max-width': isSingleWord(props.subtitle)
144
+ ? '100%'
145
+ : '90%'
138
146
  }
139
147
  })
140
148
 
141
149
  const counterFontSizeComputed = computed(() =>
142
- props.isSmall ? '20px' : props.counterFontSize
150
+ props.small ? '20px' : props.counterFontSize
143
151
  )
144
152
  const titleFontSizeComputed = computed(() =>
145
- props.isSmall ? '14px' : props.titleFontSize
153
+ props.small ? '14px' : props.titleFontSize
146
154
  )
147
155
 
148
156
  const formatCounter = (counter: DlKpiCounterType) => {
@@ -243,7 +251,7 @@ export default defineComponent({
243
251
  &__text {
244
252
  display: flex;
245
253
  flex-direction: row;
246
- max-width: 90%;
254
+ max-width: var(--dl-kpi-title-max-width);
247
255
  max-height: 40px;
248
256
  font-style: normal;
249
257
  font-weight: 400;
@@ -255,7 +263,7 @@ export default defineComponent({
255
263
  gap: 10px;
256
264
  }
257
265
  &__subtext {
258
- max-width: 90%;
266
+ max-width: var(--dl-kpi-sub-title-max-width);
259
267
  max-height: 40px;
260
268
  font-style: normal;
261
269
  font-weight: 400;
@@ -12,7 +12,7 @@
12
12
  >
13
13
  <div :class="computeClass('item-content')">
14
14
  <dl-kpi
15
- :counter="item.value"
15
+ :counter="kpiValue(item.value)"
16
16
  counter-font-size="30px"
17
17
  :title="capitalize(item.text)"
18
18
  title-font-size="16px"
@@ -20,7 +20,7 @@
20
20
  subtitle-font-size="12px"
21
21
  :info-message="null"
22
22
  :progress="null"
23
- :is-small="small"
23
+ :small="small"
24
24
  />
25
25
  </div>
26
26
  <div class="divider" />
@@ -33,6 +33,7 @@
33
33
  import { v4 } from 'uuid'
34
34
  import { defineComponent, PropType } from 'vue-demi'
35
35
  import { DlKpi } from '../../basic'
36
+ import { DlKpiCounterFormat } from '../../types'
36
37
 
37
38
  interface CounterItem {
38
39
  value?: number
@@ -84,6 +85,12 @@ export default defineComponent({
84
85
  },
85
86
  computeClass(value: string): (string | boolean)[] {
86
87
  return [value, this.small && `${value}--small`]
88
+ },
89
+ kpiValue(value: string | number) {
90
+ return {
91
+ value: value ?? 0,
92
+ format: DlKpiCounterFormat.long
93
+ }
87
94
  }
88
95
  }
89
96
  })
@@ -1,2 +1,2 @@
1
1
  import DlItem from './DlItem.vue'
2
- export default DlItem
2
+ export { DlItem }
@@ -88,5 +88,8 @@ export default defineComponent({
88
88
  &--small {
89
89
  font-size: var(--dl-font-size-small);
90
90
  }
91
+
92
+ // to deal with quasar conflicts.
93
+ line-height: initial !important;
91
94
  }
92
95
  </style>
@@ -165,6 +165,16 @@
165
165
  overflow
166
166
  />
167
167
  </div>
168
+ <h4>Chips with Fit</h4>
169
+ <div
170
+ class="col"
171
+ style="margin-bottom: 30px"
172
+ >
173
+ <DlChip
174
+ label="Long Chip Label With Alot Of Text"
175
+ fit
176
+ />
177
+ </div>
168
178
  </div>
169
179
  </template>
170
180
 
@@ -23,7 +23,7 @@
23
23
  small
24
24
  :items="[
25
25
  {
26
- text: 'lorem ipsum'
26
+ text: 'lorem'
27
27
  },
28
28
  {
29
29
  value: null,