@avakhula/ui 0.0.505 → 0.0.506-alpha-spa.1
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/.babelrc.json +0 -0
- package/.eslintrc.cjs +0 -0
- package/.nvmrc +0 -0
- package/.storybook/main.js +0 -0
- package/.storybook/preview-head.html +0 -0
- package/.storybook/preview.js +0 -0
- package/dist/index.css +1 -0
- package/dist/index.js +14352 -12501
- package/dist/index.umd.cjs +93 -82
- package/package.json +8 -7
- package/src/App.vue +7 -126
- package/src/assets/scss/mixins/dropdown-list-item.scss +6 -1
- package/src/assets/scss/mixins/tooltip-position.scss +0 -0
- package/src/assets/scss/mixins.scss +0 -0
- package/src/assets/scss/style.scss +0 -0
- package/src/assets/scss/typography.scss +3 -3
- package/src/assets/scss/variables/colors.json +0 -0
- package/src/assets/scss/variables/colors.scss +0 -0
- package/src/assets/scss/variables/shadows.json +0 -0
- package/src/assets/scss/variables/shadows.scss +0 -0
- package/src/components/Accordion/Accordion.scss +0 -0
- package/src/components/Accordion/Accordion.stories.js +0 -0
- package/src/components/Accordion/Accordion.vue +0 -0
- package/src/components/Accordion/Acordion.spec.js +0 -0
- package/src/components/Accordion/readme.mdx +0 -0
- package/src/components/Alert/Alert.spec.js +0 -0
- package/src/components/Alert/Alert.stories.js +0 -0
- package/src/components/Alert/Alert.vue +5 -0
- package/src/components/Alert/alert.scss +6 -1
- package/src/components/Alert/constants.js +0 -0
- package/src/components/Alert/readme.mdx +0 -0
- package/src/components/Avatar/Avatar.stories.js +5 -1
- package/src/components/Avatar/Avatar.vue +25 -2
- package/src/components/Avatar/constants.js +6 -0
- package/src/components/Badge/Badge.spec.js +0 -0
- package/src/components/Badge/Badge.vue +0 -0
- package/src/components/Badge/readme.mdx +0 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +23 -8
- package/src/components/Breadcrumbs/breadcrumbs.scss +0 -0
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
- package/src/components/Button/Button.spec.js +0 -0
- package/src/components/Button/Button.vue +19 -3
- package/src/components/Button/button.scss +5 -0
- package/src/components/Button/readme.mdx +0 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.js +0 -0
- package/src/components/ButtonGroup/readme.mdx +0 -0
- package/src/components/Chips/Chips.stories.js +30 -0
- package/src/components/Chips/Chips.vue +125 -0
- package/src/components/Dropdown/Dropdown.spec.js +0 -0
- package/src/components/Dropdown/Dropdown.stories.js +0 -0
- package/src/components/Dropdown/Dropdown.vue +93 -23
- package/src/components/Dropdown/DropdownDivider.vue +0 -0
- package/src/components/Dropdown/DropdownItem.vue +26 -4
- package/src/components/Dropdown/DropdownList.stories.js +0 -0
- package/src/components/Dropdown/DropdownList.vue +15 -1
- package/src/components/Dropdown/readme.mdx +0 -0
- package/src/components/Form/CharactersCount.vue +10 -7
- package/src/components/Form/Checkbox/Checkbox.scss +0 -0
- package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
- package/src/components/Form/Checkbox/Checkbox.vue +24 -11
- package/src/components/Form/Checkbox/readme.mdx +0 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +0 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
- package/src/components/Form/DatePicker/DatePicker.scss +352 -261
- package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
- package/src/components/Form/DatePicker/DatePicker.vue +72 -17
- package/src/components/Form/DatePicker/readme.mdx +0 -0
- package/src/components/Form/FormGroup/FormGroup.vue +3 -3
- package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
- package/src/components/Form/Input/Input.stories.js +0 -0
- package/src/components/Form/Input/Input.vue +119 -13
- package/src/components/Form/Input/constants.js +0 -0
- package/src/components/Form/Input/input.scss +61 -2
- package/src/components/Form/Input/readme.mdx +0 -0
- package/src/components/Form/Label/Label.stories.js +0 -0
- package/src/components/Form/Label/Label.vue +22 -10
- package/src/components/Form/Label/readme.mdx +0 -0
- package/src/components/Form/PhoneInput/PhoneInput.stories.js +0 -0
- package/src/components/Form/PhoneInput/PhoneInput.vue +76 -27
- package/src/components/Form/PhoneInput/phoneInput.scss +38 -6
- package/src/components/Form/PhoneInput/readme.mdx +0 -0
- package/src/components/Form/Radio/Radio.stories.js +0 -0
- package/src/components/Form/Radio/Radio.vue +16 -44
- package/src/components/Form/Radio/radio.scss +5 -2
- package/src/components/Form/Radio/readme.mdx +0 -0
- package/src/components/Form/TextEditor/TextEditor.stories.js +0 -0
- package/src/components/Form/TextEditor/TextEditor.vue +91 -137
- package/src/components/Form/TextEditor/Toolbar.vue +723 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +8 -0
- package/src/components/Form/TextEditor/plugins/imageBlot.js +23 -0
- package/src/components/Form/TextEditor/readme.mdx +0 -0
- package/src/components/Form/TextEditor/setupTextEditor.js +71 -0
- package/src/components/Form/TextEditor/textEditor.scss +11 -335
- package/src/components/Form/Textarea/Textarea.spec.js +0 -0
- package/src/components/Form/Textarea/Textarea.stories.js +0 -0
- package/src/components/Form/Textarea/Textarea.vue +20 -6
- package/src/components/Form/Textarea/readme.mdx +0 -0
- package/src/components/Form/Textarea/textarea.scss +30 -2
- package/src/components/Form/Toggle/Toggle.stories.js +0 -0
- package/src/components/Form/Toggle/Toggle.vue +0 -0
- package/src/components/Form/Toggle/readme.mdx +0 -0
- package/src/components/Form/Toggle/toggle.scss +0 -0
- package/src/components/IconButton/IconButton.scss +11 -0
- package/src/components/IconButton/IconButton.vue +10 -3
- package/src/components/IconButton/readme.mdx +0 -0
- package/src/components/List.vue +0 -0
- package/src/components/Modal/Modal.stories.js +0 -0
- package/src/components/Modal/Modal.vue +42 -9
- package/src/components/Modal/constants.js +0 -0
- package/src/components/Modal/readme.mdx +0 -0
- package/src/components/Pagination/LimitSelector.vue +5 -0
- package/src/components/Pagination/Pagination.vue +36 -4
- package/src/components/Pagination/pagination.scss +17 -1
- package/src/components/Panel/Panel.stories.js +0 -0
- package/src/components/Panel/Panel.vue +68 -2
- package/src/components/Popover/Popover.vue +25 -9
- package/src/components/Popover/constants.js +0 -0
- package/src/components/Popover/popover.scss +1 -1
- package/src/components/Popover/readme.mdx +0 -0
- package/src/components/ProgressBar/ProgressBar.vue +0 -0
- package/src/components/ProgressBar/constants.js +0 -0
- package/src/components/ProgressBar/progressBar.scss +0 -0
- package/src/components/ProgressBar/readme.mdx +0 -0
- package/src/components/Sorting/Sorting.stories.js +0 -0
- package/src/components/Sorting/Sorting.vue +24 -26
- package/src/components/Sorting/sorting.scss +0 -0
- package/src/components/SplitButton/SplitButton.stories.js +0 -0
- package/src/components/SplitButton/SplitButton.vue +51 -8
- package/src/components/SplitButton/SplitButtonItem.vue +13 -1
- package/src/components/SplitButton/readme.mdx +0 -0
- package/src/components/SplitButton/splitButton.scss +0 -0
- package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +0 -0
- package/src/components/StatusIndicator/constants.js +0 -0
- package/src/components/StatusIndicator/icons.js +0 -0
- package/src/components/StatusIndicator/readme.mdx +0 -0
- package/src/components/Table/Cells/Cell.vue +0 -0
- package/src/components/Table/Cells/CheckboxCell.vue +0 -0
- package/src/components/Table/Row.vue +0 -0
- package/src/components/Table/Table.stories.js +0 -0
- package/src/components/Table/Table.vue +0 -0
- package/src/components/Tabs/Tab.vue +4 -0
- package/src/components/Tabs/TabDropdown.vue +0 -0
- package/src/components/Tabs/Tabs.stories.js +0 -0
- package/src/components/Tabs/Tabs.vue +20 -5
- package/src/components/Tabs/tabs.scss +8 -2
- package/src/components/TagPill/TagPill.stories.js +0 -0
- package/src/components/TagPill/TagPill.vue +6 -0
- package/src/components/TagPill/readme.mdx +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +0 -0
- package/src/components/ToggleTip/constants.js +0 -0
- package/src/components/ToggleTip/readme.mdx +0 -0
- package/src/components/ToggleTip/toggleTip.scss +0 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/Tooltip/readme.mdx +0 -0
- package/src/components/TreeSelect/Option.vue +58 -24
- package/src/components/TreeSelect/Select.stories.js +0 -0
- package/src/components/TreeSelect/Select.vue +281 -147
- package/src/components/TreeSelect/TreeSelect.stories.js +0 -0
- package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
- package/src/components/TreeSelect/scss/option.scss +31 -0
- package/src/components/TreeSelect/scss/select.scss +93 -2
- package/src/constants/keyCodes.js +1 -0
- package/src/directives/outside/outside.stories.js +0 -0
- package/src/directives/outside/readme.mdx +0 -0
- package/src/directives/tooltip/TooltipController.js +2 -0
- package/src/directives/tooltip/readme.mdx +0 -0
- package/src/directives/tooltip/textOverflowTooltip.js +3 -1
- package/src/directives/tooltip/tooltip.js +61 -0
- package/src/directives/tooltip/tooltip.stories.js +0 -0
- package/src/helpers/debounce.js +23 -0
- package/src/helpers/removeEvents.js +0 -0
- package/src/helpers/stripHtml.js +4 -0
- package/src/index.js +7 -0
- package/src/main.js +0 -0
- package/src/mixins/expandAnimation.js +0 -0
- package/src/scripts/parseScssVariables.js +0 -0
- package/src/stories/link.readme.mdx +0 -0
- package/src/stories/variables/colors.stories.js +0 -0
- package/src/stories/variables/shadows.stories.js +0 -0
- package/static/docks/button.pdf +0 -0
- package/static/favicon.ico +0 -0
- package/vite.config.js +0 -0
- package/dist/style.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component
|
|
3
|
-
:is="
|
|
3
|
+
:is="component"
|
|
4
4
|
v-bind="attrs"
|
|
5
5
|
class="ib-dropdown-item"
|
|
6
6
|
>
|
|
@@ -15,6 +15,9 @@ export default {
|
|
|
15
15
|
type: String,
|
|
16
16
|
default: "",
|
|
17
17
|
},
|
|
18
|
+
to: {
|
|
19
|
+
type: [String, Object],
|
|
20
|
+
}
|
|
18
21
|
},
|
|
19
22
|
computed: {
|
|
20
23
|
attrs() {
|
|
@@ -23,8 +26,17 @@ export default {
|
|
|
23
26
|
attrsList.href = this.href;
|
|
24
27
|
}
|
|
25
28
|
|
|
29
|
+
if (this.to) {
|
|
30
|
+
attrsList.to = this.to;
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
return attrsList;
|
|
27
34
|
},
|
|
35
|
+
component() {
|
|
36
|
+
if (this.href.length) return "a";
|
|
37
|
+
if (this.to) return "router-link";
|
|
38
|
+
return "button";
|
|
39
|
+
}
|
|
28
40
|
},
|
|
29
41
|
};
|
|
30
42
|
</script>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,19 +3,23 @@
|
|
|
3
3
|
<ul class="tabs-list">
|
|
4
4
|
<li class="tab-item" v-for="(tab, index) in tabs" :key="index">
|
|
5
5
|
<div v-if="!tab.name" class="wrapper-tab-link">
|
|
6
|
-
<
|
|
6
|
+
<component
|
|
7
|
+
:is="setHref ? 'a' : 'div'"
|
|
8
|
+
v-bind="setHref ? { href: createHref(tab.id), target: '_self' } : {}"
|
|
7
9
|
class="tab-link"
|
|
8
10
|
:class="{
|
|
9
11
|
active: selectedTab === tab.id,
|
|
10
12
|
disabled: tab.disabled,
|
|
11
13
|
}"
|
|
12
|
-
:href="createHref(tab.id)"
|
|
13
14
|
:tabindex="tab.disabled ? -1 : 0"
|
|
14
15
|
@click="selectTab(tab.id)"
|
|
15
|
-
target="_self"
|
|
16
16
|
>
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
<ib-icon class="tab-icon" v-if="tab.icon" :name="tab.icon" />
|
|
18
|
+
|
|
19
|
+
<template v-if="showTitle">
|
|
20
|
+
{{ tab.title }}
|
|
21
|
+
</template>
|
|
22
|
+
</component>
|
|
19
23
|
</div>
|
|
20
24
|
<ib-tab-dropdown
|
|
21
25
|
v-else
|
|
@@ -32,15 +36,25 @@
|
|
|
32
36
|
</div>
|
|
33
37
|
</template>
|
|
34
38
|
<script>
|
|
39
|
+
import IbIcon from "../Icon.vue";
|
|
35
40
|
import IbTabDropdown from "./TabDropdown.vue";
|
|
36
41
|
import getHrefFromId from "../../helpers/getHrefFromID";
|
|
42
|
+
|
|
37
43
|
export default {
|
|
38
44
|
name: "IbTabs",
|
|
39
45
|
props: {
|
|
46
|
+
showTitle: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true,
|
|
49
|
+
},
|
|
40
50
|
selectedTabId: {
|
|
41
51
|
type: String,
|
|
42
52
|
default: "",
|
|
43
53
|
},
|
|
54
|
+
setHref: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
}
|
|
44
58
|
},
|
|
45
59
|
data() {
|
|
46
60
|
return {
|
|
@@ -108,6 +122,7 @@ export default {
|
|
|
108
122
|
},
|
|
109
123
|
components: {
|
|
110
124
|
IbTabDropdown,
|
|
125
|
+
IbIcon,
|
|
111
126
|
},
|
|
112
127
|
emits: ["changeTab"]
|
|
113
128
|
};
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
background-color: $gray-300;
|
|
24
24
|
z-index: -1;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
.tab-item {
|
|
28
28
|
position: relative;
|
|
29
29
|
margin: 0 15px;
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
color: $neutral-900;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
.tab-icon {
|
|
69
|
+
margin-right: 3px;
|
|
70
|
+
color: inherit;
|
|
71
|
+
font-size: 16px;
|
|
72
|
+
}
|
|
73
|
+
|
|
68
74
|
&::after {
|
|
69
75
|
content: '';
|
|
70
76
|
width: 100%;
|
|
@@ -154,4 +160,4 @@
|
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
|
-
}
|
|
163
|
+
}
|
|
File without changes
|
|
@@ -18,6 +18,10 @@ export default {
|
|
|
18
18
|
default: tagPillSTatuses.neutral,
|
|
19
19
|
validator: (value) => Object.keys(tagPillSTatuses).includes(value),
|
|
20
20
|
},
|
|
21
|
+
icon: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "",
|
|
24
|
+
},
|
|
21
25
|
showIcon: {
|
|
22
26
|
type: Boolean,
|
|
23
27
|
default: false,
|
|
@@ -31,6 +35,8 @@ export default {
|
|
|
31
35
|
return classList;
|
|
32
36
|
},
|
|
33
37
|
iconName() {
|
|
38
|
+
if (this.icon) return this.icon;
|
|
39
|
+
|
|
34
40
|
switch (this.status) {
|
|
35
41
|
case tagPillSTatuses.success:
|
|
36
42
|
return "checkmark-outline";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li>
|
|
3
3
|
<div
|
|
4
|
-
v-tooltip="showTooltip ? option.title : ''"
|
|
4
|
+
v-tooltip="showTooltip ? (option.isDisabled ? option.disableTooltip : option.title) : ''"
|
|
5
5
|
class="tree-select-option"
|
|
6
6
|
tabindex="0"
|
|
7
7
|
role="option"
|
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
:aria-label="option.title"
|
|
10
10
|
:id="'option-' + id"
|
|
11
11
|
:class="{
|
|
12
|
-
'tree-select-option-checked':
|
|
12
|
+
'tree-select-option-checked': option.checked,
|
|
13
|
+
'tree-select-option-indeterminate': isChecked(option) === null,
|
|
13
14
|
'tree-select-option-margin': hasVisibleChildren,
|
|
14
15
|
active: option.isChildrenVisible,
|
|
15
16
|
'is-multiple': isMultiple,
|
|
16
17
|
'is-not-multiple': !isMultiple,
|
|
18
|
+
'has-icon': option.icon,
|
|
17
19
|
'tree-select-option-toggle': this.isToggle && this.isMultiple,
|
|
20
|
+
'alphabetic-option': alphabeticStyle,
|
|
18
21
|
}"
|
|
19
22
|
@keydown.self="onKeydown"
|
|
20
23
|
@focus="$emit('onFocus', `option-${id}`)"
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
:disabled-focus="true"
|
|
24
27
|
kind="ghost"
|
|
25
28
|
class="toggle-children"
|
|
26
|
-
@click="toggleChildrenVisibility"
|
|
29
|
+
@click.prevent="toggleChildrenVisibility"
|
|
27
30
|
v-show="hasVisibleChildren"
|
|
28
31
|
>
|
|
29
32
|
<ib-icon :name="iconName"></ib-icon>
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
:aria-label="option.title"
|
|
47
50
|
:name="actualName"
|
|
48
51
|
:value="option.id"
|
|
49
|
-
:id="'input' + id"
|
|
52
|
+
:id="'input' + id + generateUID()"
|
|
50
53
|
:is-checked="isChecked(option)"
|
|
51
54
|
:disabled="option.isDisabled"
|
|
52
55
|
:readonly="option.readonly"
|
|
@@ -63,13 +66,21 @@
|
|
|
63
66
|
'bookmarkable-option-title ' + (isBookmarked ? 'bookmarked' : '')
|
|
64
67
|
"
|
|
65
68
|
>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
<div class="bookmarkable-option-content" v-if="!hasChildren">
|
|
70
|
+
<span class="option-label" >
|
|
71
|
+
{{ option.title }}
|
|
72
|
+
</span>
|
|
73
|
+
|
|
74
|
+
<ib-icon-button
|
|
70
75
|
@click.stop.prevent="$emit('toggle-bookmark', option)"
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
kind="ghost"
|
|
77
|
+
v-tooltip="lang(isBookmarked ? 'unpin' : 'pin_to_top', 'select')"
|
|
78
|
+
>
|
|
79
|
+
<ib-icon
|
|
80
|
+
:name="isBookmarked ? 'star' : 'star-outline'"
|
|
81
|
+
></ib-icon>
|
|
82
|
+
</ib-icon-button>
|
|
83
|
+
</div>
|
|
73
84
|
|
|
74
85
|
<span class="option-label" v-else>{{ option.title }}</span>
|
|
75
86
|
</span>
|
|
@@ -84,7 +95,13 @@
|
|
|
84
95
|
</template>
|
|
85
96
|
|
|
86
97
|
<template v-else>
|
|
87
|
-
<span class="option-label">
|
|
98
|
+
<span class="option-label">
|
|
99
|
+
<ib-icon
|
|
100
|
+
v-if="option.icon"
|
|
101
|
+
:name="option.icon"
|
|
102
|
+
></ib-icon>
|
|
103
|
+
{{ option.title }}
|
|
104
|
+
</span>
|
|
88
105
|
</template>
|
|
89
106
|
</div>
|
|
90
107
|
|
|
@@ -118,6 +135,7 @@ import List from "../List.vue";
|
|
|
118
135
|
import IbIcon from "../Icon.vue";
|
|
119
136
|
import IbIconButton from "../IconButton/IconButton.vue";
|
|
120
137
|
import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
|
|
138
|
+
import generateUID from "../../helpers/generateUID";
|
|
121
139
|
import multiLineOverflows from "../../helpers/multiLineOverflows";
|
|
122
140
|
import {
|
|
123
141
|
SPACE_KEY_CODE,
|
|
@@ -168,16 +186,26 @@ export default {
|
|
|
168
186
|
type: Boolean,
|
|
169
187
|
default: false,
|
|
170
188
|
},
|
|
189
|
+
alphabeticStyle: {
|
|
190
|
+
type: Boolean,
|
|
191
|
+
default: false
|
|
192
|
+
},
|
|
171
193
|
},
|
|
172
194
|
mounted() {
|
|
173
195
|
// eslint-disable-next-line no-prototype-builtins
|
|
174
196
|
if (this.option.hasOwnProperty("children") && this.option.children) {
|
|
175
197
|
this.checkParent();
|
|
176
198
|
}
|
|
199
|
+
|
|
200
|
+
if(this.option.showTooltipByDefault) {
|
|
201
|
+
this.showTooltip = true;
|
|
202
|
+
}
|
|
177
203
|
},
|
|
178
204
|
updated() {
|
|
179
205
|
this.$nextTick(() => {
|
|
180
|
-
if
|
|
206
|
+
if(this.option.showTooltipByDefault) {
|
|
207
|
+
this.showTooltip = true;
|
|
208
|
+
} else if (multiLineOverflows(this.$el.querySelector(".option-label"))) {
|
|
181
209
|
this.showTooltip = true;
|
|
182
210
|
}
|
|
183
211
|
});
|
|
@@ -185,6 +213,7 @@ export default {
|
|
|
185
213
|
data() {
|
|
186
214
|
return {
|
|
187
215
|
showTooltip: false,
|
|
216
|
+
generateUID,
|
|
188
217
|
};
|
|
189
218
|
},
|
|
190
219
|
methods: {
|
|
@@ -219,6 +248,11 @@ export default {
|
|
|
219
248
|
this.check(this.option, value, true, checkChildren);
|
|
220
249
|
},
|
|
221
250
|
check(option, checkStatus, isDirectChild, checkChildren) {
|
|
251
|
+
if (!this.isMultiple && this.hasVisibleChildren) {
|
|
252
|
+
this.toggleChildrenVisibility();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
|
|
222
256
|
this.$emit("check", option, checkStatus, isDirectChild);
|
|
223
257
|
if (checkChildren) {
|
|
224
258
|
option.children &&
|
|
@@ -246,12 +280,11 @@ export default {
|
|
|
246
280
|
allChildrenSelected =
|
|
247
281
|
childrenSelectedCount >= this.option.children.length;
|
|
248
282
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
283
|
+
if (!this.option.checked && allChildrenSelected || this.option.checked && !allChildrenSelected) {
|
|
284
|
+
if (this.parentAutoCheck) {
|
|
285
|
+
this.toggle(!this.option.checked, false);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
255
288
|
},
|
|
256
289
|
calculateChildren(option, filter, checkNested = false) {
|
|
257
290
|
let count = 0;
|
|
@@ -271,13 +304,14 @@ export default {
|
|
|
271
304
|
},
|
|
272
305
|
isChecked(option) {
|
|
273
306
|
if(this.hasChildren) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
307
|
+
|
|
308
|
+
const childrenSelectedCount = this.childrenSelectedCount;
|
|
309
|
+
|
|
310
|
+
if (childrenSelectedCount > 0 && this.countOfAllChildren > childrenSelectedCount
|
|
311
|
+
|| (!childrenSelectedCount && this.option.checked && !this.parentAutoCheck)
|
|
312
|
+
|| (this.countOfAllChildren == childrenSelectedCount && !this.option.checked && !this.parentAutoCheck)
|
|
279
313
|
) {
|
|
280
|
-
|
|
314
|
+
return null;
|
|
281
315
|
}
|
|
282
316
|
}
|
|
283
317
|
|
|
File without changes
|