@avakhula/ui 0.0.207 → 0.0.208
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/.eslintrc.cjs +13 -14
- package/dist/index.js +4605 -4639
- package/dist/index.umd.cjs +66 -76
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/src/App.vue +122 -21
- package/src/components/Accordion/Accordion.scss +1 -4
- package/src/components/Accordion/Accordion.vue +17 -5
- package/src/components/Alert/alert.scss +0 -1
- package/src/components/Alert/constants.js +0 -1
- package/src/components/Avatar/Avatar.vue +9 -17
- package/src/components/Dropdown/Dropdown.vue +5 -2
- package/src/components/Form/Checkbox/Checkbox.vue +49 -43
- package/src/components/Form/Input/Input.vue +1 -1
- package/src/components/Form/Radio/Radio.vue +7 -1
- package/src/components/Form/Toggle/Toggle.vue +4 -1
- package/src/components/Modal/Modal.vue +8 -5
- package/src/components/ProgressBar/ProgressBar.vue +8 -1
- package/src/components/Sorting/Sorting.stories.js +1 -1
- package/src/components/Sorting/Sorting.vue +25 -55
- package/src/components/Sorting/sorting.scss +1 -1
- package/src/components/Tooltip/Tooltip.vue +11 -95
- package/src/components/TreeSelect/Option.vue +12 -4
- package/src/components/TreeSelect/Select.vue +41 -37
- package/src/components/TreeSelect/scss/option.scss +0 -4
- package/src/directives/tooltip/TooltipController.js +16 -115
- package/src/directives/tooltip/tooltip.js +9 -24
- package/src/directives/tooltip/tooltip.stories.js +3 -76
- package/src/helpers/removeEvents.js +2 -2
- package/TODO +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avakhula/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.208",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.umd.cjs",
|
|
6
6
|
"source": "src/index.js",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@babel/core": "^7.20.7",
|
|
30
30
|
"@babel/preset-env": "^7.21.4",
|
|
31
31
|
"@rushstack/eslint-patch": "^1.1.4",
|
|
32
|
-
"@storybook/addon-a11y": "^7.
|
|
33
|
-
"@storybook/addon-actions": "^7.
|
|
34
|
-
"@storybook/addon-docs": "^7.
|
|
35
|
-
"@storybook/addon-essentials": "^7.
|
|
36
|
-
"@storybook/addon-interactions": "^7.
|
|
37
|
-
"@storybook/addon-links": "^7.
|
|
38
|
-
"@storybook/addon-mdx-gfm": "^7.
|
|
32
|
+
"@storybook/addon-a11y": "^7.3.2",
|
|
33
|
+
"@storybook/addon-actions": "^7.3.2",
|
|
34
|
+
"@storybook/addon-docs": "^7.3.2",
|
|
35
|
+
"@storybook/addon-essentials": "^7.3.2",
|
|
36
|
+
"@storybook/addon-interactions": "^7.3.2",
|
|
37
|
+
"@storybook/addon-links": "^7.3.2",
|
|
38
|
+
"@storybook/addon-mdx-gfm": "^7.3.2",
|
|
39
39
|
"@storybook/testing-library": "^0.2.0",
|
|
40
|
-
"@storybook/vue3": "^7.
|
|
41
|
-
"@storybook/vue3-vite": "^7.
|
|
40
|
+
"@storybook/vue3": "^7.3.2",
|
|
41
|
+
"@storybook/vue3-vite": "^7.3.2",
|
|
42
42
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
43
43
|
"@vitest/coverage-c8": "^0.28.4",
|
|
44
44
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-dom": "^18.2.0",
|
|
57
57
|
"sass": "^1.57.1",
|
|
58
58
|
"sass-loader": "^13.2.0",
|
|
59
|
-
"storybook": "^7.
|
|
59
|
+
"storybook": "^7.3.2",
|
|
60
60
|
"vite": "^4.0.0",
|
|
61
61
|
"vitest": "^0.28.4",
|
|
62
62
|
"vue-loader": "^16.8.3",
|
package/src/App.vue
CHANGED
|
@@ -1,30 +1,131 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<ib-select :options="opt"/>
|
|
3
3
|
|
|
4
|
-
<ib-sorting
|
|
5
|
-
title="'test'"
|
|
6
|
-
class="table-sorting"
|
|
7
|
-
view="table-sorting"
|
|
8
|
-
table-name="user-list-table"
|
|
9
|
-
toggle-tip-title="some title"
|
|
10
|
-
>
|
|
11
|
-
<template #toggleTipBody>
|
|
12
|
-
hello
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<template #toggleTipButtons>
|
|
16
|
-
some buttons
|
|
17
|
-
</template>
|
|
18
|
-
</ib-sorting>
|
|
19
|
-
</div>
|
|
20
4
|
</template>
|
|
21
5
|
|
|
22
6
|
<script>
|
|
23
|
-
import
|
|
7
|
+
import IbSelect from "./components/TreeSelect/Select.vue";
|
|
8
|
+
const testData1 = [
|
|
9
|
+
{
|
|
10
|
+
id: "1",
|
|
11
|
+
title: "A Education",
|
|
12
|
+
is_category: true,
|
|
13
|
+
initiallyVisible: true,
|
|
14
|
+
visible: true,
|
|
15
|
+
isDisabled: false,
|
|
16
|
+
checked: true,
|
|
17
|
+
isChildrenVisible: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "2",
|
|
21
|
+
title: "Education 2",
|
|
22
|
+
is_category: true,
|
|
23
|
+
initiallyVisible: true,
|
|
24
|
+
visible: true,
|
|
25
|
+
isDisabled: false,
|
|
26
|
+
checked: false,
|
|
27
|
+
isChildrenVisible: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "3",
|
|
31
|
+
title: "Education 3",
|
|
32
|
+
is_category: true,
|
|
33
|
+
initiallyVisible: true,
|
|
34
|
+
visible: true,
|
|
35
|
+
isDisabled: false,
|
|
36
|
+
checked: false,
|
|
37
|
+
isChildrenVisible: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "4",
|
|
41
|
+
title: "Education 4",
|
|
42
|
+
is_category: true,
|
|
43
|
+
initiallyVisible: true,
|
|
44
|
+
visible: true,
|
|
45
|
+
isDisabled: false,
|
|
46
|
+
checked: false,
|
|
47
|
+
isChildrenVisible: true,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "5",
|
|
51
|
+
title: "Education 5",
|
|
52
|
+
is_category: true,
|
|
53
|
+
initiallyVisible: true,
|
|
54
|
+
visible: true,
|
|
55
|
+
isDisabled: false,
|
|
56
|
+
checked: false,
|
|
57
|
+
isChildrenVisible: true,
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
id: "6",
|
|
62
|
+
title: "Education 6",
|
|
63
|
+
is_category: true,
|
|
64
|
+
initiallyVisible: true,
|
|
65
|
+
visible: true,
|
|
66
|
+
isDisabled: false,
|
|
67
|
+
checked: false,
|
|
68
|
+
isChildrenVisible: true,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
{
|
|
72
|
+
id: "7",
|
|
73
|
+
title: "Education 7",
|
|
74
|
+
is_category: true,
|
|
75
|
+
initiallyVisible: true,
|
|
76
|
+
visible: true,
|
|
77
|
+
isDisabled: false,
|
|
78
|
+
checked: false,
|
|
79
|
+
isChildrenVisible: true,
|
|
80
|
+
},
|
|
24
81
|
|
|
82
|
+
{
|
|
83
|
+
id: "8",
|
|
84
|
+
title: "Education 8",
|
|
85
|
+
is_category: true,
|
|
86
|
+
initiallyVisible: true,
|
|
87
|
+
visible: true,
|
|
88
|
+
isDisabled: false,
|
|
89
|
+
checked: false,
|
|
90
|
+
isChildrenVisible: true,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "9",
|
|
94
|
+
title: "Education 9",
|
|
95
|
+
is_category: true,
|
|
96
|
+
initiallyVisible: true,
|
|
97
|
+
visible: true,
|
|
98
|
+
isDisabled: false,
|
|
99
|
+
checked: false,
|
|
100
|
+
isChildrenVisible: true,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "10",
|
|
104
|
+
title: "Education 10",
|
|
105
|
+
is_category: true,
|
|
106
|
+
initiallyVisible: true,
|
|
107
|
+
visible: true,
|
|
108
|
+
isDisabled: false,
|
|
109
|
+
checked: false,
|
|
110
|
+
isChildrenVisible: true,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "11",
|
|
114
|
+
title: "Education 11",
|
|
115
|
+
is_category: true,
|
|
116
|
+
initiallyVisible: true,
|
|
117
|
+
visible: true,
|
|
118
|
+
isDisabled: false,
|
|
119
|
+
checked: false,
|
|
120
|
+
isChildrenVisible: true,
|
|
121
|
+
},
|
|
122
|
+
];
|
|
25
123
|
export default {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
124
|
+
data() {
|
|
125
|
+
return {
|
|
126
|
+
opt: testData1,
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
components: {IbSelect}
|
|
29
130
|
}
|
|
30
131
|
</script>
|
|
@@ -76,13 +76,10 @@ $content-bg: $gray-50;
|
|
|
76
76
|
.accordion-content {
|
|
77
77
|
border-radius: 0 0 4px 4px;
|
|
78
78
|
border: 1px solid $content-border-color;
|
|
79
|
+
padding:10px 15px 15px;
|
|
79
80
|
overflow: hidden;
|
|
80
81
|
transition: height 0.3s, padding-top 0.3s, padding-bottom 0.3s;
|
|
81
82
|
background-color: $content-bg;
|
|
82
|
-
|
|
83
|
-
.accordion-content-wrapper {
|
|
84
|
-
padding: 10px 15px 15px;
|
|
85
|
-
}
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
&.active {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ib-accordion" :class="{ active: isActive }">
|
|
3
|
-
<button
|
|
3
|
+
<button
|
|
4
|
+
class="accordion-title"
|
|
5
|
+
:id="'accordion' + uuid"
|
|
6
|
+
:aria-controls="'accordion-section-' + uuid"
|
|
7
|
+
:aria-expanded="isActive"
|
|
8
|
+
@click="onClick"
|
|
9
|
+
>
|
|
4
10
|
<slot name="title"></slot>
|
|
5
11
|
|
|
6
12
|
<ib-icon class="chevron-icon" name="chevron-down-outline" />
|
|
@@ -12,16 +18,21 @@
|
|
|
12
18
|
@after-enter="afterEnter"
|
|
13
19
|
@leave="leave"
|
|
14
20
|
>
|
|
15
|
-
<div
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
<div
|
|
22
|
+
v-show="isActive"
|
|
23
|
+
role="region"
|
|
24
|
+
class="accordion-content"
|
|
25
|
+
:id="'accordion-section-' + uuid"
|
|
26
|
+
:aria-labelledby="'accordion' + uuid"
|
|
27
|
+
>
|
|
28
|
+
<slot name="content"></slot>
|
|
19
29
|
</div>
|
|
20
30
|
</Transition>
|
|
21
31
|
</div>
|
|
22
32
|
</template>
|
|
23
33
|
|
|
24
34
|
<script>
|
|
35
|
+
import generateUID from "../../helpers/generateUID";
|
|
25
36
|
import expandAnimation from "../../mixins/expandAnimation";
|
|
26
37
|
import IbIcon from "../Icon.vue";
|
|
27
38
|
|
|
@@ -42,6 +53,7 @@ export default {
|
|
|
42
53
|
data() {
|
|
43
54
|
return {
|
|
44
55
|
isActive: this.isOpen,
|
|
56
|
+
uuid: generateUID(),
|
|
45
57
|
};
|
|
46
58
|
},
|
|
47
59
|
methods: {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<img
|
|
3
|
-
v-if="src && !userAvatar"
|
|
4
|
-
:class="classList"
|
|
5
|
-
:src="src"
|
|
6
|
-
:alt="firstName + '' + lastName"
|
|
7
|
-
/>
|
|
2
|
+
<img v-if="src && !userAvatar" :class="classList" :src="src" :alt="name" />
|
|
8
3
|
|
|
9
4
|
<div
|
|
10
5
|
v-else-if="src && userAvatar"
|
|
@@ -15,7 +10,7 @@
|
|
|
15
10
|
}"
|
|
16
11
|
></div>
|
|
17
12
|
|
|
18
|
-
<div v-else-if="
|
|
13
|
+
<div v-else-if="validateName" class="empty-avatar" :class="classList">
|
|
19
14
|
<ib-icon name="camera-outline" />
|
|
20
15
|
</div>
|
|
21
16
|
|
|
@@ -31,11 +26,7 @@ import { avatarSizes } from "./constants";
|
|
|
31
26
|
export default {
|
|
32
27
|
name: "IbAvatar",
|
|
33
28
|
props: {
|
|
34
|
-
|
|
35
|
-
type: String,
|
|
36
|
-
default: "",
|
|
37
|
-
},
|
|
38
|
-
lastName: {
|
|
29
|
+
name: {
|
|
39
30
|
type: String,
|
|
40
31
|
default: "",
|
|
41
32
|
},
|
|
@@ -58,13 +49,14 @@ export default {
|
|
|
58
49
|
return classList;
|
|
59
50
|
},
|
|
60
51
|
validateName() {
|
|
61
|
-
return (
|
|
62
|
-
this.firstName?.trim().length !== 0 &&
|
|
63
|
-
this.lastName?.trim().length !== 0
|
|
64
|
-
);
|
|
52
|
+
return this.name?.trim().split(" ").length < 2;
|
|
65
53
|
},
|
|
66
54
|
initials() {
|
|
67
|
-
|
|
55
|
+
const words = this.name.split(" ");
|
|
56
|
+
|
|
57
|
+
return words.length === 1
|
|
58
|
+
? (words[0][0] + words[0][1]).toUpperCase()
|
|
59
|
+
: (words[0][0] + words[1][0]).toUpperCase();
|
|
68
60
|
},
|
|
69
61
|
},
|
|
70
62
|
components: {
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
<div class="ib-dropdown" v-outside="close">
|
|
3
3
|
<span
|
|
4
4
|
class="dropdown-trigger"
|
|
5
|
-
:class="triggerClasses"
|
|
6
5
|
ref="dropdown"
|
|
6
|
+
aria-haspopup="true"
|
|
7
|
+
:class="triggerClasses"
|
|
8
|
+
:aria-expanded="isOpenedState ? true : false"
|
|
7
9
|
@keydown="onKeydown"
|
|
8
10
|
@click.prevent.stop="toggle"
|
|
9
11
|
v-if="hasTrigger && triggerType === 'click'"
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
|
|
24
26
|
<div
|
|
25
27
|
ref="body"
|
|
28
|
+
role="menu"
|
|
26
29
|
:class="'ib-dropdown-menu ' + classes"
|
|
27
30
|
v-if="!destroyOnHide || isOpenedState"
|
|
28
31
|
v-show="isOpenedState"
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
</span>
|
|
36
39
|
</div>
|
|
37
40
|
<div class="footer-slot">
|
|
38
|
-
<slot name="
|
|
41
|
+
<slot name="footer"></slot>
|
|
39
42
|
</div>
|
|
40
43
|
</div>
|
|
41
44
|
|
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
<div role="checkbox" :aria-checked="checked ? true : false">
|
|
3
|
+
<label
|
|
4
|
+
v-bind="attrs"
|
|
5
|
+
:for="id"
|
|
6
|
+
:tabindex="disabled | disableFocus ? -1 : 0"
|
|
7
|
+
@keypress.prevent="onChange"
|
|
8
|
+
>
|
|
9
|
+
<input
|
|
10
|
+
tabindex="-1"
|
|
11
|
+
type="checkbox"
|
|
12
|
+
:name="name"
|
|
13
|
+
:id="id"
|
|
14
|
+
:value="value"
|
|
15
|
+
:checked="checked"
|
|
16
|
+
:disabled="disabled"
|
|
17
|
+
:required="required"
|
|
18
|
+
@click="onChange"
|
|
19
|
+
/>
|
|
20
|
+
<div class="ib-checkbox-body">
|
|
21
|
+
<span
|
|
22
|
+
v-if="labelPosition === 'left' && label.length"
|
|
23
|
+
class="ib-checkbox-label"
|
|
24
|
+
:class="{ 'ib-checkbox-label-left': labelPosition === 'left' }"
|
|
25
|
+
>
|
|
26
|
+
<span v-if="required" class="required">*</span>
|
|
27
|
+
{{ label }}
|
|
28
|
+
</span>
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
<span class="ib-checkbox-input">
|
|
31
|
+
<ib-icon name="checkmark-sharp" v-show="checked && !indeterminate" />
|
|
32
|
+
<ib-icon
|
|
33
|
+
:class="'checkbox-undeterminate-icon'"
|
|
34
|
+
name="remove-sharp"
|
|
35
|
+
v-show="indeterminate"
|
|
36
|
+
/>
|
|
37
|
+
</span>
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
<span
|
|
40
|
+
v-if="labelPosition === 'right' && label?.length"
|
|
41
|
+
class="ib-checkbox-label"
|
|
42
|
+
>
|
|
43
|
+
<span v-if="required" class="required">*</span>
|
|
44
|
+
{{ label }}
|
|
45
|
+
</span>
|
|
46
|
+
</div>
|
|
47
|
+
</label>
|
|
48
|
+
</div>
|
|
47
49
|
</template>
|
|
48
50
|
<script>
|
|
49
51
|
import generateUID from "../../../helpers/generateUID";
|
|
@@ -82,6 +84,10 @@ export default {
|
|
|
82
84
|
type: Boolean,
|
|
83
85
|
default: false,
|
|
84
86
|
},
|
|
87
|
+
disableFocus: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false,
|
|
90
|
+
},
|
|
85
91
|
required: {
|
|
86
92
|
type: Boolean,
|
|
87
93
|
default: false,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<label
|
|
3
|
+
role="switch"
|
|
4
|
+
:aria-checked="checked"
|
|
5
|
+
:tabindex="disabled ? -1 : 0"
|
|
3
6
|
:class="classes"
|
|
4
7
|
@keypress.space.prevent="onChange"
|
|
5
|
-
|
|
8
|
+
@keypress.enter.prevent="onChange"
|
|
6
9
|
>
|
|
7
10
|
<div class="toggle-wrapper" ref="wrapper">
|
|
8
11
|
<div class="toggle" ref="toggle">
|
|
@@ -100,11 +100,7 @@ export default {
|
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
|
|
103
|
-
document.addEventListener("keydown",
|
|
104
|
-
if (e.keyCode === ESC_KEY_CODE && !this.stopPropagation && this.active) {
|
|
105
|
-
this.close();
|
|
106
|
-
}
|
|
107
|
-
});
|
|
103
|
+
document.addEventListener("keydown", this.onKeydown);
|
|
108
104
|
},
|
|
109
105
|
data() {
|
|
110
106
|
return {
|
|
@@ -142,6 +138,11 @@ export default {
|
|
|
142
138
|
this.close();
|
|
143
139
|
}
|
|
144
140
|
},
|
|
141
|
+
onKeydown(e) {
|
|
142
|
+
if (e.keyCode === ESC_KEY_CODE && !this.stopPropagation && this.isActive) {
|
|
143
|
+
this.close();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
145
146
|
},
|
|
146
147
|
computed: {
|
|
147
148
|
bodyStyles() {
|
|
@@ -209,6 +210,8 @@ export default {
|
|
|
209
210
|
if (this.isActive) {
|
|
210
211
|
this.close();
|
|
211
212
|
}
|
|
213
|
+
|
|
214
|
+
document.removeEventListener("keydown", this.onKeydown);
|
|
212
215
|
},
|
|
213
216
|
};
|
|
214
217
|
</script>
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ib-progress-bar-wrapper">
|
|
3
3
|
<div :class="classes">
|
|
4
|
-
<div
|
|
4
|
+
<div
|
|
5
|
+
class="progress"
|
|
6
|
+
role="meter"
|
|
7
|
+
aria-valuemin="0"
|
|
8
|
+
aria-valuemax="100"
|
|
9
|
+
:aria-valuenow="progress"
|
|
10
|
+
:style="{ width: progress + '%' }"
|
|
11
|
+
>
|
|
5
12
|
<div class="gradient"></div>
|
|
6
13
|
</div>
|
|
7
14
|
<div></div>
|