@milaboratories/uikit 2.2.46 → 2.2.47

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.46",
3
+ "version": "2.2.47",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -34,9 +34,9 @@
34
34
  "yarpm": "^1.2.0",
35
35
  "svgo": "^3.3.2",
36
36
  "@types/d3": "^7.4.3",
37
+ "@milaboratories/helpers": "^1.6.11",
37
38
  "@milaboratories/eslint-config": "^1.0.1",
38
- "@platforma-sdk/model": "^1.21.20",
39
- "@milaboratories/helpers": "^1.6.11"
39
+ "@platforma-sdk/model": "^1.21.20"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "vite",
@@ -7,8 +7,9 @@ export default {
7
7
  <script lang="ts" setup>
8
8
  import { useEventListener } from '@/composition/useEventListener';
9
9
  import './pl-dialog-modal.scss';
10
- import { ref, useAttrs, useSlots } from 'vue';
10
+ import { computed, ref, useAttrs, useSlots } from 'vue';
11
11
  import PlCloseModalBtn from '@/utils/PlCloseModalBtn.vue';
12
+ import type { Size } from '@/types';
12
13
 
13
14
  const slots = useSlots();
14
15
 
@@ -56,6 +57,10 @@ const props = withDefaults(
56
57
  * If `true`, the modal window closes when clicking outside the modal area (default: `true`)
57
58
  */
58
59
  closeOnOutsideClick?: boolean;
60
+ /**
61
+ * Predefined size (standard small | medium | large). Takes precedence over (min|max)(width|height) properties. Not defined by default.
62
+ */
63
+ size?: Size | undefined;
59
64
  }>(),
60
65
  {
61
66
  width: '448px',
@@ -65,11 +70,45 @@ const props = withDefaults(
65
70
  closable: true,
66
71
  noContentGutters: false,
67
72
  actionsHasTopBorder: true,
73
+ size: undefined,
68
74
  },
69
75
  );
70
76
 
71
77
  const modal = ref<HTMLElement>();
72
78
 
79
+ const style = computed(() => {
80
+ const { width, height, minHeight, maxHeight, size } = props;
81
+
82
+ if (size === 'small') {
83
+ return {
84
+ width: '448px',
85
+ height: '440px',
86
+ minHeight: 'auto',
87
+ maxHeight: 'auto',
88
+ };
89
+ }
90
+
91
+ if (size === 'medium') {
92
+ return {
93
+ width: '720px',
94
+ height: '720px',
95
+ minHeight: 'auto',
96
+ maxHeight: 'auto',
97
+ };
98
+ }
99
+
100
+ if (size === 'large') {
101
+ return {
102
+ width: '1080px',
103
+ height: '880px',
104
+ minHeight: 'auto',
105
+ maxHeight: 'auto',
106
+ };
107
+ }
108
+
109
+ return { width, height, minHeight, maxHeight };
110
+ });
111
+
73
112
  const $attrs = useAttrs();
74
113
 
75
114
  function onClickShadow(ev: Event) {
@@ -94,7 +133,7 @@ useEventListener(document.body, 'keyup', (ev) => {
94
133
  ref="modal"
95
134
  class="pl-dialog-modal"
96
135
  :class="{ 'has-title': slots.title, 'has-content': slots.default }"
97
- :style="{ width, height, minHeight, maxHeight }"
136
+ :style="style"
98
137
  >
99
138
  <PlCloseModalBtn v-if="closable" class="close-modal-btn" @click.stop="emit('update:modelValue', false)" />
100
139
  <div v-if="slots.title" class="pl-dialog-modal__title">
@@ -73,6 +73,7 @@ const props = withDefaults(
73
73
  placeholder: '...',
74
74
  required: false,
75
75
  disabled: false,
76
+ options: undefined,
76
77
  },
77
78
  );
78
79
 
@@ -53,6 +53,7 @@ const props = withDefaults(
53
53
  placeholder: '...',
54
54
  required: false,
55
55
  disabled: false,
56
+ options: undefined,
56
57
  },
57
58
  );
58
59