@v1nt1248/3nclient-lib 0.1.11 → 0.1.13

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
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.1.11",
5
+ "version": "0.1.13",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "type": "module",
8
8
  "files": [
@@ -36,7 +36,8 @@
36
36
  "build:components": "LIB_NAME=lib vite build",
37
37
  "build:plugins": "LIB_NAME=plugins vite build",
38
38
  "build:utils": "LIB_NAME=utils vite build",
39
- "build": "pnpm run clean:dist && pnpm run build:components && pnpm run build:plugins && pnpm run build:utils && pnpm run copy:css",
39
+ "build": "pnpm run clean:dist && pnpm run build:plugins && pnpm run build:utils && pnpm run build:components && pnpm run copy:css",
40
+ "pack": "pnpm run build && npm pack && cp *.tgz ./dist && rm *.tgz",
40
41
  "preview": "vite preview",
41
42
  "stylelint": "stylelint --config .stylelint.config.cjs 'src/**/*.{vue,scss}'",
42
43
  "stylelint:fix": "stylelint --config .stylelint.config.cjs --fix 'src/**/*.{vue,scss}'",
@@ -61,7 +62,7 @@
61
62
  },
62
63
  "peerDependencies": {
63
64
  "pinia": "2.2.1",
64
- "vue": "3.4.37"
65
+ "vue": "3.4.38"
65
66
  },
66
67
  "devDependencies": {
67
68
  "@types/lodash": "4.17.5",
@@ -70,9 +71,9 @@
70
71
  "@typescript-eslint/eslint-plugin": "8.0.1",
71
72
  "@typescript-eslint/parser": "8.0.1",
72
73
  "@vitejs/plugin-vue": "5.1.2",
73
- "@vue/compiler-core": "3.4.37",
74
+ "@vue/compiler-core": "3.4.38",
74
75
  "@vue/eslint-config-typescript": "13.0.0",
75
- "@vue/runtime-core": "3.4.37",
76
+ "@vue/runtime-core": "3.4.38",
76
77
  "@vuedx/typescript-plugin-vue": "0.7.6",
77
78
  "eslint": "9.9.0",
78
79
  "eslint-config-prettier": "^9.1.0",
@@ -98,7 +99,7 @@
98
99
  "vite-plugin-dts": "4.0.2",
99
100
  "vite-plugin-vue-devtools": "^7.3.7",
100
101
  "vitepress": "1.3.2",
101
- "vue": "3.4.37",
102
+ "vue": "3.4.38",
102
103
  "vue-tsc": "2.0.29"
103
104
  },
104
105
  "packageManager": "pnpm@9.7.0",
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { computed } from 'vue';
3
3
  import { Icon } from '@iconify/vue';
4
4
  import type { Ui3nIconEmits, Ui3nIconProps } from './types';
5
5
 
@@ -15,20 +15,23 @@ const props = withDefaults(
15
15
  );
16
16
  const emits = defineEmits<Ui3nIconEmits>();
17
17
 
18
- const onLoad = (value: any) => {
18
+ const iconName = computed(() => `ic:${props.icon}`);
19
+
20
+ function onLoad(value: unknown) {
19
21
  if (props.onLoad) {
20
22
  props.onLoad(value);
21
23
  }
22
- };
23
- const onClick = (ev: Event) => {
24
+ }
25
+
26
+ function onClick(ev: Event) {
24
27
  emits('click', ev);
25
- };
28
+ }
26
29
  </script>
27
30
 
28
31
  <template>
29
32
  <icon
30
33
  :class="$style.icon"
31
- :icon="icon"
34
+ :icon="iconName"
32
35
  :title="title"
33
36
  :inline="inline"
34
37
  :width="width"
@@ -149,7 +149,7 @@ const validate = (text: string) => {
149
149
 
150
150
  <ui3n-icon
151
151
  v-if="displayStateMode === 'success' && displayStateWithIcon && !isFocused"
152
- icon="check-circle-outline"
152
+ icon="sharp-check-circle-outline"
153
153
  :width="16"
154
154
  :height="16"
155
155
  color="var(--success-content-default)"
@@ -19,25 +19,25 @@ const props = withDefaults(
19
19
  const stylesByTypes = {
20
20
  success: {
21
21
  color: 'var(--success-content-default)',
22
- icon: 'warning',
22
+ icon: 'round-warning',
23
23
  iconColor: 'var(--success-fill-default)',
24
24
  iconRotate: 0,
25
25
  },
26
26
  warning: {
27
27
  color: 'var(--warning-content-default)',
28
- icon: 'warning',
28
+ icon: 'round-warning',
29
29
  iconColor: 'var(--warning-fill-default)',
30
30
  iconRotate: 0,
31
31
  },
32
32
  info: {
33
33
  color: 'var(--info-content-default)',
34
- icon: 'info',
34
+ icon: 'round-info',
35
35
  iconColor: 'var(--info-fill-default)',
36
36
  iconRotate: 90,
37
37
  },
38
38
  error: {
39
39
  color: 'var(--error-content-default)',
40
- icon: 'info',
40
+ icon: 'round-info',
41
41
  iconColor: 'var(--error-fill-default)',
42
42
  iconRotate: 90,
43
43
  },
@@ -12,8 +12,8 @@
12
12
  <template>
13
13
  <transition mode="out-in" name="fade">
14
14
  <ui3n-icon
15
- :key="value === 'asc' ? 'arrow-downward' : 'arrow-upward'"
16
- :icon="value === 'asc' ? 'arrow-downward' : 'arrow-upward'"
15
+ :key="value === 'asc' ? 'baseline-arrow-downward' : 'baseline-arrow-upward'"
16
+ :icon="value === 'asc' ? 'baseline-arrow-downward' : 'baseline-arrow-upward'"
17
17
  :width="iconSize"
18
18
  :height="iconSize"
19
19
  :color="iconColor"
@@ -5,30 +5,29 @@ import type { Ui3nTooltipEmits, Ui3nTooltipProps, Ui3nTooltipSlots } from './typ
5
5
 
6
6
  const baseOffset = 5;
7
7
 
8
- const props = withDefaults(
9
- defineProps<Ui3nTooltipProps>(),
10
- {
11
- color: 'var(--color-bg-control-secondary-default)',
12
- textColor: 'var(--color-text-control-primary-default)',
13
- placement: 'top',
14
- positionStrategy: 'absolute',
15
- offsetX: 0,
16
- offsetY: 0,
17
- trigger: 'hover',
18
- },
19
- );
8
+ const props = withDefaults(defineProps<Ui3nTooltipProps>(), {
9
+ color: 'var(--color-bg-control-secondary-default)',
10
+ textColor: 'var(--color-text-control-primary-default)',
11
+ placement: 'top',
12
+ positionStrategy: 'absolute',
13
+ offsetX: 0,
14
+ offsetY: 0,
15
+ trigger: 'hover',
16
+ });
20
17
 
21
18
  const emits = defineEmits<Ui3nTooltipEmits>();
22
19
  defineSlots<Ui3nTooltipSlots>();
23
20
 
24
21
  const referenceElEventHandler = {
25
- ...(props.trigger === 'hover' && !props.disabled && {
26
- mouseenter: () => handleMouseEvents(true),
27
- mouseleave: () => handleMouseEvents(false),
28
- }),
29
- ...(props.trigger === 'click' && !props.disabled && {
30
- click: () => handleMouseEvents(!showTooltip.value),
31
- }),
22
+ ...(props.trigger === 'hover' &&
23
+ !props.disabled && {
24
+ mouseenter: () => handleMouseEvents(true),
25
+ mouseleave: () => handleMouseEvents(false),
26
+ }),
27
+ ...(props.trigger === 'click' &&
28
+ !props.disabled && {
29
+ click: () => handleMouseEvents(!showTooltip.value),
30
+ }),
32
31
  };
33
32
 
34
33
  const showTooltip = ref(false);
@@ -72,10 +71,7 @@ const { floatingStyles, isPositioned, middlewareData } = useFloating(referenceEl
72
71
  open: showTooltip,
73
72
  placement: props.placement,
74
73
  strategy: props.positionStrategy,
75
- middleware: [
76
- offset(offsetOptions.value),
77
- arrow({ element: floatingArrowEl, padding: 8 }),
78
- ],
74
+ middleware: [offset(offsetOptions.value), arrow({ element: floatingArrowEl, padding: 8 })],
79
75
  whileElementsMounted: props.positionStrategy === 'fixed' ? autoUpdate : undefined,
80
76
  });
81
77
 
@@ -87,16 +83,13 @@ function handleMouseEvents(val: boolean) {
87
83
 
88
84
  watch(
89
85
  () => props.modelValue,
90
- (val) => props.trigger === 'manual' && (showTooltip.value = val),
86
+ val => props.trigger === 'manual' && (showTooltip.value = val),
91
87
  { immediate: true },
92
88
  );
93
89
 
94
- watch(
95
- isPositioned,
96
- (val) => {
97
- val ? emits('opened') : emits('closed');
98
- },
99
- );
90
+ watch(isPositioned, val => {
91
+ val ? emits('opened') : emits('closed');
92
+ });
100
93
  </script>
101
94
 
102
95
  <template>
@@ -109,7 +102,12 @@ watch(
109
102
  <slot name="default" />
110
103
  </div>
111
104
 
112
- <div ref="floatingEl" :class="$style.floating" :style="floatingStyles" v-if="showTooltip">
105
+ <div
106
+ ref="floatingEl"
107
+ :class="$style.floating"
108
+ :style="floatingStyles"
109
+ v-if="showTooltip"
110
+ >
113
111
  <slot name="content">
114
112
  <div :class="$style.content">
115
113
  {{ props.content }}
@@ -1,2 +0,0 @@
1
- import { Plugin } from 'vue';
2
- export declare const useIcons: Plugin;