@v1nt1248/3nclient-lib 0.0.41 → 0.1.0
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 +4 -4
- package/dist/components/index.d.ts +22 -38
- package/dist/components/ui3n-badge-simple.vue.d.ts +3 -3
- package/dist/components/ui3n-badge.vue.d.ts +2 -2
- package/dist/components/ui3n-breadcrumb.vue.d.ts +7 -7
- package/dist/components/ui3n-breadcrumbs.vue.d.ts +3 -3
- package/dist/components/ui3n-button.vue.d.ts +29 -4
- package/dist/components/ui3n-checkbox.vue.d.ts +3 -3
- package/dist/components/ui3n-chip.vue.d.ts +3 -3
- package/dist/components/ui3n-dialog.vue.d.ts +6 -5
- package/dist/components/ui3n-drop-files.vue.d.ts +23 -3
- package/dist/components/ui3n-emoji.vue.d.ts +3 -3
- package/dist/components/ui3n-icon.vue.d.ts +29 -3
- package/dist/components/ui3n-input.vue.d.ts +9 -9
- package/dist/components/ui3n-list.vue.d.ts +4 -4
- package/dist/components/ui3n-menu.vue.d.ts +3 -3
- package/dist/components/ui3n-notification.vue.d.ts +32 -2
- package/dist/components/ui3n-switch.vue.d.ts +55 -0
- package/dist/components/ui3n-table-sort-icon.vue.d.ts +1 -1
- package/dist/components/ui3n-table.vue.d.ts +4 -3
- package/dist/components/ui3n-tabs.vue.d.ts +3 -3
- package/dist/components/ui3n-text.vue.d.ts +29 -3
- package/dist/components/ui3n-virtual-scroll.vue.d.ts +12 -9
- package/dist/constants/types.d.ts +2 -4
- package/dist/directives/index.d.ts +3 -2
- package/dist/directives/ui3n-click-outside.d.ts +2 -1
- package/dist/directives/ui3n-html.d.ts +1 -0
- package/dist/index.d.ts +27 -29
- package/dist/plugins/dialogs.d.ts +3 -3
- package/dist/plugins/i18n.d.ts +2 -2
- package/dist/plugins/icons.d.ts +1 -0
- package/dist/plugins/index.d.ts +5 -8
- package/dist/plugins/notifications.d.ts +2 -2
- package/dist/plugins/store-dialogs.d.ts +2 -1
- package/dist/plugins/store-notifications.d.ts +2 -1
- package/dist/plugins/store-vue-bus.d.ts +2 -1
- package/dist/plugins/vue-bus.d.ts +3 -3
- package/dist/style.css +1 -1
- package/dist/tools/sqlite-on-3nstorage/index.d.ts +3 -2
- package/dist/tools/ui.helpers.d.ts +1 -0
- package/dist/ui-3n-lib.js +6953 -6615
- package/package.json +57 -58
- package/src/components/index.ts +47 -41
- package/src/components/ui3n-badge-simple.vue +35 -38
- package/src/components/ui3n-badge.vue +25 -25
- package/src/components/ui3n-breadcrumb.vue +44 -44
- package/src/components/ui3n-breadcrumbs.vue +19 -19
- package/src/components/ui3n-button.vue +240 -150
- package/src/components/ui3n-checkbox.vue +199 -158
- package/src/components/ui3n-chip.vue +96 -98
- package/src/components/ui3n-dialog.vue +225 -235
- package/src/components/ui3n-drop-files.vue +146 -154
- package/src/components/ui3n-emoji.vue +62 -64
- package/src/components/ui3n-icon.vue +32 -13
- package/src/components/ui3n-input.vue +239 -221
- package/src/components/ui3n-list.vue +92 -111
- package/src/components/ui3n-menu.vue +101 -100
- package/src/components/ui3n-notification.vue +182 -113
- package/src/components/ui3n-switch.vue +146 -0
- package/src/components/ui3n-table-sort-icon.vue +1 -2
- package/src/components/ui3n-table.vue +229 -223
- package/src/components/ui3n-tabs.vue +141 -148
- package/src/components/ui3n-text.vue +235 -146
- package/src/components/ui3n-virtual-scroll.vue +68 -68
- package/dist/stories/Ui3nBadge.stories.d.ts +0 -124
- package/dist/stories/Ui3nBreadcrumbs.stories.d.ts +0 -252
- package/dist/stories/Ui3nButton.stories.d.ts +0 -152
- package/dist/stories/Ui3nCheckbox.stories.d.ts +0 -186
- package/dist/stories/Ui3nChip.stories.d.ts +0 -562
- package/dist/stories/Ui3nDialog.stories.d.ts +0 -41
- package/dist/stories/Ui3nDropFiles.stories.d.ts +0 -73
- package/dist/stories/Ui3nEmoji.stories.d.ts +0 -39
- package/dist/stories/Ui3nIcon.stories.d.ts +0 -80
- package/dist/stories/Ui3nInput.stories.d.ts +0 -456
- package/dist/stories/Ui3nList.stories.d.ts +0 -54
- package/dist/stories/Ui3nTabs.stories.d.ts +0 -177
- package/dist/stories/data/data-to-list.d.ts +0 -8
- package/dist/stories/data/icons.d.ts +0 -1
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.0
|
|
5
|
+
"version": "0.1.0",
|
|
6
6
|
"description": "Library for 3NWeb clients",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
@@ -29,68 +29,67 @@
|
|
|
29
29
|
"linter:fix": "eslint -c .eslintrc.cjs --fix --ext .js,.vue,.ts, src",
|
|
30
30
|
"lint": "yarn linter && yarn stylelint",
|
|
31
31
|
"lint:fix": "yarn linter:fix && yarn stylelint:fix",
|
|
32
|
-
"
|
|
33
|
-
"build
|
|
32
|
+
"docs:dev": "vitepress dev docs",
|
|
33
|
+
"docs:build": "vitepress build docs",
|
|
34
|
+
"docs:preview": "vitepress preview docs"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@iconify-icons/ic": "
|
|
37
|
-
"@iconify/vue": "
|
|
38
|
-
"dayjs": "
|
|
39
|
-
"lodash": "
|
|
40
|
-
"mitt": "
|
|
41
|
-
"sanitize-html": "
|
|
42
|
-
"tslib": "
|
|
37
|
+
"@iconify-icons/ic": "1.2.13",
|
|
38
|
+
"@iconify/vue": "4.1.2",
|
|
39
|
+
"dayjs": "1.11.11",
|
|
40
|
+
"lodash": "4.17.21",
|
|
41
|
+
"mitt": "3.0.1",
|
|
42
|
+
"sanitize-html": "2.13.0",
|
|
43
|
+
"tslib": "2.6.3"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"pinia": "
|
|
46
|
-
"vue": "
|
|
46
|
+
"pinia": "2.1.7",
|
|
47
|
+
"vue": "3.4.27"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"stylelint-config-recommended-vue": "^1.5.0",
|
|
85
|
-
"stylelint-config-standard": "^36.0.0",
|
|
86
|
-
"stylelint-rscss": "^0.4.0",
|
|
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"
|
|
50
|
+
"@types/lodash": "4.17.5",
|
|
51
|
+
"@types/node": "20.14.2",
|
|
52
|
+
"@types/sanitize-html": "2.11.0",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "7.13.0",
|
|
54
|
+
"@typescript-eslint/parser": "7.13.0",
|
|
55
|
+
"@vitejs/plugin-vue": "5.0.5",
|
|
56
|
+
"@vue/compiler-core": "3.4.27",
|
|
57
|
+
"@vue/eslint-config-typescript": "13.0.0",
|
|
58
|
+
"@vue/runtime-core": "3.4.27",
|
|
59
|
+
"@vuedx/typescript-plugin-vue": "0.7.6",
|
|
60
|
+
"eslint": "9.4.0",
|
|
61
|
+
"eslint-config-prettier": "^9.1.0",
|
|
62
|
+
"eslint-plugin-import": "2.29.1",
|
|
63
|
+
"eslint-plugin-node": "11.1.0",
|
|
64
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
65
|
+
"eslint-plugin-promise": "6.2.0",
|
|
66
|
+
"eslint-plugin-vue": "9.26.0",
|
|
67
|
+
"jackspeak": "3.4.0",
|
|
68
|
+
"path": "0.12.7",
|
|
69
|
+
"pinia": "2.1.7",
|
|
70
|
+
"postcss-html": "1.7.0",
|
|
71
|
+
"prettier": "^3.3.2",
|
|
72
|
+
"sass": "1.77.5",
|
|
73
|
+
"stylelint": "16.6.1",
|
|
74
|
+
"stylelint-config-recommended-scss": "14.0.0",
|
|
75
|
+
"stylelint-config-recommended-vue": "1.5.0",
|
|
76
|
+
"stylelint-config-standard": "36.0.0",
|
|
77
|
+
"stylelint-scss": "6.3.1",
|
|
78
|
+
"typescript": "5.4.5",
|
|
79
|
+
"vite": "5.2.13",
|
|
80
|
+
"vite-plugin-css-injected-by-js": "3.5.1",
|
|
81
|
+
"vite-plugin-dts": "3.9.1",
|
|
82
|
+
"vitepress": "1.2.3",
|
|
83
|
+
"vue": "3.4.27",
|
|
84
|
+
"vue-tsc": "2.0.21"
|
|
94
85
|
},
|
|
95
|
-
"packageManager": "
|
|
86
|
+
"packageManager": "pnpm@9.3.0",
|
|
87
|
+
"pnpm": {
|
|
88
|
+
"peerDependencyRules": {
|
|
89
|
+
"ignoreMissing": [
|
|
90
|
+
"@algolia/client-search",
|
|
91
|
+
"search-insights"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
96
95
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import Ui3nIcon from './ui3n-icon.vue'
|
|
2
|
-
import type { Ui3nIconProps, Ui3nIconEmits } from './ui3n-icon.vue'
|
|
3
|
-
import Ui3nButton from './ui3n-button.vue'
|
|
4
|
-
import type { Ui3nButtonProps, Ui3nButtonEmits } from './ui3n-button.vue'
|
|
5
|
-
import Ui3nChip from './ui3n-chip.vue'
|
|
6
|
-
import type { Ui3nChipProps, Ui3nChipEmits, Ui3nChipSlots } from './ui3n-chip.vue'
|
|
7
|
-
import Ui3nDropFiles from './ui3n-drop-files.vue'
|
|
8
|
-
import type { Ui3nDropFilesProps, Ui3nDropFilesEmits } from './ui3n-drop-files.vue'
|
|
9
|
-
import Ui3nEmoji from './ui3n-emoji.vue'
|
|
10
|
-
import type { Ui3nEmojiProps, Ui3nEmojiEmits } from './ui3n-emoji.vue'
|
|
11
|
-
import Ui3nInput from './ui3n-input.vue'
|
|
12
|
-
import type { Ui3nInputProps, Ui3nInputEmits } from './ui3n-input.vue'
|
|
13
|
-
import Ui3nText from './ui3n-text.vue'
|
|
14
|
-
import type { Ui3nTextProps, Ui3nTextEmits } from './ui3n-text.vue'
|
|
15
|
-
import Ui3nCheckbox from './ui3n-checkbox.vue'
|
|
16
|
-
import type { Ui3nCheckboxProps, Ui3nCheckboxEmits, Ui3nCheckboxSlots } from './ui3n-checkbox.vue'
|
|
17
|
-
import Ui3nNotification from './ui3n-notification.vue'
|
|
18
|
-
import Ui3nTableSortIcon from './ui3n-table-sort-icon.vue'
|
|
19
|
-
import type { Ui3nTableSortIconProps } from './ui3n-table-sort-icon.vue'
|
|
20
|
-
import Ui3nTable from './ui3n-table.vue'
|
|
21
|
-
import type { Ui3nTableProps, Ui3nTableEmits } from './ui3n-table.vue'
|
|
22
|
-
import Ui3nDialog from './ui3n-dialog.vue'
|
|
23
|
-
import type { Ui3nDialogComponentProps, Ui3nDialogComponentEmits, Ui3nDialogProps, Ui3nDialogEvent } from './ui3n-dialog.vue'
|
|
24
|
-
import Ui3nMenu from './ui3n-menu.vue'
|
|
25
|
-
import type { Ui3nMenuProps, Ui3nMenuEmits, Ui3nMenuSlots } from './ui3n-menu.vue'
|
|
26
|
-
import Ui3nList from './ui3n-list.vue'
|
|
27
|
-
import type { Ui3nListProps, Ui3nListEmits, Ui3nListSlots } from './ui3n-list.vue'
|
|
28
|
-
import Ui3nVirtualScroll from './ui3n-virtual-scroll.vue'
|
|
29
|
-
import type { Ui3nVirtualScrollProps, Ui3nVirtualScrollSlots } from './ui3n-virtual-scroll.vue'
|
|
30
|
-
import Ui3nTabs from './ui3n-tabs.vue'
|
|
31
|
-
import type { Ui3nTabsProps, Ui3nTabsEmits, Ui3nTabsSlots } from './ui3n-tabs.vue'
|
|
32
|
-
import Ui3nBadge from './ui3n-badge.vue'
|
|
33
|
-
import type { Ui3nBadgeProps } from './ui3n-badge.vue'
|
|
34
|
-
import Ui3nBreadcrumb from './ui3n-breadcrumb.vue'
|
|
35
|
-
import type {
|
|
36
|
-
import Ui3nBreadcrumbs from './ui3n-breadcrumbs.vue'
|
|
37
|
-
import type {
|
|
1
|
+
import Ui3nIcon from './ui3n-icon.vue';
|
|
2
|
+
import type { Ui3nIconProps, Ui3nIconEmits } from './ui3n-icon.vue';
|
|
3
|
+
import Ui3nButton from './ui3n-button.vue';
|
|
4
|
+
import type { Ui3nButtonProps, Ui3nButtonEmits } from './ui3n-button.vue';
|
|
5
|
+
import Ui3nChip from './ui3n-chip.vue';
|
|
6
|
+
import type { Ui3nChipProps, Ui3nChipEmits, Ui3nChipSlots } from './ui3n-chip.vue';
|
|
7
|
+
import Ui3nDropFiles from './ui3n-drop-files.vue';
|
|
8
|
+
import type { Ui3nDropFilesProps, Ui3nDropFilesEmits } from './ui3n-drop-files.vue';
|
|
9
|
+
import Ui3nEmoji from './ui3n-emoji.vue';
|
|
10
|
+
import type { Ui3nEmojiProps, Ui3nEmojiEmits } from './ui3n-emoji.vue';
|
|
11
|
+
import Ui3nInput from './ui3n-input.vue';
|
|
12
|
+
import type { Ui3nInputProps, Ui3nInputEmits } from './ui3n-input.vue';
|
|
13
|
+
import Ui3nText from './ui3n-text.vue';
|
|
14
|
+
import type { Ui3nTextProps, Ui3nTextEmits } from './ui3n-text.vue';
|
|
15
|
+
import Ui3nCheckbox from './ui3n-checkbox.vue';
|
|
16
|
+
import type { Ui3nCheckboxProps, Ui3nCheckboxEmits, Ui3nCheckboxSlots } from './ui3n-checkbox.vue';
|
|
17
|
+
import Ui3nNotification from './ui3n-notification.vue';
|
|
18
|
+
import Ui3nTableSortIcon from './ui3n-table-sort-icon.vue';
|
|
19
|
+
import type { Ui3nTableSortIconProps } from './ui3n-table-sort-icon.vue';
|
|
20
|
+
import Ui3nTable from './ui3n-table.vue';
|
|
21
|
+
import type { Ui3nTableProps, Ui3nTableEmits } from './ui3n-table.vue';
|
|
22
|
+
import Ui3nDialog from './ui3n-dialog.vue';
|
|
23
|
+
import type { Ui3nDialogComponentProps, Ui3nDialogComponentEmits, Ui3nDialogProps, Ui3nDialogEvent } from './ui3n-dialog.vue';
|
|
24
|
+
import Ui3nMenu from './ui3n-menu.vue';
|
|
25
|
+
import type { Ui3nMenuProps, Ui3nMenuEmits, Ui3nMenuSlots } from './ui3n-menu.vue';
|
|
26
|
+
import Ui3nList from './ui3n-list.vue';
|
|
27
|
+
import type { Ui3nListProps, Ui3nListEmits, Ui3nListSlots } from './ui3n-list.vue';
|
|
28
|
+
import Ui3nVirtualScroll from './ui3n-virtual-scroll.vue';
|
|
29
|
+
import type { Ui3nVirtualScrollProps, Ui3nVirtualScrollSlots } from './ui3n-virtual-scroll.vue';
|
|
30
|
+
import Ui3nTabs from './ui3n-tabs.vue';
|
|
31
|
+
import type { Ui3nTabsProps, Ui3nTabsEmits, Ui3nTabsSlots } from './ui3n-tabs.vue';
|
|
32
|
+
import Ui3nBadge from './ui3n-badge.vue';
|
|
33
|
+
import type { Ui3nBadgeProps } from './ui3n-badge.vue';
|
|
34
|
+
import Ui3nBreadcrumb from './ui3n-breadcrumb.vue';
|
|
35
|
+
import type { Ui3nBreadcrumbProps, Ui3nBreadcrumbEmits, Ui3nBreadcrumbSlots } from './ui3n-breadcrumb.vue';
|
|
36
|
+
import Ui3nBreadcrumbs from './ui3n-breadcrumbs.vue';
|
|
37
|
+
import type { Ui3nBreadcrumbsProps } from './ui3n-breadcrumbs.vue';
|
|
38
|
+
import Ui3nSwitch from './ui3n-switch.vue';
|
|
39
|
+
import type { Ui3nSwitchProps, Ui3nSwitchEmits, Ui3nSwitchSlots } from './ui3n-switch.vue';
|
|
38
40
|
|
|
39
41
|
export {
|
|
40
42
|
Ui3nIcon,
|
|
@@ -92,9 +94,13 @@ export {
|
|
|
92
94
|
Ui3nBadge,
|
|
93
95
|
Ui3nBadgeProps,
|
|
94
96
|
Ui3nBreadcrumb,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
Ui3nBreadcrumbProps,
|
|
98
|
+
Ui3nBreadcrumbEmits,
|
|
99
|
+
Ui3nBreadcrumbSlots,
|
|
98
100
|
Ui3nBreadcrumbs,
|
|
99
|
-
|
|
101
|
+
Ui3nBreadcrumbsProps,
|
|
102
|
+
Ui3nSwitch,
|
|
103
|
+
Ui3nSwitchProps,
|
|
104
|
+
Ui3nSwitchEmits,
|
|
105
|
+
Ui3nSwitchSlots,
|
|
100
106
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
{
|
|
14
14
|
dot: false,
|
|
15
15
|
value: '',
|
|
16
|
-
color: '
|
|
17
|
-
textColor: '
|
|
16
|
+
color: 'var(--color-bg-button-primary-default)',
|
|
17
|
+
textColor: 'var(--color-text-button-primary-default)',
|
|
18
18
|
},
|
|
19
19
|
)
|
|
20
20
|
|
|
@@ -45,53 +45,50 @@
|
|
|
45
45
|
<template>
|
|
46
46
|
<div
|
|
47
47
|
ref="element"
|
|
48
|
-
:class="[
|
|
49
|
-
'ui3n-badge-simple',
|
|
50
|
-
{ 'ui3n-badge-simple__dot': dot },
|
|
51
|
-
]"
|
|
48
|
+
:class="[$style.badgeSimple, dot && $style.dot]"
|
|
52
49
|
>
|
|
53
50
|
<span
|
|
54
51
|
v-if="!dot"
|
|
55
|
-
class="
|
|
52
|
+
:class="$style.text"
|
|
56
53
|
>
|
|
57
54
|
{{ value }}
|
|
58
55
|
</span>
|
|
59
56
|
</div>
|
|
60
57
|
</template>
|
|
61
58
|
|
|
62
|
-
<style lang="scss"
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
<style lang="scss" module>
|
|
60
|
+
.badgeSimple {
|
|
61
|
+
--ui3n-badge-size: 20px;
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
position: relative;
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
background-color: v-bind(color);
|
|
66
|
+
outline: 1px var(--white-0) solid;
|
|
70
67
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
68
|
+
&:not(.dot) {
|
|
69
|
+
min-height: var(--ui3n-badge-size);
|
|
70
|
+
height: var(--ui3n-badge-size);
|
|
71
|
+
width: max-content;
|
|
72
|
+
padding: 0 6px;
|
|
73
|
+
border-radius: 10px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
80
76
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
.dot {
|
|
78
|
+
min-width: var(--spacing-s);
|
|
79
|
+
width: var(--spacing-s);
|
|
80
|
+
max-width: var(--spacing-s);
|
|
81
|
+
min-height: var(--spacing-s);
|
|
82
|
+
height: var(--spacing-s);
|
|
83
|
+
max-height: var(--spacing-s);
|
|
84
|
+
border-radius: 50%;
|
|
85
|
+
}
|
|
88
86
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
87
|
+
.text {
|
|
88
|
+
display: block;
|
|
89
|
+
color: v-bind(textColor);
|
|
90
|
+
font-size: var(--font-12);
|
|
91
|
+
line-height: var(--ui3n-badge-size);
|
|
92
|
+
text-align: center;
|
|
93
|
+
}
|
|
97
94
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, ref, useSlots } from 'vue'
|
|
3
|
-
import get from 'lodash/get'
|
|
4
|
-
import Ui3nBadgeSimple from './ui3n-badge-simple.vue'
|
|
2
|
+
import { computed, ref, useSlots } from 'vue';
|
|
3
|
+
import get from 'lodash/get';
|
|
4
|
+
import Ui3nBadgeSimple from './ui3n-badge-simple.vue';
|
|
5
5
|
|
|
6
6
|
export interface Ui3nBadgeProps {
|
|
7
7
|
dot?: boolean;
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
{
|
|
17
17
|
dot: false,
|
|
18
18
|
value: '',
|
|
19
|
-
color: '
|
|
20
|
-
textColor: '
|
|
19
|
+
color: 'var(--color-bg-button-primary-default)',
|
|
20
|
+
textColor: 'var(--color-text-button-primary-default)',
|
|
21
21
|
position: 'right-top',
|
|
22
22
|
},
|
|
23
|
-
)
|
|
23
|
+
);
|
|
24
24
|
|
|
25
25
|
const slots = useSlots()
|
|
26
26
|
const badgeElementSize = ref<{
|
|
27
27
|
width: number;
|
|
28
28
|
height: number;
|
|
29
|
-
} | never>()
|
|
29
|
+
} | never>();
|
|
30
30
|
|
|
31
|
-
const hasDefaultSlot = computed(() => !!slots.default)
|
|
31
|
+
const hasDefaultSlot = computed(() => !!slots.default);
|
|
32
32
|
const style = computed(() => {
|
|
33
33
|
const [xPosition, yPosition] = props.position.split('-')
|
|
34
34
|
return {
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
...(yPosition === 'top' && { top: `-${get(badgeElementSize.value, 'height', 0) / 2}px` }),
|
|
38
38
|
...(yPosition === 'bottom' && { bottom: `-${get(badgeElementSize.value, 'height', 0) / 2}px` }),
|
|
39
39
|
}
|
|
40
|
-
})
|
|
40
|
+
});
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
44
|
<!-- eslint-disable vue/no-multiple-template-root -->
|
|
45
45
|
<div
|
|
46
46
|
v-if="hasDefaultSlot"
|
|
47
|
-
class="
|
|
47
|
+
:class="$style.badge"
|
|
48
48
|
>
|
|
49
|
-
<div class="
|
|
49
|
+
<div :class="$style.wrapper">
|
|
50
50
|
<slot />
|
|
51
51
|
|
|
52
52
|
<ui3n-badge-simple
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
:color="color"
|
|
56
56
|
:text-color="textColor"
|
|
57
57
|
:style="style"
|
|
58
|
-
class="
|
|
58
|
+
:class="$style.content"
|
|
59
59
|
@change:size="badgeElementSize = $event"
|
|
60
60
|
/>
|
|
61
61
|
</div>
|
|
@@ -70,20 +70,20 @@
|
|
|
70
70
|
/>
|
|
71
71
|
</template>
|
|
72
72
|
|
|
73
|
-
<style lang="scss"
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
<style lang="scss" module>
|
|
74
|
+
.badge {
|
|
75
|
+
--ui3n-badge-size: 20px;
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
position: relative;
|
|
78
|
+
}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
.wrapper {
|
|
81
|
+
position: relative;
|
|
82
|
+
width: max-content;
|
|
83
|
+
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
85
|
+
.content {
|
|
86
|
+
position: absolute;
|
|
87
|
+
z-index: 5;
|
|
88
|
+
}
|
|
89
89
|
</style>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, getCurrentInstance } from 'vue';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface Ui3nBreadcrumbProps {
|
|
5
5
|
separator?: string | undefined;
|
|
6
6
|
isActive?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface Ui3nBreadcrumbEmits {
|
|
10
10
|
(ev: 'click', value: Event): void;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface Ui3nBreadcrumbSlots {
|
|
13
13
|
separator: () => unknown;
|
|
14
14
|
default: () => unknown;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const props = withDefaults(
|
|
18
|
-
defineProps<
|
|
18
|
+
defineProps<Ui3nBreadcrumbProps>(),
|
|
19
19
|
{
|
|
20
20
|
separator: undefined,
|
|
21
21
|
isActive: false,
|
|
22
22
|
disabled: false,
|
|
23
23
|
},
|
|
24
|
-
)
|
|
24
|
+
);
|
|
25
25
|
|
|
26
|
-
const emits = defineEmits<
|
|
27
|
-
defineSlots<
|
|
26
|
+
const emits = defineEmits<Ui3nBreadcrumbEmits>();
|
|
27
|
+
defineSlots<Ui3nBreadcrumbSlots>();
|
|
28
28
|
|
|
29
29
|
const separatorValue = computed(() => {
|
|
30
30
|
if (props.separator) {
|
|
@@ -33,33 +33,29 @@
|
|
|
33
33
|
|
|
34
34
|
const instance = getCurrentInstance()
|
|
35
35
|
return instance?.parent?.props.separator || '/'
|
|
36
|
-
})
|
|
36
|
+
});
|
|
37
37
|
|
|
38
38
|
const parentDisabled = computed(() => {
|
|
39
39
|
const instance = getCurrentInstance()
|
|
40
|
-
return instance?.parent?.props.disabled || false
|
|
41
|
-
})
|
|
40
|
+
return instance?.parent?.props.disabled || false
|
|
41
|
+
});
|
|
42
42
|
|
|
43
43
|
const onClick = (ev: Event) => {
|
|
44
|
-
emits('click', ev)
|
|
44
|
+
emits('click', ev)
|
|
45
45
|
}
|
|
46
46
|
</script>
|
|
47
47
|
|
|
48
48
|
<template>
|
|
49
49
|
<div
|
|
50
50
|
:class="[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'ui3n-breadcrumb--disabled': disabled || parentDisabled,
|
|
55
|
-
},
|
|
51
|
+
$style.breadcrumb,
|
|
52
|
+
isActive && $style.active,
|
|
53
|
+
(disabled || parentDisabled) && $style.disabled,
|
|
56
54
|
]"
|
|
57
55
|
v-on="isActive && !(disabled || parentDisabled) ? { click: onClick } : {}"
|
|
58
56
|
>
|
|
59
57
|
<slot />
|
|
60
|
-
<div
|
|
61
|
-
v-if="isActive"
|
|
62
|
-
class="ui3n-breadcrumb__separator"
|
|
58
|
+
<div v-if="isActive" :class="$style.separator"
|
|
63
59
|
>
|
|
64
60
|
<slot name="separator">
|
|
65
61
|
<span>{{ separatorValue }}</span>
|
|
@@ -68,36 +64,40 @@
|
|
|
68
64
|
</div>
|
|
69
65
|
</template>
|
|
70
66
|
|
|
71
|
-
<style lang="scss"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
<style lang="scss" module>
|
|
68
|
+
.breadcrumb {
|
|
69
|
+
--ui3n-breadcrumb-font-size: var(--spacing-m);
|
|
70
|
+
--ui3n-breadcrumb-color-default: var(--color-text-block-primary-default);
|
|
71
|
+
--ui3n-breadcrumb-color-selected: var(--color-text-block-accent-default);
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
position: relative;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
}
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
.separator {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
margin: 0 var(--spacing-s);
|
|
82
|
+
}
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
.active {
|
|
85
|
+
font-size: var(--ui3n-breadcrumb-font-size);
|
|
86
|
+
line-height: 1.25;
|
|
87
|
+
color: var(--ui3n-breadcrumb-color-default);
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
}
|
|
89
|
+
&:hover {
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
color: var(--ui3n-breadcrumb-color-selected);
|
|
97
92
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
pointer-events: none;
|
|
93
|
+
.separator {
|
|
94
|
+
color: var(--ui3n-breadcrumb-color-default);
|
|
101
95
|
}
|
|
102
96
|
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.disabled {
|
|
100
|
+
cursor: default;
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
}
|
|
103
103
|
</style>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export interface Ui3nBreadcrumbsProps {
|
|
3
|
+
separator?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
withDefaults(
|
|
8
|
+
defineProps<Ui3nBreadcrumbsProps>(),
|
|
9
|
+
{
|
|
10
|
+
separator: '/',
|
|
11
|
+
disabled: false,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
|
-
<div :class="
|
|
18
|
-
<slot
|
|
17
|
+
<div :class="$style.breadcrumbs">
|
|
18
|
+
<slot/>
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
|
-
<style lang="scss"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
<style lang="scss" module>
|
|
23
|
+
.breadcrumbs {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
}
|
|
28
28
|
</style>
|