@milaboratories/uikit 2.2.22 → 2.2.23

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": "2.2.22",
3
+ "version": "2.2.23",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -32,8 +32,8 @@
32
32
  "vue-tsc": "^2.1.10",
33
33
  "yarpm": "^1.2.0",
34
34
  "svgo": "^3.3.2",
35
- "@milaboratories/helpers": "^1.6.8",
36
- "@platforma-sdk/model": "^1.14.1"
35
+ "@platforma-sdk/model": "^1.14.1",
36
+ "@milaboratories/helpers": "^1.6.8"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "vite",
@@ -11,6 +11,9 @@ import { defaultData, useVisibleItems, vTextOverflown } from './remote';
11
11
  import { PlSearchField } from '../PlSearchField';
12
12
  import { PlIcon16 } from '../PlIcon16';
13
13
 
14
+ // note that on a Mac, a click combined with the control key is intercepted by the operating system and used to open a context menu, so ctrlKey is not detectable on click events.
15
+ const isCtrlOrMeta = (ev: KeyboardEvent | MouseEvent) => ev.ctrlKey || ev.metaKey;
16
+
14
17
  defineEmits<{
15
18
  (e: 'update:modelValue', value: boolean): void;
16
19
  (e: 'import:files', value: ImportedFiles): void;
@@ -119,7 +122,10 @@ const setDirPath = (dirPath: string) => {
119
122
  };
120
123
 
121
124
  const selectFile = (ev: MouseEvent, file: FileDialogItem) => {
122
- const { shiftKey, metaKey } = ev;
125
+ const { shiftKey } = ev;
126
+
127
+ const ctrlOrMetaKey = isCtrlOrMeta(ev);
128
+
123
129
  const { lastSelected } = data;
124
130
 
125
131
  ev.preventDefault();
@@ -135,7 +141,7 @@ const selectFile = (ev: MouseEvent, file: FileDialogItem) => {
135
141
  return;
136
142
  }
137
143
 
138
- if (!metaKey && !shiftKey) {
144
+ if (!ctrlOrMetaKey && !shiftKey) {
139
145
  data.items.forEach((f) => {
140
146
  if (f.id !== file.id) {
141
147
  f.selected = false;
@@ -238,12 +244,14 @@ useEventListener(document, 'keydown', (ev: KeyboardEvent) => {
238
244
  return;
239
245
  }
240
246
 
241
- if (ev.metaKey && ev.code === 'KeyA') {
247
+ const ctrlOrMetaKey = isCtrlOrMeta(ev);
248
+
249
+ if (ctrlOrMetaKey && ev.code === 'KeyA') {
242
250
  ev.preventDefault();
243
251
  selectAll();
244
252
  }
245
253
 
246
- if (ev.metaKey && ev.shiftKey && ev.code === 'Period') {
254
+ if (ctrlOrMetaKey && ev.shiftKey && ev.code === 'Period') {
247
255
  ev.preventDefault();
248
256
  data.showHiddenItems = !data.showHiddenItems;
249
257
  }
@@ -13,7 +13,7 @@ import DoubleContour from '@/utils/DoubleContour.vue';
13
13
  import { useLabelNotch } from '@/utils/useLabelNotch';
14
14
  import { useValidation } from '@/utils/useValidation';
15
15
  import { PlIcon16 } from '../PlIcon16';
16
- import { PlIcon24 } from '../PlIcon24';
16
+ import { PlMaskIcon24 } from '../PlMaskIcon24';
17
17
  import type { Equal } from '@milaboratories/helpers';
18
18
 
19
19
  const slots = useSlots();
@@ -160,7 +160,7 @@ const displayErrors = computed(() => {
160
160
 
161
161
  const hasErrors = computed(() => displayErrors.value.length > 0);
162
162
 
163
- const canShowClearable = computed(() => props.clearable && nonEmpty.value && props.type !== 'password');
163
+ const canShowClearable = computed(() => props.clearable && nonEmpty.value && props.type !== 'password' && !props.disabled);
164
164
 
165
165
  const togglePasswordVisibility = () => (showPassword.value = !showPassword.value);
166
166
 
@@ -206,7 +206,7 @@ useLabelNotch(rootRef);
206
206
  />
207
207
  <div class="pl-text-field__append">
208
208
  <PlIcon16 v-if="canShowClearable" class="pl-text-field__clearable" name="delete-clear" @click="clear" />
209
- <PlIcon24 v-if="type === 'password'" :name="passwordIcon" style="cursor: pointer" @click="togglePasswordVisibility" />
209
+ <PlMaskIcon24 v-if="type === 'password'" :name="passwordIcon" style="cursor: pointer" @click="togglePasswordVisibility" />
210
210
  <slot name="append" />
211
211
  </div>
212
212
  <DoubleContour class="pl-text-field__contour" />
@@ -3,6 +3,7 @@
3
3
  .pl-text-field {
4
4
  $root: &;
5
5
 
6
+ --pl-text-field-text-color: var(--txt-01);
6
7
  --contour-color: var(--txt-01);
7
8
  --label-color: var(--txt-01);
8
9
  --contour-border-width: 1px;
@@ -36,7 +37,7 @@
36
37
  border: none;
37
38
  font-size: inherit;
38
39
  background-color: transparent;
39
- color: var(--txt-01);
40
+ color: var(--pl-text-field-text-color);
40
41
  caret-color: var(--border-color-focus);
41
42
  cursor: inherit;
42
43
 
@@ -140,6 +141,9 @@
140
141
 
141
142
  &.disabled {
142
143
  --contour-color: var(--color-dis-01);
144
+ --label-color: var(--dis-01);
145
+ --pl-text-field-text-color: var(--dis-01);
146
+ --mask-icon-bg-color: var(--dis-01);
143
147
  cursor: not-allowed;
144
148
  }
145
149
  }