@dataloop-ai/components 0.19.150 → 0.19.152

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.19.150",
3
+ "version": "0.19.152",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -205,7 +205,7 @@ body {
205
205
  --dl-color-fill-third: #fbfbfb;
206
206
  --dl-color-link: #20abfa;
207
207
  --dl-color-cell-background: #fffae2;
208
- --dl-color-disabled-slider: #e4e4e4;
208
+ --dl-color-disabled-slider: #B3B3B3;
209
209
  --q-color-positive: #38d079;
210
210
  --q-color-warning: #e1b75b;
211
211
 
@@ -765,7 +765,14 @@ export default defineComponent({
765
765
  setCaretAtTheEnd(input.value)
766
766
  return
767
767
  }
768
- if (!toEmit.endsWith('.')) {
768
+ /**
769
+ * if the number ends with a dot followed by multiple zeros
770
+ * then we should not replace the inputs value with the parsed number
771
+ */
772
+ if (
773
+ !toEmit.endsWith('.') &&
774
+ !new RegExp(/\.\d*0+$/, 'g').test(toEmit)
775
+ ) {
769
776
  input.value.innerHTML = String(Number(toEmit))
770
777
  .toString()
771
778
  .replace(/ /g, ' ')
@@ -1105,7 +1112,28 @@ export default defineComponent({
1105
1112
  methods: {
1106
1113
  onKeydown(e: KeyboardEvent) {
1107
1114
  if (e.key !== 'Backspace') {
1108
- if (this.type === 'number' && !/^[\d.]$/.test(e.key)) {
1115
+ /**
1116
+ * Allow only numbers
1117
+ * Allow decimal point
1118
+ * Allow arrow keys
1119
+ * Allow delete
1120
+ * Allow control/meta keys
1121
+ * Allow select all
1122
+ */
1123
+ if (
1124
+ this.type === 'number' &&
1125
+ !/^[\d.]$/.test(e.key) &&
1126
+ ![
1127
+ 'ArrowLeft',
1128
+ 'ArrowRight',
1129
+ 'Backspace',
1130
+ 'Delete',
1131
+ 'Control',
1132
+ 'Meta',
1133
+ 'a'
1134
+ ].includes(e.key) &&
1135
+ !(e.ctrlKey || e.metaKey)
1136
+ ) {
1109
1137
  e.preventDefault()
1110
1138
  return
1111
1139
  }
@@ -97,8 +97,8 @@ export function useTablePaginationState(
97
97
  const computedPagination = computed(() => {
98
98
  const pag = pagination.value
99
99
  ? {
100
- ...innerPagination.value,
101
- ...pagination.value
100
+ ...pagination.value,
101
+ ...innerPagination.value
102
102
  }
103
103
  : innerPagination.value
104
104
 
@@ -364,14 +364,6 @@
364
364
  bottom: 0;
365
365
  pointer-events: none;
366
366
  }
367
-
368
- &:before {
369
- // background-color: var(--dl-color-fill-hover);
370
- }
371
-
372
- &:after {
373
- // background-color: var(--dl-color-fill);
374
- }
375
367
  }
376
368
 
377
369
  tr.selected td:after {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <div style="padding-bottom: 10px">
3
+ <div style="padding-bottom: 10px; max-width: 100px">
4
4
  <div>Number input</div>
5
5
  <dl-input
6
6
  v-model="numberVal"
@@ -8,6 +8,7 @@
8
8
  placeholder="Test reactivity"
9
9
  :disabled="disabledInput"
10
10
  />
11
+ {{ numberVal }}
11
12
  </div>
12
13
  <div style="padding-bottom: 10px">
13
14
  <div>switch the disalbed prop: {{ disabledInput }}</div>
@@ -100,7 +100,8 @@
100
100
  :draggable="draggable"
101
101
  :dense="dense"
102
102
  :pagination="{
103
- rowsPerPage: 10
103
+ rowsPerPage: 10,
104
+ page: 2
104
105
  }"
105
106
  class="sticky-header"
106
107
  :filter="filter"