@avakhula/ui 0.0.351 → 0.0.353
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/.prettierrc.json +0 -0
- package/.storybook/intelliboardTheme.js +0 -0
- package/.storybook/manager.js +0 -0
- package/.storybook/scss-loader.scss +0 -0
- package/.storybook/withSource.js +0 -0
- package/README.md +0 -0
- package/dist/index.js +7309 -6846
- package/dist/index.umd.cjs +72 -72
- package/dist/style.css +1 -1
- package/index.html +0 -0
- package/package.json +4 -3
- package/src/App.vue +13 -69
- package/src/EventEmmiter.js +0 -0
- package/src/assets/scss/mixins.scss +0 -0
- package/src/assets/scss/reset.scss +0 -0
- package/src/assets/scss/style.scss +0 -0
- package/src/assets/scss/typography.scss +0 -0
- package/src/components/Alert/Alert.vue +5 -0
- package/src/components/Alert/alert.scss +6 -1
- 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.stories.js +0 -0
- package/src/components/Button/Button.stories.js +0 -0
- package/src/components/Button/constants.js +0 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +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/DropdownDivider.vue +0 -0
- package/src/components/Dropdown/DropdownList.vue +0 -0
- package/src/components/Dropdown/constants.js +0 -0
- package/src/components/Form/CharactersCount.vue +10 -7
- package/src/components/Form/Checkbox/Checkbox.vue +21 -6
- package/src/components/Form/DatePicker/DatePicker.vue +40 -13
- package/src/components/Form/DatePicker/Icons/chevron-back.js +0 -0
- package/src/components/Form/DatePicker/Icons/chevron-forward.js +0 -0
- package/src/components/Form/FormGroup/FormGroup.stories.js +0 -0
- package/src/components/Form/FormGroup/FormGroupSet.stories.js +0 -0
- package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
- package/src/components/Form/Input/Input.vue +2 -2
- package/src/components/Form/Label/Label.vue +1 -1
- package/src/components/Form/PhoneInput/PhoneInput.vue +26 -21
- package/src/components/Form/PhoneInput/phoneInput.scss +4 -5
- package/src/components/Form/Radio/Radio.vue +3 -3
- package/src/components/Form/TextEditor/TextEditor.vue +46 -4
- package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +0 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +0 -0
- package/src/components/Form/TextEditor/plugins/alphabetList.js +0 -0
- package/src/components/Form/TextEditor/textEditor.scss +50 -26
- package/src/components/Form/Textarea/Textarea.spec.js +0 -0
- package/src/components/Form/Textarea/Textarea.vue +14 -1
- package/src/components/Form/Textarea/textarea.scss +7 -1
- package/src/components/Icon.vue +0 -0
- package/src/components/IconButton/IconButton.scss +11 -0
- package/src/components/IconButton/IconButton.stories.js +0 -0
- package/src/components/IconButton/constants.js +0 -0
- package/src/components/Modal/Modal.vue +6 -4
- package/src/components/Pagination/Pagination.stories.js +0 -0
- package/src/components/Pagination/Pagination.vue +2 -2
- package/src/components/Panel/Panel.vue +52 -1
- package/src/components/Popover/Popover.stories.js +0 -0
- package/src/components/ProgressBar/ProgressBar.stories.js +0 -0
- package/src/components/Sorting/constants.js +0 -0
- package/src/components/SplitButton/SplitButtonItem.vue +0 -0
- package/src/components/SplitButton/constants.js +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 +0 -0
- package/src/components/TagPill/TagPill.vue +0 -0
- package/src/components/TagPill/constants.js +0 -0
- package/src/components/ToggleTip/ToggleTip.stories.js +0 -0
- package/src/components/ToggleTip/ToggleTip.vue +0 -0
- package/src/components/Tooltip/Tooltip.stories.js +0 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/TreeSelect/Select.vue +17 -4
- package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
- package/src/constants/events.js +0 -0
- package/src/constants/keyCodes.js +0 -0
- package/src/directives/outside/outside.js +0 -0
- package/src/directives/tooltip/tooltip.js +15 -0
- package/src/helpers/generateUID.js +0 -0
- package/src/helpers/getHrefFromID.js +0 -0
- package/src/helpers/multiLineOverflows.js +0 -0
- package/src/index.js +2 -0
- package/src/stories/link.stories.js +0 -0
- package/static/Logo.svg +0 -0
- package/vite.config.js +0 -0
package/index.html
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avakhula/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.353",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.umd.cjs",
|
|
6
6
|
"source": "src/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"registry": "https://registry.npmjs.org/"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"dev": "vite",
|
|
14
|
+
"dev": "vite --port 3006",
|
|
15
15
|
"build": "vite build",
|
|
16
16
|
"preview": "vite preview",
|
|
17
17
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-path .gitignore",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@vueup/vue-quill": "^1.2.0",
|
|
25
25
|
"mitt": "^3.0.0",
|
|
26
|
+
"quill-placeholder-module": "^0.3.1",
|
|
26
27
|
"vue": "^3.2.45"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
"vite": "^4.0.0",
|
|
61
62
|
"vitest": "^0.28.4",
|
|
62
63
|
"vue-loader": "^16.8.3",
|
|
63
|
-
"vue-tel-input": "^
|
|
64
|
+
"vue-tel-input": "^9.1.4"
|
|
64
65
|
}
|
|
65
66
|
}
|
package/src/App.vue
CHANGED
|
@@ -1,76 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{{ selectedCount }}
|
|
2
|
+
<chips :active="true" @click="() => console.log('hello click')">
|
|
3
|
+
<template #icon>
|
|
4
|
+
<icon name="people-outline" />
|
|
6
5
|
</template>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<ib-phone-input></ib-phone-input>
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
Users
|
|
7
|
+
</chips>
|
|
12
8
|
</template>
|
|
13
9
|
|
|
14
10
|
<script>
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {IbCheckboxGroup} from "./index.js";
|
|
18
|
-
import {IbRadio} from "./index.js";
|
|
19
|
-
import IbToggle from "@/components/Form/Toggle/Toggle.vue";
|
|
20
|
-
import {IbPhoneInput} from "./index.js";
|
|
21
|
-
const testData1 = [
|
|
22
|
-
{
|
|
23
|
-
disable: false,
|
|
24
|
-
active: false,
|
|
25
|
-
id: "2024-06-12 23:59:59.999999",
|
|
26
|
-
title: "One Day",
|
|
27
|
-
isDisabled: false,
|
|
28
|
-
showTooltipByDefault: true
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
disable: false,
|
|
32
|
-
active: false,
|
|
33
|
-
id: "2024-06-18 23:59:59.999999",
|
|
34
|
-
title: "One Week",
|
|
35
|
-
isDisabled: false
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
disable: false,
|
|
39
|
-
active: false,
|
|
40
|
-
id: "2024-06-25 23:59:59.999999",
|
|
41
|
-
title: "Two Weeks",
|
|
42
|
-
isDisabled: true
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
disable: false,
|
|
46
|
-
active: false,
|
|
47
|
-
id: "2024-07-11 23:59:59.999999",
|
|
48
|
-
title: "One Month",
|
|
49
|
-
isDisabled: true,
|
|
50
|
-
disableTooltip: 'disable 123',
|
|
51
|
-
showTooltipByDefault: true
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
disable: false,
|
|
55
|
-
active: true,
|
|
56
|
-
id: "2025-02-01 23:59:59.999999",
|
|
57
|
-
title: "All Time",
|
|
58
|
-
isDisabled: true,
|
|
59
|
-
disableTooltip: 'disable 123'
|
|
60
|
-
}
|
|
61
|
-
]
|
|
11
|
+
import Chips from "./components/Chips/Chips.vue";
|
|
12
|
+
import Icon from "./components/Icon.vue";
|
|
62
13
|
export default {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
14
|
+
components: {
|
|
15
|
+
Chips,
|
|
16
|
+
Icon,
|
|
67
17
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
checked: '1'
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
components: {IbToggle, IbSelect, IbCheckboxGroup, IbRadio, IbPhoneInput}
|
|
75
|
-
}
|
|
76
|
-
</script>
|
|
18
|
+
};
|
|
19
|
+
</script>
|
|
20
|
+
|
package/src/EventEmmiter.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<b v-if="title?.length" class="ib-alert-title">
|
|
7
7
|
{{ title }}
|
|
8
8
|
</b>
|
|
9
|
+
<slot name="title"></slot>
|
|
9
10
|
</span>
|
|
10
11
|
|
|
11
12
|
<span class="text-content">
|
|
@@ -54,6 +55,10 @@ export default {
|
|
|
54
55
|
type: String,
|
|
55
56
|
default: "",
|
|
56
57
|
},
|
|
58
|
+
additionalTitleText: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "",
|
|
61
|
+
},
|
|
57
62
|
},
|
|
58
63
|
mounted() {
|
|
59
64
|
this.checkHeight();
|
|
@@ -82,6 +82,7 @@ $alert-success-secondary-color: $green-50;
|
|
|
82
82
|
|
|
83
83
|
.text-content {
|
|
84
84
|
@include Ib-H5-regular;
|
|
85
|
+
margin-left: 3px;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
&.large {
|
|
@@ -109,6 +110,7 @@ $alert-success-secondary-color: $green-50;
|
|
|
109
110
|
margin-bottom: 5px;
|
|
110
111
|
padding-left: 0!important;
|
|
111
112
|
word-break: break-word;
|
|
113
|
+
margin-left: 3px;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
& + .close-button {
|
|
@@ -138,10 +140,13 @@ $alert-success-secondary-color: $green-50;
|
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
&-title {
|
|
141
|
-
margin-right: 5px;
|
|
142
143
|
@include Ib-H4-medium;
|
|
143
144
|
}
|
|
144
145
|
|
|
146
|
+
&-additional-text {
|
|
147
|
+
margin-right: 5px;
|
|
148
|
+
}
|
|
149
|
+
|
|
145
150
|
&-icon {
|
|
146
151
|
display: inline-block;
|
|
147
152
|
font-size: 20px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Avatar from "./Avatar.vue";
|
|
2
|
-
import { avatarSizes } from "./constants";
|
|
2
|
+
import { avatarSizes, avatarTypes } from "./constants";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Avatar",
|
|
@@ -9,6 +9,10 @@ export default {
|
|
|
9
9
|
control: { type: "select" },
|
|
10
10
|
options: Object.values(avatarSizes),
|
|
11
11
|
},
|
|
12
|
+
type: {
|
|
13
|
+
control: { type: "select" },
|
|
14
|
+
options: Object.values(avatarTypes),
|
|
15
|
+
},
|
|
12
16
|
},
|
|
13
17
|
};
|
|
14
18
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<script>
|
|
28
28
|
import IbIcon from "../Icon.vue";
|
|
29
|
-
import { avatarSizes } from "./constants";
|
|
29
|
+
import { avatarSizes, avatarTypes } from "./constants";
|
|
30
30
|
|
|
31
31
|
export default {
|
|
32
32
|
name: "IbAvatar",
|
|
@@ -51,10 +51,14 @@ export default {
|
|
|
51
51
|
type: String,
|
|
52
52
|
default: avatarSizes.M,
|
|
53
53
|
},
|
|
54
|
+
type: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: avatarTypes.CIRCLE,
|
|
57
|
+
},
|
|
54
58
|
},
|
|
55
59
|
computed: {
|
|
56
60
|
classList() {
|
|
57
|
-
const classList = ["avatar", `avatar-size-${this.size}`];
|
|
61
|
+
const classList = ["avatar", `avatar-size-${this.size}`, `avatar-type-${this.type}`];
|
|
58
62
|
return classList;
|
|
59
63
|
},
|
|
60
64
|
validateName() {
|
|
@@ -86,15 +90,34 @@ $avatar-border: $blue-200;
|
|
|
86
90
|
justify-content: center;
|
|
87
91
|
object-fit: cover;
|
|
88
92
|
|
|
93
|
+
&.avatar-type-circle {
|
|
94
|
+
border-radius: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.avatar-type-square {
|
|
98
|
+
border-radius: 4px;
|
|
99
|
+
}
|
|
100
|
+
|
|
89
101
|
&.avatar-size {
|
|
90
102
|
&-m {
|
|
91
103
|
width: 34px;
|
|
104
|
+
min-width: 34px;
|
|
92
105
|
height: 34px;
|
|
106
|
+
min-height: 34px;
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
&-l {
|
|
96
110
|
width: 74px;
|
|
111
|
+
min-width: 74px;
|
|
97
112
|
height: 74px;
|
|
113
|
+
min-height: 74px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&-xl {
|
|
117
|
+
width: 87px;
|
|
118
|
+
min-width: 87px;
|
|
119
|
+
height: 87px;
|
|
120
|
+
min-height: 87px;
|
|
98
121
|
}
|
|
99
122
|
}
|
|
100
123
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import IbChips from "./Chips.vue";
|
|
2
|
+
import Icon from "../Icon.vue";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Chips",
|
|
6
|
+
component: IbChips,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = (args) => ({
|
|
10
|
+
components: { IbChips },
|
|
11
|
+
setup() {
|
|
12
|
+
return { args };
|
|
13
|
+
},
|
|
14
|
+
template: '<ib-chips v-bind="args">Total Visits: 0-20</ib-chips>',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const TemplateWithIcon = (args) => ({
|
|
18
|
+
components: { IbChips, Icon },
|
|
19
|
+
setup() {
|
|
20
|
+
return { args };
|
|
21
|
+
},
|
|
22
|
+
template: '<ib-chips v-bind="args"><template #icon><icon name="people-outline" /></template>Users</ib-chips>',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const Default = Template.bind({});
|
|
26
|
+
Default.args = {};
|
|
27
|
+
|
|
28
|
+
export const ChipsWithIcon = TemplateWithIcon.bind({});
|
|
29
|
+
ChipsWithIcon.args = {};
|
|
30
|
+
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
:class="{
|
|
4
|
+
'ib-chips': true,
|
|
5
|
+
'ib-chips-active': active,
|
|
6
|
+
'ib-chips-error': error,
|
|
7
|
+
'ib-chips-disabled': disabled,
|
|
8
|
+
}"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
>
|
|
11
|
+
<span v-if="hasIcon" class="ib-chips-icon-wrapper">
|
|
12
|
+
<slot class="ib-chips-icon" name="icon" />
|
|
13
|
+
</span>
|
|
14
|
+
|
|
15
|
+
<slot />
|
|
16
|
+
|
|
17
|
+
<span class="ib-chips-close-wrapper" v-if="showCloseIcon">
|
|
18
|
+
<icon class="ib-chips-icon" name="close-outline" />
|
|
19
|
+
</span>
|
|
20
|
+
</button>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import Icon from "../Icon.vue";
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
showCloseIcon: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
active: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
error: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
hasIcon() {
|
|
47
|
+
return this.$slots?.icon;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
components: {
|
|
51
|
+
Icon,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
<style lang="scss" scoped>
|
|
56
|
+
@import "../../assets/scss/variables/colors.scss";
|
|
57
|
+
@import "../../assets/scss/typography.scss";
|
|
58
|
+
@import "../../assets/scss/mixins.scss";
|
|
59
|
+
|
|
60
|
+
.ib-chips {
|
|
61
|
+
@include Ib-H4-medium;
|
|
62
|
+
padding: 8.5px 10px;
|
|
63
|
+
border: 2px solid transparent;
|
|
64
|
+
border-radius: 4px;
|
|
65
|
+
height: 36px;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
background-color: $gray-100;
|
|
69
|
+
color: $neutral-600;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
transition: all 0.3s;
|
|
72
|
+
|
|
73
|
+
.ib-chips-close-wrapper,
|
|
74
|
+
.ib-chips-icon-wrapper {
|
|
75
|
+
width: 16px;
|
|
76
|
+
height: 16px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ib-chips-icon-wrapper {
|
|
80
|
+
margin-right: 5px;
|
|
81
|
+
}
|
|
82
|
+
.ib-chips-close-wrapper {
|
|
83
|
+
margin-left: 5px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ib-chips-icon {
|
|
87
|
+
color: inherit;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.ib-chips-active {
|
|
92
|
+
background-color: $blue-200;
|
|
93
|
+
color: $blue-800;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.ib-chips-error {
|
|
97
|
+
border-color: $red-800;
|
|
98
|
+
color: $red-800;
|
|
99
|
+
background-color: $red-50;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.ib-chips-disabled {
|
|
103
|
+
border-color: transparent!important;
|
|
104
|
+
color: $neutral-500!important;
|
|
105
|
+
background-color: $gray-100!important;
|
|
106
|
+
cursor: default;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
border-color: $blue-300;
|
|
111
|
+
background-color: $blue-100;
|
|
112
|
+
color: $blue-700;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:active {
|
|
116
|
+
border-color: transparent;
|
|
117
|
+
background-color: $blue-200;
|
|
118
|
+
color: $blue-900;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&:focus {
|
|
122
|
+
@include focus(2px);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
<template v-if="!characterLength">
|
|
4
4
|
<p class="val-limit">Max {{ characterLimit }}</p>
|
|
5
5
|
</template>
|
|
6
|
-
<template v-else-if="characterLimit
|
|
7
|
-
<p class="val-length">{{
|
|
6
|
+
<template v-else-if="characterLimit >= characterLength">
|
|
7
|
+
<p class="val-length">{{ characterLength }}</p>
|
|
8
8
|
/
|
|
9
9
|
<p class="val-limit">{{ characterLimit }}</p>
|
|
10
10
|
</template>
|
|
11
|
-
<template v-else-if="characterLimit === characterLength">0</template>
|
|
12
|
-
|
|
13
11
|
<template v-else>
|
|
14
|
-
<p class="val-length
|
|
15
|
-
{{ characterLimit - characterLength }}
|
|
16
|
-
</p>
|
|
12
|
+
<p class="val-length error">{{ characterLimit - characterLength }}</p>
|
|
17
13
|
</template>
|
|
18
14
|
</div>
|
|
19
15
|
</template>
|
|
@@ -51,5 +47,12 @@ $textarea-character-count-limited-color: $red-900;
|
|
|
51
47
|
color: $textarea-character-count-limited-color;
|
|
52
48
|
}
|
|
53
49
|
}
|
|
50
|
+
|
|
51
|
+
.val-length,
|
|
52
|
+
.val-limit {
|
|
53
|
+
&.error {
|
|
54
|
+
color: $textarea-character-count-limited-color;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
</style>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div role="checkbox" class="ib-checkbox-wrapper" :class="this.$attrs.class"
|
|
2
|
+
<div role="checkbox" class="ib-checkbox-wrapper" :class="this.$attrs.class">
|
|
3
3
|
<label
|
|
4
4
|
v-bind="attrs"
|
|
5
5
|
:for="id"
|
|
6
6
|
:tabindex="disabled | disableFocus ? -1 : 0"
|
|
7
|
+
:aria-checked="checked ? true : false"
|
|
7
8
|
@click.prevent.stop="onChange"
|
|
8
9
|
@keypress.prevent="onChange"
|
|
9
10
|
>
|
|
@@ -12,12 +13,22 @@
|
|
|
12
13
|
type="checkbox"
|
|
13
14
|
:name="name"
|
|
14
15
|
:id="id"
|
|
15
|
-
:value="value"
|
|
16
|
+
:value="value ?? 1"
|
|
16
17
|
:disabled="disabled"
|
|
17
18
|
:required="required"
|
|
18
19
|
v-model="checked"
|
|
19
20
|
@click="onChange"
|
|
20
21
|
/>
|
|
22
|
+
|
|
23
|
+
<input
|
|
24
|
+
v-if="!value && !checked"
|
|
25
|
+
value="0"
|
|
26
|
+
type="hidden"
|
|
27
|
+
:name="name"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
:required="required"
|
|
30
|
+
/>
|
|
31
|
+
|
|
21
32
|
<div class="ib-checkbox-body">
|
|
22
33
|
<span
|
|
23
34
|
v-if="labelPosition === 'left' && label.length"
|
|
@@ -72,10 +83,10 @@ export default {
|
|
|
72
83
|
},
|
|
73
84
|
},
|
|
74
85
|
value: {
|
|
75
|
-
|
|
86
|
+
type: [String, Number],
|
|
76
87
|
},
|
|
77
88
|
modelValue: {
|
|
78
|
-
type: Boolean,
|
|
89
|
+
type: [Boolean, String],
|
|
79
90
|
},
|
|
80
91
|
isChecked: {
|
|
81
92
|
type: Boolean,
|
|
@@ -108,12 +119,16 @@ export default {
|
|
|
108
119
|
},
|
|
109
120
|
modelValue(value) {
|
|
110
121
|
this.$emit("update:modelValue", this.modelValue);
|
|
111
|
-
this.checked = value;
|
|
122
|
+
this.checked = value === "0" ? false : Boolean(value);
|
|
112
123
|
},
|
|
113
124
|
},
|
|
114
125
|
data() {
|
|
126
|
+
const value = this.modelValue
|
|
127
|
+
? (this.modelValue === "0" ? false : Boolean(this.modelValue))
|
|
128
|
+
: this.isChecked;
|
|
129
|
+
|
|
115
130
|
return {
|
|
116
|
-
checked:
|
|
131
|
+
checked: value,
|
|
117
132
|
};
|
|
118
133
|
},
|
|
119
134
|
methods: {
|
|
@@ -18,11 +18,15 @@
|
|
|
18
18
|
{{ label }}
|
|
19
19
|
</ib-label>
|
|
20
20
|
<div class="input-wrapper" @click="open" :class="{ active: isOpen }">
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
<label :aria-label="ariaLabel">
|
|
22
|
+
<input
|
|
23
|
+
:placeholder="placeholder"
|
|
24
|
+
:name="name"
|
|
25
|
+
ref="date"
|
|
26
|
+
id="date"
|
|
27
|
+
class="date-picker-input"
|
|
28
|
+
/>
|
|
29
|
+
</label>
|
|
26
30
|
|
|
27
31
|
<ib-icon name="today-outline" class="calendar-icon" />
|
|
28
32
|
</div>
|
|
@@ -46,12 +50,14 @@
|
|
|
46
50
|
@click="openEndDate"
|
|
47
51
|
:class="{ active: isOpenEndDate }"
|
|
48
52
|
>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
<label :aria-label="endDateAriaLabel">
|
|
54
|
+
<input
|
|
55
|
+
class="date-picker-input"
|
|
56
|
+
:placeholder="endDatePlaceholder"
|
|
57
|
+
@keydown="onKeydownEndField"
|
|
58
|
+
ref="toDate"
|
|
59
|
+
/>
|
|
60
|
+
</label>
|
|
55
61
|
<ib-icon name="today-outline" class="calendar-icon" />
|
|
56
62
|
</div>
|
|
57
63
|
|
|
@@ -90,6 +96,10 @@ export default {
|
|
|
90
96
|
type: String,
|
|
91
97
|
default: "",
|
|
92
98
|
},
|
|
99
|
+
endDatePlaceholder: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: "",
|
|
102
|
+
},
|
|
93
103
|
required: {
|
|
94
104
|
type: Boolean,
|
|
95
105
|
default: false,
|
|
@@ -102,6 +112,14 @@ export default {
|
|
|
102
112
|
type: String,
|
|
103
113
|
default: SINGLE_MODE,
|
|
104
114
|
},
|
|
115
|
+
ariaLabel: {
|
|
116
|
+
type: String,
|
|
117
|
+
required: true,
|
|
118
|
+
},
|
|
119
|
+
endDateAriaLabel: {
|
|
120
|
+
type: String,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
105
123
|
label: {
|
|
106
124
|
type: String,
|
|
107
125
|
default: "",
|
|
@@ -138,7 +156,10 @@ export default {
|
|
|
138
156
|
this.initFlatpickr();
|
|
139
157
|
},
|
|
140
158
|
modelValue() {
|
|
141
|
-
this.
|
|
159
|
+
if (JSON.stringify(this.modelValue) === JSON.stringify(this.data)) return;
|
|
160
|
+
|
|
161
|
+
const value = this.modelValue[0] && this.modelValue[1] ? this.modelValue : [];
|
|
162
|
+
this.flat?.setDate(value, true);
|
|
142
163
|
},
|
|
143
164
|
},
|
|
144
165
|
data() {
|
|
@@ -196,7 +217,7 @@ export default {
|
|
|
196
217
|
if (this.mode === RANGE_MODE) {
|
|
197
218
|
defaultConfig.defaultDate = this.modelValue.length
|
|
198
219
|
? [this.modelValue[0], this.modelValue[1]]
|
|
199
|
-
: [this.value[0], this.value[1]];
|
|
220
|
+
: [this.value?.[0], this.value?.[1]];
|
|
200
221
|
} else {
|
|
201
222
|
defaultConfig.defaultDate = this.modelValue
|
|
202
223
|
? this.modelValue
|
|
@@ -227,6 +248,11 @@ export default {
|
|
|
227
248
|
this.close();
|
|
228
249
|
}
|
|
229
250
|
},
|
|
251
|
+
onKeydownEndField(e) {
|
|
252
|
+
if (e.key === "ArrowDown") {
|
|
253
|
+
this.flat.selectedDateElem.focus();
|
|
254
|
+
}
|
|
255
|
+
},
|
|
230
256
|
triggerChange() {
|
|
231
257
|
setTimeout(() => {
|
|
232
258
|
if (this.pickerOptions.mode === "range") {
|
|
@@ -277,6 +303,7 @@ export default {
|
|
|
277
303
|
IbLabel,
|
|
278
304
|
IbAlert,
|
|
279
305
|
},
|
|
306
|
+
emits: ["input", "update:modelValue"],
|
|
280
307
|
};
|
|
281
308
|
</script>
|
|
282
309
|
<style lang="scss">
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|