@nilloq/ouds-web 0.1.5 → 0.1.7
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/LICENSE +21 -0
- package/README.md +17 -72
- package/dist/alert-B4w3fDHo.js +89 -0
- package/dist/alert-Chns046l.js +77 -0
- package/dist/alert.js +2 -0
- package/dist/badge-CDpWg-AO.js +57 -0
- package/dist/badge-yaFEZnEW.js +54 -0
- package/dist/badge.js +2 -0
- package/dist/{button-LlRiSiGS.js → button-nN1Pcwm6.js} +36 -21
- package/dist/button-rgIJZsYq.js +94 -0
- package/dist/button.js +1 -1
- package/dist/checkbox-D7TFFuw3.js +196 -0
- package/dist/checkbox-DfYlHYR2.js +155 -0
- package/dist/checkbox.js +1 -1
- package/dist/chip-B3v4pWZD.js +92 -0
- package/dist/chip-DGfqitrQ.js +115 -0
- package/dist/chip.js +2 -0
- package/dist/control-item-slots-BDoeNuk4.js +15 -0
- package/dist/control-item-slots-Ddp7c8w8.js +12 -0
- package/dist/elements-alert.js +2 -0
- package/dist/elements-badge.js +2 -0
- package/dist/elements-button.js +1 -1
- package/dist/elements-checkbox.js +1 -1
- package/dist/elements-chip.js +2 -0
- package/dist/elements-modal.js +2 -0
- package/dist/elements-radio.js +2 -0
- package/dist/elements-select.js +1 -1
- package/dist/elements-switch.js +2 -0
- package/dist/elements-tag.js +1 -1
- package/dist/elements-text-area.js +2 -0
- package/dist/elements-text-input.js +1 -1
- package/dist/elements.js +14 -7
- package/dist/index.js +13 -6
- package/dist/modal-BAvMVUIE.js +193 -0
- package/dist/modal-BnT5Kxjg.js +181 -0
- package/dist/modal.js +2 -0
- package/dist/radio-CDq4r1_L.js +155 -0
- package/dist/radio-TaYThYkI.js +199 -0
- package/dist/radio.js +5 -0
- package/dist/{runtime-dom.esm-bundler-BzNNnH8h.js → runtime-dom.esm-bundler-DLryEdgJ.js} +987 -839
- package/dist/select--O3jL-En.js +134 -0
- package/dist/select-NiIx8bVD.js +191 -0
- package/dist/select.js +1 -1
- package/dist/switch-BmxLKPbL.js +179 -0
- package/dist/switch-D5N-j5F7.js +140 -0
- package/dist/switch.js +5 -0
- package/dist/tag-BvOt0v-c.js +84 -0
- package/dist/tag-Un7w0uDf.js +81 -0
- package/dist/tag.js +1 -1
- package/dist/text-area-BdmAyh3N.js +163 -0
- package/dist/text-area-BgYNtAMx.js +107 -0
- package/dist/text-area.js +5 -0
- package/dist/text-input-DgFIuIOA.js +235 -0
- package/dist/text-input-i559HVOP.js +163 -0
- package/dist/text-input.js +1 -1
- package/dist/types/alert.d.ts +1 -0
- package/dist/types/badge.d.ts +1 -0
- package/dist/types/chip.d.ts +1 -0
- package/dist/types/components/alert/Alert.vue.d.ts +37 -0
- package/dist/types/components/alert/alert.context.d.ts +2 -0
- package/dist/types/components/alert/alert.options.d.ts +2 -0
- package/dist/types/components/alert/alert.types.d.ts +14 -0
- package/dist/types/components/badge/Badge.vue.d.ts +26 -0
- package/dist/types/components/badge/badge.options.d.ts +4 -0
- package/dist/types/components/badge/badge.types.d.ts +13 -0
- package/dist/types/components/button/Button.vue.d.ts +8 -5
- package/dist/types/components/button/button.options.d.ts +1 -1
- package/dist/types/components/button/button.types.d.ts +2 -0
- package/dist/types/components/checkbox/Checkbox.vue.d.ts +13 -17
- package/dist/types/components/checkbox/VueCheckbox.vue.d.ts +18 -8
- package/dist/types/components/checkbox/checkbox.context.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.types.d.ts +20 -0
- package/dist/types/components/chip/Chip.vue.d.ts +38 -0
- package/dist/types/components/chip/VueChip.vue.d.ts +32 -0
- package/dist/types/components/chip/chip.context.d.ts +2 -0
- package/dist/types/components/chip/chip.types.d.ts +27 -0
- package/dist/types/components/modal/Modal.vue.d.ts +86 -0
- package/dist/types/components/modal/modal.context.d.ts +2 -0
- package/dist/types/components/modal/modal.options.d.ts +7 -0
- package/dist/types/components/modal/modal.types.d.ts +28 -0
- package/dist/types/components/radio/Radio.vue.d.ts +22 -0
- package/dist/types/components/radio/VueRadio.vue.d.ts +36 -0
- package/dist/types/components/radio/radio.context.d.ts +2 -0
- package/dist/types/components/radio/radio.types.d.ts +36 -0
- package/dist/types/components/select/Select.vue.d.ts +17 -17
- package/dist/types/components/select/VueSelect.vue.d.ts +24 -8
- package/dist/types/components/select/select.types.d.ts +28 -0
- package/dist/types/components/shared/control-item-slots.d.ts +3 -0
- package/dist/types/components/switch/Switch.vue.d.ts +20 -0
- package/dist/types/components/switch/VueSwitch.vue.d.ts +34 -0
- package/dist/types/components/switch/switch.context.d.ts +2 -0
- package/dist/types/components/switch/switch.types.d.ts +30 -0
- package/dist/types/components/tag/Tag.vue.d.ts +9 -4
- package/dist/types/components/tag/tag.options.d.ts +1 -1
- package/dist/types/components/tag/tag.types.d.ts +4 -0
- package/dist/types/components/text-area/TextArea.vue.d.ts +22 -0
- package/dist/types/components/text-area/VueTextArea.vue.d.ts +38 -0
- package/dist/types/components/text-area/text-area.types.d.ts +34 -0
- package/dist/types/components/text-input/TextInput.vue.d.ts +19 -34
- package/dist/types/components/text-input/VueTextInput.vue.d.ts +26 -16
- package/dist/types/components/text-input/text-input.types.d.ts +26 -0
- package/dist/types/elements/alert.d.ts +5 -0
- package/dist/types/elements/badge.d.ts +5 -0
- package/dist/types/elements/chip.d.ts +4 -0
- package/dist/types/elements/index.d.ts +15 -0
- package/dist/types/elements/modal.d.ts +5 -0
- package/dist/types/elements/radio.d.ts +4 -0
- package/dist/types/elements/switch.d.ts +4 -0
- package/dist/types/elements/text-area.d.ts +4 -0
- package/dist/types/modal.d.ts +1 -0
- package/dist/types/radio.d.ts +2 -0
- package/dist/types/switch.d.ts +2 -0
- package/dist/types/text-area.d.ts +2 -0
- package/dist/types/vue/alert.d.ts +3 -0
- package/dist/types/vue/badge.d.ts +3 -0
- package/dist/types/vue/checkbox.d.ts +1 -1
- package/dist/types/vue/chip.d.ts +2 -0
- package/dist/types/vue/index.d.ts +16 -3
- package/dist/types/vue/modal.d.ts +3 -0
- package/dist/types/vue/radio.d.ts +2 -0
- package/dist/types/vue/select.d.ts +1 -1
- package/dist/types/vue/switch.d.ts +2 -0
- package/dist/types/vue/text-area.d.ts +2 -0
- package/dist/types/vue/text-input.d.ts +1 -1
- package/dist/vue-alert.js +2 -0
- package/dist/vue-badge.js +2 -0
- package/dist/vue-button.js +1 -1
- package/dist/vue-checkbox.js +1 -1
- package/dist/vue-chip.js +2 -0
- package/dist/vue-modal.js +2 -0
- package/dist/vue-radio.js +2 -0
- package/dist/vue-select.js +1 -1
- package/dist/vue-switch.js +2 -0
- package/dist/vue-tag.js +1 -1
- package/dist/vue-text-area.js +2 -0
- package/dist/vue-text-input.js +1 -1
- package/dist/vue.js +13 -6
- package/package.json +96 -11
- package/dist/button-BPOKh6G4.js +0 -79
- package/dist/checkbox-BYrgMhwO.js +0 -105
- package/dist/checkbox-D-A_bSBK.js +0 -79
- package/dist/select-CA6TVlpX.js +0 -58
- package/dist/select-CKHEHpJL.js +0 -80
- package/dist/tag-B2qhuHjk.js +0 -41
- package/dist/tag-BY32Hj5n.js +0 -44
- package/dist/text-input-CtTr5yfe.js +0 -151
- package/dist/text-input-l1F2arKl.js +0 -201
package/dist/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { n as u,
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
1
|
+
import { n as e, r as t, t as n } from "./alert-B4w3fDHo.js";
|
|
2
|
+
import { i as r, n as i, r as a, t as o } from "./badge-CDpWg-AO.js";
|
|
3
|
+
import { a as s, i as c, n as l, o as u, r as d, t as f } from "./button-rgIJZsYq.js";
|
|
4
|
+
import { i as p, n as m, r as h, t as g } from "./tag-BvOt0v-c.js";
|
|
5
|
+
import { n as _, t as v } from "./chip-B3v4pWZD.js";
|
|
6
|
+
import { n as y, t as b } from "./select--O3jL-En.js";
|
|
7
|
+
import { n as x, t as S } from "./checkbox-DfYlHYR2.js";
|
|
8
|
+
import { n as C, t as w } from "./radio-CDq4r1_L.js";
|
|
9
|
+
import { n as T, t as E } from "./switch-D5N-j5F7.js";
|
|
10
|
+
import { n as D, t as O } from "./text-input-i559HVOP.js";
|
|
11
|
+
import { n as k, t as A } from "./text-area-BgYNtAMx.js";
|
|
12
|
+
import { a as j, i as M, n as N, r as P, t as F } from "./modal-BAvMVUIE.js";
|
|
6
13
|
import "./elements.js";
|
|
7
|
-
export {
|
|
14
|
+
export { n as OudsAlert, o as OudsBadge, f as OudsButton, S as OudsCheckbox, v as OudsChip, F as OudsModal, w as OudsRadio, b as OudsSelect, E as OudsSwitch, g as OudsTag, A as OudsTextArea, O as OudsTextInput, t as alertVariants, a as badgeSizes, r as badgeVariants, d as buttonNavigations, c as buttonSizes, s as buttonTypes, u as buttonVariants, e as defineOudsAlert, i as defineOudsBadge, l as defineOudsButton, x as defineOudsCheckbox, _ as defineOudsChip, N as defineOudsModal, C as defineOudsRadio, y as defineOudsSelect, T as defineOudsSwitch, m as defineOudsTag, k as defineOudsTextArea, D as defineOudsTextInput, P as modalSizes, M as modalTypes, j as modalVariants, h as tagSizes, p as tagVariants };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { A as e, C as t, D as n, N as r, O as i, T as a, a as o, b as s, c, d as l, f as u, g as d, h as f, j as p, l as m, m as h, n as g, o as _, p as v, s as y, t as b, u as x, v as S, x as C, y as w } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
|
|
2
|
+
import { r as T, t as E } from "./control-item-slots-BDoeNuk4.js";
|
|
3
|
+
//#region src/components/modal/modal.context.ts
|
|
4
|
+
var D = Symbol("ouds-modal-element-id"), ee = [
|
|
5
|
+
"id",
|
|
6
|
+
"aria-labelledby",
|
|
7
|
+
"aria-describedby"
|
|
8
|
+
], O = { class: "modal-header" }, k = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "modal-subtitle"
|
|
11
|
+
}, A = ["aria-hidden"], j = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "visually-hidden"
|
|
14
|
+
}, M = ["aria-label"], N = ["id"], P = /* @__PURE__ */ l({
|
|
15
|
+
inheritAttrs: !1,
|
|
16
|
+
__name: "Modal",
|
|
17
|
+
props: {
|
|
18
|
+
open: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
label: { default: "Dialog" },
|
|
23
|
+
description: { default: "" },
|
|
24
|
+
subtitle: { default: "" },
|
|
25
|
+
headingLevel: { default: "h2" },
|
|
26
|
+
type: { default: "dialog" },
|
|
27
|
+
size: { default: "default" },
|
|
28
|
+
variant: { default: "neutral" },
|
|
29
|
+
iconLabel: { default: "" },
|
|
30
|
+
fixedHeight: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
nonBlurred: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
stickyActions: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
horizontalActions: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
dismissible: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !0
|
|
49
|
+
},
|
|
50
|
+
closeLabel: { default: "Close dialog" },
|
|
51
|
+
closeOnEscape: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !0
|
|
54
|
+
},
|
|
55
|
+
closeOnBackdrop: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
emits: [
|
|
61
|
+
"update:open",
|
|
62
|
+
"show",
|
|
63
|
+
"close",
|
|
64
|
+
"cancel"
|
|
65
|
+
],
|
|
66
|
+
setup(l, { expose: b, emit: E }) {
|
|
67
|
+
let P = l, F = E, I = s(), L = u(D, void 0), R = L ? g() : void 0, z = T(!!L), B = C(), V = i(), H = o(() => `${L || `ouds-modal-${B}`}-title`), U = o(() => `${L || `ouds-modal-${B}`}-description`), W = o(() => P.iconLabel || {
|
|
68
|
+
neutral: "",
|
|
69
|
+
negative: "Error",
|
|
70
|
+
positive: "Success",
|
|
71
|
+
info: "Information",
|
|
72
|
+
warning: "Warning"
|
|
73
|
+
}[P.variant]);
|
|
74
|
+
function G() {
|
|
75
|
+
return P.stickyActions && !!(P.description || z("description") || z("default"));
|
|
76
|
+
}
|
|
77
|
+
let K = !1, q = !1;
|
|
78
|
+
function J(e) {
|
|
79
|
+
R && Reflect.set(R, "open", e), F("update:open", e);
|
|
80
|
+
}
|
|
81
|
+
function Y() {
|
|
82
|
+
V.value && !V.value.open && (K && X(), V.value.returnValue = "", V.value.showModal(), K = !0, J(!0), F("show"));
|
|
83
|
+
}
|
|
84
|
+
function X() {
|
|
85
|
+
K && V.value && !V.value.open && (K = !1, J(!1), F("close", V.value.returnValue));
|
|
86
|
+
}
|
|
87
|
+
function Z(e) {
|
|
88
|
+
V.value?.open && (V.value.close(e), X());
|
|
89
|
+
}
|
|
90
|
+
function Q(e) {
|
|
91
|
+
if (P.closeOnEscape || e.preventDefault(), R) {
|
|
92
|
+
let t = new CustomEvent("cancel", {
|
|
93
|
+
detail: [e],
|
|
94
|
+
cancelable: !0
|
|
95
|
+
});
|
|
96
|
+
R.dispatchEvent(t) || e.preventDefault();
|
|
97
|
+
} else F("cancel", e);
|
|
98
|
+
}
|
|
99
|
+
function $(e) {
|
|
100
|
+
let t = V.value;
|
|
101
|
+
if (!t || e.target !== t) return !1;
|
|
102
|
+
let n = t.getBoundingClientRect();
|
|
103
|
+
return e.clientX < n.left || e.clientX > n.right || e.clientY < n.top || e.clientY > n.bottom;
|
|
104
|
+
}
|
|
105
|
+
function te(e) {
|
|
106
|
+
P.closeOnBackdrop && q && $(e) && Z(), q = !1;
|
|
107
|
+
}
|
|
108
|
+
return t(() => P.open, (e) => {
|
|
109
|
+
e ? Y() : Z();
|
|
110
|
+
}, { flush: "post" }), f(() => {
|
|
111
|
+
P.open && Y();
|
|
112
|
+
}), h(() => {
|
|
113
|
+
K = !1, V.value?.open && V.value.close();
|
|
114
|
+
}), b({
|
|
115
|
+
showModal: Y,
|
|
116
|
+
close: Z
|
|
117
|
+
}), (t, i) => (d(), m("dialog", v({
|
|
118
|
+
ref_key: "dialog",
|
|
119
|
+
ref: V
|
|
120
|
+
}, e(I), {
|
|
121
|
+
id: e(L) ? `${e(I).id || e(L)}-dialog` : e(I).id || `ouds-modal-${e(B)}`,
|
|
122
|
+
class: ["modal-base", [l.type === "fullscreen" ? "modal-fullscreen-dialog" : "modal-dialog", {
|
|
123
|
+
"modal-small": l.type === "dialog" && l.size === "small",
|
|
124
|
+
"modal-fixed-height": l.type === "dialog" && l.fixedHeight,
|
|
125
|
+
"modal-non-blurred": l.type === "dialog" && l.nonBlurred
|
|
126
|
+
}]],
|
|
127
|
+
"aria-labelledby": e(I)["aria-labelledby"] || H.value,
|
|
128
|
+
"aria-describedby": e(I)["aria-describedby"] || (l.description || e(z)("description") ? U.value : void 0),
|
|
129
|
+
onCancel: Q,
|
|
130
|
+
onClose: X,
|
|
131
|
+
onPointerdown: i[1] ||= (e) => n(q) ? q.value = $(e) : q = $(e),
|
|
132
|
+
onClick: te
|
|
133
|
+
}), [
|
|
134
|
+
_("div", O, [
|
|
135
|
+
S(t.$slots, "previous"),
|
|
136
|
+
l.subtitle || e(z)("subtitle") ? (d(), m("p", k, [S(t.$slots, "subtitle", {}, () => [x(r(l.subtitle), 1)])])) : c("", !0),
|
|
137
|
+
(d(), y(w(l.headingLevel), {
|
|
138
|
+
id: H.value,
|
|
139
|
+
class: "modal-title"
|
|
140
|
+
}, {
|
|
141
|
+
default: a(() => [l.variant !== "neutral" || e(z)("icon") ? (d(), m("span", {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: p(["modal-icon", l.variant !== "neutral" && `modal-icon-${l.variant}`]),
|
|
144
|
+
"aria-hidden": !W.value || void 0
|
|
145
|
+
}, [W.value ? (d(), m("span", j, r(W.value), 1)) : c("", !0), l.variant === "neutral" ? S(t.$slots, "icon", {}, void 0, void 0, 1) : c("", !0)], 10, A)) : c("", !0), S(t.$slots, "title", {}, () => [x(r(l.label), 1)])]),
|
|
146
|
+
_: 3
|
|
147
|
+
}, 8, ["id"])),
|
|
148
|
+
l.dismissible ? (d(), m("button", {
|
|
149
|
+
key: 1,
|
|
150
|
+
type: "button",
|
|
151
|
+
class: "btn btn-close",
|
|
152
|
+
"aria-label": l.closeLabel,
|
|
153
|
+
onClick: i[0] ||= (e) => Z()
|
|
154
|
+
}, null, 8, M)) : c("", !0)
|
|
155
|
+
]),
|
|
156
|
+
_("div", { class: p(["modal-body", { "pt-large": !l.description && !e(z)("description") && e(z)("default") }]) }, [
|
|
157
|
+
l.description || e(z)("description") ? (d(), m("p", {
|
|
158
|
+
key: 0,
|
|
159
|
+
id: U.value
|
|
160
|
+
}, [S(t.$slots, "description", {}, () => [x(r(l.description), 1)])], 8, N)) : c("", !0),
|
|
161
|
+
S(t.$slots, "default"),
|
|
162
|
+
e(z)("actions") && !G() ? (d(), m("div", {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: p(["modal-footer", { "modal-footer-horizontal": l.horizontalActions }])
|
|
165
|
+
}, [S(t.$slots, "actions", { close: Z })], 2)) : c("", !0)
|
|
166
|
+
], 2),
|
|
167
|
+
e(z)("actions") && G() ? (d(), m("div", {
|
|
168
|
+
key: 0,
|
|
169
|
+
class: p(["modal-footer", { "modal-footer-horizontal": l.horizontalActions }])
|
|
170
|
+
}, [S(t.$slots, "actions", { close: Z })], 2)) : c("", !0)
|
|
171
|
+
], 16, ee));
|
|
172
|
+
}
|
|
173
|
+
}), F = ["dialog", "fullscreen"], I = ["default", "small"], L = [
|
|
174
|
+
"neutral",
|
|
175
|
+
"negative",
|
|
176
|
+
"positive",
|
|
177
|
+
"info",
|
|
178
|
+
"warning"
|
|
179
|
+
], R = 0, z = b(P, {
|
|
180
|
+
shadowRoot: !1,
|
|
181
|
+
configureApp(e) {
|
|
182
|
+
e.provide(D, `ouds-modal-element-${R++}`);
|
|
183
|
+
}
|
|
184
|
+
}), B = class extends z {
|
|
185
|
+
connectedCallback() {
|
|
186
|
+
E(this), super.connectedCallback();
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
function V() {
|
|
190
|
+
typeof customElements < "u" && (customElements.get("ouds-modal") || customElements.define("ouds-modal", B));
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
export { L as a, F as i, V as n, I as r, B as t };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { n as e } from "./control-item-slots-Ddp7c8w8.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, inject as c, isRef as l, mergeProps as u, normalizeClass as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useAttrs as b, useHost as x, useId as S, watch as C, withCtx as w } from "vue";
|
|
3
|
+
//#region src/components/modal/modal.context.ts
|
|
4
|
+
var T = Symbol("ouds-modal-element-id"), E = [
|
|
5
|
+
"id",
|
|
6
|
+
"aria-labelledby",
|
|
7
|
+
"aria-describedby"
|
|
8
|
+
], ee = { class: "modal-header" }, D = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "modal-subtitle"
|
|
11
|
+
}, O = ["aria-hidden"], k = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "visually-hidden"
|
|
14
|
+
}, A = ["aria-label"], j = ["id"], M = /* @__PURE__ */ s({
|
|
15
|
+
inheritAttrs: !1,
|
|
16
|
+
__name: "Modal",
|
|
17
|
+
props: {
|
|
18
|
+
open: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
label: { default: "Dialog" },
|
|
23
|
+
description: { default: "" },
|
|
24
|
+
subtitle: { default: "" },
|
|
25
|
+
headingLevel: { default: "h2" },
|
|
26
|
+
type: { default: "dialog" },
|
|
27
|
+
size: { default: "default" },
|
|
28
|
+
variant: { default: "neutral" },
|
|
29
|
+
iconLabel: { default: "" },
|
|
30
|
+
fixedHeight: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
nonBlurred: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
stickyActions: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
horizontalActions: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
dismissible: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !0
|
|
49
|
+
},
|
|
50
|
+
closeLabel: { default: "Close dialog" },
|
|
51
|
+
closeOnEscape: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !0
|
|
54
|
+
},
|
|
55
|
+
closeOnBackdrop: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
emits: [
|
|
61
|
+
"update:open",
|
|
62
|
+
"show",
|
|
63
|
+
"close",
|
|
64
|
+
"cancel"
|
|
65
|
+
],
|
|
66
|
+
setup(s, { expose: M, emit: N }) {
|
|
67
|
+
let P = s, F = N, I = b(), L = c(T, void 0), R = L ? x() : void 0, z = e(!!L), B = S(), V = h(), H = t(() => `${L || `ouds-modal-${B}`}-title`), U = t(() => `${L || `ouds-modal-${B}`}-description`), W = t(() => P.iconLabel || {
|
|
68
|
+
neutral: "",
|
|
69
|
+
negative: "Error",
|
|
70
|
+
positive: "Success",
|
|
71
|
+
info: "Information",
|
|
72
|
+
warning: "Warning"
|
|
73
|
+
}[P.variant]);
|
|
74
|
+
function G() {
|
|
75
|
+
return P.stickyActions && !!(P.description || z("description") || z("default"));
|
|
76
|
+
}
|
|
77
|
+
let K = !1, q = !1;
|
|
78
|
+
function J(e) {
|
|
79
|
+
R && Reflect.set(R, "open", e), F("update:open", e);
|
|
80
|
+
}
|
|
81
|
+
function Y() {
|
|
82
|
+
V.value && !V.value.open && (K && X(), V.value.returnValue = "", V.value.showModal(), K = !0, J(!0), F("show"));
|
|
83
|
+
}
|
|
84
|
+
function X() {
|
|
85
|
+
K && V.value && !V.value.open && (K = !1, J(!1), F("close", V.value.returnValue));
|
|
86
|
+
}
|
|
87
|
+
function Z(e) {
|
|
88
|
+
V.value?.open && (V.value.close(e), X());
|
|
89
|
+
}
|
|
90
|
+
function Q(e) {
|
|
91
|
+
if (P.closeOnEscape || e.preventDefault(), R) {
|
|
92
|
+
let t = new CustomEvent("cancel", {
|
|
93
|
+
detail: [e],
|
|
94
|
+
cancelable: !0
|
|
95
|
+
});
|
|
96
|
+
R.dispatchEvent(t) || e.preventDefault();
|
|
97
|
+
} else F("cancel", e);
|
|
98
|
+
}
|
|
99
|
+
function $(e) {
|
|
100
|
+
let t = V.value;
|
|
101
|
+
if (!t || e.target !== t) return !1;
|
|
102
|
+
let n = t.getBoundingClientRect();
|
|
103
|
+
return e.clientX < n.left || e.clientX > n.right || e.clientY < n.top || e.clientY > n.bottom;
|
|
104
|
+
}
|
|
105
|
+
function te(e) {
|
|
106
|
+
P.closeOnBackdrop && q && $(e) && Z(), q = !1;
|
|
107
|
+
}
|
|
108
|
+
return C(() => P.open, (e) => {
|
|
109
|
+
e ? Y() : Z();
|
|
110
|
+
}, { flush: "post" }), p(() => {
|
|
111
|
+
P.open && Y();
|
|
112
|
+
}), f(() => {
|
|
113
|
+
K = !1, V.value?.open && V.value.close();
|
|
114
|
+
}), M({
|
|
115
|
+
showModal: Y,
|
|
116
|
+
close: Z
|
|
117
|
+
}), (e, t) => (m(), i("dialog", u({
|
|
118
|
+
ref_key: "dialog",
|
|
119
|
+
ref: V
|
|
120
|
+
}, y(I), {
|
|
121
|
+
id: y(L) ? `${y(I).id || y(L)}-dialog` : y(I).id || `ouds-modal-${y(B)}`,
|
|
122
|
+
class: ["modal-base", [s.type === "fullscreen" ? "modal-fullscreen-dialog" : "modal-dialog", {
|
|
123
|
+
"modal-small": s.type === "dialog" && s.size === "small",
|
|
124
|
+
"modal-fixed-height": s.type === "dialog" && s.fixedHeight,
|
|
125
|
+
"modal-non-blurred": s.type === "dialog" && s.nonBlurred
|
|
126
|
+
}]],
|
|
127
|
+
"aria-labelledby": y(I)["aria-labelledby"] || H.value,
|
|
128
|
+
"aria-describedby": y(I)["aria-describedby"] || (s.description || y(z)("description") ? U.value : void 0),
|
|
129
|
+
onCancel: Q,
|
|
130
|
+
onClose: X,
|
|
131
|
+
onPointerdown: t[1] ||= (e) => l(q) ? q.value = $(e) : q = $(e),
|
|
132
|
+
onClick: te
|
|
133
|
+
}), [
|
|
134
|
+
a("div", ee, [
|
|
135
|
+
g(e.$slots, "previous"),
|
|
136
|
+
s.subtitle || y(z)("subtitle") ? (m(), i("p", D, [g(e.$slots, "subtitle", {}, () => [o(v(s.subtitle), 1)])])) : r("", !0),
|
|
137
|
+
(m(), n(_(s.headingLevel), {
|
|
138
|
+
id: H.value,
|
|
139
|
+
class: "modal-title"
|
|
140
|
+
}, {
|
|
141
|
+
default: w(() => [s.variant !== "neutral" || y(z)("icon") ? (m(), i("span", {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: d(["modal-icon", s.variant !== "neutral" && `modal-icon-${s.variant}`]),
|
|
144
|
+
"aria-hidden": !W.value || void 0
|
|
145
|
+
}, [W.value ? (m(), i("span", k, v(W.value), 1)) : r("", !0), s.variant === "neutral" ? g(e.$slots, "icon", {}, void 0, void 0, 1) : r("", !0)], 10, O)) : r("", !0), g(e.$slots, "title", {}, () => [o(v(s.label), 1)])]),
|
|
146
|
+
_: 3
|
|
147
|
+
}, 8, ["id"])),
|
|
148
|
+
s.dismissible ? (m(), i("button", {
|
|
149
|
+
key: 1,
|
|
150
|
+
type: "button",
|
|
151
|
+
class: "btn btn-close",
|
|
152
|
+
"aria-label": s.closeLabel,
|
|
153
|
+
onClick: t[0] ||= (e) => Z()
|
|
154
|
+
}, null, 8, A)) : r("", !0)
|
|
155
|
+
]),
|
|
156
|
+
a("div", { class: d(["modal-body", { "pt-large": !s.description && !y(z)("description") && y(z)("default") }]) }, [
|
|
157
|
+
s.description || y(z)("description") ? (m(), i("p", {
|
|
158
|
+
key: 0,
|
|
159
|
+
id: U.value
|
|
160
|
+
}, [g(e.$slots, "description", {}, () => [o(v(s.description), 1)])], 8, j)) : r("", !0),
|
|
161
|
+
g(e.$slots, "default"),
|
|
162
|
+
y(z)("actions") && !G() ? (m(), i("div", {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: d(["modal-footer", { "modal-footer-horizontal": s.horizontalActions }])
|
|
165
|
+
}, [g(e.$slots, "actions", { close: Z })], 2)) : r("", !0)
|
|
166
|
+
], 2),
|
|
167
|
+
y(z)("actions") && G() ? (m(), i("div", {
|
|
168
|
+
key: 0,
|
|
169
|
+
class: d(["modal-footer", { "modal-footer-horizontal": s.horizontalActions }])
|
|
170
|
+
}, [g(e.$slots, "actions", { close: Z })], 2)) : r("", !0)
|
|
171
|
+
], 16, E));
|
|
172
|
+
}
|
|
173
|
+
}), N = ["dialog", "fullscreen"], P = ["default", "small"], F = [
|
|
174
|
+
"neutral",
|
|
175
|
+
"negative",
|
|
176
|
+
"positive",
|
|
177
|
+
"info",
|
|
178
|
+
"warning"
|
|
179
|
+
];
|
|
180
|
+
//#endregion
|
|
181
|
+
export { M as i, N as n, F as r, P as t };
|
package/dist/modal.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { A as e, M as t, N as n, T as r, a as i, b as a, c as o, d as s, f as c, g as l, j as u, k as d, l as f, o as p, p as m, s as h, t as g, u as _, v, x as y, y as b } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
|
|
2
|
+
import { r as x, t as S } from "./control-item-slots-BDoeNuk4.js";
|
|
3
|
+
//#region src/components/radio/radio.context.ts
|
|
4
|
+
var C = Symbol("ouds-radio-element-id"), w = { class: "control-item-assets-container" }, T = [
|
|
5
|
+
"id",
|
|
6
|
+
"name",
|
|
7
|
+
"value",
|
|
8
|
+
"checked",
|
|
9
|
+
"disabled",
|
|
10
|
+
"required",
|
|
11
|
+
"aria-describedby",
|
|
12
|
+
"aria-invalid"
|
|
13
|
+
], E = [
|
|
14
|
+
"id",
|
|
15
|
+
"aria-checked",
|
|
16
|
+
"aria-labelledby",
|
|
17
|
+
"aria-describedby",
|
|
18
|
+
"aria-invalid"
|
|
19
|
+
], D = { class: "control-item-text-container" }, O = ["id"], k = ["id"], A = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "control-item-assets-container"
|
|
22
|
+
}, j = /* @__PURE__ */ s({
|
|
23
|
+
inheritAttrs: !1,
|
|
24
|
+
__name: "Radio",
|
|
25
|
+
props: {
|
|
26
|
+
label: { default: "Radio" },
|
|
27
|
+
description: { default: "" },
|
|
28
|
+
value: { default: "" },
|
|
29
|
+
checked: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
required: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
divider: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
outlined: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
extraLabel: { default: "" },
|
|
50
|
+
name: { default: "" },
|
|
51
|
+
readonly: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
invalid: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
58
|
+
},
|
|
59
|
+
reverse: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
maxWidth: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
setup(s) {
|
|
69
|
+
let g = a();
|
|
70
|
+
function S() {
|
|
71
|
+
let { class: e, style: t, ...n } = g;
|
|
72
|
+
return n;
|
|
73
|
+
}
|
|
74
|
+
let j = d(() => g.id), M = y(), N = c(C, void 0), P = x(N !== void 0), F = d(() => N ? `${j.value || N}-input` : j.value || `ouds-radio-${M}`), I = d(() => `${F.value}-label`), L = d(() => `${F.value}-extra-label`), R = d(() => `${F.value}-description`);
|
|
75
|
+
function z() {
|
|
76
|
+
let e = [g["aria-describedby"]];
|
|
77
|
+
return (s.extraLabel || P("extra-label")) && e.push(L.value), (s.description || P("description")) && e.push(R.value), e.filter(Boolean).join(" ") || void 0;
|
|
78
|
+
}
|
|
79
|
+
function B() {
|
|
80
|
+
return [g["aria-labelledby"], I.value].filter(Boolean).join(" ");
|
|
81
|
+
}
|
|
82
|
+
let V = i(() => ["radio-button-item", {
|
|
83
|
+
"control-item-divider": s.divider,
|
|
84
|
+
"radio-button-item-outlined": s.outlined,
|
|
85
|
+
"control-item-reverse": s.reverse,
|
|
86
|
+
"component-max-width": s.maxWidth
|
|
87
|
+
}]);
|
|
88
|
+
return (i, a) => (l(), f("div", {
|
|
89
|
+
class: u([V.value, e(g).class]),
|
|
90
|
+
style: t(e(g).style)
|
|
91
|
+
}, [
|
|
92
|
+
p("div", w, [s.readonly ? (l(), f("span", m({ key: 1 }, S(), {
|
|
93
|
+
id: F.value,
|
|
94
|
+
class: "control-item-indicator",
|
|
95
|
+
role: "radio",
|
|
96
|
+
"aria-disabled": "true",
|
|
97
|
+
tabindex: "0",
|
|
98
|
+
"aria-checked": s.checked,
|
|
99
|
+
"aria-labelledby": B(),
|
|
100
|
+
"aria-describedby": z(),
|
|
101
|
+
"aria-invalid": s.invalid || e(g)["aria-invalid"]
|
|
102
|
+
}), null, 16, E)) : (l(), f("input", m({ key: 0 }, S(), {
|
|
103
|
+
id: F.value,
|
|
104
|
+
class: "control-item-indicator",
|
|
105
|
+
type: "radio",
|
|
106
|
+
name: s.name,
|
|
107
|
+
value: s.value,
|
|
108
|
+
checked: s.checked,
|
|
109
|
+
disabled: s.disabled,
|
|
110
|
+
required: s.required,
|
|
111
|
+
"aria-describedby": z(),
|
|
112
|
+
"aria-invalid": s.invalid || e(g)["aria-invalid"]
|
|
113
|
+
}), null, 16, T))]),
|
|
114
|
+
p("div", D, [
|
|
115
|
+
(l(), h(b(s.readonly ? "span" : "label"), {
|
|
116
|
+
id: I.value,
|
|
117
|
+
class: u(["control-item-label", { "is-required": s.required }]),
|
|
118
|
+
for: s.readonly ? void 0 : F.value
|
|
119
|
+
}, {
|
|
120
|
+
default: r(() => [v(i.$slots, "label", {}, () => [_(n(s.label), 1)])]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, [
|
|
123
|
+
"id",
|
|
124
|
+
"class",
|
|
125
|
+
"for"
|
|
126
|
+
])),
|
|
127
|
+
s.extraLabel || e(P)("extra-label") ? (l(), f("p", {
|
|
128
|
+
key: 0,
|
|
129
|
+
id: L.value,
|
|
130
|
+
class: "radio-button-extra-label"
|
|
131
|
+
}, [v(i.$slots, "extra-label", {}, () => [_(n(s.extraLabel), 1)])], 8, O)) : o("", !0),
|
|
132
|
+
s.description || e(P)("description") ? (l(), f("p", {
|
|
133
|
+
key: 1,
|
|
134
|
+
id: R.value,
|
|
135
|
+
class: "control-item-description"
|
|
136
|
+
}, [v(i.$slots, "description", {}, () => [_(n(s.description), 1)])], 8, k)) : o("", !0)
|
|
137
|
+
]),
|
|
138
|
+
e(P)("asset") ? (l(), f("div", A, [v(i.$slots, "asset")])) : o("", !0)
|
|
139
|
+
], 6));
|
|
140
|
+
}
|
|
141
|
+
}), M = 0, N = g(j, {
|
|
142
|
+
shadowRoot: !1,
|
|
143
|
+
configureApp(e) {
|
|
144
|
+
e.provide(C, `ouds-radio-element-${M++}`);
|
|
145
|
+
}
|
|
146
|
+
}), P = class extends N {
|
|
147
|
+
connectedCallback() {
|
|
148
|
+
S(this), super.connectedCallback();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
function F() {
|
|
152
|
+
typeof customElements < "u" && (customElements.get("ouds-radio") || customElements.define("ouds-radio", P));
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { F as n, P as t };
|