@milaboratories/uikit 2.2.28 → 2.2.30

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.28",
3
+ "version": "2.2.30",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -32,9 +32,9 @@
32
32
  "vue-tsc": "^2.1.10",
33
33
  "yarpm": "^1.2.0",
34
34
  "svgo": "^3.3.2",
35
- "@milaboratories/helpers": "^1.6.9",
36
35
  "@milaboratories/eslint-config": "^1.0.0",
37
- "@platforma-sdk/model": "^1.17.0"
36
+ "@platforma-sdk/model": "^1.18.0",
37
+ "@milaboratories/helpers": "^1.6.9"
38
38
  },
39
39
  "scripts": {
40
40
  "dev": "vite",
@@ -80,6 +80,10 @@ const modelText = computed<string>(() => {
80
80
 
81
81
  const inputModel = ref(modelText.value);
82
82
 
83
+ watch(modelText, (v) => {
84
+ inputModel.value = v;
85
+ });
86
+
83
87
  const placeholderVal = computed(() => {
84
88
  if (data.isOpen) {
85
89
  if (searchPhrase.value && searchPhrase.value.length >= modelText.value.length - 1) {
@@ -136,7 +140,6 @@ function updateSelected() {
136
140
  }),
137
141
  (v) => (v < 0 ? 0 : v),
138
142
  );
139
- inputModel.value = modelText.value;
140
143
  }
141
144
 
142
145
  function resetSearchPhrase() {
@@ -256,7 +259,6 @@ useElementPosition(container, (pos) => {
256
259
  </script>
257
260
 
258
261
  <template>
259
- <!-- {{ inputModel }} -->
260
262
  <div
261
263
  ref="container"
262
264
  tabindex="0"
@@ -5,19 +5,18 @@ import { computed } from 'vue';
5
5
  const props = defineProps<{
6
6
  modelValue?: string;
7
7
  placeholder?: string;
8
- value?: string;
9
8
  disabled?: boolean;
10
9
  maxWidth?: string;
11
10
  width?: string;
12
11
  }>();
13
12
 
14
- const emit = defineEmits(['input', 'update:modelValue']);
13
+ const emit = defineEmits(['update:modelValue']);
15
14
 
16
15
  const text = computed(() => {
17
16
  if (props.placeholder) {
18
17
  return props.placeholder;
19
18
  }
20
- return (props.modelValue || props.value)?.replace('"', '');
19
+ return (props.modelValue)?.replace('"', '');
21
20
  });
22
21
 
23
22
  const styles = computed(() => {
@@ -32,8 +31,7 @@ const styles = computed(() => {
32
31
  });
33
32
 
34
33
  function handleInput(event: Event) {
35
- const value = (event.target as HTMLInputElement).value;
36
- emit('update:modelValue', value);
34
+ emit('update:modelValue', (event.target as HTMLInputElement).value);
37
35
  }
38
36
  </script>
39
37
 
@@ -14,12 +14,27 @@ const slots = useSlots();
14
14
  defineProps<{
15
15
  noBodyGutters?: boolean;
16
16
  }>();
17
+
18
+ const setTitleIfNeeded = (el: HTMLElement) => {
19
+ el.removeAttribute('title');
20
+ if (el.clientWidth < el.scrollWidth) {
21
+ el.setAttribute('title', el.innerText);
22
+ }
23
+ };
24
+
25
+ const vTextOverflownTitle = {
26
+ mounted: setTitleIfNeeded,
27
+ updated: setTitleIfNeeded,
28
+ };
17
29
  </script>
18
30
 
19
31
  <template>
20
32
  <div class="pl-layout-component pl-block-page" :class="{ noBodyGutters }">
21
33
  <div v-if="slots.title" class="pl-block-page__title">
22
- <div class="pl-block-page__title__default"><slot name="title" /></div>
34
+ <div class="pl-block-page__title__default">
35
+ <span v-text-overflown-title><slot name="title" /></span>
36
+ <slot name="after-title" />
37
+ </div>
23
38
  <div class="pl-block-page__title__append">
24
39
  <slot name="append" />
25
40
  </div>
@@ -20,19 +20,32 @@
20
20
  align-items: center;
21
21
  gap: 12px;
22
22
  padding: 20px 24px;
23
+ min-width: 0;
24
+ max-width: 100%;
23
25
 
24
26
  &__default {
25
27
  flex: 1;
28
+ min-width: 0;
29
+ max-width: 100%;
26
30
  margin: 0;
27
31
  color: var(--txt-01);
28
- font-size: 28px;
29
- font-weight: 500;
30
- line-height: 32px;
31
- letter-spacing: -0.56px;
32
32
  display: flex;
33
33
  flex-direction: row;
34
34
  align-items: center;
35
35
  gap: 12px;
36
+
37
+ > span {
38
+ font-size: 28px;
39
+ font-weight: 500;
40
+ line-height: 36px;
41
+ letter-spacing: -0.56px;
42
+ white-space: nowrap;
43
+ overflow: hidden;
44
+ text-overflow: ellipsis;
45
+ min-width: 0;
46
+ max-width: 100%;
47
+ display: inline-block;
48
+ }
36
49
  }
37
50
 
38
51
  &__append {