@milaboratories/uikit 1.2.15 → 1.2.16

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": "@milaboratories/uikit",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -30,7 +30,7 @@
30
30
  "vite": "^5.4.8",
31
31
  "vue-tsc": "^2.1.6",
32
32
  "yarpm": "^1.2.0",
33
- "@milaboratories/helpers": "^1.6.4",
33
+ "@milaboratories/helpers": "^1.6.5",
34
34
  "@platforma-sdk/model": "^1.2.30"
35
35
  },
36
36
  "scripts": {
@@ -154,10 +154,23 @@ function handleKeyPress(e: { code: string; preventDefault(): void }) {
154
154
 
155
155
  e.code === 'ArrowUp' ? increment() : e.code === 'ArrowDown' ? decrement() : undefined;
156
156
  }
157
+
158
+ // https://stackoverflow.com/questions/880512/prevent-text-selection-after-double-click#:~:text=If%20you%20encounter%20a%20situation,none%3B%20to%20the%20summary%20element.
159
+ const onMousedown = (ev: MouseEvent) => {
160
+ if (ev.detail > 1) {
161
+ ev.preventDefault();
162
+ }
163
+ };
157
164
  </script>
158
165
 
159
166
  <template>
160
- <div ref="root" :class="{ error: !!errors.trim(), disabled: disabled }" class="mi-number-field d-flex-column" @keydown="handleKeyPress($event)">
167
+ <div
168
+ ref="root"
169
+ :class="{ error: !!errors.trim(), disabled: disabled }"
170
+ class="mi-number-field d-flex-column"
171
+ @mousedown="onMousedown"
172
+ @keydown="handleKeyPress($event)"
173
+ >
161
174
  <div class="mi-number-field__main-wrapper d-flex">
162
175
  <DoubleContour class="mi-number-field__contour" />
163
176
  <div class="mi-number-field__wrapper flex-grow d-flex flex-align-center">
package/src/types.ts CHANGED
@@ -43,6 +43,8 @@ export type ListOptionNormalized<T = unknown> = {
43
43
  value: T;
44
44
  };
45
45
 
46
+ export type ListOptionType<Type> = Type extends ListOption<infer X>[] ? X : never;
47
+
46
48
  export const maskIcons16 = [
47
49
  'checkmark',
48
50
  'import',