@avakhula/ui 0.0.10
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 +14 -0
- package/.eslintrc.cjs +15 -0
- package/.nvmrc +1 -0
- package/.prettierrc.json +1 -0
- package/.storybook/intelliboardTheme.js +10 -0
- package/.storybook/main.js +25 -0
- package/.storybook/manager.js +7 -0
- package/.storybook/preview-head.html +11 -0
- package/.storybook/preview.js +24 -0
- package/.storybook/scss-loader.scss +6 -0
- package/.storybook/withSource.js +97 -0
- package/README.md +35 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.mjs +19366 -0
- package/dist/index.umd.js +209 -0
- package/dist/style.css +1 -0
- package/index.html +21 -0
- package/package.json +63 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +37 -0
- package/src/EventEmmiter.js +19 -0
- package/src/assets/scss/mixins/dropdown-list-item.scss +45 -0
- package/src/assets/scss/mixins/tooltip-position.scss +147 -0
- package/src/assets/scss/mixins.scss +21 -0
- package/src/assets/scss/reset.scss +12 -0
- package/src/assets/scss/style.scss +73 -0
- package/src/assets/scss/typography.scss +155 -0
- package/src/assets/scss/variables/colors.scss +115 -0
- package/src/assets/scss/variables/shadows.scss +17 -0
- package/src/components/Accordion/Accordion.scss +94 -0
- package/src/components/Accordion/Accordion.stories.js +41 -0
- package/src/components/Accordion/Accordion.vue +104 -0
- package/src/components/Accordion/readme.mdx +38 -0
- package/src/components/Alert/Alert.stories.js +69 -0
- package/src/components/Alert/Alert.vue +131 -0
- package/src/components/Alert/alert.scss +166 -0
- package/src/components/Alert/constants.js +6 -0
- package/src/components/Alert/readme.mdx +63 -0
- package/src/components/Badge/Badge.stories.js +53 -0
- package/src/components/Badge/Badge.vue +58 -0
- package/src/components/Badge/readme.mdx +38 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +98 -0
- package/src/components/Breadcrumbs/breadcrumbs.scss +77 -0
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +37 -0
- package/src/components/Button/Button.stories.js +124 -0
- package/src/components/Button/Button.vue +165 -0
- package/src/components/Button/button.scss +217 -0
- package/src/components/Button/constants.js +8 -0
- package/src/components/Button/readme.mdx +118 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.js +27 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +24 -0
- package/src/components/ButtonGroup/readme.mdx +10 -0
- package/src/components/Dropdown/Dropdown.spec.js +90 -0
- package/src/components/Dropdown/Dropdown.stories.js +48 -0
- package/src/components/Dropdown/Dropdown.vue +313 -0
- package/src/components/Dropdown/DropdownDivider.vue +15 -0
- package/src/components/Dropdown/DropdownItem.vue +59 -0
- package/src/components/Dropdown/DropdownList.stories.js +174 -0
- package/src/components/Dropdown/DropdownList.vue +93 -0
- package/src/components/Dropdown/constants.js +10 -0
- package/src/components/Dropdown/readme.mdx +88 -0
- package/src/components/Form/CharactersCount.vue +55 -0
- package/src/components/Form/Checkbox/Checkbox.scss +226 -0
- package/src/components/Form/Checkbox/Checkbox.stories.js +63 -0
- package/src/components/Form/Checkbox/Checkbox.vue +128 -0
- package/src/components/Form/Checkbox/readme.mdx +69 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +64 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +87 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +56 -0
- package/src/components/Form/DatePicker/DatePicker.scss +479 -0
- package/src/components/Form/DatePicker/DatePicker.stories.js +78 -0
- package/src/components/Form/DatePicker/DatePicker.vue +284 -0
- package/src/components/Form/DatePicker/Icons/chevron-back.js +5 -0
- package/src/components/Form/DatePicker/Icons/chevron-forward.js +5 -0
- package/src/components/Form/DatePicker/readme.mdx +115 -0
- package/src/components/Form/FormGroup/FormGroup.stories.js +48 -0
- package/src/components/Form/FormGroup/FormGroup.vue +61 -0
- package/src/components/Form/FormGroup/FormGroupSet.stories.js +32 -0
- package/src/components/Form/FormGroup/FormGroupSet.vue +75 -0
- package/src/components/Form/Input/Input.stories.js +137 -0
- package/src/components/Form/Input/Input.vue +231 -0
- package/src/components/Form/Input/constants.js +5 -0
- package/src/components/Form/Input/input.scss +133 -0
- package/src/components/Form/Input/readme.mdx +68 -0
- package/src/components/Form/Label/Label.stories.js +29 -0
- package/src/components/Form/Label/Label.vue +87 -0
- package/src/components/Form/Label/readme.mdx +25 -0
- package/src/components/Form/PhoneInput/PhoneInput.stories.js +43 -0
- package/src/components/Form/PhoneInput/PhoneInput.vue +105 -0
- package/src/components/Form/PhoneInput/phoneInput.scss +197 -0
- package/src/components/Form/PhoneInput/readme.mdx +37 -0
- package/src/components/Form/Radio/Radio.stories.js +34 -0
- package/src/components/Form/Radio/Radio.vue +109 -0
- package/src/components/Form/Radio/radio.scss +187 -0
- package/src/components/Form/Radio/readme.mdx +48 -0
- package/src/components/Form/TextEditor/TextEditor.stories.js +58 -0
- package/src/components/Form/TextEditor/TextEditor.vue +305 -0
- package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +3 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +111 -0
- package/src/components/Form/TextEditor/plugins/alphabetList.js +43 -0
- package/src/components/Form/TextEditor/readme.mdx +59 -0
- package/src/components/Form/TextEditor/textEditor.scss +684 -0
- package/src/components/Form/Textarea/Textarea.spec.js +107 -0
- package/src/components/Form/Textarea/Textarea.stories.js +68 -0
- package/src/components/Form/Textarea/Textarea.vue +102 -0
- package/src/components/Form/Textarea/readme.mdx +45 -0
- package/src/components/Form/Textarea/textarea.scss +84 -0
- package/src/components/Form/Toggle/Toggle.stories.js +44 -0
- package/src/components/Form/Toggle/Toggle.vue +122 -0
- package/src/components/Form/Toggle/readme.mdx +39 -0
- package/src/components/Form/Toggle/toggle.scss +166 -0
- package/src/components/Icon.vue +41 -0
- package/src/components/IconButton/IconButton.scss +91 -0
- package/src/components/IconButton/IconButton.stories.js +115 -0
- package/src/components/IconButton/IconButton.vue +100 -0
- package/src/components/IconButton/constants.js +14 -0
- package/src/components/IconButton/readme.mdx +66 -0
- package/src/components/List.vue +150 -0
- package/src/components/Modal/Modal.stories.js +48 -0
- package/src/components/Modal/Modal.vue +231 -0
- package/src/components/Modal/readme.mdx +76 -0
- package/src/components/Pagination/LimitSelector.vue +73 -0
- package/src/components/Pagination/Pagination.stories.js +54 -0
- package/src/components/Pagination/Pagination.vue +227 -0
- package/src/components/Pagination/pagination.scss +189 -0
- package/src/components/Popover/Popover.stories.js +46 -0
- package/src/components/Popover/Popover.vue +81 -0
- package/src/components/Popover/constants.js +14 -0
- package/src/components/Popover/popover.scss +26 -0
- package/src/components/Popover/readme.mdx +42 -0
- package/src/components/ProgressBar/ProgressBar.stories.js +90 -0
- package/src/components/ProgressBar/ProgressBar.vue +58 -0
- package/src/components/ProgressBar/constants.js +6 -0
- package/src/components/ProgressBar/progressBar.scss +116 -0
- package/src/components/ProgressBar/readme.mdx +67 -0
- package/src/components/Sorting/Sorting.stories.js +35 -0
- package/src/components/Sorting/Sorting.vue +128 -0
- package/src/components/Sorting/constants.js +10 -0
- package/src/components/Sorting/sorting.scss +87 -0
- package/src/components/SplitButton/SplitButton.stories.js +39 -0
- package/src/components/SplitButton/SplitButton.vue +132 -0
- package/src/components/SplitButton/SplitButtonItem.vue +34 -0
- package/src/components/SplitButton/constants.js +4 -0
- package/src/components/SplitButton/readme.mdx +77 -0
- package/src/components/SplitButton/splitButton.scss +161 -0
- package/src/components/StatusIndicator/StatusIndicator.stories.js +40 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +52 -0
- package/src/components/StatusIndicator/constants.js +10 -0
- package/src/components/StatusIndicator/icons.js +48 -0
- package/src/components/StatusIndicator/readme.mdx +21 -0
- package/src/components/Table/Cells/Cell.vue +71 -0
- package/src/components/Table/Cells/CheckboxCell.vue +48 -0
- package/src/components/Table/Row.vue +26 -0
- package/src/components/Table/Table.stories.js +59 -0
- package/src/components/Table/Table.vue +36 -0
- package/src/components/Tabs/Tab.vue +37 -0
- package/src/components/Tabs/TabDropdown.vue +93 -0
- package/src/components/Tabs/Tabs.stories.js +57 -0
- package/src/components/Tabs/Tabs.vue +94 -0
- package/src/components/Tabs/tabs.scss +157 -0
- package/src/components/TagPill/TagPill.stories.js +30 -0
- package/src/components/TagPill/TagPill.vue +133 -0
- package/src/components/TagPill/constants.js +9 -0
- package/src/components/TagPill/readme.mdx +37 -0
- package/src/components/ToggleTip/ToggleTip.stories.js +98 -0
- package/src/components/ToggleTip/ToggleTip.vue +112 -0
- package/src/components/ToggleTip/constants.js +14 -0
- package/src/components/ToggleTip/readme.mdx +46 -0
- package/src/components/ToggleTip/toggleTip.scss +55 -0
- package/src/components/Tooltip/Tooltip.stories.js +56 -0
- package/src/components/Tooltip/Tooltip.vue +49 -0
- package/src/components/Tooltip/readme.mdx +43 -0
- package/src/components/TreeSelect/Option.vue +325 -0
- package/src/components/TreeSelect/Select.stories.js +349 -0
- package/src/components/TreeSelect/Select.vue +909 -0
- package/src/components/TreeSelect/TreeSelect.stories.js +270 -0
- package/src/components/TreeSelect/scss/option.scss +204 -0
- package/src/components/TreeSelect/scss/select.scss +166 -0
- package/src/constants/events.js +2 -0
- package/src/constants/keyCodes.js +8 -0
- package/src/directives/outside/outside.js +81 -0
- package/src/directives/outside/outside.stories.js +29 -0
- package/src/directives/outside/readme.mdx +24 -0
- package/src/helpers/generateUID.js +3 -0
- package/src/helpers/getHrefFromID.js +3 -0
- package/src/helpers/multiLineOverflows.js +3 -0
- package/src/helpers/removeEvents.js +9 -0
- package/src/index.js +49 -0
- package/src/main.js +12 -0
- package/src/stories/link.readme.mdx +57 -0
- package/src/stories/link.stories.js +59 -0
- package/static/Logo.svg +25 -0
- package/static/docks/button.pdf +147566 -0
- package/vite.config.js +47 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import IbTreeSelect from "./Select.vue";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Form/TreeSelect",
|
|
5
|
+
components: IbTreeSelect,
|
|
6
|
+
argTypes: {
|
|
7
|
+
onResize: { action: "resize" },
|
|
8
|
+
onSearch: { action: "search" },
|
|
9
|
+
onSubmit: { action: "submit" },
|
|
10
|
+
onInput: { action: "input" },
|
|
11
|
+
placeholder: {
|
|
12
|
+
control: { type: "text" },
|
|
13
|
+
},
|
|
14
|
+
searchPlaceholderText: {
|
|
15
|
+
control: { type: "text" },
|
|
16
|
+
},
|
|
17
|
+
clearButtonMessage: {
|
|
18
|
+
control: { type: "text" },
|
|
19
|
+
},
|
|
20
|
+
showClearButton: {
|
|
21
|
+
control: { type: "boolean" },
|
|
22
|
+
},
|
|
23
|
+
isResizable: {
|
|
24
|
+
control: { type: "boolean" },
|
|
25
|
+
},
|
|
26
|
+
name: {
|
|
27
|
+
control: { type: "text" },
|
|
28
|
+
},
|
|
29
|
+
maxSelectedNames: {
|
|
30
|
+
control: { type: "number" },
|
|
31
|
+
},
|
|
32
|
+
isMultiple: {
|
|
33
|
+
control: { type: "boolean" },
|
|
34
|
+
},
|
|
35
|
+
parentAutoCheck: {
|
|
36
|
+
control: { type: "boolean" },
|
|
37
|
+
},
|
|
38
|
+
strings: {
|
|
39
|
+
control: { type: "object" },
|
|
40
|
+
},
|
|
41
|
+
onlyEndNodes: {
|
|
42
|
+
control: { type: "boolean" },
|
|
43
|
+
},
|
|
44
|
+
isRequired: {
|
|
45
|
+
control: { type: "boolean" },
|
|
46
|
+
},
|
|
47
|
+
htmlOptionTitle: {
|
|
48
|
+
control: { type: "boolean" },
|
|
49
|
+
},
|
|
50
|
+
showInputs: {
|
|
51
|
+
control: { type: "boolean" },
|
|
52
|
+
},
|
|
53
|
+
dependency: {
|
|
54
|
+
control: { type: "text" },
|
|
55
|
+
},
|
|
56
|
+
filterId: {
|
|
57
|
+
control: { type: "text" },
|
|
58
|
+
},
|
|
59
|
+
staticPlaceholder: {
|
|
60
|
+
control: { type: "boolean" },
|
|
61
|
+
},
|
|
62
|
+
useSearch: {
|
|
63
|
+
control: { type: "boolean" },
|
|
64
|
+
},
|
|
65
|
+
isWatching: {
|
|
66
|
+
control: { type: "boolean" },
|
|
67
|
+
},
|
|
68
|
+
vertical: {
|
|
69
|
+
control: { type: "text" },
|
|
70
|
+
},
|
|
71
|
+
emptyMessage: {
|
|
72
|
+
control: { type: "text" },
|
|
73
|
+
},
|
|
74
|
+
allOptions: {
|
|
75
|
+
control: { type: "boolean" },
|
|
76
|
+
},
|
|
77
|
+
watchClearValue: {
|
|
78
|
+
control: { type: "boolean" },
|
|
79
|
+
},
|
|
80
|
+
isToggle: {
|
|
81
|
+
control: { type: "boolean" },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const Template = (args) => ({
|
|
87
|
+
components: { IbTreeSelect },
|
|
88
|
+
setup() {
|
|
89
|
+
return { args };
|
|
90
|
+
},
|
|
91
|
+
template: "<ib-tree-select v-bind='args' />",
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const testData = [
|
|
95
|
+
{
|
|
96
|
+
id: "category_id_2",
|
|
97
|
+
title: "Education",
|
|
98
|
+
is_category: true,
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
id: "category_id_19",
|
|
102
|
+
title: "Test1",
|
|
103
|
+
is_category: true,
|
|
104
|
+
children: [
|
|
105
|
+
{
|
|
106
|
+
id: 139,
|
|
107
|
+
title: "Test Course 1",
|
|
108
|
+
selected: false,
|
|
109
|
+
initiallyVisible: true,
|
|
110
|
+
visible: true,
|
|
111
|
+
isDisabled: false,
|
|
112
|
+
checked: false,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: 300,
|
|
116
|
+
title: "Course for unenrollmemt test",
|
|
117
|
+
selected: false,
|
|
118
|
+
initiallyVisible: true,
|
|
119
|
+
visible: true,
|
|
120
|
+
isDisabled: false,
|
|
121
|
+
checked: false,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
initiallyVisible: true,
|
|
125
|
+
visible: true,
|
|
126
|
+
isDisabled: false,
|
|
127
|
+
checked: false,
|
|
128
|
+
isChildrenVisible: true,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 15,
|
|
132
|
+
title: "History",
|
|
133
|
+
selected: false,
|
|
134
|
+
initiallyVisible: true,
|
|
135
|
+
visible: true,
|
|
136
|
+
isDisabled: false,
|
|
137
|
+
checked: false,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 17,
|
|
141
|
+
title: "Algebra 101",
|
|
142
|
+
selected: false,
|
|
143
|
+
initiallyVisible: true,
|
|
144
|
+
visible: true,
|
|
145
|
+
isDisabled: false,
|
|
146
|
+
checked: false,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 29,
|
|
150
|
+
title: "Music",
|
|
151
|
+
selected: false,
|
|
152
|
+
initiallyVisible: true,
|
|
153
|
+
visible: true,
|
|
154
|
+
isDisabled: false,
|
|
155
|
+
checked: false,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 30,
|
|
159
|
+
title: "Astronomy",
|
|
160
|
+
selected: false,
|
|
161
|
+
initiallyVisible: true,
|
|
162
|
+
visible: true,
|
|
163
|
+
isDisabled: false,
|
|
164
|
+
checked: false,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 31,
|
|
168
|
+
title: "Pharmacology",
|
|
169
|
+
selected: false,
|
|
170
|
+
initiallyVisible: true,
|
|
171
|
+
visible: true,
|
|
172
|
+
isDisabled: false,
|
|
173
|
+
checked: false,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 32,
|
|
177
|
+
title: "German Basics",
|
|
178
|
+
selected: false,
|
|
179
|
+
initiallyVisible: true,
|
|
180
|
+
visible: true,
|
|
181
|
+
isDisabled: false,
|
|
182
|
+
checked: false,
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
initiallyVisible: true,
|
|
186
|
+
visible: true,
|
|
187
|
+
isDisabled: false,
|
|
188
|
+
checked: false,
|
|
189
|
+
isChildrenVisible: true,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 43234,
|
|
193
|
+
title: "German Basics 1",
|
|
194
|
+
selected: false,
|
|
195
|
+
initiallyVisible: true,
|
|
196
|
+
visible: true,
|
|
197
|
+
isDisabled: false,
|
|
198
|
+
checked: false,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: 434,
|
|
202
|
+
title: "German Basics 2",
|
|
203
|
+
selected: false,
|
|
204
|
+
initiallyVisible: true,
|
|
205
|
+
visible: true,
|
|
206
|
+
isDisabled: false,
|
|
207
|
+
checked: false,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 4324,
|
|
211
|
+
title: "German Basics 3",
|
|
212
|
+
selected: false,
|
|
213
|
+
initiallyVisible: true,
|
|
214
|
+
visible: true,
|
|
215
|
+
isDisabled: false,
|
|
216
|
+
checked: false,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: 41224,
|
|
220
|
+
title: "German Basics 4",
|
|
221
|
+
selected: false,
|
|
222
|
+
initiallyVisible: true,
|
|
223
|
+
visible: true,
|
|
224
|
+
isDisabled: false,
|
|
225
|
+
checked: false,
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 990,
|
|
229
|
+
title: "German Basics 5",
|
|
230
|
+
selected: false,
|
|
231
|
+
initiallyVisible: true,
|
|
232
|
+
visible: true,
|
|
233
|
+
isDisabled: false,
|
|
234
|
+
checked: false,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: 122324,
|
|
238
|
+
title: "German Basics 6",
|
|
239
|
+
selected: false,
|
|
240
|
+
initiallyVisible: true,
|
|
241
|
+
visible: true,
|
|
242
|
+
isDisabled: false,
|
|
243
|
+
checked: false,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 9123123,
|
|
247
|
+
title: "German Basics 7",
|
|
248
|
+
selected: false,
|
|
249
|
+
initiallyVisible: true,
|
|
250
|
+
visible: true,
|
|
251
|
+
isDisabled: false,
|
|
252
|
+
checked: false,
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
export const Default = Template.bind({});
|
|
256
|
+
Default.args = {
|
|
257
|
+
options: testData,
|
|
258
|
+
initialSize: {
|
|
259
|
+
left: 0,
|
|
260
|
+
right: 100,
|
|
261
|
+
},
|
|
262
|
+
ariaLabel: "Search",
|
|
263
|
+
clearButtonMessage: "Clear",
|
|
264
|
+
placeholder: "Please select",
|
|
265
|
+
};
|
|
266
|
+
Default.decorators = [
|
|
267
|
+
() => ({
|
|
268
|
+
template: '<div style="padding-top: 50px"><story /></div>',
|
|
269
|
+
}),
|
|
270
|
+
];
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
@import "../../../assets/scss/variables/colors.scss";
|
|
2
|
+
@import "../../../assets/scss/typography.scss";
|
|
3
|
+
@import "../../../assets/scss/mixins.scss";
|
|
4
|
+
|
|
5
|
+
$option-hover-bg: $gray-100;
|
|
6
|
+
$option-checked-bg: $gray-100;
|
|
7
|
+
$option-checked-hover-bg: $blue-50;
|
|
8
|
+
|
|
9
|
+
.not-tree-child {
|
|
10
|
+
.tree-select-option {
|
|
11
|
+
.tree-select-option-label {
|
|
12
|
+
padding-left: 15px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tree-select-option {
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
.popover-wrapper {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tree-select-option-label {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
height: 36px;
|
|
29
|
+
padding: 0 5px 0 44px;
|
|
30
|
+
|
|
31
|
+
.ib-checkbox {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
|
|
35
|
+
&:focus {
|
|
36
|
+
.ib-checkbox-body {
|
|
37
|
+
outline: none!important;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ib-checkbox-body {
|
|
43
|
+
padding: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.option-label {
|
|
47
|
+
margin-left: 15px;
|
|
48
|
+
@include Ib-H4-regular;
|
|
49
|
+
@include lineClamp(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.toggle-children {
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 5px;
|
|
56
|
+
left: 15px;
|
|
57
|
+
z-index: 100;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ib-checkbox-body {
|
|
61
|
+
padding: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ib-list {
|
|
65
|
+
margin: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:focus {
|
|
69
|
+
outline: none;
|
|
70
|
+
& > .ib-button {
|
|
71
|
+
|
|
72
|
+
& + .tree-select-option-label {
|
|
73
|
+
@include outline();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ib-list .tree-select-option-label {
|
|
78
|
+
outline: none;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.tree-select-option-checked {
|
|
83
|
+
background-color: $option-checked-bg;
|
|
84
|
+
|
|
85
|
+
.tree-select-option-label {
|
|
86
|
+
&:hover {
|
|
87
|
+
background-color: $option-checked-hover-bg;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.tree-select-option-label {
|
|
93
|
+
&:hover {
|
|
94
|
+
background-color: $option-hover-bg;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.is-not-multiple {
|
|
99
|
+
border-left: 2px solid transparent;
|
|
100
|
+
&:hover {
|
|
101
|
+
border-left-color: $option-hover-bg;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.tree-select-option-checked {
|
|
105
|
+
border-left-color: $blue-900;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.tree-select-option-label .option-label {
|
|
109
|
+
margin-left: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.tree-select-option {
|
|
114
|
+
.toggle-children,
|
|
115
|
+
.option-label,
|
|
116
|
+
.ib-checkbox {
|
|
117
|
+
transform: translateX(25px);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.option-label {
|
|
121
|
+
width: calc(100% - 50px);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.tree-select-option {
|
|
125
|
+
.toggle-children,
|
|
126
|
+
.option-label,
|
|
127
|
+
.ib-checkbox {
|
|
128
|
+
transform: translateX(50px);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.option-label {
|
|
132
|
+
width: calc(100% - 75px);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.tree-select-option {
|
|
136
|
+
.toggle-children,
|
|
137
|
+
.option-label,
|
|
138
|
+
.ib-checkbox {
|
|
139
|
+
transform: translateX(75px);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.option-label {
|
|
143
|
+
width: calc(100% - 100px);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.tree-select-option {
|
|
147
|
+
.toggle-children,
|
|
148
|
+
.option-label,
|
|
149
|
+
.ib-checkbox {
|
|
150
|
+
transform: translateX(100px);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.option-label {
|
|
154
|
+
width: calc(100% - 125px);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.tree-select-option {
|
|
158
|
+
.toggle-children,
|
|
159
|
+
.option-label,
|
|
160
|
+
.ib-checkbox {
|
|
161
|
+
transform: translateX(125px);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.option-label {
|
|
165
|
+
width: calc(100% - 150px);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.tree-select-option-toggle {
|
|
174
|
+
position: relative;
|
|
175
|
+
|
|
176
|
+
&.tree-select-option-checked {
|
|
177
|
+
background-color: $option-checked-bg;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.ib-tooltip {
|
|
181
|
+
position: initial;
|
|
182
|
+
|
|
183
|
+
.option-label {
|
|
184
|
+
position: absolute;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
.ib-toggle-container {
|
|
190
|
+
position: absolute;
|
|
191
|
+
right: 0;
|
|
192
|
+
top: 50%;
|
|
193
|
+
transform: translateY(-50%);
|
|
194
|
+
|
|
195
|
+
&:focus {
|
|
196
|
+
outline: none!important;
|
|
197
|
+
}
|
|
198
|
+
&:hover,
|
|
199
|
+
&.toggle-on {
|
|
200
|
+
background-color: transparent;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
@import "../../../assets/scss/variables/shadows.scss";
|
|
2
|
+
@import "../../../assets/scss/variables/colors.scss";
|
|
3
|
+
@import "../../../assets/scss/typography.scss";
|
|
4
|
+
@import "../../../assets/scss/mixins.scss";
|
|
5
|
+
|
|
6
|
+
$choice-bg: $gray-100;
|
|
7
|
+
$choice-border-color: $gray-500;
|
|
8
|
+
$choice-text-color: $neutral-900;
|
|
9
|
+
|
|
10
|
+
$menu-bg: $white;
|
|
11
|
+
$menu-shadow: $ib-shadow-3;
|
|
12
|
+
|
|
13
|
+
$choice-hover-bg: $blue-100;
|
|
14
|
+
$choice-hover-border-color: $blue-800;
|
|
15
|
+
$choice-hover-icon-color: $blue-700;
|
|
16
|
+
|
|
17
|
+
$choice-opened-bg: $blue-50;
|
|
18
|
+
$choice-opened-border-color: $blue-900;
|
|
19
|
+
$choice-opened-icon-color: $blue-900;
|
|
20
|
+
|
|
21
|
+
$tree-search-border-color: $gray-600;
|
|
22
|
+
.tree-select {
|
|
23
|
+
.dropdown-trigger {
|
|
24
|
+
display: inline-block;
|
|
25
|
+
position: relative;
|
|
26
|
+
|
|
27
|
+
.button-clear {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 50%;
|
|
30
|
+
transform: translateY(-50%);
|
|
31
|
+
right: 31px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.tree-select-caret {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
transform: translateY(-50%);
|
|
38
|
+
right: 10px;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
.tree-choice {
|
|
46
|
+
background-color: $choice-hover-bg;
|
|
47
|
+
border-bottom-color: $choice-hover-border-color;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tree-select-caret {
|
|
51
|
+
color: $choice-hover-icon-color;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.tree-choice {
|
|
57
|
+
@include Ib-H4-regular;
|
|
58
|
+
padding: 0 5px 0 15px;
|
|
59
|
+
height: 36px;
|
|
60
|
+
background-color: $choice-bg;
|
|
61
|
+
color: $choice-text-color;
|
|
62
|
+
border-radius: 4px 4px 0 0;
|
|
63
|
+
width: 280px;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
position: relative;
|
|
69
|
+
padding-right: 40px;
|
|
70
|
+
border-bottom: 1px solid $choice-border-color;
|
|
71
|
+
transition: background-color 0.3s, border-color 0.3s, border-radius 0.3s;
|
|
72
|
+
|
|
73
|
+
&.has-clear-button {
|
|
74
|
+
padding-right: 30px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
span {
|
|
78
|
+
@include lineClamp(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:focus {
|
|
82
|
+
border-radius: 4px;
|
|
83
|
+
border-bottom-color: transparent;
|
|
84
|
+
@include outline();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.tree-choice-opened {
|
|
88
|
+
background-color: $choice-opened-bg;
|
|
89
|
+
border-bottom-color: $choice-opened-border-color;
|
|
90
|
+
|
|
91
|
+
.tree-select-caret {
|
|
92
|
+
color: $choice-opened-icon-color;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.button-clear {
|
|
98
|
+
margin-left: auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.tree-drop {
|
|
102
|
+
z-index: 9998;
|
|
103
|
+
box-shadow: $menu-shadow;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
position: absolute;
|
|
106
|
+
display: block;
|
|
107
|
+
background-color: $menu-bg;
|
|
108
|
+
min-width: 100%;
|
|
109
|
+
width: fit-content;
|
|
110
|
+
max-height: 415px;
|
|
111
|
+
padding: 6.5px 0;
|
|
112
|
+
top: 5px;
|
|
113
|
+
|
|
114
|
+
.tree-search {
|
|
115
|
+
background-color: transparent;
|
|
116
|
+
border-radius: 0!important;
|
|
117
|
+
border-bottom-color: $tree-search-border-color;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ib-input-wrapper {
|
|
121
|
+
margin-bottom: 6.5px;
|
|
122
|
+
|
|
123
|
+
& > div {
|
|
124
|
+
overflow: visible;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ib-list {
|
|
129
|
+
margin: 0;
|
|
130
|
+
overflow: auto;
|
|
131
|
+
max-height: 360px;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ib-dropdown-menu {
|
|
136
|
+
position: inherit;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.ib-dropdown-resizer {
|
|
140
|
+
position: absolute;
|
|
141
|
+
cursor: move;
|
|
142
|
+
background: transparent;
|
|
143
|
+
z-index: 2;
|
|
144
|
+
|
|
145
|
+
&.ib-dropdown-resizer-left,
|
|
146
|
+
&.ib-dropdown-resizer-right {
|
|
147
|
+
width: 3px;
|
|
148
|
+
top: 0;
|
|
149
|
+
bottom: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.ib-dropdown-resizer-left {
|
|
153
|
+
left: 0;
|
|
154
|
+
cursor: w-resize;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.ib-dropdown-resizer-right {
|
|
158
|
+
right: 0;
|
|
159
|
+
cursor: e-resize;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tree-select-empty {
|
|
164
|
+
text-align: center;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const ESC_KEY_CODE = 27;
|
|
2
|
+
export const SPACE_KEY_CODE = 32;
|
|
3
|
+
export const ENTER_KEY_CODE = 13;
|
|
4
|
+
export const TAB_KEY_CODE = 9;
|
|
5
|
+
export const ARROW_UP_KEY_CODE = 38;
|
|
6
|
+
export const ARROW_LEFT_KEY_CODE = 37;
|
|
7
|
+
export const ARROW_RIGHT_KEY_CODE = 39;
|
|
8
|
+
export const ARROW_DOWN_KEY_CODE = 40;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const { performance } = window;
|
|
2
|
+
const getEventLikeTimeStamp =
|
|
3
|
+
typeof performance?.now === "function" &&
|
|
4
|
+
Date.now() > document.createEvent("Event").timeStamp
|
|
5
|
+
? () => performance.now()
|
|
6
|
+
: () => Date.now();
|
|
7
|
+
|
|
8
|
+
const callbacks = new Map();
|
|
9
|
+
let listening = false;
|
|
10
|
+
|
|
11
|
+
const globalListener = (event) => {
|
|
12
|
+
callbacks.forEach(({ bindTimeStamp, callback }, element) => {
|
|
13
|
+
if (element.contains(event.target) || event.timeStamp <= bindTimeStamp) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
callback(event);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error(e);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const startListening = () => {
|
|
26
|
+
if (listening) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
document.addEventListener("click", globalListener, { capture: true });
|
|
31
|
+
listening = true;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const stopListening = () => {
|
|
35
|
+
if (!listening) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
document.removeEventListener("click", globalListener);
|
|
40
|
+
listening = false;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const created = (el, { value, arg = "click" }) => {
|
|
44
|
+
if (typeof value !== "function") {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`[OutsideDirective] Value must be a function; got ${typeof value}!`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (arg !== "click") {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`[OutsideDirective] Cannot bind ${arg} events; only click events are currently supported!`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (callbacks.has(el)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!listening) {
|
|
61
|
+
startListening();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
callbacks.set(el, {
|
|
65
|
+
bindTimeStamp: getEventLikeTimeStamp(),
|
|
66
|
+
callback: value,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const beforeUnmount = (el) => {
|
|
71
|
+
callbacks.delete(el);
|
|
72
|
+
|
|
73
|
+
if (callbacks.size === 0) {
|
|
74
|
+
stopListening();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const OutsideDirective = {
|
|
79
|
+
created,
|
|
80
|
+
beforeUnmount,
|
|
81
|
+
};
|