energy-components 1.10.1 → 1.11.0
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/components/collapsable.es.js +4 -0
- package/dist/components/collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js +86 -0
- package/dist/components/datepicker.es.js +717 -708
- package/dist/components/index.es.js +73 -70
- package/dist/components/style/collapsable.css +1 -0
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/textField.es.js +122 -108
- package/dist/energy-components.es.js +3413 -3308
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +53 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +15 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent as w, ref as d, computed as r, watch as f, nextTick as c, createElementBlock as B, openBlock as m, normalizeClass as i, createElementVNode as a, withKeys as C, createBlock as S, createCommentVNode as $, createVNode as I, toDisplayString as v, renderSlot as N, createTextVNode as V } from "vue";
|
|
2
|
+
import { R as h } from "./icon-svg-DuzOdbk1.js";
|
|
3
|
+
import './style/collapsable.css';const H = ["id", "aria-expanded", "aria-controls", "disabled"], x = { class: "rds-e-collapsable__header-title" }, D = { class: "rds-e-collapsable__header-title-text" }, E = ["id", "aria-labelledby"], W = /* @__PURE__ */ w({
|
|
4
|
+
__name: "collapsable",
|
|
5
|
+
props: {
|
|
6
|
+
title: {},
|
|
7
|
+
content: { default: "" },
|
|
8
|
+
icon: { default: "" },
|
|
9
|
+
open: { type: Boolean, default: !1 },
|
|
10
|
+
disabled: { type: Boolean, default: !1 },
|
|
11
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
12
|
+
id: { default: "" }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:open"],
|
|
15
|
+
setup(y, { emit: g }) {
|
|
16
|
+
const o = y, k = g, l = d(o.open), t = d(null), s = d(null), p = r(() => o.id || `rds-collapsable-${Math.random().toString(36).substr(2, 9)}`), u = r(() => `${p.value}-panel`), b = r(() => `${p.value}-header`), n = () => {
|
|
17
|
+
if (!t.value || !s.value) return;
|
|
18
|
+
const e = s.value.scrollHeight;
|
|
19
|
+
t.value.style.maxHeight = l.value ? `${e}px` : "0px";
|
|
20
|
+
}, _ = () => {
|
|
21
|
+
o.disabled || (l.value = !l.value, k("update:open", l.value), c(() => {
|
|
22
|
+
n();
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
return f(() => o.open, (e) => {
|
|
26
|
+
l.value = e, c(() => {
|
|
27
|
+
n();
|
|
28
|
+
});
|
|
29
|
+
}), f(l, () => {
|
|
30
|
+
c(() => {
|
|
31
|
+
n();
|
|
32
|
+
});
|
|
33
|
+
}, { immediate: !0 }), (e, K) => (m(), B("div", {
|
|
34
|
+
class: i(["rds-e-collapsable", {
|
|
35
|
+
"rds-e-collapsable--open": l.value,
|
|
36
|
+
"rds-e-collapsable--disabled": e.disabled,
|
|
37
|
+
"rds-e-collapsable--full-width": e.fullWidth
|
|
38
|
+
}])
|
|
39
|
+
}, [
|
|
40
|
+
a("button", {
|
|
41
|
+
id: b.value,
|
|
42
|
+
class: "rds-e-collapsable__header",
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-expanded": l.value,
|
|
45
|
+
"aria-controls": u.value,
|
|
46
|
+
disabled: e.disabled,
|
|
47
|
+
onClick: _,
|
|
48
|
+
onKeydown: C(_, ["enter", "space"])
|
|
49
|
+
}, [
|
|
50
|
+
e.icon ? (m(), S(h, {
|
|
51
|
+
key: 0,
|
|
52
|
+
name: e.icon,
|
|
53
|
+
class: "rds-e-collapsable__header-icon"
|
|
54
|
+
}, null, 8, ["name"])) : $("", !0),
|
|
55
|
+
a("span", x, [
|
|
56
|
+
a("span", D, v(e.title), 1)
|
|
57
|
+
]),
|
|
58
|
+
I(h, {
|
|
59
|
+
class: i(["rds-e-collapsable__header-arrow", { "rds-e-collapsable__header-arrow--open": l.value }]),
|
|
60
|
+
name: "arrow_down"
|
|
61
|
+
}, null, 8, ["class"])
|
|
62
|
+
], 40, H),
|
|
63
|
+
a("div", {
|
|
64
|
+
id: u.value,
|
|
65
|
+
ref_key: "panel",
|
|
66
|
+
ref: t,
|
|
67
|
+
class: i(["rds-e-collapsable__panel", { "rds-e-collapsable__panel--open": l.value }]),
|
|
68
|
+
role: "region",
|
|
69
|
+
"aria-labelledby": b.value
|
|
70
|
+
}, [
|
|
71
|
+
a("div", {
|
|
72
|
+
ref_key: "panelContent",
|
|
73
|
+
ref: s,
|
|
74
|
+
class: "rds-e-collapsable__panel-content"
|
|
75
|
+
}, [
|
|
76
|
+
N(e.$slots, "default", {}, () => [
|
|
77
|
+
V(v(e.content), 1)
|
|
78
|
+
])
|
|
79
|
+
], 512)
|
|
80
|
+
], 10, E)
|
|
81
|
+
], 2));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
W as _
|
|
86
|
+
};
|