@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.
- package/dist/App.js +23 -0
- package/dist/EventEmmiter.js +33 -0
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/chunks/floating-ui.dom-D8OVFdyL.js +861 -0
- package/dist/chunks/vue-quill.esm-bundler-FvTqp_xR.js +9070 -0
- package/dist/components/Accordion/Accordion.js +81 -0
- package/dist/components/Alert/Alert.js +121 -0
- package/dist/components/Alert/constants.js +10 -0
- package/dist/components/Avatar/Avatar.js +75 -0
- package/dist/components/Avatar/constants.js +12 -0
- package/dist/components/Badge/Badge.js +29 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +117 -0
- package/dist/components/Button/Button.js +140 -0
- package/dist/components/Button/constants.js +11 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +14 -0
- package/dist/components/Chips/Chips.js +65 -0
- package/dist/components/Dropdown/Dropdown.js +228 -0
- package/dist/components/Dropdown/DropdownDivider.js +10 -0
- package/dist/components/Dropdown/DropdownItem.js +50 -0
- package/dist/components/Dropdown/DropdownList.js +104 -0
- package/dist/components/Dropdown/constants.js +12 -0
- package/dist/components/Form/CharactersCount.js +33 -0
- package/dist/components/Form/Checkbox/Checkbox.js +171 -0
- package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +81 -0
- package/dist/components/Form/DatePicker/DatePicker.js +1782 -0
- package/dist/components/Form/DatePicker/Icons/chevron-back.js +8 -0
- package/dist/components/Form/DatePicker/Icons/chevron-forward.js +8 -0
- package/dist/components/Form/FormGroup/FormGroup.js +30 -0
- package/dist/components/Form/FormGroup/FormGroupSet.js +44 -0
- package/dist/components/Form/Input/Input.js +375 -0
- package/dist/components/Form/Input/constants.js +9 -0
- package/dist/components/Form/Label/Label.js +87 -0
- package/dist/components/Form/PhoneInput/PhoneInput.js +3811 -0
- package/dist/components/Form/Radio/Radio.js +91 -0
- package/dist/components/Form/TextEditor/TextEditor.js +422 -0
- package/dist/components/Form/TextEditor/Toolbar.js +291 -0
- package/dist/components/Form/TextEditor/icons/toolbarIcons.js +109 -0
- package/dist/components/Form/TextEditor/plugins/alphabetList.js +31 -0
- package/dist/components/Form/TextEditor/plugins/imageBlot.js +16 -0
- package/dist/components/Form/TextEditor/setupTextEditor.js +27 -0
- package/dist/components/Form/Textarea/Textarea.js +121 -0
- package/dist/components/Form/Toggle/Toggle.js +134 -0
- package/dist/components/Icon.js +37 -0
- package/dist/components/IconButton/IconButton.js +93 -0
- package/dist/components/IconButton/constants.js +15 -0
- package/dist/components/List.js +66 -0
- package/dist/components/Modal/Modal.js +198 -0
- package/dist/components/Modal/constants.js +9 -0
- package/dist/components/Pagination/LimitSelector.js +73 -0
- package/dist/components/Pagination/Pagination.js +226 -0
- package/dist/components/Panel/Panel.js +107 -0
- package/dist/components/Popover/Popover.js +105 -0
- package/dist/components/Popover/constants.js +17 -0
- package/dist/components/ProgressBar/ProgressBar.js +63 -0
- package/dist/components/ProgressBar/constants.js +10 -0
- package/dist/components/Sorting/Sorting.js +182 -0
- package/dist/components/Sorting/constants.js +12 -0
- package/dist/components/SplitButton/SplitButton.js +145 -0
- package/dist/components/SplitButton/SplitButtonItem.js +34 -0
- package/dist/components/SplitButton/constants.js +7 -0
- package/dist/components/StatusIndicator/StatusIndicator.js +29 -0
- package/dist/components/StatusIndicator/constants.js +13 -0
- package/dist/components/StatusIndicator/icons.js +44 -0
- package/dist/components/Table/Cells/Cell.js +39 -0
- package/dist/components/Table/Cells/CheckboxCell.js +37 -0
- package/dist/components/Table/Row.js +14 -0
- package/dist/components/Table/Table.js +24 -0
- package/dist/components/Tabs/Tab.js +47 -0
- package/dist/components/Tabs/TabDropdown.js +94 -0
- package/dist/components/Tabs/Tabs.js +128 -0
- package/dist/components/TagPill/TagPill.js +61 -0
- package/dist/components/TagPill/constants.js +12 -0
- package/dist/components/ToggleTip/ToggleTip.js +91 -0
- package/dist/components/ToggleTip/constants.js +17 -0
- package/dist/components/Tooltip/Tooltip.js +46 -0
- package/dist/components/TreeSelect/Option.js +302 -0
- package/dist/components/TreeSelect/Select.js +1871 -0
- package/dist/components/TreeSelect/mixins/InfinityLoaderMixin.js +32 -0
- package/dist/constants/events.js +5 -0
- package/dist/constants/keyCodes.js +12 -0
- package/dist/directives/outside/outside.js +37 -0
- package/dist/directives/tooltip/TooltipController.js +116 -0
- package/dist/directives/tooltip/textOverflowTooltip.js +23 -0
- package/dist/directives/tooltip/tooltip.js +48 -0
- package/dist/helpers/debounce.js +14 -0
- package/dist/helpers/generateUID.js +6 -0
- package/dist/helpers/getHrefFromID.js +6 -0
- package/dist/helpers/multiLineOverflows.js +6 -0
- package/dist/helpers/removeEvents.js +8 -0
- package/dist/helpers/stripHtml.js +6 -0
- package/dist/index.css +1 -1
- package/dist/index.js +103 -22665
- package/dist/main.js +10 -0
- package/dist/mixins/expandAnimation.js +24 -0
- package/package.json +7 -4
- package/src/components/Form/Textarea/Textarea.vue +8 -4
- package/.babelrc.json +0 -14
- package/.eslintrc.cjs +0 -22
- package/.nvmrc +0 -1
- package/.prettierrc.json +0 -1
- package/.storybook/intelliboardTheme.js +0 -10
- package/.storybook/main.js +0 -25
- package/.storybook/manager.js +0 -7
- package/.storybook/preview-head.html +0 -12
- package/.storybook/preview.js +0 -25
- package/.storybook/scss-loader.scss +0 -6
- package/.storybook/withSource.js +0 -97
- package/dist/index.umd.cjs +0 -238
- package/index.html +0 -21
- package/static/Logo.svg +0 -25
- package/static/docks/button.pdf +0 -147566
- package/static/favicon.ico +0 -0
- package/vite.config.js +0 -47
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import p from "../../../helpers/generateUID.js";
|
|
2
|
+
import b from "../../Icon.js";
|
|
3
|
+
import k from "../../Tooltip/Tooltip.js";
|
|
4
|
+
import { resolveComponent as r, createElementBlock as h, openBlock as i, withKeys as g, normalizeClass as _, withModifiers as a, createElementVNode as s, createCommentVNode as f, createBlock as y, createVNode as m, toDisplayString as C } from "vue";
|
|
5
|
+
import { _ as x } from "../../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const v = {
|
|
7
|
+
name: "IbToggle",
|
|
8
|
+
model: {
|
|
9
|
+
prop: "isChecked",
|
|
10
|
+
event: "input"
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
isChecked: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
required: !1
|
|
16
|
+
},
|
|
17
|
+
id: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: () => p()
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
name: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "active"
|
|
28
|
+
},
|
|
29
|
+
label: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
error: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
labelPosition: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "right"
|
|
40
|
+
},
|
|
41
|
+
helpMessage: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
44
|
+
},
|
|
45
|
+
helpMessageOff: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
watch: {
|
|
51
|
+
isChecked(c) {
|
|
52
|
+
this.checked = c;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
data() {
|
|
56
|
+
return {
|
|
57
|
+
checked: this.isChecked
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
onChange() {
|
|
62
|
+
this.disabled || (this.checked = !this.checked, this.$emit("input", this.checked));
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
classes() {
|
|
67
|
+
return {
|
|
68
|
+
"ib-toggle-container": !0,
|
|
69
|
+
"has-error": this.error,
|
|
70
|
+
"toggle-on": this.checked,
|
|
71
|
+
"toggle-disabled": this.disabled,
|
|
72
|
+
"label-position-left": this.labelPosition === "left"
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
components: { IbIcon: b, IbTooltip: k }
|
|
77
|
+
}, M = ["aria-checked", "tabindex"], S = {
|
|
78
|
+
class: "toggle-wrapper",
|
|
79
|
+
ref: "wrapper"
|
|
80
|
+
}, w = {
|
|
81
|
+
class: "toggle",
|
|
82
|
+
ref: "toggle"
|
|
83
|
+
}, B = ["name", "checked", "id", "disabled"], I = /* @__PURE__ */ s("span", { class: "toggle-slider round" }, null, -1), N = {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: "toggle-label"
|
|
86
|
+
};
|
|
87
|
+
function O(c, t, e, T, o, l) {
|
|
88
|
+
const d = r("ib-icon"), u = r("ib-tooltip");
|
|
89
|
+
return i(), h("label", {
|
|
90
|
+
role: "switch",
|
|
91
|
+
"aria-checked": o.checked,
|
|
92
|
+
tabindex: e.disabled ? -1 : 0,
|
|
93
|
+
class: _(l.classes),
|
|
94
|
+
onKeypress: [
|
|
95
|
+
t[2] || (t[2] = g(a((...n) => l.onChange && l.onChange(...n), ["prevent"]), ["space"])),
|
|
96
|
+
t[3] || (t[3] = g(a((...n) => l.onChange && l.onChange(...n), ["prevent"]), ["enter"]))
|
|
97
|
+
]
|
|
98
|
+
}, [
|
|
99
|
+
s("div", S, [
|
|
100
|
+
s("div", w, [
|
|
101
|
+
s("input", {
|
|
102
|
+
tabindex: "-1",
|
|
103
|
+
type: "checkbox",
|
|
104
|
+
value: "1",
|
|
105
|
+
name: e.name,
|
|
106
|
+
checked: o.checked,
|
|
107
|
+
id: e.id,
|
|
108
|
+
disabled: e.disabled,
|
|
109
|
+
onClick: t[0] || (t[0] = (...n) => l.onChange && l.onChange(...n)),
|
|
110
|
+
onInput: t[1] || (t[1] = a(() => {
|
|
111
|
+
}, ["stop"]))
|
|
112
|
+
}, null, 40, B),
|
|
113
|
+
I,
|
|
114
|
+
m(d, {
|
|
115
|
+
class: "checked-icon",
|
|
116
|
+
name: "checkmark"
|
|
117
|
+
}),
|
|
118
|
+
m(d, {
|
|
119
|
+
class: "unchecked-icon",
|
|
120
|
+
name: "close"
|
|
121
|
+
})
|
|
122
|
+
], 512)
|
|
123
|
+
], 512),
|
|
124
|
+
e.label.length ? (i(), h("span", N, C(e.label), 1)) : f("", !0),
|
|
125
|
+
e.helpMessage.length ? (i(), y(u, {
|
|
126
|
+
key: 1,
|
|
127
|
+
text: o.checked ? e.helpMessage : e.helpMessageOff.length ? e.helpMessageOff : e.helpMessage
|
|
128
|
+
}, null, 8, ["text"])) : f("", !0)
|
|
129
|
+
], 42, M);
|
|
130
|
+
}
|
|
131
|
+
const q = /* @__PURE__ */ x(v, [["render", O]]);
|
|
132
|
+
export {
|
|
133
|
+
q as default
|
|
134
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createElementBlock as o, openBlock as s, normalizeClass as r, normalizeStyle as c } from "vue";
|
|
2
|
+
import { _ as a } from "../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const i = {
|
|
4
|
+
name: "IbIcon",
|
|
5
|
+
props: {
|
|
6
|
+
name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
classes: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
styles: {
|
|
15
|
+
type: [String, Object],
|
|
16
|
+
default: ""
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
mounted() {
|
|
20
|
+
const n = setInterval(() => {
|
|
21
|
+
var t, e;
|
|
22
|
+
(e = (t = this.$refs.icon) == null ? void 0 : t.shadowRoot) != null && e.querySelector("title") && (this.$refs.icon.shadowRoot.querySelector("title").innerHTML = "", clearInterval(n));
|
|
23
|
+
}, 1e3);
|
|
24
|
+
}
|
|
25
|
+
}, l = ["name"];
|
|
26
|
+
function m(n, t, e, f, u, d) {
|
|
27
|
+
return s(), o("ion-icon", {
|
|
28
|
+
style: c(e.styles),
|
|
29
|
+
name: e.name,
|
|
30
|
+
class: r(e.classes + " ib-icon icon-" + e.name),
|
|
31
|
+
ref: "icon"
|
|
32
|
+
}, null, 14, l);
|
|
33
|
+
}
|
|
34
|
+
const h = /* @__PURE__ */ a(i, [["render", m]]);
|
|
35
|
+
export {
|
|
36
|
+
h as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import a from "../Button/Button.js";
|
|
2
|
+
import { TooltipDirective as l } from "../../directives/tooltip/tooltip.js";
|
|
3
|
+
import { iconButtonSize as i, iconButtonKindOptions as o } from "./constants.js";
|
|
4
|
+
import { resolveComponent as d, resolveDirective as c, withDirectives as u, createBlock as f, openBlock as p, mergeProps as b, withCtx as h, renderSlot as m } from "vue";
|
|
5
|
+
import { _ } from "../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const v = {
|
|
7
|
+
name: "IbIconButton",
|
|
8
|
+
props: {
|
|
9
|
+
kind: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: o.primary,
|
|
12
|
+
validator: (t) => Object.keys(o).includes(t)
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: i.s,
|
|
17
|
+
validator: (t) => Object.keys(i).includes(t)
|
|
18
|
+
},
|
|
19
|
+
rounded: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: !1,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: !1,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
href: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
to: {
|
|
34
|
+
type: [String, Object],
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
helpText: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
disabledFocus: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
preventDefault: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
tooltipVisible: !1
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
classes() {
|
|
57
|
+
const t = ["ib-icon-button"];
|
|
58
|
+
return t.push(`ib-icon-btn-${this.kind}`), t.push(`ib-icon-btn-${this.size}`), this.rounded && t.push("ib-icon-btn-rounded"), this.disabled && t.push("ib-icon-btn-disabled"), t;
|
|
59
|
+
},
|
|
60
|
+
attrs() {
|
|
61
|
+
const t = { ...this.$attrs };
|
|
62
|
+
return t.class = [...this.classes, t.class], this.disabledFocus && (t.tabindex = "-1"), t;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
components: {
|
|
66
|
+
IbButton: a
|
|
67
|
+
},
|
|
68
|
+
directives: {
|
|
69
|
+
Tooltip: l
|
|
70
|
+
},
|
|
71
|
+
inheritAttrs: !1
|
|
72
|
+
};
|
|
73
|
+
function y(t, B, e, k, S, s) {
|
|
74
|
+
const n = d("ib-button"), r = c("tooltip");
|
|
75
|
+
return u((p(), f(n, b(s.attrs, {
|
|
76
|
+
href: e.href,
|
|
77
|
+
to: e.to,
|
|
78
|
+
kind: e.kind,
|
|
79
|
+
disabled: e.disabled,
|
|
80
|
+
"prevent-default": e.preventDefault
|
|
81
|
+
}), {
|
|
82
|
+
default: h(() => [
|
|
83
|
+
m(t.$slots, "default")
|
|
84
|
+
]),
|
|
85
|
+
_: 3
|
|
86
|
+
}, 16, ["href", "to", "kind", "disabled", "prevent-default"])), [
|
|
87
|
+
[r, e.helpText]
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
const T = /* @__PURE__ */ _(v, [["render", y]]);
|
|
91
|
+
export {
|
|
92
|
+
T as default
|
|
93
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { buttonKindOptions as t } from "../Button/constants.js";
|
|
2
|
+
const o = {
|
|
3
|
+
[t.primary]: t.primary,
|
|
4
|
+
[t.tertiary]: t.tertiary,
|
|
5
|
+
[t.ghost]: t.ghost,
|
|
6
|
+
white: "white"
|
|
7
|
+
}, n = {
|
|
8
|
+
xs: "xs",
|
|
9
|
+
s: "s",
|
|
10
|
+
m: "m"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
o as iconButtonKindOptions,
|
|
14
|
+
n as iconButtonSize
|
|
15
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ARROW_DOWN_KEY_CODE as u, ARROW_UP_KEY_CODE as m } from "../constants/keyCodes.js";
|
|
2
|
+
import { createElementBlock as f, openBlock as p, normalizeClass as N, renderSlot as E } from "vue";
|
|
3
|
+
import { _ as h } from "../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const C = {
|
|
5
|
+
name: "IbList",
|
|
6
|
+
data() {
|
|
7
|
+
return {
|
|
8
|
+
rootClass: "ib-list"
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
methods: {
|
|
12
|
+
onKeydown(o) {
|
|
13
|
+
var i, d, a, l, r;
|
|
14
|
+
if (o.keyCode === u) {
|
|
15
|
+
if (this.$el.parentNode.closest(`.${this.rootClass}`)) return;
|
|
16
|
+
o.preventDefault();
|
|
17
|
+
const e = document.activeElement, t = e.querySelector(`.${this.rootClass}`);
|
|
18
|
+
let n = e.nextElementSibling ? e.nextElementSibling : (i = e.parentNode.nextElementSibling) == null ? void 0 : i.childNodes[0];
|
|
19
|
+
if (t && window.getComputedStyle(t).display !== "none") {
|
|
20
|
+
t.querySelector('a, button, input, [tabindex="0"]').focus();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (n) {
|
|
24
|
+
n.focus();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const s = (a = (d = e.closest(`.${this.rootClass}`).parentNode) == null ? void 0 : d.parentNode) == null ? void 0 : a.nextElementSibling.childNodes[0];
|
|
28
|
+
s && s.nodeName !== "#text" && s.focus();
|
|
29
|
+
}
|
|
30
|
+
if (o.keyCode === m) {
|
|
31
|
+
if (this.$el.parentNode.closest(`.${this.rootClass}`)) return;
|
|
32
|
+
o.preventDefault();
|
|
33
|
+
const e = document.activeElement, t = e.previousElementSibling ? e.previousElementSibling : (l = e.parentNode.previousElementSibling) == null ? void 0 : l.childNodes[0];
|
|
34
|
+
if (!t) {
|
|
35
|
+
e.closest(`.${this.rootClass}`).parentNode.focus();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (t && t.nodeName !== "#text") {
|
|
39
|
+
const n = t == null ? void 0 : t.querySelector(
|
|
40
|
+
`.${this.rootClass}`
|
|
41
|
+
);
|
|
42
|
+
if (n && window.getComputedStyle(n).display !== "none") {
|
|
43
|
+
const s = Array.from(n.childNodes).filter(
|
|
44
|
+
(c) => c.nodeName !== "#text"
|
|
45
|
+
);
|
|
46
|
+
(r = s[s.length - 1]) == null || r.childNodes[0].focus();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
t.focus();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function y(o, i, d, a, l, r) {
|
|
56
|
+
return p(), f("ul", {
|
|
57
|
+
class: N(l.rootClass),
|
|
58
|
+
onKeydown: i[0] || (i[0] = (...e) => r.onKeydown && r.onKeydown(...e))
|
|
59
|
+
}, [
|
|
60
|
+
E(o.$slots, "default")
|
|
61
|
+
], 34);
|
|
62
|
+
}
|
|
63
|
+
const _ = /* @__PURE__ */ h(C, [["render", y]]);
|
|
64
|
+
export {
|
|
65
|
+
_ as default
|
|
66
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import w from "../IconButton/IconButton.js";
|
|
2
|
+
import k from "../Icon.js";
|
|
3
|
+
import { modalSizes as n } from "./constants.js";
|
|
4
|
+
import { OutsideDirective as x } from "../../directives/outside/outside.js";
|
|
5
|
+
import { ESC_KEY_CODE as L, TAB_KEY_CODE as m } from "../../constants/keyCodes.js";
|
|
6
|
+
import { resolveComponent as f, resolveDirective as F, createElementBlock as a, openBlock as l, Fragment as _, createCommentVNode as d, createBlock as p, renderSlot as c, Teleport as C, createElementVNode as b, normalizeClass as h, withDirectives as H, normalizeStyle as I, withCtx as M, createVNode as S } from "vue";
|
|
7
|
+
import { _ as E } from "../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const z = {
|
|
9
|
+
name: "IbModal",
|
|
10
|
+
directives: { Outside: x },
|
|
11
|
+
emits: {
|
|
12
|
+
open: null,
|
|
13
|
+
close: null
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
active: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
},
|
|
20
|
+
classList: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
stopPropagation: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
showCloseButton: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !0
|
|
31
|
+
},
|
|
32
|
+
size: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: n.S
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
watch: {
|
|
38
|
+
active(e) {
|
|
39
|
+
this.isActive = e, e ? (this.$nextTick(() => {
|
|
40
|
+
this.setupFocusTrap();
|
|
41
|
+
}), document.addEventListener("keydown", this.onKeydown), document.addEventListener("blur", this.setFocusOnModal, !0)) : (this.cleanupFocusTrap(), document.removeEventListener("keydown", this.onKeydown), document.removeEventListener("blur", this.setFocusOnModal, !0));
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
isActive: this.active
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
setupFocusTrap() {
|
|
51
|
+
var o, i;
|
|
52
|
+
if (this.focusableItems = ((i = (o = this.$refs) == null ? void 0 : o.modal) == null ? void 0 : i.querySelectorAll(
|
|
53
|
+
"[tabindex], a, button, input, select, textarea"
|
|
54
|
+
)) || [], this.focusableItems.length === 0) return;
|
|
55
|
+
const e = this.focusableItems[0], t = this.focusableItems[this.focusableItems.length - 1];
|
|
56
|
+
this.firstFocusableHandler = (r) => {
|
|
57
|
+
r.keyCode === m && r.shiftKey && (r.preventDefault(), t.focus());
|
|
58
|
+
}, this.lastFocusableHandler = (r) => {
|
|
59
|
+
r.keyCode === m && !r.shiftKey && (r.preventDefault(), e.focus());
|
|
60
|
+
}, e.addEventListener("keydown", this.firstFocusableHandler), t.addEventListener("keydown", this.lastFocusableHandler), e.focus();
|
|
61
|
+
},
|
|
62
|
+
cleanupFocusTrap() {
|
|
63
|
+
if (this.focusableItems.length === 0) return;
|
|
64
|
+
const e = this.focusableItems[0], t = this.focusableItems[this.focusableItems.length - 1];
|
|
65
|
+
this.firstFocusableHandler && (e == null || e.removeEventListener("keydown", this.firstFocusableHandler)), this.lastFocusableHandler && (t == null || t.removeEventListener("keydown", this.lastFocusableHandler)), this.firstFocusableHandler = null, this.lastFocusableHandler = null, this.focusableItems = [];
|
|
66
|
+
},
|
|
67
|
+
showModal(e) {
|
|
68
|
+
e ? this.open() : this.close();
|
|
69
|
+
},
|
|
70
|
+
onTriggerBlur(e) {
|
|
71
|
+
var t, o, i;
|
|
72
|
+
!((t = this.$refs.modal) != null && t.contains(e.relatedTarget)) && this.isActive && ((i = (o = this.$refs.modal) == null ? void 0 : o.querySelector("a, button, [tabindex]")) == null || i.focus());
|
|
73
|
+
},
|
|
74
|
+
open() {
|
|
75
|
+
this.isActive = !0, document.body.classList.add("modal-open"), this.$emit("open");
|
|
76
|
+
},
|
|
77
|
+
close() {
|
|
78
|
+
var e, t;
|
|
79
|
+
(t = (e = this.$refs.trigger) == null ? void 0 : e.querySelector("a, button, [tabindex]")) == null || t.focus(), document.body.classList.remove("modal-open"), this.$emit("close");
|
|
80
|
+
},
|
|
81
|
+
setFocusOnModal(e) {
|
|
82
|
+
if (!this.isActive) return;
|
|
83
|
+
const o = Array.from(
|
|
84
|
+
document.querySelectorAll(".modal.is-active")
|
|
85
|
+
).sort(
|
|
86
|
+
(i, r) => +(getComputedStyle(i).zIndex || 0) - +(getComputedStyle(r).zIndex || 0)
|
|
87
|
+
).at(-1);
|
|
88
|
+
if (o === this.$refs.modal && !o.contains(e.target) && !o.contains(e.relatedTarget)) {
|
|
89
|
+
const i = o.querySelector(
|
|
90
|
+
`a[href], button:not([disabled]),
|
|
91
|
+
textarea, input:not([type="hidden"]),
|
|
92
|
+
select, [tabindex]:not([tabindex="-1"])`
|
|
93
|
+
);
|
|
94
|
+
i == null || i.focus();
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
clickOutside(e) {
|
|
98
|
+
var t;
|
|
99
|
+
this.stopPropagation || !((t = this.$refs.trigger) != null && t.contains(e.target)) && this.isActive && this.close();
|
|
100
|
+
},
|
|
101
|
+
onKeydown(e) {
|
|
102
|
+
e.keyCode === L && !this.stopPropagation && this.isActive && this.close();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
computed: {
|
|
106
|
+
classes() {
|
|
107
|
+
const e = ["modal"];
|
|
108
|
+
return this.classList.length && e.push(this.classList), this.isActive && e.push("is-active"), e;
|
|
109
|
+
},
|
|
110
|
+
bodyStyles() {
|
|
111
|
+
const e = {};
|
|
112
|
+
return this.size === n.S && (e.width = "380px", e.minHeight = "160px", e.maxHeight = "680px"), this.size === n.M && (e.width = "600px", e.minHeight = "260px", e.maxHeight = "680px"), this.size === n.L && (e.width = "850px", e.minHeight = "400px", e.maxHeight = "680px"), this.size === n.XL && (e.width = "80vw", e.maxWidth = "1400px"), e;
|
|
113
|
+
},
|
|
114
|
+
bodyClassList() {
|
|
115
|
+
const e = ["modal-body"];
|
|
116
|
+
return this.size === n.S && e.push("modal-body-s"), this.size === n.M && e.push("modal-body-m"), this.size === n.L && e.push("modal-body-l"), this.size === n.XL && e.push("modal-body-xl"), e;
|
|
117
|
+
},
|
|
118
|
+
hasTrigger() {
|
|
119
|
+
return !!this.$slots.trigger;
|
|
120
|
+
},
|
|
121
|
+
hasHeader() {
|
|
122
|
+
return !!this.$slots.header;
|
|
123
|
+
},
|
|
124
|
+
hasFooter() {
|
|
125
|
+
return !!this.$slots.footer;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
components: {
|
|
129
|
+
IbIconButton: w,
|
|
130
|
+
IbIcon: k
|
|
131
|
+
},
|
|
132
|
+
beforeUnmount() {
|
|
133
|
+
this.isActive && this.close(), document.removeEventListener("keydown", this.onKeydown), document.removeEventListener("blur", this.setFocusOnModal, !0);
|
|
134
|
+
}
|
|
135
|
+
}, A = {
|
|
136
|
+
key: 1,
|
|
137
|
+
class: "modal-header"
|
|
138
|
+
}, B = {
|
|
139
|
+
key: 2,
|
|
140
|
+
class: "modal-footer"
|
|
141
|
+
};
|
|
142
|
+
function T(e, t, o, i, r, s) {
|
|
143
|
+
const y = f("ib-icon"), v = f("ib-icon-button"), g = F("outside");
|
|
144
|
+
return l(), a(_, null, [
|
|
145
|
+
s.hasTrigger ? (l(), a("div", {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "modal-trigger",
|
|
148
|
+
ref: "trigger",
|
|
149
|
+
onBlurCapture: t[0] || (t[0] = (...u) => s.onTriggerBlur && s.onTriggerBlur(...u)),
|
|
150
|
+
onClick: t[1] || (t[1] = (...u) => s.open && s.open(...u))
|
|
151
|
+
}, [
|
|
152
|
+
c(e.$slots, "trigger", {}, void 0, !0)
|
|
153
|
+
], 544)) : d("", !0),
|
|
154
|
+
r.isActive ? (l(), p(C, {
|
|
155
|
+
key: 1,
|
|
156
|
+
to: "body"
|
|
157
|
+
}, [
|
|
158
|
+
b("div", {
|
|
159
|
+
class: h(s.classes),
|
|
160
|
+
ref: "modal"
|
|
161
|
+
}, [
|
|
162
|
+
H((l(), a("div", {
|
|
163
|
+
class: h(s.bodyClassList),
|
|
164
|
+
style: I(s.bodyStyles)
|
|
165
|
+
}, [
|
|
166
|
+
o.showCloseButton ? (l(), p(v, {
|
|
167
|
+
key: 0,
|
|
168
|
+
class: "modal-close-icon",
|
|
169
|
+
kind: "ghost",
|
|
170
|
+
onClick: s.close
|
|
171
|
+
}, {
|
|
172
|
+
default: M(() => [
|
|
173
|
+
S(y, { name: "close-outline" })
|
|
174
|
+
]),
|
|
175
|
+
_: 1
|
|
176
|
+
}, 8, ["onClick"])) : d("", !0),
|
|
177
|
+
s.hasHeader ? (l(), a("p", A, [
|
|
178
|
+
c(e.$slots, "header", { showModal: s.showModal }, void 0, !0)
|
|
179
|
+
])) : d("", !0),
|
|
180
|
+
b("div", {
|
|
181
|
+
class: h(["modal-content", { "without-title": !s.hasHeader }])
|
|
182
|
+
}, [
|
|
183
|
+
c(e.$slots, "body", { showModal: s.showModal }, void 0, !0)
|
|
184
|
+
], 2),
|
|
185
|
+
s.hasFooter ? (l(), a("div", B, [
|
|
186
|
+
c(e.$slots, "footer", { showModal: s.showModal }, void 0, !0)
|
|
187
|
+
])) : d("", !0)
|
|
188
|
+
], 6)), [
|
|
189
|
+
[g, s.clickOutside]
|
|
190
|
+
])
|
|
191
|
+
], 2)
|
|
192
|
+
])) : d("", !0)
|
|
193
|
+
], 64);
|
|
194
|
+
}
|
|
195
|
+
const X = /* @__PURE__ */ E(z, [["render", T], ["__scopeId", "data-v-1379c0fb"]]);
|
|
196
|
+
export {
|
|
197
|
+
X as default
|
|
198
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import s from "../Form/Label/Label.js";
|
|
2
|
+
import n from "../TreeSelect/Select.js";
|
|
3
|
+
import { resolveComponent as r, createElementBlock as c, openBlock as p, createVNode as o, withCtx as m, createTextVNode as u, toDisplayString as d } from "vue";
|
|
4
|
+
import { _ } from "../../chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const b = {
|
|
6
|
+
name: "IbLimitSelector",
|
|
7
|
+
props: {
|
|
8
|
+
labelSelect: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
value: {
|
|
13
|
+
type: Number
|
|
14
|
+
},
|
|
15
|
+
vertical: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
options: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => [10, 25, 50, 100]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
watch(e) {
|
|
24
|
+
this.selected = e;
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
selected: this.value
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
selectItem(e) {
|
|
33
|
+
this.selected = e, this.onChange(e);
|
|
34
|
+
},
|
|
35
|
+
onChange(e) {
|
|
36
|
+
Number.isInteger(+e) && this.$emit("select", +e);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
prepareOptions() {
|
|
41
|
+
return this.options.map((e) => ({ id: e, title: e }));
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
components: {
|
|
45
|
+
IbLabel: s,
|
|
46
|
+
IbSelect: n
|
|
47
|
+
}
|
|
48
|
+
}, f = { class: "report-limit-selector" };
|
|
49
|
+
function h(e, v, t, I, S, l) {
|
|
50
|
+
const i = r("ib-label"), a = r("ib-select");
|
|
51
|
+
return p(), c("div", f, [
|
|
52
|
+
o(i, null, {
|
|
53
|
+
default: m(() => [
|
|
54
|
+
u(d(t.labelSelect), 1)
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
}),
|
|
58
|
+
o(a, {
|
|
59
|
+
classList: "report-limit-selector-select",
|
|
60
|
+
value: t.value,
|
|
61
|
+
vertical: t.vertical,
|
|
62
|
+
options: l.prepareOptions,
|
|
63
|
+
"is-multiple": !1,
|
|
64
|
+
"show-clear-button": !1,
|
|
65
|
+
"aria-label": "Pagination",
|
|
66
|
+
onInput: l.selectItem
|
|
67
|
+
}, null, 8, ["value", "vertical", "options", "onInput"])
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
const L = /* @__PURE__ */ _(b, [["render", h]]);
|
|
71
|
+
export {
|
|
72
|
+
L as default
|
|
73
|
+
};
|