@cling-se/widget 0.14.3 → 0.14.4

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 (134) hide show
  1. package/.eslintrc.cjs +4 -4
  2. package/README.md +40 -40
  3. package/package.json +1 -1
  4. package/tsconfig.json +26 -26
  5. package/tsconfig.node.json +10 -10
  6. package/tsconfig.paths.json +17 -17
  7. package/vite.config.ts +61 -61
  8. package/dist/AddClientCallout-DKH-LP5B.js +0 -46
  9. package/dist/AnswerModal-BCbq8wc4.js +0 -3869
  10. package/dist/AttachmentItem-60CSZnkF.js +0 -78
  11. package/dist/BaseDatePicker-Cl8SnC1k.js +0 -3183
  12. package/dist/BaseUpload-D4FCjlhL.js +0 -1977
  13. package/dist/BlockMedia-CqkwdGnE.js +0 -76
  14. package/dist/CCallout-BTBgU8f-.js +0 -59
  15. package/dist/CCurrencyDropdown-CL32Mo-Y.js +0 -246
  16. package/dist/CDropdownItem-DlWtQwO6.js +0 -538
  17. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  18. package/dist/CFormField-BxJv-nUO.js +0 -241
  19. package/dist/CPhoneFormat-CJ9kndtJ.js +0 -62
  20. package/dist/CPriceInput-BpXI5X2j.js +0 -112
  21. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  22. package/dist/ClientAutocomplete-D9Dj9iBW.js +0 -78
  23. package/dist/ClientModal-JOt8NGcR.js +0 -625
  24. package/dist/ColorPicker-uPKD-Gvm.js +0 -2879
  25. package/dist/CompanyModal-7bG0iIRd.js +0 -141
  26. package/dist/ContentWrapper-B2nyZHL4.js +0 -183
  27. package/dist/CoverBlockSettings-C1O_FAde.js +0 -275
  28. package/dist/DocAnswer-B9G-y4Px.js +0 -36
  29. package/dist/DocDetails-DYHxKChO.js +0 -246
  30. package/dist/DocForm-BktEXjML.js +0 -7273
  31. package/dist/DocFormSend-DM6QgUOj.js +0 -143
  32. package/dist/DocLinks-BIGwfB3H.js +0 -38
  33. package/dist/DocModalBase-D5GdwTI7.js +0 -28
  34. package/dist/DocPrint-HqbaIGms.js +0 -240
  35. package/dist/DocReceipt-WXo6vWyW.js +0 -210
  36. package/dist/DocSendReminder-C8dNEpLg.js +0 -137
  37. package/dist/DocTextEditor-BfOZFDTP.js +0 -17177
  38. package/dist/DocTimeline-CitwS9px.js +0 -481
  39. package/dist/DocumentClient-CQ_z8ajY.js +0 -136
  40. package/dist/DocumentLayout-BA7mFfZh.js +0 -4909
  41. package/dist/DocumentLogotype-woc_hfll.js +0 -87
  42. package/dist/DocumentVoided-DC4FzpxG.js +0 -25
  43. package/dist/EmbedInput-CheqYcNr.js +0 -113
  44. package/dist/EmbedSettings-YcwM8hJw.js +0 -72
  45. package/dist/ErrorCallout-6pCYcx00.js +0 -28
  46. package/dist/FilePreviewModal-T8AiphqO.js +0 -81
  47. package/dist/Flag-Ddm6a4Il.js +0 -114
  48. package/dist/HeaderSettings-DHdZweJH.js +0 -392
  49. package/dist/ImageSelectModal-CAoBhnI8.js +0 -84
  50. package/dist/ImageUploadWrapper-CNv59Lhh.js +0 -1604
  51. package/dist/Index-B6S9U4Z-.js +0 -26
  52. package/dist/Index-BHX0D5fW.js +0 -559
  53. package/dist/Index-BL_7m5Ca.js +0 -70
  54. package/dist/Index-BXMXEUfo.js +0 -223
  55. package/dist/Index-BhVBvMu6.js +0 -32
  56. package/dist/Index-Bl_SNW80.js +0 -25
  57. package/dist/Index-BsguntKl.js +0 -21
  58. package/dist/Index-CGYjPfsf.js +0 -2402
  59. package/dist/Index-CKrGb3of.js +0 -61
  60. package/dist/Index-CMNrQo5a.js +0 -140
  61. package/dist/Index-CU50Al5c.js +0 -642
  62. package/dist/Index-CdqrrZxd.js +0 -77
  63. package/dist/Index-CfnL9dAw.js +0 -58
  64. package/dist/Index-CuW0MYrT.js +0 -171
  65. package/dist/Index-D-z8JSn6.js +0 -154
  66. package/dist/Index-D8giJ_bs.js +0 -84
  67. package/dist/Index-DDvfqy_h.js +0 -24
  68. package/dist/Index-DQDalqZ-.js +0 -107
  69. package/dist/Index-DTIPKKkV.js +0 -150
  70. package/dist/Index-DWxzUBff.js +0 -754
  71. package/dist/Index-DaNGeDQw.js +0 -144
  72. package/dist/Index-DfLU_AyN.js +0 -49
  73. package/dist/Index-DkVav_I7.js +0 -25
  74. package/dist/Index-Dxp8QAtB.js +0 -57
  75. package/dist/Index-DzjxFkcv.js +0 -52
  76. package/dist/Index-EwUJJWaB.js +0 -69
  77. package/dist/Index-I60qAqLl.js +0 -31
  78. package/dist/Index-LfF-7lQK.js +0 -292
  79. package/dist/Index-P0_dyc2V.js +0 -45
  80. package/dist/Index-RQMPSeHw.js +0 -98
  81. package/dist/Index-oipNLl3Y.js +0 -46
  82. package/dist/Index-sJq2Iyvt.js +0 -62
  83. package/dist/Index-uubi3NHX.js +0 -33
  84. package/dist/Index-vNj2kYZT.js +0 -55
  85. package/dist/InputToggleRow-B2pWvVyx.js +0 -57
  86. package/dist/ManualPopover-BI_Sf1zG.js +0 -54
  87. package/dist/MediaWrapper-eFpWxv3n.js +0 -23
  88. package/dist/NotBindingText-DA5NpePz.js +0 -32
  89. package/dist/PackageGroup-DOSijBdN.js +0 -699
  90. package/dist/PdfTerms-Q5YuVtrJ.js +0 -36
  91. package/dist/PdfViewer-zcWl8XZT.js +0 -374
  92. package/dist/PlainHtml-BmA83UAm.js +0 -20
  93. package/dist/PriceHeader-C14L5zgG.js +0 -339
  94. package/dist/SearchApi-CGT7-jVf.js +0 -161
  95. package/dist/Setup-RJQvZlDO.js +0 -50
  96. package/dist/SmartList-YosKRPVn.js +0 -83
  97. package/dist/TermsSettings-C5JTv7rT.js +0 -102
  98. package/dist/ThemeColorRow-D-C_tm2f.js +0 -63
  99. package/dist/ToggleBinding-KEVHHvKf.js +0 -38
  100. package/dist/UploadModal-DOYoWELI.js +0 -95
  101. package/dist/VideoPlayerInput-Dxb6CNk-.js +0 -93
  102. package/dist/VideoPlayerSettings-DsVN4Ix-.js +0 -61
  103. package/dist/VideoSelectModal-BpfzNx61.js +0 -100
  104. package/dist/anime.es-BrPTThYb.js +0 -858
  105. package/dist/answerDocumentMixin-BJMGrfUs.js +0 -51
  106. package/dist/color-TdtKxwVa.js +0 -19
  107. package/dist/debounce-BN83gOVd.js +0 -84
  108. package/dist/dom-CJxkno7i.js +0 -91
  109. package/dist/favicon.ico +0 -0
  110. package/dist/focusDrawerMixin-CawyQaGq.js +0 -22
  111. package/dist/formComponentsInstall-jcnyQ1zw.js +0 -2494
  112. package/dist/formDrawerState-BdNohvZH.js +0 -20
  113. package/dist/formValidationMixin-DOwgebZk.js +0 -49
  114. package/dist/i18nMessages-Chz_lxGG.js +0 -17
  115. package/dist/index-BBJIOkm_.js +0 -347
  116. package/dist/index-BNq9YCWc.js +0 -166
  117. package/dist/index-BdhbkLLU.js +0 -81
  118. package/dist/index-COf8F6CL.js +0 -3916
  119. package/dist/index-D0WvZHX_.js +0 -102
  120. package/dist/index-DTzZP4yq.js +0 -492
  121. package/dist/index.es.js +0 -35
  122. package/dist/index.umd.js +0 -3148
  123. package/dist/main-DE5THsiR.js +0 -56739
  124. package/dist/mapFormMixin-y2txvLw9.js +0 -72
  125. package/dist/omit-BrsWQAtU.js +0 -31
  126. package/dist/publicSenderState-BYsq95Vt.js +0 -21
  127. package/dist/splitpanes-BHUVsCZF.js +0 -382
  128. package/dist/style.css +0 -4
  129. package/dist/throttle-C2srA2wa.js +0 -18
  130. package/dist/tinycolor-SjV_ROuP.js +0 -633
  131. package/dist/tippy.esm-Dj7DQppr.js +0 -1799
  132. package/dist/utils-16HMuRfY.js +0 -108
  133. package/dist/vuedraggable.umd-Cd1g2Hr7.js +0 -3161
  134. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,72 +0,0 @@
1
- import { b as r } from "./main-DE5THsiR.js";
2
- const f = (a = [], { event: o = "input", type: c = void 0, useEmit: d = !0, setFnName: l } = {}) => ({
3
- inheritAttrs: !1,
4
- props: {
5
- _document: {
6
- type: Object,
7
- default: () => ({})
8
- },
9
- _value: {
10
- type: Object,
11
- default: () => ({})
12
- }
13
- },
14
- inject: {
15
- viewSettings: {
16
- default: () => ({
17
- canEdit: !1,
18
- isForm: !1,
19
- setFormValue: null,
20
- removeFormValue: null,
21
- isPublicForm: !1
22
- })
23
- },
24
- containerType: {
25
- default: () => ({})
26
- }
27
- },
28
- computed: {
29
- canEdit() {
30
- return r(this, "viewSettings.canEdit");
31
- },
32
- device() {
33
- return r(this, "containerType.device", "");
34
- },
35
- isForm() {
36
- return r(this, "viewSettings.isForm");
37
- },
38
- ...a.reduce((i, e) => {
39
- const t = e, s = {
40
- get() {
41
- return this._value ? r(this._document, (this._value || {})[e]) : r(this.$attrs, e);
42
- },
43
- set(u) {
44
- this.setField({ field: e, value: u, type: c });
45
- }
46
- };
47
- return i[t] = s, i;
48
- }, {})
49
- },
50
- methods: {
51
- // Setter method exposed to host component, in case extra setter options are needed
52
- // Providing either 'key' or 'field' optional, but one required
53
- // key > field
54
- // 'field' refers to name of computed field registered for the mixin
55
- setField({ key: i, field: e, value: t, options: s, type: u }) {
56
- const n = i || (this._value || {})[e];
57
- if (!n)
58
- return;
59
- const m = l ? this[l] : this.viewSettings.setFormValue;
60
- !d && typeof m == "function" ? m({ key: n, value: t, options: s }) : o ? (u === "number" && Number.isNaN(parseFloat(t)) && (t = null), this.$emit(o, { key: n, value: t, options: s })) : this.$emit({ key: n, value: t, options: s });
61
- },
62
- // Forward of document remove method
63
- // Note: does not yet support emit option like the setter
64
- removeField(i) {
65
- var e, t;
66
- (t = (e = this.viewSettings) == null ? void 0 : e.removeFormValue) == null || t.call(e, i);
67
- }
68
- }
69
- });
70
- export {
71
- f as m
72
- };
@@ -1,31 +0,0 @@
1
- import { W as l, _ as o, X as i, Y as _, k as u, Z as f, $ as v, a0 as c, a1 as m, a2 as O, a3 as g } from "./main-DE5THsiR.js";
2
- var C = l;
3
- function L(t) {
4
- return C(t) ? void 0 : t;
5
- }
6
- var b = L, F = o;
7
- function A(t) {
8
- var e = t == null ? 0 : t.length;
9
- return e ? F(t, 1) : [];
10
- }
11
- var E = A, P = E, R = i, $ = _;
12
- function d(t) {
13
- return $(R(t, void 0, P), t + "");
14
- }
15
- var y = d, S = f, D = O, G = v, M = g, N = c, T = b, h = y, j = m, p = 1, x = 2, I = 4, K = h(function(t, e) {
16
- var a = {};
17
- if (t == null)
18
- return a;
19
- var s = !1;
20
- e = S(e, function(n) {
21
- return n = M(n, t), s || (s = n.length > 1), n;
22
- }), N(t, j(t), a), s && (a = D(a, p | x | I, T));
23
- for (var r = e.length; r--; )
24
- G(a, e[r]);
25
- return a;
26
- }), U = K;
27
- const k = /* @__PURE__ */ u(U);
28
- export {
29
- y as _,
30
- k as o
31
- };
@@ -1,21 +0,0 @@
1
- import { I as a, V as c } from "./main-DE5THsiR.js";
2
- const e = JSON.parse(a.getItem("publicSender")), s = c.observable({
3
- company: {
4
- name: "",
5
- LogotypePublicId: null,
6
- ...e ? e.company : {}
7
- },
8
- user: {
9
- email: "",
10
- firstname: "",
11
- lastname: "",
12
- cellphone: "",
13
- ...e ? e.user : {}
14
- }
15
- }), r = ({ company: n, user: t }) => {
16
- Object.assign(s.company, n), Object.assign(s.user, t), a.setItem("publicSender", JSON.stringify(s));
17
- };
18
- export {
19
- r as a,
20
- s
21
- };
@@ -1,382 +0,0 @@
1
- var _ = Object.defineProperty, M = Object.defineProperties, g = Object.getOwnPropertyDescriptors, u = Object.getOwnPropertySymbols, v = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable, m = (e, t, i) => t in e ? _(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, y = (e, t) => {
2
- for (var i in t || (t = {}))
3
- v.call(t, i) && m(e, i, t[i]);
4
- if (u)
5
- for (var i of u(t))
6
- P.call(t, i) && m(e, i, t[i]);
7
- return e;
8
- }, C = (e, t) => M(e, g(t)), w = (e, t) => {
9
- var i = {};
10
- for (var s in e)
11
- v.call(e, s) && t.indexOf(s) < 0 && (i[s] = e[s]);
12
- if (e != null && u)
13
- for (var s of u(e))
14
- t.indexOf(s) < 0 && P.call(e, s) && (i[s] = e[s]);
15
- return i;
16
- };
17
- function S(e, t, i, s, n, a, r, h) {
18
- var o = typeof e == "function" ? e.options : e;
19
- t && (o.render = t, o.staticRenderFns = i, o._compiled = !0);
20
- var l;
21
- if (n && (l = n), l)
22
- if (o.functional) {
23
- o._injectStyles = l;
24
- var c = o.render;
25
- o.render = function(x, p) {
26
- return l.call(p), c(x, p);
27
- };
28
- } else {
29
- var d = o.beforeCreate;
30
- o.beforeCreate = d ? [].concat(d, l) : [l];
31
- }
32
- return {
33
- exports: e,
34
- options: o
35
- };
36
- }
37
- const b = {
38
- name: "splitpanes",
39
- props: {
40
- horizontal: { type: Boolean },
41
- pushOtherPanes: { type: Boolean, default: !0 },
42
- dblClickSplitter: { type: Boolean, default: !0 },
43
- rtl: { type: Boolean, default: !1 },
44
- firstSplitter: { type: Boolean }
45
- },
46
- provide() {
47
- return {
48
- requestUpdate: this.requestUpdate,
49
- onPaneAdd: this.onPaneAdd,
50
- onPaneRemove: this.onPaneRemove,
51
- onPaneClick: this.onPaneClick
52
- };
53
- },
54
- data: () => ({
55
- container: null,
56
- ready: !1,
57
- panes: [],
58
- touch: {
59
- mouseDown: !1,
60
- dragging: !1,
61
- activeSplitter: null
62
- },
63
- splitterTaps: {
64
- splitter: null,
65
- timeoutId: null
66
- }
67
- }),
68
- computed: {
69
- panesCount() {
70
- return this.panes.length;
71
- },
72
- indexedPanes() {
73
- return this.panes.reduce((e, t) => (e[t.id] = t) && e, {});
74
- }
75
- },
76
- methods: {
77
- updatePaneComponents() {
78
- this.panes.forEach((e) => {
79
- e.update && e.update({
80
- [this.horizontal ? "height" : "width"]: `${this.indexedPanes[e.id].size}%`
81
- });
82
- });
83
- },
84
- bindEvents() {
85
- document.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.addEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.addEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.addEventListener("touchend", this.onMouseUp));
86
- },
87
- unbindEvents() {
88
- document.removeEventListener("mousemove", this.onMouseMove, { passive: !1 }), document.removeEventListener("mouseup", this.onMouseUp), "ontouchstart" in window && (document.removeEventListener("touchmove", this.onMouseMove, { passive: !1 }), document.removeEventListener("touchend", this.onMouseUp));
89
- },
90
- onMouseDown(e, t) {
91
- this.bindEvents(), this.touch.mouseDown = !0, this.touch.activeSplitter = t;
92
- },
93
- onMouseMove(e) {
94
- this.touch.mouseDown && (e.preventDefault(), this.touch.dragging = !0, this.calculatePanesSize(this.getCurrentMouseDrag(e)), this.$emit("resize", this.panes.map((t) => ({ min: t.min, max: t.max, size: t.size }))));
95
- },
96
- onMouseUp() {
97
- this.touch.dragging && this.$emit("resized", this.panes.map((e) => ({ min: e.min, max: e.max, size: e.size }))), this.touch.mouseDown = !1, setTimeout(() => {
98
- this.touch.dragging = !1, this.unbindEvents();
99
- }, 100);
100
- },
101
- onSplitterClick(e, t) {
102
- "ontouchstart" in window && (e.preventDefault(), this.dblClickSplitter && (this.splitterTaps.splitter === t ? (clearTimeout(this.splitterTaps.timeoutId), this.splitterTaps.timeoutId = null, this.onSplitterDblClick(e, t), this.splitterTaps.splitter = null) : (this.splitterTaps.splitter = t, this.splitterTaps.timeoutId = setTimeout(() => {
103
- this.splitterTaps.splitter = null;
104
- }, 500)))), this.touch.dragging || this.$emit("splitter-click", this.panes[t]);
105
- },
106
- onSplitterDblClick(e, t) {
107
- let i = 0;
108
- this.panes = this.panes.map((s, n) => (s.size = n === t ? s.max : s.min, n !== t && (i += s.min), s)), this.panes[t].size -= i, this.$emit("pane-maximize", this.panes[t]);
109
- },
110
- onPaneClick(e, t) {
111
- this.$emit("pane-click", this.indexedPanes[t]);
112
- },
113
- getCurrentMouseDrag(e) {
114
- const t = this.container.getBoundingClientRect(), { clientX: i, clientY: s } = "ontouchstart" in window && e.touches ? e.touches[0] : e;
115
- return {
116
- x: i - t.left,
117
- y: s - t.top
118
- };
119
- },
120
- getCurrentDragPercentage(e) {
121
- e = e[this.horizontal ? "y" : "x"];
122
- const t = this.container[this.horizontal ? "clientHeight" : "clientWidth"];
123
- return this.rtl && !this.horizontal && (e = t - e), e * 100 / t;
124
- },
125
- calculatePanesSize(e) {
126
- const t = this.touch.activeSplitter;
127
- let i = {
128
- prevPanesSize: this.sumPrevPanesSize(t),
129
- nextPanesSize: this.sumNextPanesSize(t),
130
- prevReachedMinPanes: 0,
131
- nextReachedMinPanes: 0
132
- };
133
- const s = 0 + (this.pushOtherPanes ? 0 : i.prevPanesSize), n = 100 - (this.pushOtherPanes ? 0 : i.nextPanesSize), a = Math.max(Math.min(this.getCurrentDragPercentage(e), n), s);
134
- let r = [t, t + 1], h = this.panes[r[0]] || null, o = this.panes[r[1]] || null;
135
- const l = h.max < 100 && a >= h.max + i.prevPanesSize, c = o.max < 100 && a <= 100 - (o.max + this.sumNextPanesSize(t + 1));
136
- if (l || c) {
137
- l ? (h.size = h.max, o.size = Math.max(100 - h.max - i.prevPanesSize - i.nextPanesSize, 0)) : (h.size = Math.max(100 - o.max - i.prevPanesSize - this.sumNextPanesSize(t + 1), 0), o.size = o.max);
138
- return;
139
- }
140
- if (this.pushOtherPanes) {
141
- const d = this.doPushOtherPanes(i, a);
142
- if (!d)
143
- return;
144
- ({ sums: i, panesToResize: r } = d), h = this.panes[r[0]] || null, o = this.panes[r[1]] || null;
145
- }
146
- h !== null && (h.size = Math.min(Math.max(a - i.prevPanesSize - i.prevReachedMinPanes, h.min), h.max)), o !== null && (o.size = Math.min(Math.max(100 - a - i.nextPanesSize - i.nextReachedMinPanes, o.min), o.max));
147
- },
148
- doPushOtherPanes(e, t) {
149
- const i = this.touch.activeSplitter, s = [i, i + 1];
150
- return t < e.prevPanesSize + this.panes[s[0]].min && (s[0] = this.findPrevExpandedPane(i).index, e.prevReachedMinPanes = 0, s[0] < i && this.panes.forEach((n, a) => {
151
- a > s[0] && a <= i && (n.size = n.min, e.prevReachedMinPanes += n.min);
152
- }), e.prevPanesSize = this.sumPrevPanesSize(s[0]), s[0] === void 0) ? (e.prevReachedMinPanes = 0, this.panes[0].size = this.panes[0].min, this.panes.forEach((n, a) => {
153
- a > 0 && a <= i && (n.size = n.min, e.prevReachedMinPanes += n.min);
154
- }), this.panes[s[1]].size = 100 - e.prevReachedMinPanes - this.panes[0].min - e.prevPanesSize - e.nextPanesSize, null) : t > 100 - e.nextPanesSize - this.panes[s[1]].min && (s[1] = this.findNextExpandedPane(i).index, e.nextReachedMinPanes = 0, s[1] > i + 1 && this.panes.forEach((n, a) => {
155
- a > i && a < s[1] && (n.size = n.min, e.nextReachedMinPanes += n.min);
156
- }), e.nextPanesSize = this.sumNextPanesSize(s[1] - 1), s[1] === void 0) ? (e.nextReachedMinPanes = 0, this.panes[this.panesCount - 1].size = this.panes[this.panesCount - 1].min, this.panes.forEach((n, a) => {
157
- a < this.panesCount - 1 && a >= i + 1 && (n.size = n.min, e.nextReachedMinPanes += n.min);
158
- }), this.panes[s[0]].size = 100 - e.prevPanesSize - e.nextReachedMinPanes - this.panes[this.panesCount - 1].min - e.nextPanesSize, null) : { sums: e, panesToResize: s };
159
- },
160
- sumPrevPanesSize(e) {
161
- return this.panes.reduce((t, i, s) => t + (s < e ? i.size : 0), 0);
162
- },
163
- sumNextPanesSize(e) {
164
- return this.panes.reduce((t, i, s) => t + (s > e + 1 ? i.size : 0), 0);
165
- },
166
- findPrevExpandedPane(e) {
167
- return [...this.panes].reverse().find((i) => i.index < e && i.size > i.min) || {};
168
- },
169
- findNextExpandedPane(e) {
170
- return this.panes.find((i) => i.index > e + 1 && i.size > i.min) || {};
171
- },
172
- checkSplitpanesNodes() {
173
- Array.from(this.container.children).forEach((t) => {
174
- const i = t.classList.contains("splitpanes__pane"), s = t.classList.contains("splitpanes__splitter");
175
- if (!i && !s) {
176
- t.parentNode.removeChild(t), console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.");
177
- return;
178
- }
179
- });
180
- },
181
- addSplitter(e, t, i = !1) {
182
- const s = e - 1, n = document.createElement("div");
183
- n.classList.add("splitpanes__splitter"), i || (n.onmousedown = (a) => this.onMouseDown(a, s), typeof window < "u" && "ontouchstart" in window && (n.ontouchstart = (a) => this.onMouseDown(a, s)), n.onclick = (a) => this.onSplitterClick(a, s + 1)), this.dblClickSplitter && (n.ondblclick = (a) => this.onSplitterDblClick(a, s + 1)), t.parentNode.insertBefore(n, t);
184
- },
185
- removeSplitter(e) {
186
- e.onmousedown = void 0, e.onclick = void 0, e.ondblclick = void 0, e.parentNode.removeChild(e);
187
- },
188
- redoSplitters() {
189
- const e = Array.from(this.container.children);
190
- e.forEach((i) => {
191
- i.className.includes("splitpanes__splitter") && this.removeSplitter(i);
192
- });
193
- let t = 0;
194
- e.forEach((i) => {
195
- i.className.includes("splitpanes__pane") && (!t && this.firstSplitter ? this.addSplitter(t, i, !0) : t && this.addSplitter(t, i), t++);
196
- });
197
- },
198
- requestUpdate(e) {
199
- var t = e, { target: i } = t, s = w(t, ["target"]);
200
- const n = this.indexedPanes[i._uid];
201
- Object.entries(s).forEach(([a, r]) => n[a] = r);
202
- },
203
- onPaneAdd(e) {
204
- let t = -1;
205
- Array.from(e.$el.parentNode.children).some((n) => (n.className.includes("splitpanes__pane") && t++, n === e.$el));
206
- const i = parseFloat(e.minSize), s = parseFloat(e.maxSize);
207
- this.panes.splice(t, 0, {
208
- id: e._uid,
209
- index: t,
210
- min: isNaN(i) ? 0 : i,
211
- max: isNaN(s) ? 100 : s,
212
- size: e.size === null ? null : parseFloat(e.size),
213
- givenSize: e.size,
214
- update: e.update
215
- }), this.panes.forEach((n, a) => n.index = a), this.ready && this.$nextTick(() => {
216
- this.redoSplitters(), this.resetPaneSizes({ addedPane: this.panes[t] }), this.$emit("pane-add", { index: t, panes: this.panes.map((n) => ({ min: n.min, max: n.max, size: n.size })) });
217
- });
218
- },
219
- onPaneRemove(e) {
220
- const t = this.panes.findIndex((s) => s.id === e._uid), i = this.panes.splice(t, 1)[0];
221
- this.panes.forEach((s, n) => s.index = n), this.$nextTick(() => {
222
- this.redoSplitters(), this.resetPaneSizes({ removedPane: C(y({}, i), { index: t }) }), this.$emit("pane-remove", { removed: i, panes: this.panes.map((s) => ({ min: s.min, max: s.max, size: s.size })) });
223
- });
224
- },
225
- resetPaneSizes(e = {}) {
226
- !e.addedPane && !e.removedPane ? this.initialPanesSizing() : this.panes.some((t) => t.givenSize !== null || t.min || t.max < 100) ? this.equalizeAfterAddOrRemove(e) : this.equalize(), this.ready && this.$emit("resized", this.panes.map((t) => ({ min: t.min, max: t.max, size: t.size })));
227
- },
228
- equalize() {
229
- const e = 100 / this.panesCount;
230
- let t = 0, i = [], s = [];
231
- this.panes.forEach((n) => {
232
- n.size = Math.max(Math.min(e, n.max), n.min), t -= n.size, n.size >= n.max && i.push(n.id), n.size <= n.min && s.push(n.id);
233
- }), t > 0.1 && this.readjustSizes(t, i, s);
234
- },
235
- initialPanesSizing() {
236
- 100 / this.panesCount;
237
- let e = 100, t = [], i = [], s = 0;
238
- this.panes.forEach((a) => {
239
- e -= a.size, a.size !== null && s++, a.size >= a.max && t.push(a.id), a.size <= a.min && i.push(a.id);
240
- });
241
- let n = 100;
242
- e > 0.1 && (this.panes.forEach((a) => {
243
- a.size === null && (a.size = Math.max(Math.min(e / (this.panesCount - s), a.max), a.min)), n -= a.size;
244
- }), n > 0.1 && this.readjustSizes(e, t, i));
245
- },
246
- equalizeAfterAddOrRemove({ addedPane: e, removedPane: t } = {}) {
247
- let i = 100 / this.panesCount, s = 0, n = [], a = [];
248
- e && e.givenSize !== null && (i = (100 - e.givenSize) / (this.panesCount - 1)), this.panes.forEach((r) => {
249
- s -= r.size, r.size >= r.max && n.push(r.id), r.size <= r.min && a.push(r.id);
250
- }), !(Math.abs(s) < 0.1) && (this.panes.forEach((r) => {
251
- e && e.givenSize !== null && e.id === r.id || (r.size = Math.max(Math.min(i, r.max), r.min)), s -= r.size, r.size >= r.max && n.push(r.id), r.size <= r.min && a.push(r.id);
252
- }), s > 0.1 && this.readjustSizes(s, n, a));
253
- },
254
- readjustSizes(e, t, i) {
255
- let s;
256
- e > 0 ? s = e / (this.panesCount - t.length) : s = e / (this.panesCount - i.length), this.panes.forEach((n, a) => {
257
- if (e > 0 && !t.includes(n.id)) {
258
- const r = Math.max(Math.min(n.size + s, n.max), n.min), h = r - n.size;
259
- e -= h, n.size = r;
260
- } else if (!i.includes(n.id)) {
261
- const r = Math.max(Math.min(n.size + s, n.max), n.min), h = r - n.size;
262
- e -= h, n.size = r;
263
- }
264
- n.update({
265
- [this.horizontal ? "height" : "width"]: `${this.indexedPanes[n.id].size}%`
266
- });
267
- }), Math.abs(e) > 0.1 && this.$nextTick(() => {
268
- this.ready && console.warn("Splitpanes: Could not resize panes correctly due to their constraints.");
269
- });
270
- }
271
- },
272
- watch: {
273
- panes: {
274
- deep: !0,
275
- immediate: !1,
276
- handler() {
277
- this.updatePaneComponents();
278
- }
279
- },
280
- horizontal() {
281
- this.updatePaneComponents();
282
- },
283
- firstSplitter() {
284
- this.redoSplitters();
285
- },
286
- dblClickSplitter(e) {
287
- [...this.container.querySelectorAll(".splitpanes__splitter")].forEach((i, s) => {
288
- i.ondblclick = e ? (n) => this.onSplitterDblClick(n, s) : void 0;
289
- });
290
- }
291
- },
292
- beforeDestroy() {
293
- this.ready = !1;
294
- },
295
- mounted() {
296
- this.container = this.$refs.container, this.checkSplitpanesNodes(), this.redoSplitters(), this.resetPaneSizes(), this.$emit("ready"), this.ready = !0;
297
- },
298
- render(e) {
299
- return e("div", {
300
- ref: "container",
301
- class: [
302
- "splitpanes",
303
- `splitpanes--${this.horizontal ? "horizontal" : "vertical"}`,
304
- {
305
- "splitpanes--dragging": this.touch.dragging
306
- }
307
- ]
308
- }, this.$slots.default);
309
- }
310
- };
311
- let E, R;
312
- const f = {};
313
- var k = /* @__PURE__ */ S(b, E, R, !1, N);
314
- function N(e) {
315
- for (let t in f)
316
- this[t] = f[t];
317
- }
318
- var j = /* @__PURE__ */ function() {
319
- return k.exports;
320
- }(), O = function() {
321
- var e = this, t = e.$createElement, i = e._self._c || t;
322
- return i("div", { staticClass: "splitpanes__pane", style: e.style, on: { click: function(s) {
323
- return e.onPaneClick(s, e._uid);
324
- } } }, [e._t("default")], 2);
325
- }, D = [];
326
- const $ = {
327
- name: "pane",
328
- inject: ["requestUpdate", "onPaneAdd", "onPaneRemove", "onPaneClick"],
329
- props: {
330
- size: { type: [Number, String], default: null },
331
- minSize: { type: [Number, String], default: 0 },
332
- maxSize: { type: [Number, String], default: 100 }
333
- },
334
- data: () => ({
335
- style: {}
336
- }),
337
- mounted() {
338
- this.onPaneAdd(this);
339
- },
340
- beforeDestroy() {
341
- this.onPaneRemove(this);
342
- },
343
- methods: {
344
- update(e) {
345
- this.style = e;
346
- }
347
- },
348
- computed: {
349
- sizeNumber() {
350
- return this.size || this.size === 0 ? parseFloat(this.size) : null;
351
- },
352
- minSizeNumber() {
353
- return parseFloat(this.minSize);
354
- },
355
- maxSizeNumber() {
356
- return parseFloat(this.maxSize);
357
- }
358
- },
359
- watch: {
360
- sizeNumber(e) {
361
- this.requestUpdate({ target: this, size: e });
362
- },
363
- minSizeNumber(e) {
364
- this.requestUpdate({ target: this, min: e });
365
- },
366
- maxSizeNumber(e) {
367
- this.requestUpdate({ target: this, max: e });
368
- }
369
- }
370
- }, z = {};
371
- var T = /* @__PURE__ */ S($, O, D, !1, q);
372
- function q(e) {
373
- for (let t in z)
374
- this[t] = z[t];
375
- }
376
- var U = /* @__PURE__ */ function() {
377
- return T.exports;
378
- }();
379
- export {
380
- U as p,
381
- j as s
382
- };