@v1nt1248/3nclient-lib 0.0.38 → 0.0.40
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/README.md +2 -0
- package/dist/components/index.d.ts +5 -1
- package/dist/components/ui3n-badge-simple.vue.d.ts +4 -1
- package/dist/components/ui3n-badge.vue.d.ts +4 -1
- package/dist/components/ui3n-breadcrumb.vue.d.ts +52 -0
- package/dist/components/ui3n-breadcrumbs.vue.d.ts +39 -0
- package/dist/components/ui3n-button.vue.d.ts +4 -1
- package/dist/components/ui3n-checkbox.vue.d.ts +6 -3
- package/dist/components/ui3n-chip.vue.d.ts +5 -2
- package/dist/components/ui3n-dialog.vue.d.ts +1 -1
- package/dist/components/ui3n-drop-files.vue.d.ts +1 -1
- package/dist/components/ui3n-emoji.vue.d.ts +4 -1
- package/dist/components/ui3n-icon.vue.d.ts +1 -1
- package/dist/components/ui3n-input.vue.d.ts +1 -1
- package/dist/components/ui3n-list.vue.d.ts +6 -3
- package/dist/components/ui3n-menu.vue.d.ts +5 -2
- package/dist/components/ui3n-notification.vue.d.ts +1 -1
- package/dist/components/ui3n-table-sort-icon.vue.d.ts +1 -1
- package/dist/components/ui3n-table.vue.d.ts +1 -1
- package/dist/components/ui3n-tabs.vue.d.ts +4 -1
- package/dist/components/ui3n-text.vue.d.ts +2 -2
- package/dist/components/ui3n-virtual-scroll.vue.d.ts +6 -3
- package/dist/index.d.ts +4 -0
- package/dist/stories/Ui3nBadge.stories.d.ts +60 -96
- package/dist/stories/Ui3nBreadcrumbs.stories.d.ts +252 -0
- package/dist/stories/Ui3nButton.stories.d.ts +77 -113
- package/dist/stories/Ui3nCheckbox.stories.d.ts +100 -140
- package/dist/stories/Ui3nChip.stories.d.ts +300 -420
- package/dist/stories/Ui3nDialog.stories.d.ts +1 -1
- package/dist/stories/Ui3nDropFiles.stories.d.ts +32 -67
- package/dist/stories/Ui3nEmoji.stories.d.ts +1 -1
- package/dist/stories/Ui3nIcon.stories.d.ts +1 -1
- package/dist/stories/Ui3nInput.stories.d.ts +6 -6
- package/dist/stories/Ui3nList.stories.d.ts +3 -3
- package/dist/stories/Ui3nTabs.stories.d.ts +91 -130
- package/dist/style.css +1 -1
- package/dist/ui-3n-lib.js +4461 -4401
- package/package.json +44 -44
- package/src/components/index.ts +10 -0
- package/src/components/ui3n-breadcrumb.vue +105 -0
- package/src/components/ui3n-breadcrumbs.vue +28 -0
- package/src/components/ui3n-button.vue +7 -4
- package/src/components/ui3n-dialog.vue +12 -2
package/package.json
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
"name": "@v1nt1248/3nclient-lib",
|
|
3
3
|
"license": "AGPL-3.0-or-later",
|
|
4
4
|
"author": "v1nt1248",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.40",
|
|
6
6
|
"description": "Library for 3NWeb clients",
|
|
7
|
-
"private": false,
|
|
8
7
|
"type": "module",
|
|
9
8
|
"files": [
|
|
10
9
|
"dist",
|
|
@@ -36,61 +35,62 @@
|
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@iconify-icons/ic": "^1.2.13",
|
|
38
37
|
"@iconify/vue": "^4.1.1",
|
|
39
|
-
"dayjs": "^1.11.
|
|
38
|
+
"dayjs": "^1.11.10",
|
|
40
39
|
"lodash": "^4.17.21",
|
|
41
40
|
"mitt": "^3.0.1",
|
|
42
|
-
"sanitize-html": "^2.
|
|
41
|
+
"sanitize-html": "^2.12.1",
|
|
43
42
|
"tslib": "^2.6.2"
|
|
44
43
|
},
|
|
45
44
|
"peerDependencies": {
|
|
46
|
-
"pinia": "^2.1.
|
|
47
|
-
"vue": "^3.
|
|
45
|
+
"pinia": "^2.1.7",
|
|
46
|
+
"vue": "^3.4.21"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
|
-
"@storybook/addon-actions": "^
|
|
51
|
-
"@storybook/addon-docs": "^
|
|
52
|
-
"@storybook/addon-essentials": "^
|
|
53
|
-
"@storybook/addon-interactions": "^
|
|
54
|
-
"@storybook/addon-links": "^
|
|
55
|
-
"@storybook/blocks": "^
|
|
56
|
-
"@storybook/builder-vite": "^
|
|
57
|
-
"@storybook/testing-library": "^0.2.
|
|
58
|
-
"@storybook/vue3": "^
|
|
59
|
-
"@storybook/vue3-vite": "^
|
|
60
|
-
"@types/lodash": "^4.
|
|
61
|
-
"@types/node": "^20.
|
|
62
|
-
"@types/sanitize-html": "^2.
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
64
|
-
"@typescript-eslint/parser": "^
|
|
65
|
-
"@vitejs/plugin-vue": "^
|
|
66
|
-
"@vue/compiler-core": "^3.
|
|
67
|
-
"@vue/eslint-config-typescript": "^
|
|
49
|
+
"@storybook/addon-actions": "^8.0.2",
|
|
50
|
+
"@storybook/addon-docs": "^8.0.2",
|
|
51
|
+
"@storybook/addon-essentials": "^8.0.2",
|
|
52
|
+
"@storybook/addon-interactions": "^8.0.2",
|
|
53
|
+
"@storybook/addon-links": "^8.0.2",
|
|
54
|
+
"@storybook/blocks": "^8.0.2",
|
|
55
|
+
"@storybook/builder-vite": "^8.0.2",
|
|
56
|
+
"@storybook/testing-library": "^0.2.2",
|
|
57
|
+
"@storybook/vue3": "^8.0.2",
|
|
58
|
+
"@storybook/vue3-vite": "^8.0.2",
|
|
59
|
+
"@types/lodash": "^4.17.0",
|
|
60
|
+
"@types/node": "^20.11.30",
|
|
61
|
+
"@types/sanitize-html": "^2.11.0",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
63
|
+
"@typescript-eslint/parser": "^7.3.1",
|
|
64
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
65
|
+
"@vue/compiler-core": "^3.4.21",
|
|
66
|
+
"@vue/eslint-config-typescript": "^13.0.0",
|
|
68
67
|
"@vuedx/typescript-plugin-vue": "^0.7.6",
|
|
69
|
-
"eslint": "^8.
|
|
70
|
-
"eslint-plugin-import": "^2.
|
|
68
|
+
"eslint": "^8.57.0",
|
|
69
|
+
"eslint-plugin-import": "^2.29.1",
|
|
71
70
|
"eslint-plugin-node": "^11.1.0",
|
|
72
71
|
"eslint-plugin-promise": "^6.1.1",
|
|
73
|
-
"eslint-plugin-storybook": "^0.
|
|
74
|
-
"eslint-plugin-vue": "^9.
|
|
75
|
-
"jackspeak": "^2.3.
|
|
76
|
-
"
|
|
77
|
-
"
|
|
72
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
73
|
+
"eslint-plugin-vue": "^9.23.0",
|
|
74
|
+
"jackspeak": "^2.3.6",
|
|
75
|
+
"path": "^0.12.7",
|
|
76
|
+
"pinia": "^2.1.7",
|
|
77
|
+
"postcss-html": "^1.6.0",
|
|
78
78
|
"react": "^18.2.0",
|
|
79
79
|
"react-dom": "^18.2.0",
|
|
80
|
-
"sass": "^1.
|
|
81
|
-
"storybook": "^
|
|
82
|
-
"stylelint": "^
|
|
83
|
-
"stylelint-config-recommended-scss": "^
|
|
80
|
+
"sass": "^1.72.0",
|
|
81
|
+
"storybook": "^8.0.2",
|
|
82
|
+
"stylelint": "^16.2.1",
|
|
83
|
+
"stylelint-config-recommended-scss": "^14.0.0",
|
|
84
84
|
"stylelint-config-recommended-vue": "^1.5.0",
|
|
85
|
-
"stylelint-config-standard": "^
|
|
85
|
+
"stylelint-config-standard": "^36.0.0",
|
|
86
86
|
"stylelint-rscss": "^0.4.0",
|
|
87
|
-
"stylelint-scss": "^
|
|
88
|
-
"typescript": "^5.
|
|
89
|
-
"vite": "^
|
|
90
|
-
"vite-plugin-css-injected-by-js": "^3.
|
|
91
|
-
"vite-plugin-dts": "^3.
|
|
92
|
-
"vue": "^3.
|
|
93
|
-
"vue-tsc": "^
|
|
87
|
+
"stylelint-scss": "^6.2.1",
|
|
88
|
+
"typescript": "^5.4.2",
|
|
89
|
+
"vite": "^5.2.2",
|
|
90
|
+
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
91
|
+
"vite-plugin-dts": "^3.7.3",
|
|
92
|
+
"vue": "^3.4.21",
|
|
93
|
+
"vue-tsc": "^2.0.7"
|
|
94
94
|
},
|
|
95
|
-
"packageManager": "yarn@
|
|
95
|
+
"packageManager": "yarn@4.1.1"
|
|
96
96
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -31,6 +31,10 @@ import Ui3nTabs from './ui3n-tabs.vue'
|
|
|
31
31
|
import type { Ui3nTabsProps, Ui3nTabsEmits, Ui3nTabsSlots } from './ui3n-tabs.vue'
|
|
32
32
|
import Ui3nBadge from './ui3n-badge.vue'
|
|
33
33
|
import type { Ui3nBadgeProps } from './ui3n-badge.vue'
|
|
34
|
+
import Ui3nBreadcrumb from './ui3n-breadcrumb.vue'
|
|
35
|
+
import type { Ui3nBreadcrumdProps, Ui3nBreadcrumdEmits, Ui3nBreadcrumdSlots } from './ui3n-breadcrumb.vue'
|
|
36
|
+
import Ui3nBreadcrumbs from './ui3n-breadcrumbs.vue'
|
|
37
|
+
import type { Ui3nBreadcrumdsProps } from './ui3n-breadcrumbs.vue'
|
|
34
38
|
|
|
35
39
|
export {
|
|
36
40
|
Ui3nIcon,
|
|
@@ -87,4 +91,10 @@ export {
|
|
|
87
91
|
Ui3nTabsSlots,
|
|
88
92
|
Ui3nBadge,
|
|
89
93
|
Ui3nBadgeProps,
|
|
94
|
+
Ui3nBreadcrumb,
|
|
95
|
+
Ui3nBreadcrumdProps,
|
|
96
|
+
Ui3nBreadcrumdEmits,
|
|
97
|
+
Ui3nBreadcrumdSlots,
|
|
98
|
+
Ui3nBreadcrumbs,
|
|
99
|
+
Ui3nBreadcrumdsProps,
|
|
90
100
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, getCurrentInstance } from 'vue';
|
|
3
|
+
|
|
4
|
+
export interface Ui3nBreadcrumdProps {
|
|
5
|
+
separator?: string | undefined;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface Ui3nBreadcrumdEmits {
|
|
10
|
+
(ev: 'click', value: Event): void;
|
|
11
|
+
}
|
|
12
|
+
export interface Ui3nBreadcrumdSlots {
|
|
13
|
+
separator: () => unknown;
|
|
14
|
+
default: () => unknown;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<Ui3nBreadcrumdProps>(),
|
|
19
|
+
{
|
|
20
|
+
separator: undefined,
|
|
21
|
+
isActive: false,
|
|
22
|
+
disabled: false,
|
|
23
|
+
},
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
const emits = defineEmits<Ui3nBreadcrumdEmits>()
|
|
27
|
+
defineSlots<Ui3nBreadcrumdSlots>()
|
|
28
|
+
|
|
29
|
+
const separatorValue = computed(() => {
|
|
30
|
+
if (props.separator) {
|
|
31
|
+
return props.separator
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const instance = getCurrentInstance()
|
|
35
|
+
console.log('INS: ', instance?.parent?.props.separator)
|
|
36
|
+
return instance?.parent?.props.separator || '/'
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const parentDisabled = computed(() => {
|
|
40
|
+
const instance = getCurrentInstance()
|
|
41
|
+
console.log('DIS: ', instance?.parent?.props.disabled)
|
|
42
|
+
return instance?.parent?.props.disabled || false;
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const onClick = (ev: Event) => {
|
|
46
|
+
emits('click', ev);
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<div
|
|
52
|
+
:class="[
|
|
53
|
+
'ui3n-breadcrumb',
|
|
54
|
+
{
|
|
55
|
+
'ui3n-breadcrumb--active': isActive,
|
|
56
|
+
'ui3n-breadcrumb--disabled': disabled || parentDisabled,
|
|
57
|
+
},
|
|
58
|
+
]"
|
|
59
|
+
v-on="isActive && !(disabled || parentDisabled) ? { click: onClick } : {}"
|
|
60
|
+
>
|
|
61
|
+
<slot />
|
|
62
|
+
<div
|
|
63
|
+
v-if="isActive"
|
|
64
|
+
class="ui3n-breadcrumb__separator"
|
|
65
|
+
>
|
|
66
|
+
<slot name="separator">
|
|
67
|
+
<span>{{ separatorValue }}</span>
|
|
68
|
+
</slot>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<style lang="scss" scoped>
|
|
74
|
+
.ui3n-breadcrumb {
|
|
75
|
+
--ui3n-breadcrumb-font-size: 16px;
|
|
76
|
+
--ui3n-breadcrumb-color-default: var(--black-90, #212121);
|
|
77
|
+
--ui3n-breadcrumb-color-selected: var(--blue-main, #0090ec);
|
|
78
|
+
|
|
79
|
+
position: relative;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
|
|
83
|
+
&__separator {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
margin: 0 var(--base-size, 8px);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--active {
|
|
90
|
+
font-size: var(--ui3n-breadcrumb-font-size);
|
|
91
|
+
line-height: 1.25;
|
|
92
|
+
color: var(--ui3n-breadcrumb-color-default);
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
color: var(--ui3n-breadcrumb-color-selected);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&--disabled {
|
|
101
|
+
cursor: default;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
export interface Ui3nBreadcrumdsProps {
|
|
3
|
+
separator?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
withDefaults(
|
|
8
|
+
defineProps<Ui3nBreadcrumdsProps>(),
|
|
9
|
+
{
|
|
10
|
+
separator: '/',
|
|
11
|
+
disabled: false,
|
|
12
|
+
},
|
|
13
|
+
)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div :class="['ui3n-breadcrumbs']">
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style lang="scss" scoped>
|
|
23
|
+
.ui3n-breadcrumbs {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface Ui3nButtonEmits {
|
|
18
|
+
(ev: 'init', value: HTMLButtonElement): void;
|
|
18
19
|
(ev: 'click', value: Event): void;
|
|
19
20
|
(ev: 'focus', value: Event): void;
|
|
20
21
|
(ev: 'blur', value: Event): void;
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
|
|
23
24
|
const slots = useSlots()
|
|
24
25
|
const props = defineProps<Ui3nButtonProps>()
|
|
25
|
-
const
|
|
26
|
+
const emits = defineEmits<Ui3nButtonEmits>()
|
|
26
27
|
|
|
27
28
|
const buttonEl = ref<HTMLButtonElement | null>(null)
|
|
28
29
|
const isSlotEmpty = computed(() => !hasSlotContent(slots['default']))
|
|
@@ -51,6 +52,8 @@
|
|
|
51
52
|
if (props.textColor) {
|
|
52
53
|
buttonEl.value.style.setProperty('--ui3n-button-text-color', props.textColor)
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
emits('init', buttonEl.value)
|
|
54
57
|
}
|
|
55
58
|
})
|
|
56
59
|
</script>
|
|
@@ -64,9 +67,9 @@
|
|
|
64
67
|
]"
|
|
65
68
|
type="button"
|
|
66
69
|
:disabled="props.disabled"
|
|
67
|
-
@click="
|
|
68
|
-
@focusin="
|
|
69
|
-
@focusout="
|
|
70
|
+
@click="emits('click', $event)"
|
|
71
|
+
@focusin="emits('focus', $event)"
|
|
72
|
+
@focusout="emits('blur', $event)"
|
|
70
73
|
>
|
|
71
74
|
<ui3n-icon
|
|
72
75
|
v-if="props.icon"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import { computed, onMounted, ref } from 'vue'
|
|
3
|
+
import { computed, nextTick, onMounted, ref } from 'vue'
|
|
4
4
|
import type { Component } from 'vue'
|
|
5
5
|
import Ui3nButton from './ui3n-button.vue'
|
|
6
6
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
cancelButtonBackground?: string;
|
|
28
28
|
closeOnClickOverlay?: boolean;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
export interface Ui3nDialogComponentProps {
|
|
32
32
|
component: Component;
|
|
33
33
|
componentProps?: Record<string, any>;
|
|
@@ -97,6 +97,12 @@
|
|
|
97
97
|
dialogElement.value.style.setProperty('--dialog-confirm-background-color', dialogProps.value.confirmButtonBackground)
|
|
98
98
|
dialogElement.value.style.setProperty('--dialog-cancel-background-color', dialogProps.value.cancelButtonBackground)
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
if (dialogElement.value) {
|
|
102
|
+
nextTick(() => {
|
|
103
|
+
dialogElement.value!.focus()
|
|
104
|
+
})
|
|
105
|
+
}
|
|
100
106
|
})
|
|
101
107
|
|
|
102
108
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -172,8 +178,11 @@
|
|
|
172
178
|
>
|
|
173
179
|
<div
|
|
174
180
|
ref="dialogElement"
|
|
181
|
+
tabindex="1"
|
|
175
182
|
:class="dialogProps.cssClass"
|
|
176
183
|
:style="dialogProps.cssStyle"
|
|
184
|
+
@keydown.esc.stop="startEmit('cancel')"
|
|
185
|
+
@keydown.enter.stop=" isValid && startEmit('confirm')"
|
|
177
186
|
>
|
|
178
187
|
<div
|
|
179
188
|
v-if="dialogProps.title"
|
|
@@ -270,6 +279,7 @@
|
|
|
270
279
|
max-height: 95%;
|
|
271
280
|
background-color: var(--system-white, #fff);
|
|
272
281
|
border-radius: var(--dialog-border-radius);
|
|
282
|
+
outline: none;
|
|
273
283
|
@include elevation();
|
|
274
284
|
|
|
275
285
|
&__title {
|