@dataloop-ai/components 0.18.5 → 0.18.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.18.5",
3
+ "version": "0.18.6",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -51,24 +51,23 @@ import {
51
51
  } from 'vue-demi'
52
52
  import { getColor, includes } from '../../../utils'
53
53
  import { DlIcon } from '../../essential'
54
+ import { DlAlertType } from './types'
54
55
 
55
- type AlertType = 'info' | 'success' | 'warning' | 'error'
56
-
57
- const typeToIconMap: Record<AlertType, string> = {
56
+ const typeToIconMap: Record<DlAlertType, string> = {
58
57
  info: 'icon-dl-info-filled',
59
58
  success: 'icon-dl-approve-filled',
60
59
  warning: 'icon-dl-alert-filled',
61
60
  error: 'icon-dl-error-filled'
62
61
  }
63
62
 
64
- const typeToIconColorMap: Record<AlertType, string> = {
63
+ const typeToIconColorMap: Record<DlAlertType, string> = {
65
64
  info: 'dl-color-info',
66
65
  success: 'dl-color-positive',
67
66
  warning: 'dl-color-warning',
68
67
  error: 'dl-color-negative'
69
68
  }
70
69
 
71
- const typeToBackgroundMap: Record<AlertType, string> = {
70
+ const typeToBackgroundMap: Record<DlAlertType, string> = {
72
71
  info: 'dl-color-info-background',
73
72
  success: 'dl-color-positive-background',
74
73
  warning: 'dl-color-warning-background',
@@ -115,7 +114,7 @@ export default defineComponent({
115
114
  emits: ['update:model-value'],
116
115
  setup(props, { emit }) {
117
116
  const show = ref(props.modelValue)
118
- const type = props.type as AlertType
117
+ const type = props.type as DlAlertType
119
118
  const typeIcon = typeToIconMap[type]
120
119
  const icon = computed(() => typeToIconMap[type])
121
120
  const iconColor = computed(() => typeToIconColorMap[type])
@@ -0,0 +1 @@
1
+ export type DlAlertType = 'info' | 'success' | 'warning' | 'error'
@@ -8,3 +8,4 @@ export * from './DlWidget/types'
8
8
  export * from './DlButton/types'
9
9
  export * from './DlGrid/types'
10
10
  export * from './DlEmptyState/types'
11
+ export * from './DlAlert/types'
@@ -8,15 +8,7 @@
8
8
  'read-only': readOnly,
9
9
  wrap: wrap
10
10
  }"
11
- :style="{
12
- width: width,
13
- height: height,
14
- zIndex: zIndex,
15
- maxWidth: maxWidth,
16
- minWidth: minWidth,
17
- maxHeight: maxHeight,
18
- minHeight: minHeight
19
- }"
11
+ :style="editorStyle"
20
12
  >
21
13
  <div
22
14
  class="hljs"
@@ -211,7 +203,7 @@ export default defineComponent({
211
203
  },
212
204
  borderRadius: {
213
205
  type: String,
214
- default: '12px'
206
+ default: '0px'
215
207
  },
216
208
  languages: {
217
209
  type: Array as PropType<string[][]>,
@@ -259,7 +251,13 @@ export default defineComponent({
259
251
  height,
260
252
  fontSize,
261
253
  header,
262
- padding
254
+ padding,
255
+ width,
256
+ zIndex,
257
+ minHeight,
258
+ maxHeight,
259
+ minWidth,
260
+ maxWidth
263
261
  } = toRefs(props)
264
262
  const scrollBarWidth = ref(0)
265
263
  const scrollBarHeight = ref(0)
@@ -312,6 +310,18 @@ export default defineComponent({
312
310
  return height.value == 'auto' ? false : true
313
311
  })
314
312
 
313
+ const editorStyle = computed<Record<string, any>>(() => {
314
+ return {
315
+ width: width.value,
316
+ height: height.value,
317
+ zIndex: zIndex.value,
318
+ maxWidth: maxWidth.value,
319
+ minWidth: minWidth.value,
320
+ maxHeight: maxHeight.value,
321
+ minHeight: minHeight.value
322
+ }
323
+ })
324
+
315
325
  watch(contentValue, () => {
316
326
  nextTick(() => {
317
327
  code.value!.textContent = contentValue.value
@@ -520,7 +530,8 @@ export default defineComponent({
520
530
  tab,
521
531
  changeLang,
522
532
  updateValue,
523
- textAreaStyle
533
+ textAreaStyle,
534
+ editorStyle
524
535
  }
525
536
  }
526
537
  })
@@ -139,11 +139,13 @@ export default defineComponent({
139
139
  const demos: {
140
140
  name: string
141
141
  component: any
142
- }[] = names.map((n: string) => ({
143
- name: n,
144
- // @ts-ignore
145
- component: Demos[n]
146
- }))
142
+ }[] = names
143
+ .map((n: string) => ({
144
+ name: n,
145
+ // @ts-ignore
146
+ component: Demos[n]
147
+ }))
148
+ .sort((a, b) => a.name.localeCompare(b.name))
147
149
 
148
150
  const filteredDemos = computed(() => {
149
151
  if (!filterTerm.value || !filterTerm.value.length) {
@@ -198,7 +200,8 @@ export default defineComponent({
198
200
 
199
201
  <style scoped lang="scss">
200
202
  .layout-wrapper {
201
- display: flex;
203
+ display: grid;
204
+ grid-template-columns: 12% 85%;
202
205
  }
203
206
 
204
207
  .sidebar {