@avakhula/ui 0.1.22 → 0.1.23

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.
Files changed (114) hide show
  1. package/dist/App.js +23 -0
  2. package/dist/EventEmmiter.js +33 -0
  3. package/dist/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
  4. package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  5. package/dist/chunks/floating-ui.dom-D8OVFdyL.js +861 -0
  6. package/dist/chunks/vue-quill.esm-bundler-FvTqp_xR.js +9070 -0
  7. package/dist/components/Accordion/Accordion.js +81 -0
  8. package/dist/components/Alert/Alert.js +121 -0
  9. package/dist/components/Alert/constants.js +10 -0
  10. package/dist/components/Avatar/Avatar.js +75 -0
  11. package/dist/components/Avatar/constants.js +12 -0
  12. package/dist/components/Badge/Badge.js +29 -0
  13. package/dist/components/Breadcrumbs/Breadcrumbs.js +117 -0
  14. package/dist/components/Button/Button.js +140 -0
  15. package/dist/components/Button/constants.js +11 -0
  16. package/dist/components/ButtonGroup/ButtonGroup.js +14 -0
  17. package/dist/components/Chips/Chips.js +65 -0
  18. package/dist/components/Dropdown/Dropdown.js +228 -0
  19. package/dist/components/Dropdown/DropdownDivider.js +10 -0
  20. package/dist/components/Dropdown/DropdownItem.js +50 -0
  21. package/dist/components/Dropdown/DropdownList.js +104 -0
  22. package/dist/components/Dropdown/constants.js +12 -0
  23. package/dist/components/Form/CharactersCount.js +33 -0
  24. package/dist/components/Form/Checkbox/Checkbox.js +171 -0
  25. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +81 -0
  26. package/dist/components/Form/DatePicker/DatePicker.js +1782 -0
  27. package/dist/components/Form/DatePicker/Icons/chevron-back.js +8 -0
  28. package/dist/components/Form/DatePicker/Icons/chevron-forward.js +8 -0
  29. package/dist/components/Form/FormGroup/FormGroup.js +30 -0
  30. package/dist/components/Form/FormGroup/FormGroupSet.js +44 -0
  31. package/dist/components/Form/Input/Input.js +375 -0
  32. package/dist/components/Form/Input/constants.js +9 -0
  33. package/dist/components/Form/Label/Label.js +87 -0
  34. package/dist/components/Form/PhoneInput/PhoneInput.js +3811 -0
  35. package/dist/components/Form/Radio/Radio.js +91 -0
  36. package/dist/components/Form/TextEditor/TextEditor.js +422 -0
  37. package/dist/components/Form/TextEditor/Toolbar.js +291 -0
  38. package/dist/components/Form/TextEditor/icons/toolbarIcons.js +109 -0
  39. package/dist/components/Form/TextEditor/plugins/alphabetList.js +31 -0
  40. package/dist/components/Form/TextEditor/plugins/imageBlot.js +16 -0
  41. package/dist/components/Form/TextEditor/setupTextEditor.js +27 -0
  42. package/dist/components/Form/Textarea/Textarea.js +121 -0
  43. package/dist/components/Form/Toggle/Toggle.js +134 -0
  44. package/dist/components/Icon.js +37 -0
  45. package/dist/components/IconButton/IconButton.js +93 -0
  46. package/dist/components/IconButton/constants.js +15 -0
  47. package/dist/components/List.js +66 -0
  48. package/dist/components/Modal/Modal.js +198 -0
  49. package/dist/components/Modal/constants.js +9 -0
  50. package/dist/components/Pagination/LimitSelector.js +73 -0
  51. package/dist/components/Pagination/Pagination.js +226 -0
  52. package/dist/components/Panel/Panel.js +107 -0
  53. package/dist/components/Popover/Popover.js +105 -0
  54. package/dist/components/Popover/constants.js +17 -0
  55. package/dist/components/ProgressBar/ProgressBar.js +63 -0
  56. package/dist/components/ProgressBar/constants.js +10 -0
  57. package/dist/components/Sorting/Sorting.js +182 -0
  58. package/dist/components/Sorting/constants.js +12 -0
  59. package/dist/components/SplitButton/SplitButton.js +145 -0
  60. package/dist/components/SplitButton/SplitButtonItem.js +34 -0
  61. package/dist/components/SplitButton/constants.js +7 -0
  62. package/dist/components/StatusIndicator/StatusIndicator.js +29 -0
  63. package/dist/components/StatusIndicator/constants.js +13 -0
  64. package/dist/components/StatusIndicator/icons.js +44 -0
  65. package/dist/components/Table/Cells/Cell.js +39 -0
  66. package/dist/components/Table/Cells/CheckboxCell.js +37 -0
  67. package/dist/components/Table/Row.js +14 -0
  68. package/dist/components/Table/Table.js +24 -0
  69. package/dist/components/Tabs/Tab.js +47 -0
  70. package/dist/components/Tabs/TabDropdown.js +94 -0
  71. package/dist/components/Tabs/Tabs.js +128 -0
  72. package/dist/components/TagPill/TagPill.js +61 -0
  73. package/dist/components/TagPill/constants.js +12 -0
  74. package/dist/components/ToggleTip/ToggleTip.js +91 -0
  75. package/dist/components/ToggleTip/constants.js +17 -0
  76. package/dist/components/Tooltip/Tooltip.js +46 -0
  77. package/dist/components/TreeSelect/Option.js +302 -0
  78. package/dist/components/TreeSelect/Select.js +1871 -0
  79. package/dist/components/TreeSelect/mixins/InfinityLoaderMixin.js +32 -0
  80. package/dist/constants/events.js +5 -0
  81. package/dist/constants/keyCodes.js +12 -0
  82. package/dist/directives/outside/outside.js +37 -0
  83. package/dist/directives/tooltip/TooltipController.js +116 -0
  84. package/dist/directives/tooltip/textOverflowTooltip.js +23 -0
  85. package/dist/directives/tooltip/tooltip.js +48 -0
  86. package/dist/helpers/debounce.js +14 -0
  87. package/dist/helpers/generateUID.js +6 -0
  88. package/dist/helpers/getHrefFromID.js +6 -0
  89. package/dist/helpers/multiLineOverflows.js +6 -0
  90. package/dist/helpers/removeEvents.js +8 -0
  91. package/dist/helpers/stripHtml.js +6 -0
  92. package/dist/index.css +1 -1
  93. package/dist/index.js +103 -22665
  94. package/dist/main.js +10 -0
  95. package/dist/mixins/expandAnimation.js +24 -0
  96. package/package.json +7 -4
  97. package/src/components/Form/Textarea/Textarea.vue +8 -4
  98. package/.babelrc.json +0 -14
  99. package/.eslintrc.cjs +0 -22
  100. package/.nvmrc +0 -1
  101. package/.prettierrc.json +0 -1
  102. package/.storybook/intelliboardTheme.js +0 -10
  103. package/.storybook/main.js +0 -25
  104. package/.storybook/manager.js +0 -7
  105. package/.storybook/preview-head.html +0 -12
  106. package/.storybook/preview.js +0 -25
  107. package/.storybook/scss-loader.scss +0 -6
  108. package/.storybook/withSource.js +0 -97
  109. package/dist/index.umd.cjs +0 -238
  110. package/index.html +0 -21
  111. package/static/Logo.svg +0 -25
  112. package/static/docks/button.pdf +0 -147566
  113. package/static/favicon.ico +0 -0
  114. package/vite.config.js +0 -47
@@ -0,0 +1,302 @@
1
+ import D from "../Form/Checkbox/Checkbox.js";
2
+ import I from "../Form/Toggle/Toggle.js";
3
+ import M from "../List.js";
4
+ import E from "../Icon.js";
5
+ import S from "../IconButton/IconButton.js";
6
+ import { TooltipDirective as A } from "../../directives/tooltip/tooltip.js";
7
+ import O from "../../helpers/generateUID.js";
8
+ import L from "../../helpers/multiLineOverflows.js";
9
+ import { SPACE_KEY_CODE as N, ARROW_RIGHT_KEY_CODE as K, ARROW_LEFT_KEY_CODE as x } from "../../constants/keyCodes.js";
10
+ import { resolveComponent as d, resolveDirective as H, createElementBlock as l, openBlock as n, withDirectives as r, withModifiers as u, normalizeClass as f, createElementVNode as _, createCommentVNode as v, createVNode as p, withCtx as C, vShow as m, createBlock as c, resolveDynamicComponent as P, toDisplayString as b, Fragment as T, createTextVNode as R, renderList as F } from "vue";
11
+ import { _ as Y } from "../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
12
+ const z = {
13
+ name: "select-option",
14
+ props: {
15
+ option: {
16
+ type: Object
17
+ },
18
+ name: String,
19
+ parentAutoCheck: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ isMultiple: {
24
+ type: Boolean,
25
+ default: !0
26
+ },
27
+ uid: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ onlyEndNodes: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ htmlTitle: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ showInput: {
40
+ type: Boolean,
41
+ default: !0
42
+ },
43
+ isBookmarkable: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ isBookmarked: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
51
+ isToggle: {
52
+ type: Boolean,
53
+ default: !1
54
+ },
55
+ alphabeticStyle: {
56
+ type: Boolean,
57
+ default: !1
58
+ }
59
+ },
60
+ mounted() {
61
+ this.option.hasOwnProperty("children") && this.option.children && this.checkParent(), this.option.showTooltipByDefault && (this.showTooltip = !0);
62
+ },
63
+ updated() {
64
+ this.$nextTick(() => {
65
+ this.option.showTooltipByDefault ? this.showTooltip = !0 : L(this.$el.querySelector(".option-label")) && (this.showTooltip = !0);
66
+ });
67
+ },
68
+ data() {
69
+ return {
70
+ showTooltip: !1,
71
+ generateUID: O
72
+ };
73
+ },
74
+ methods: {
75
+ onKeydown(t) {
76
+ t.keyCode === N && (t.preventDefault(), this.onChange()), this.hasVisibleChildren && (t.keyCode === K && (this.option.isChildrenVisible = !0), t.keyCode === x && (this.option.isChildrenVisible = !1));
77
+ },
78
+ onChange() {
79
+ var t, i;
80
+ !this.isMultiple && !this.isChecked(this.option) && ((t = this.$refs.component) == null || t.onChange()), this.isMultiple && ((i = this.$refs.component) == null || i.onChange());
81
+ },
82
+ toggle(t, i = !0) {
83
+ this.check(this.option, t, !0, i);
84
+ },
85
+ check(t, i, e, h) {
86
+ if (!this.isMultiple && this.hasVisibleChildren) {
87
+ this.toggleChildrenVisibility();
88
+ return;
89
+ }
90
+ this.$emit("check", t, i, e), h && t.children && t.children.forEach((a) => {
91
+ this.check(a, i, !1, !0);
92
+ });
93
+ },
94
+ toggleChildrenVisibility() {
95
+ this.option.isChildrenVisible = !this.option.isChildrenVisible;
96
+ },
97
+ checkChildren(t, i, e) {
98
+ e && this.isMultiple && this.$nextTick(() => {
99
+ this.checkParent();
100
+ }), this.$emit("check", t, i, !1);
101
+ },
102
+ checkParent() {
103
+ const t = this.option.children.filter(
104
+ (e) => e.checked
105
+ ).length, i = t >= this.option.children.length;
106
+ (!this.option.checked && i || this.option.checked && !i) && this.parentAutoCheck && this.toggle(!this.option.checked, !1);
107
+ },
108
+ calculateChildren(t, i, e = !1) {
109
+ let h = 0;
110
+ return t.children && t.children.forEach((a) => {
111
+ (!i || i(a)) && h++, e && (h += this.calculateChildren(a, i, e));
112
+ }), h;
113
+ },
114
+ isChecked(t) {
115
+ if (this.hasChildren) {
116
+ const i = this.childrenSelectedCount;
117
+ if (i > 0 && this.countOfAllChildren > i || !i && this.option.checked && !this.parentAutoCheck || this.countOfAllChildren == i && !this.option.checked && !this.parentAutoCheck)
118
+ return null;
119
+ }
120
+ return t.checked ? !0 : t.isIndeterminate ? null : !1;
121
+ }
122
+ },
123
+ computed: {
124
+ component() {
125
+ return this.isMultiple && this.isToggle ? I : D;
126
+ },
127
+ hasChildren() {
128
+ return !!(this.option.children && this.option.children.length);
129
+ },
130
+ hasVisibleChildren() {
131
+ return this.calculateChildren(this.option, (t) => t.visible);
132
+ },
133
+ iconName() {
134
+ return this.option.isChildrenVisible ? "chevron-down" : "chevron-forward";
135
+ },
136
+ id() {
137
+ return this.uid + "_" + this.option.id;
138
+ },
139
+ actualName() {
140
+ return this.onlyEndNodes && this.option.children && this.option.children.length ? "" : this.name;
141
+ },
142
+ childrenSelectedCount() {
143
+ return this.calculateChildren(
144
+ this.option,
145
+ (t) => t.checked,
146
+ !0
147
+ );
148
+ },
149
+ countOfAllChildren() {
150
+ return this.calculateChildren(this.option, () => !0, !0);
151
+ }
152
+ },
153
+ components: {
154
+ IbIcon: E,
155
+ List: M,
156
+ IbIconButton: S
157
+ },
158
+ directives: { Tooltip: A }
159
+ }, U = ["aria-selected", "aria-label", "id"], W = {
160
+ key: 0,
161
+ class: "bookmarkable-option-content"
162
+ }, j = { class: "option-label" }, q = {
163
+ key: 1,
164
+ class: "option-label"
165
+ }, G = ["innerHTML"], J = ["innerHTML"], Q = {
166
+ key: 2,
167
+ class: "option-label"
168
+ };
169
+ function X(t, i, e, h, a, o) {
170
+ const k = d("ib-icon"), g = d("ib-icon-button"), w = d("select-option"), B = d("list"), y = H("tooltip");
171
+ return n(), l("li", null, [
172
+ r((n(), l("div", {
173
+ class: f(["tree-select-option", {
174
+ "tree-select-option-checked": e.option.checked,
175
+ "tree-select-option-indeterminate": o.isChecked(e.option) === null,
176
+ "tree-select-option-margin": o.hasVisibleChildren,
177
+ active: e.option.isChildrenVisible,
178
+ "is-multiple": e.isMultiple,
179
+ "is-not-multiple": !e.isMultiple,
180
+ "has-icon": e.option.icon,
181
+ "tree-select-option-toggle": this.isToggle && this.isMultiple,
182
+ "alphabetic-option": e.alphabeticStyle
183
+ }]),
184
+ tabindex: "0",
185
+ role: "option",
186
+ "aria-selected": o.isChecked(e.option),
187
+ "aria-label": e.option.title,
188
+ id: "option-" + o.id,
189
+ onKeydown: i[3] || (i[3] = u((...s) => o.onKeydown && o.onKeydown(...s), ["self"])),
190
+ onFocus: i[4] || (i[4] = (s) => t.$emit("onFocus", `option-${o.id}`))
191
+ }, [
192
+ r(p(g, {
193
+ "disabled-focus": !0,
194
+ kind: "ghost",
195
+ class: "toggle-children",
196
+ onClick: u(o.toggleChildrenVisibility, ["prevent"])
197
+ }, {
198
+ default: C(() => [
199
+ p(k, { name: o.iconName }, null, 8, ["name"])
200
+ ]),
201
+ _: 1
202
+ }, 8, ["onClick"]), [
203
+ [m, o.hasVisibleChildren]
204
+ ]),
205
+ _("div", {
206
+ onClick: i[1] || (i[1] = u((...s) => o.onChange && o.onChange(...s), ["prevent"])),
207
+ class: f({
208
+ disabled: e.option.isDisabled,
209
+ "tree-select-option-label": !0,
210
+ "tree-select-option-has-children": o.hasVisibleChildren,
211
+ active: !e.showInput && e.option.checked
212
+ })
213
+ }, [
214
+ r((n(), c(P(o.component), {
215
+ ref: "component",
216
+ tabindex: "-1",
217
+ "disable-focus": "",
218
+ "aria-label": e.option.title,
219
+ name: o.actualName,
220
+ value: e.option.id,
221
+ id: "input" + o.id + a.generateUID(),
222
+ "is-checked": o.isChecked(e.option),
223
+ disabled: e.option.isDisabled,
224
+ readonly: e.option.readonly,
225
+ autocomplete: "off",
226
+ autocorrect: "off",
227
+ autocapitalize: "off",
228
+ spellcheck: "false",
229
+ onInput: o.toggle
230
+ }, null, 40, ["aria-label", "name", "value", "id", "is-checked", "disabled", "readonly", "onInput"])), [
231
+ [m, e.showInput]
232
+ ]),
233
+ e.isBookmarkable ? (n(), l("span", {
234
+ key: 0,
235
+ class: f(
236
+ "bookmarkable-option-title " + (e.isBookmarked ? "bookmarked" : "")
237
+ )
238
+ }, [
239
+ o.hasChildren ? (n(), l("span", q, b(e.option.title), 1)) : (n(), l("div", W, [
240
+ _("span", j, b(e.option.title), 1),
241
+ r((n(), c(g, {
242
+ onClick: i[0] || (i[0] = u((s) => t.$emit("toggle-bookmark", e.option), ["stop", "prevent"])),
243
+ kind: "ghost"
244
+ }, {
245
+ default: C(() => [
246
+ p(k, {
247
+ name: e.isBookmarked ? "star" : "star-outline"
248
+ }, null, 8, ["name"])
249
+ ]),
250
+ _: 1
251
+ })), [
252
+ [y, t.lang(e.isBookmarked ? "unpin" : "pin_to_top", "select")]
253
+ ])
254
+ ]))
255
+ ], 2)) : e.htmlTitle ? (n(), l(T, { key: 1 }, [
256
+ o.hasChildren ? (n(), l("span", {
257
+ key: 1,
258
+ class: "option-label",
259
+ innerHTML: e.option.title
260
+ }, null, 8, J)) : (n(), l("span", {
261
+ key: 0,
262
+ class: "option-label",
263
+ innerHTML: e.option.title
264
+ }, null, 8, G))
265
+ ], 64)) : (n(), l("span", Q, [
266
+ e.option.icon ? (n(), c(k, {
267
+ key: 0,
268
+ name: e.option.icon
269
+ }, null, 8, ["name"])) : v("", !0),
270
+ R(" " + b(e.option.title), 1)
271
+ ]))
272
+ ], 2),
273
+ o.hasChildren ? r((n(), c(B, { key: 0 }, {
274
+ default: C(() => [
275
+ (n(!0), l(T, null, F(e.option.children, (s) => r((n(), c(w, {
276
+ key: s.value,
277
+ option: s,
278
+ name: e.name,
279
+ "parent-auto-check": e.parentAutoCheck,
280
+ "is-multiple": e.isMultiple,
281
+ "show-input": e.showInput,
282
+ onCheck: o.checkChildren,
283
+ onToggleBookmark: i[2] || (i[2] = (V) => t.$emit("toggle-bookmark", V)),
284
+ uid: e.uid,
285
+ "is-bookmarkable": e.isBookmarkable
286
+ }, null, 8, ["option", "name", "parent-auto-check", "is-multiple", "show-input", "onCheck", "uid", "is-bookmarkable"])), [
287
+ [m, s.visible]
288
+ ])), 128))
289
+ ]),
290
+ _: 1
291
+ }, 512)), [
292
+ [m, o.hasVisibleChildren && e.option.isChildrenVisible]
293
+ ]) : v("", !0)
294
+ ], 42, U)), [
295
+ [y, a.showTooltip ? e.option.isDisabled ? e.option.disableTooltip : e.option.title : ""]
296
+ ])
297
+ ]);
298
+ }
299
+ const re = /* @__PURE__ */ Y(z, [["render", X]]);
300
+ export {
301
+ re as default
302
+ };