@milaboratories/uikit 2.2.47 → 2.2.48

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.47",
3
+ "version": "2.2.48",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -34,8 +34,8 @@
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",
38
37
  "@milaboratories/eslint-config": "^1.0.1",
38
+ "@milaboratories/helpers": "^1.6.11",
39
39
  "@platforma-sdk/model": "^1.21.20"
40
40
  },
41
41
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from 'vue';
3
- import { debounce, notEmpty } from '../helpers/utils';
3
+ import { debounce, notEmpty } from '@milaboratories/helpers';
4
4
 
5
5
  const hasElementEllipsis = ref(false);
6
6
 
@@ -7,7 +7,7 @@ export default {
7
7
  <script lang="ts" setup>
8
8
  import { useEventListener } from '@/composition/useEventListener';
9
9
  import './pl-dialog-modal.scss';
10
- import { computed, ref, useAttrs, useSlots } from 'vue';
10
+ import { computed, ref, useSlots } from 'vue';
11
11
  import PlCloseModalBtn from '@/utils/PlCloseModalBtn.vue';
12
12
  import type { Size } from '@/types';
13
13
 
@@ -109,8 +109,6 @@ const style = computed(() => {
109
109
  return { width, height, minHeight, maxHeight };
110
110
  });
111
111
 
112
- const $attrs = useAttrs();
113
-
114
112
  function onClickShadow(ev: Event) {
115
113
  if (modal.value && props.closeOnOutsideClick && document.contains(ev.target as Node) && !modal.value.contains(ev.target as Node)) {
116
114
  emit('update:modelValue', false);
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'vue';
2
2
  import { ref, watch } from 'vue';
3
- import { notEmpty } from '@/helpers/utils';
3
+ import { notEmpty } from '@milaboratories/helpers';
4
4
 
5
5
  const $store = new Map<string, Ref<string | null>>();
6
6
 
@@ -4,14 +4,6 @@ export function call<R>(f: () => R): R {
4
4
  return f();
5
5
  }
6
6
 
7
- export function notEmpty<T>(v: T | null | undefined, message: string): T {
8
- if (v === null || v === undefined) {
9
- throw Error(message);
10
- }
11
-
12
- return v;
13
- }
14
-
15
7
  export function requestTick<P>(cb: (...args: P[]) => void) {
16
8
  let tick = false;
17
9
 
@@ -108,17 +100,6 @@ export function animateInfinite(options: { getFraction: (dt: number) => number;
108
100
  /* eslint-disable @typescript-eslint/no-explicit-any */
109
101
  type AnyFunction = (...args: any[]) => any;
110
102
 
111
- export function debounce<F extends AnyFunction>(func: F, delay: number) {
112
- let timerId = -1;
113
- return (...args: Parameters<F>) => {
114
- if (timerId !== -1) {
115
- clearTimeout(timerId);
116
- timerId = -1;
117
- }
118
- timerId = window.setTimeout(() => func(...args), delay);
119
- };
120
- }
121
-
122
103
  export function throttle<F extends AnyFunction>(callback: F, ms: number, trailing = true): (...args: Parameters<F>) => void {
123
104
  let t = 0,
124
105
  call: AnyFunction | null;
@@ -142,6 +123,10 @@ export function listToOptions<T>(list: T[] | readonly T[]): ListOption<T>[] {
142
123
  }
143
124
 
144
125
  export function normalizeListOptions<V = unknown>(options: Readonly<ListOption<V>[]>) {
126
+ if (!Array.isArray(options)) {
127
+ throw Error('Invalid component options: ' + String(options));
128
+ }
129
+
145
130
  return options.map((it) => ({
146
131
  label: 'label' in it ? it.label : it.text,
147
132
  value: it.value,
package/vite.config.ts CHANGED
@@ -40,8 +40,8 @@ export default defineConfig({
40
40
  },
41
41
  },
42
42
  build: {
43
- sourcemap: process.env.DEV_SOURCE_MAP === '1',
44
- emptyOutDir: false,
43
+ sourcemap: true,
44
+ emptyOutDir: true,
45
45
  lib: {
46
46
  // Could also be a dictionary or array of multiple entry points
47
47
  entry: [resolve(__dirname, 'src/index.ts')],