@knime/product-features 0.2.3 → 0.3.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/_plugin-vue_export-helper-BLJdeqtw.js +15264 -0
- package/dist/_plugin-vue_export-helper-BLJdeqtw.js.map +1 -0
- package/dist/_plugin-vue_export-helper.css +4544 -0
- package/dist/ai.css +197 -0
- package/dist/ai.js +195 -0
- package/dist/ai.js.map +1 -0
- package/dist/nodes.css +0 -4564
- package/dist/nodes.js +3 -11252
- package/dist/nodes.js.map +1 -1
- package/dist/src/ai/KdsPromptInput/InlineStatusBanner.vue.d.ts +11 -0
- package/dist/src/ai/KdsPromptInput/InlineStatusBanner.vue.d.ts.map +1 -0
- package/dist/src/ai/KdsPromptInput/KdsPromptInput.vue.d.ts +22 -0
- package/dist/src/ai/KdsPromptInput/KdsPromptInput.vue.d.ts.map +1 -0
- package/dist/src/ai/KdsPromptInput/enums.d.ts +6 -0
- package/dist/src/ai/KdsPromptInput/enums.d.ts.map +1 -0
- package/dist/src/ai/KdsPromptInput/index.d.ts +4 -0
- package/dist/src/ai/KdsPromptInput/index.d.ts.map +1 -0
- package/dist/src/ai/KdsPromptInput/types.d.ts +59 -0
- package/dist/src/ai/KdsPromptInput/types.d.ts.map +1 -0
- package/dist/src/ai/index.d.ts +3 -0
- package/dist/src/ai/index.d.ts.map +1 -0
- package/dist/src/versions/CreateVersionForm/CreateVersionForm.vue.d.ts +16 -0
- package/dist/src/versions/CreateVersionForm/CreateVersionForm.vue.d.ts.map +1 -0
- package/dist/src/versions/CreateVersionForm/index.d.ts +3 -0
- package/dist/src/versions/CreateVersionForm/index.d.ts.map +1 -0
- package/dist/src/versions/CreateVersionForm/types.d.ts +4 -0
- package/dist/src/versions/CreateVersionForm/types.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/CurrentState.vue.d.ts +20 -0
- package/dist/src/versions/VersionHistory/CurrentState.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/HistoryEvent.vue.d.ts +23 -0
- package/dist/src/versions/VersionHistory/HistoryEvent.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/HistoryEventAuthor.vue.d.ts +7 -0
- package/dist/src/versions/VersionHistory/HistoryEventAuthor.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/HistoryEventFooter.vue.d.ts +8 -0
- package/dist/src/versions/VersionHistory/HistoryEventFooter.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/VersionHistory.vue.d.ts +20 -0
- package/dist/src/versions/VersionHistory/VersionHistory.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/VersionItem.vue.d.ts +20 -0
- package/dist/src/versions/VersionHistory/VersionItem.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/VersionLabel.vue.d.ts +144 -0
- package/dist/src/versions/VersionHistory/VersionLabel.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/VersionLimitInfo.vue.d.ts +9 -0
- package/dist/src/versions/VersionHistory/VersionLimitInfo.vue.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/constants.d.ts +4 -0
- package/dist/src/versions/VersionHistory/constants.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/index.d.ts +4 -0
- package/dist/src/versions/VersionHistory/index.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/mock-data/index.d.ts +11 -0
- package/dist/src/versions/VersionHistory/mock-data/index.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/mock-data/savepoints.d.ts +5 -0
- package/dist/src/versions/VersionHistory/mock-data/savepoints.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/mock-data/versionHistory.d.ts +7 -0
- package/dist/src/versions/VersionHistory/mock-data/versionHistory.d.ts.map +1 -0
- package/dist/src/versions/VersionHistory/types.d.ts +63 -0
- package/dist/src/versions/VersionHistory/types.d.ts.map +1 -0
- package/dist/src/versions/index.d.ts +5 -0
- package/dist/src/versions/index.d.ts.map +1 -0
- package/dist/versions.css +114 -0
- package/dist/versions.js +630 -0
- package/dist/versions.js.map +1 -0
- package/package.json +11 -3
package/dist/versions.js
ADDED
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, createVNode, unref, renderSlot, toDisplayString, ref, computed, onMounted, createTextVNode, normalizeClass, Fragment, createBlock, withCtx, createSlots, withModifiers, useModel, useTemplateRef, normalizeStyle, mergeModels, renderList, nextTick } from 'vue';
|
|
2
|
+
import { d as KdsIcon, _ as _export_sfc, h as KdsAvatar, i as KdsSelectableCard, j as _sfc_main$1h, e as _sfc_main$1s, k as _sfc_main$1p, l as KdsPopover, a as KdsDescription, m as _sfc_main$h, n as _sfc_main$1r, o as KdsPanel, p as KdsTextInput, q as KdsTextarea } from './_plugin-vue_export-helper-BLJdeqtw.js';
|
|
3
|
+
|
|
4
|
+
import './versions.css';const _hoisted_1$8 = { class: "history-event-wrapper" };
|
|
5
|
+
const _hoisted_2$4 = { class: "history-event-decorator" };
|
|
6
|
+
const _hoisted_3 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "history-event-line-top"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_4 = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "history-event-line-bottom"
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_5 = { class: "card-wrapper" };
|
|
15
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
16
|
+
__name: "HistoryEvent",
|
|
17
|
+
props: {
|
|
18
|
+
isSelected: { type: Boolean },
|
|
19
|
+
isFirstItem: { type: Boolean },
|
|
20
|
+
isLastItem: { type: Boolean }
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
return (_ctx, _cache) => {
|
|
24
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
25
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
26
|
+
!__props.isFirstItem ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true),
|
|
27
|
+
createVNode(unref(KdsIcon), {
|
|
28
|
+
class: "history-event-icon",
|
|
29
|
+
name: __props.isSelected ? "circle-success" : "circle-unchecked",
|
|
30
|
+
size: "small"
|
|
31
|
+
}, null, 8, ["name"]),
|
|
32
|
+
!__props.isLastItem ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
|
|
33
|
+
]),
|
|
34
|
+
createElementVNode("div", _hoisted_5, [
|
|
35
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
36
|
+
])
|
|
37
|
+
]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const HistoryEvent = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-249d4c97"]]);
|
|
43
|
+
|
|
44
|
+
const _hoisted_1$7 = { class: "avatar-and-name-wrapper" };
|
|
45
|
+
const _hoisted_2$3 = { class: "author-name" };
|
|
46
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
47
|
+
__name: "HistoryEventAuthor",
|
|
48
|
+
props: {
|
|
49
|
+
avatar: {},
|
|
50
|
+
author: {}
|
|
51
|
+
},
|
|
52
|
+
setup(__props) {
|
|
53
|
+
const nameInitials = (name) => name.split(/[., _-]/, 2).map((part) => part.charAt(0).toUpperCase()).join("");
|
|
54
|
+
return (_ctx, _cache) => {
|
|
55
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
56
|
+
createVNode(unref(KdsAvatar), {
|
|
57
|
+
src: __props.avatar.src,
|
|
58
|
+
title: __props.author,
|
|
59
|
+
initials: nameInitials(__props.author)
|
|
60
|
+
}, null, 8, ["src", "title", "initials"]),
|
|
61
|
+
createElementVNode("span", _hoisted_2$3, toDisplayString(__props.author), 1)
|
|
62
|
+
]);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const HistoryEventAuthor = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-168fd828"]]);
|
|
68
|
+
|
|
69
|
+
const getLocalTimeZone = () => Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
70
|
+
|
|
71
|
+
const formatDateString = (dateString, useTimeZone = false) => {
|
|
72
|
+
const date = new Date(dateString);
|
|
73
|
+
if (isNaN(date)) {
|
|
74
|
+
throw Error("Invalid Date format");
|
|
75
|
+
}
|
|
76
|
+
const baseDateOptions = {
|
|
77
|
+
day: "numeric",
|
|
78
|
+
month: "short",
|
|
79
|
+
year: "numeric"
|
|
80
|
+
};
|
|
81
|
+
const dateOptions = useTimeZone ? { ...baseDateOptions, timeZone: getLocalTimeZone() } : baseDateOptions;
|
|
82
|
+
return date.toLocaleDateString("en-US", dateOptions);
|
|
83
|
+
};
|
|
84
|
+
const formatTimeString = (timeString, useTimeZone = false) => {
|
|
85
|
+
const time = new Date(timeString);
|
|
86
|
+
if (isNaN(time)) {
|
|
87
|
+
throw Error("Invalid Date format");
|
|
88
|
+
}
|
|
89
|
+
const baseTimeOptions = {
|
|
90
|
+
hour: "numeric",
|
|
91
|
+
minute: "2-digit"
|
|
92
|
+
};
|
|
93
|
+
const timeOptions = useTimeZone ? { ...baseTimeOptions, timeZone: getLocalTimeZone() } : baseTimeOptions;
|
|
94
|
+
return time.toLocaleTimeString("en-US", timeOptions);
|
|
95
|
+
};
|
|
96
|
+
const formatDateTimeString = (dateTimeString, useTimeZone = false) => {
|
|
97
|
+
return `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(
|
|
98
|
+
dateTimeString,
|
|
99
|
+
useTimeZone
|
|
100
|
+
)}`;
|
|
101
|
+
};
|
|
102
|
+
const formatLocalDateTimeString = (date, showTime) => showTime ? formatDateTimeString(date, true) : formatDateString(date, true);
|
|
103
|
+
|
|
104
|
+
const _hoisted_1$6 = { class: "history-event-footer" };
|
|
105
|
+
const _hoisted_2$2 = ["title", "datetime"];
|
|
106
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
107
|
+
__name: "HistoryEventFooter",
|
|
108
|
+
props: {
|
|
109
|
+
date: {},
|
|
110
|
+
version: {}
|
|
111
|
+
},
|
|
112
|
+
setup(__props) {
|
|
113
|
+
const isMounted = ref(false);
|
|
114
|
+
const localDateTime = computed(
|
|
115
|
+
() => isMounted.value ? formatLocalDateTimeString(__props.date, true) : formatDateTimeString(__props.date, true)
|
|
116
|
+
);
|
|
117
|
+
onMounted(() => {
|
|
118
|
+
isMounted.value = true;
|
|
119
|
+
});
|
|
120
|
+
return (_ctx, _cache) => {
|
|
121
|
+
return openBlock(), createElementBlock("span", _hoisted_1$6, [
|
|
122
|
+
_cache[0] || (_cache[0] = createTextVNode(" Created on ", -1)),
|
|
123
|
+
createElementVNode("time", {
|
|
124
|
+
title: __props.date,
|
|
125
|
+
datetime: __props.date,
|
|
126
|
+
class: normalizeClass({ hidden: !isMounted.value })
|
|
127
|
+
}, toDisplayString(localDateTime.value), 11, _hoisted_2$2),
|
|
128
|
+
__props.version ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
129
|
+
createTextVNode("– Version " + toDisplayString(__props.version), 1)
|
|
130
|
+
], 64)) : createCommentVNode("", true)
|
|
131
|
+
]);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const HistoryEventFooter = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-8a0eddd7"]]);
|
|
137
|
+
|
|
138
|
+
const _hoisted_1$5 = { class: "content-wrapper" };
|
|
139
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
140
|
+
__name: "CurrentState",
|
|
141
|
+
props: {
|
|
142
|
+
currentSavepoint: {},
|
|
143
|
+
isSelected: { type: Boolean },
|
|
144
|
+
hasEditCapability: { type: Boolean },
|
|
145
|
+
hasPreviousVersion: { type: Boolean },
|
|
146
|
+
hasVersionLimit: { type: Boolean },
|
|
147
|
+
isVersionLimitExceeded: { type: Boolean }
|
|
148
|
+
},
|
|
149
|
+
emits: ["createVersion", "discard", "select"],
|
|
150
|
+
setup(__props, { emit: __emit }) {
|
|
151
|
+
const props = __props;
|
|
152
|
+
const emit = __emit;
|
|
153
|
+
const menuItems = computed(
|
|
154
|
+
() => props.hasEditCapability && props.hasPreviousVersion ? [
|
|
155
|
+
{
|
|
156
|
+
id: "discard",
|
|
157
|
+
text: "Discard",
|
|
158
|
+
handler: () => emit("discard")
|
|
159
|
+
}
|
|
160
|
+
] : []
|
|
161
|
+
);
|
|
162
|
+
return (_ctx, _cache) => {
|
|
163
|
+
return openBlock(), createBlock(HistoryEvent, {
|
|
164
|
+
"is-selected": __props.isSelected,
|
|
165
|
+
"is-first-item": "",
|
|
166
|
+
"is-last-item": !__props.hasPreviousVersion && !__props.hasVersionLimit
|
|
167
|
+
}, {
|
|
168
|
+
default: withCtx(() => [
|
|
169
|
+
createVNode(unref(KdsSelectableCard), {
|
|
170
|
+
"model-value": __props.isSelected,
|
|
171
|
+
headline: "Draft",
|
|
172
|
+
ariaLabel: "Savepoint history event",
|
|
173
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => !__props.isSelected && _ctx.$emit("select"))
|
|
174
|
+
}, createSlots({
|
|
175
|
+
default: withCtx(() => [
|
|
176
|
+
createElementVNode("div", _hoisted_1$5, [
|
|
177
|
+
createVNode(HistoryEventAuthor, {
|
|
178
|
+
author: __props.currentSavepoint.author,
|
|
179
|
+
avatar: __props.currentSavepoint.avatar
|
|
180
|
+
}, null, 8, ["author", "avatar"]),
|
|
181
|
+
createVNode(HistoryEventFooter, {
|
|
182
|
+
date: __props.currentSavepoint.lastEditedOn
|
|
183
|
+
}, null, 8, ["date"])
|
|
184
|
+
])
|
|
185
|
+
]),
|
|
186
|
+
_: 2
|
|
187
|
+
}, [
|
|
188
|
+
menuItems.value.length ? {
|
|
189
|
+
name: "header-actions",
|
|
190
|
+
fn: withCtx(() => [
|
|
191
|
+
createVNode(unref(_sfc_main$1h), {
|
|
192
|
+
items: menuItems.value,
|
|
193
|
+
variant: "transparent",
|
|
194
|
+
"leading-icon": "more-actions",
|
|
195
|
+
ariaLabel: "More actions"
|
|
196
|
+
}, null, 8, ["items"])
|
|
197
|
+
]),
|
|
198
|
+
key: "0"
|
|
199
|
+
} : void 0
|
|
200
|
+
]), 1032, ["model-value"]),
|
|
201
|
+
__props.hasEditCapability && !__props.isVersionLimitExceeded ? (openBlock(), createBlock(unref(_sfc_main$1s), {
|
|
202
|
+
key: 0,
|
|
203
|
+
label: "Create version",
|
|
204
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.$emit("createVersion"), ["stop"]))
|
|
205
|
+
})) : createCommentVNode("", true)
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
}, 8, ["is-selected", "is-last-item"]);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const CurrentState = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-a6a58c85"]]);
|
|
214
|
+
|
|
215
|
+
const _hoisted_1$4 = { class: "label-popover-container" };
|
|
216
|
+
const _hoisted_2$1 = { class: "label-title" };
|
|
217
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
218
|
+
__name: "VersionLabel",
|
|
219
|
+
props: /* @__PURE__ */ mergeModels({
|
|
220
|
+
label: {}
|
|
221
|
+
}, {
|
|
222
|
+
"modelValue": { type: Boolean, ...{ default: false } },
|
|
223
|
+
"modelModifiers": {}
|
|
224
|
+
}),
|
|
225
|
+
emits: ["update:modelValue"],
|
|
226
|
+
setup(__props) {
|
|
227
|
+
const isPopoverOpen = useModel(__props, "modelValue");
|
|
228
|
+
const popoverEl = useTemplateRef("popover");
|
|
229
|
+
return (_ctx, _cache) => {
|
|
230
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
231
|
+
createVNode(unref(_sfc_main$1p), {
|
|
232
|
+
modelValue: isPopoverOpen.value,
|
|
233
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isPopoverOpen.value = $event),
|
|
234
|
+
"data-kds-card-secondary-action": "",
|
|
235
|
+
label: __props.label.label.name,
|
|
236
|
+
"aria-haspopup": "dialog",
|
|
237
|
+
"aria-expanded": isPopoverOpen.value,
|
|
238
|
+
"aria-controls": popoverEl.value?.popoverId,
|
|
239
|
+
size: "xsmall",
|
|
240
|
+
style: normalizeStyle(popoverEl.value?.anchorStyle)
|
|
241
|
+
}, null, 8, ["modelValue", "label", "aria-expanded", "aria-controls", "style"]),
|
|
242
|
+
createVNode(unref(KdsPopover), {
|
|
243
|
+
ref: "popover",
|
|
244
|
+
modelValue: isPopoverOpen.value,
|
|
245
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isPopoverOpen.value = $event),
|
|
246
|
+
placement: "bottom-left",
|
|
247
|
+
role: "dialog",
|
|
248
|
+
"aria-label": "Label details"
|
|
249
|
+
}, {
|
|
250
|
+
default: withCtx(() => [
|
|
251
|
+
createElementVNode("div", _hoisted_1$4, [
|
|
252
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(__props.label.label.name), 1),
|
|
253
|
+
createVNode(unref(KdsDescription), {
|
|
254
|
+
text: __props.label.label.description
|
|
255
|
+
}, null, 8, ["text"]),
|
|
256
|
+
__props.label.message ? (openBlock(), createBlock(unref(KdsDescription), {
|
|
257
|
+
key: 0,
|
|
258
|
+
text: __props.label.message
|
|
259
|
+
}, null, 8, ["text"])) : createCommentVNode("", true)
|
|
260
|
+
])
|
|
261
|
+
]),
|
|
262
|
+
_: 1
|
|
263
|
+
}, 8, ["modelValue"])
|
|
264
|
+
], 64);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const VersionLabel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-00d7133a"]]);
|
|
270
|
+
|
|
271
|
+
const _hoisted_1$3 = { class: "content-wrapper" };
|
|
272
|
+
const _hoisted_2 = { class: "labels-wrapper" };
|
|
273
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
274
|
+
__name: "VersionItem",
|
|
275
|
+
props: {
|
|
276
|
+
version: {},
|
|
277
|
+
isSelected: { type: Boolean },
|
|
278
|
+
hasAdminRights: { type: Boolean },
|
|
279
|
+
hasEditCapability: { type: Boolean },
|
|
280
|
+
isFirstItem: { type: Boolean },
|
|
281
|
+
isLastItem: { type: Boolean }
|
|
282
|
+
},
|
|
283
|
+
emits: ["select", "delete", "restore"],
|
|
284
|
+
setup(__props, { emit: __emit }) {
|
|
285
|
+
const props = __props;
|
|
286
|
+
const emit = __emit;
|
|
287
|
+
const toggleVersionSelection = () => {
|
|
288
|
+
emit("select", !props.isSelected);
|
|
289
|
+
};
|
|
290
|
+
const menuItems = computed(
|
|
291
|
+
() => [
|
|
292
|
+
props.hasEditCapability && {
|
|
293
|
+
id: "show",
|
|
294
|
+
text: props.isSelected ? "Deselect this version" : "Show this version",
|
|
295
|
+
handler: toggleVersionSelection
|
|
296
|
+
},
|
|
297
|
+
props.hasEditCapability && {
|
|
298
|
+
id: "restore",
|
|
299
|
+
text: "Restore this version",
|
|
300
|
+
handler: () => emit("restore")
|
|
301
|
+
},
|
|
302
|
+
props.hasAdminRights && {
|
|
303
|
+
id: "delete",
|
|
304
|
+
text: "Delete this version",
|
|
305
|
+
handler: () => emit("delete")
|
|
306
|
+
}
|
|
307
|
+
].filter((i) => i !== false)
|
|
308
|
+
);
|
|
309
|
+
return (_ctx, _cache) => {
|
|
310
|
+
return openBlock(), createBlock(HistoryEvent, {
|
|
311
|
+
"is-selected": __props.isSelected,
|
|
312
|
+
"is-first-item": __props.isFirstItem,
|
|
313
|
+
"is-last-item": __props.isLastItem
|
|
314
|
+
}, {
|
|
315
|
+
default: withCtx(() => [
|
|
316
|
+
createVNode(unref(KdsSelectableCard), {
|
|
317
|
+
"model-value": __props.isSelected,
|
|
318
|
+
headline: __props.version.title,
|
|
319
|
+
ariaLabel: "Version history event",
|
|
320
|
+
"onUpdate:modelValue": toggleVersionSelection
|
|
321
|
+
}, createSlots({
|
|
322
|
+
default: withCtx(() => [
|
|
323
|
+
createElementVNode("div", _hoisted_1$3, [
|
|
324
|
+
createVNode(HistoryEventAuthor, {
|
|
325
|
+
author: __props.version.author,
|
|
326
|
+
avatar: __props.version.avatar
|
|
327
|
+
}, null, 8, ["author", "avatar"]),
|
|
328
|
+
__props.version.description ? (openBlock(), createBlock(unref(KdsDescription), {
|
|
329
|
+
key: 0,
|
|
330
|
+
text: __props.version.description
|
|
331
|
+
}, null, 8, ["text"])) : createCommentVNode("", true),
|
|
332
|
+
createElementVNode("div", _hoisted_2, [
|
|
333
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.version.labels, (label) => {
|
|
334
|
+
return openBlock(), createBlock(VersionLabel, {
|
|
335
|
+
key: label.labelId,
|
|
336
|
+
label
|
|
337
|
+
}, null, 8, ["label"]);
|
|
338
|
+
}), 128))
|
|
339
|
+
]),
|
|
340
|
+
createVNode(HistoryEventFooter, {
|
|
341
|
+
version: __props.version.version,
|
|
342
|
+
date: __props.version.createdOn
|
|
343
|
+
}, null, 8, ["version", "date"])
|
|
344
|
+
])
|
|
345
|
+
]),
|
|
346
|
+
_: 2
|
|
347
|
+
}, [
|
|
348
|
+
menuItems.value.length ? {
|
|
349
|
+
name: "header-actions",
|
|
350
|
+
fn: withCtx(() => [
|
|
351
|
+
createVNode(unref(_sfc_main$1h), {
|
|
352
|
+
items: menuItems.value,
|
|
353
|
+
variant: "transparent",
|
|
354
|
+
"leading-icon": "more-actions",
|
|
355
|
+
ariaLabel: "More actions"
|
|
356
|
+
}, null, 8, ["items"])
|
|
357
|
+
]),
|
|
358
|
+
key: "0"
|
|
359
|
+
} : void 0
|
|
360
|
+
]), 1032, ["model-value", "headline"])
|
|
361
|
+
]),
|
|
362
|
+
_: 1
|
|
363
|
+
}, 8, ["is-selected", "is-first-item", "is-last-item"]);
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
const VersionItem = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-9cf889d1"]]);
|
|
369
|
+
|
|
370
|
+
const _hoisted_1$2 = { class: "content-wrapper" };
|
|
371
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
372
|
+
__name: "VersionLimitInfo",
|
|
373
|
+
props: {
|
|
374
|
+
versionLimit: {},
|
|
375
|
+
upgradeUrl: { default: () => void 0 },
|
|
376
|
+
isPrivate: { type: Boolean, default: false }
|
|
377
|
+
},
|
|
378
|
+
setup(__props) {
|
|
379
|
+
const isLimitReached = computed(
|
|
380
|
+
() => __props.versionLimit.currentUsage >= __props.versionLimit.limit
|
|
381
|
+
);
|
|
382
|
+
const headline = computed(() => {
|
|
383
|
+
if (isLimitReached.value) {
|
|
384
|
+
return `You've reached the maximum of ${__props.versionLimit.limit} versions.`;
|
|
385
|
+
} else {
|
|
386
|
+
return `Using ${__props.versionLimit.currentUsage} of ${__props.versionLimit.limit} versions.`;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
return (_ctx, _cache) => {
|
|
390
|
+
return openBlock(), createBlock(HistoryEvent, {
|
|
391
|
+
"is-selected": false,
|
|
392
|
+
"is-first-item": false,
|
|
393
|
+
"is-last-item": ""
|
|
394
|
+
}, {
|
|
395
|
+
default: withCtx(() => [
|
|
396
|
+
createVNode(unref(_sfc_main$h), {
|
|
397
|
+
variant: "filled",
|
|
398
|
+
headline: headline.value
|
|
399
|
+
}, createSlots({
|
|
400
|
+
default: withCtx(() => [
|
|
401
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
402
|
+
createVNode(unref(KdsDescription), {
|
|
403
|
+
text: `Upgrade to use unlimited versions${__props.isPrivate ? " for private items." : "."}`
|
|
404
|
+
}, null, 8, ["text"])
|
|
405
|
+
])
|
|
406
|
+
]),
|
|
407
|
+
_: 2
|
|
408
|
+
}, [
|
|
409
|
+
__props.upgradeUrl ? {
|
|
410
|
+
name: "header-actions",
|
|
411
|
+
fn: withCtx(() => [
|
|
412
|
+
createVNode(unref(_sfc_main$1r), {
|
|
413
|
+
label: "Upgrade",
|
|
414
|
+
to: __props.upgradeUrl
|
|
415
|
+
}, null, 8, ["to"])
|
|
416
|
+
]),
|
|
417
|
+
key: "0"
|
|
418
|
+
} : void 0
|
|
419
|
+
]), 1032, ["headline"])
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
const VersionLimitInfo = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0a98c542"]]);
|
|
428
|
+
|
|
429
|
+
const VERSION_DEFAULT_LIMIT = 10;
|
|
430
|
+
const CURRENT_STATE_VERSION = "current-state";
|
|
431
|
+
const MOST_RECENT_VERSION = "most-recent";
|
|
432
|
+
|
|
433
|
+
const _hoisted_1$1 = { class: "version-history-wrapper" };
|
|
434
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
435
|
+
__name: "VersionHistory",
|
|
436
|
+
props: {
|
|
437
|
+
hasUnversionedChanges: { type: Boolean },
|
|
438
|
+
unversionedSavepoint: {},
|
|
439
|
+
currentVersion: {},
|
|
440
|
+
versionHistory: {},
|
|
441
|
+
loading: { type: Boolean },
|
|
442
|
+
hasLoadedAllVersions: { type: Boolean },
|
|
443
|
+
hasAdminRights: { type: Boolean },
|
|
444
|
+
hasEditCapability: { type: Boolean },
|
|
445
|
+
versionLimit: {},
|
|
446
|
+
upgradeUrl: {},
|
|
447
|
+
isPrivate: { type: Boolean }
|
|
448
|
+
},
|
|
449
|
+
emits: ["close", "loadAll", "create", "delete", "restore", "select", "discardCurrentState"],
|
|
450
|
+
setup(__props, { emit: __emit }) {
|
|
451
|
+
const props = __props;
|
|
452
|
+
const emit = __emit;
|
|
453
|
+
const isVersionLimitExceeded = computed(() => {
|
|
454
|
+
return props.versionLimit?.limit !== void 0 && props.versionLimit.currentUsage >= props.versionLimit.limit;
|
|
455
|
+
});
|
|
456
|
+
const headlineTrailingActions = computed(
|
|
457
|
+
() => [
|
|
458
|
+
{
|
|
459
|
+
type: "button",
|
|
460
|
+
props: {
|
|
461
|
+
leadingIcon: "x-close",
|
|
462
|
+
ariaLabel: "Close",
|
|
463
|
+
variant: "transparent"
|
|
464
|
+
},
|
|
465
|
+
onClick: () => emit("close")
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
);
|
|
469
|
+
return (_ctx, _cache) => {
|
|
470
|
+
return openBlock(), createBlock(unref(KdsPanel), {
|
|
471
|
+
headline: "Version history",
|
|
472
|
+
"headline-trailing-actions": headlineTrailingActions.value
|
|
473
|
+
}, {
|
|
474
|
+
default: withCtx(() => [
|
|
475
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
476
|
+
__props.unversionedSavepoint ? (openBlock(), createBlock(CurrentState, {
|
|
477
|
+
key: 0,
|
|
478
|
+
"current-savepoint": __props.unversionedSavepoint,
|
|
479
|
+
"is-selected": __props.currentVersion === unref(CURRENT_STATE_VERSION),
|
|
480
|
+
"has-edit-capability": __props.hasEditCapability,
|
|
481
|
+
"has-previous-version": __props.versionHistory.length > 0,
|
|
482
|
+
"has-version-limit": __props.versionLimit?.limit !== void 0,
|
|
483
|
+
"is-version-limit-exceeded": isVersionLimitExceeded.value,
|
|
484
|
+
onSelect: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("select", unref(CURRENT_STATE_VERSION))),
|
|
485
|
+
onCreateVersion: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("create")),
|
|
486
|
+
onDiscard: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("discardCurrentState"))
|
|
487
|
+
}, null, 8, ["current-savepoint", "is-selected", "has-edit-capability", "has-previous-version", "has-version-limit", "is-version-limit-exceeded"])) : createCommentVNode("", true),
|
|
488
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.versionHistory, (historyEvent, index) => {
|
|
489
|
+
return openBlock(), createBlock(VersionItem, {
|
|
490
|
+
key: historyEvent.version,
|
|
491
|
+
version: historyEvent,
|
|
492
|
+
"is-selected": historyEvent.version === __props.currentVersion,
|
|
493
|
+
"has-admin-rights": __props.hasAdminRights,
|
|
494
|
+
"has-edit-capability": __props.hasEditCapability,
|
|
495
|
+
"is-first-item": !__props.unversionedSavepoint && index === 0,
|
|
496
|
+
"is-last-item": index === __props.versionHistory.length - 1 && __props.versionLimit?.limit === void 0,
|
|
497
|
+
onDelete: ($event) => _ctx.$emit("delete", historyEvent.version),
|
|
498
|
+
onRestore: ($event) => _ctx.$emit("restore", historyEvent.version),
|
|
499
|
+
onSelect: ($event) => _ctx.$emit("select", $event ? historyEvent.version : unref(CURRENT_STATE_VERSION))
|
|
500
|
+
}, null, 8, ["version", "is-selected", "has-admin-rights", "has-edit-capability", "is-first-item", "is-last-item", "onDelete", "onRestore", "onSelect"]);
|
|
501
|
+
}), 128)),
|
|
502
|
+
__props.versionLimit?.limit !== void 0 ? (openBlock(), createBlock(VersionLimitInfo, {
|
|
503
|
+
key: 1,
|
|
504
|
+
class: "version-limit-info",
|
|
505
|
+
"version-limit": {
|
|
506
|
+
limit: __props.versionLimit.limit,
|
|
507
|
+
currentUsage: __props.versionLimit.currentUsage
|
|
508
|
+
},
|
|
509
|
+
"upgrade-url": __props.upgradeUrl,
|
|
510
|
+
"is-private": __props.isPrivate
|
|
511
|
+
}, null, 8, ["version-limit", "upgrade-url", "is-private"])) : createCommentVNode("", true),
|
|
512
|
+
!__props.hasLoadedAllVersions ? (openBlock(), createBlock(unref(_sfc_main$1s), {
|
|
513
|
+
key: 2,
|
|
514
|
+
variant: "transparent",
|
|
515
|
+
disabled: __props.loading,
|
|
516
|
+
label: __props.loading ? "Loading..." : "Load all",
|
|
517
|
+
class: "load-more-button",
|
|
518
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("loadAll"))
|
|
519
|
+
}, null, 8, ["disabled", "label"])) : createCommentVNode("", true)
|
|
520
|
+
])
|
|
521
|
+
]),
|
|
522
|
+
_: 1
|
|
523
|
+
}, 8, ["headline-trailing-actions"]);
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
const VersionHistory = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-e775efff"]]);
|
|
529
|
+
|
|
530
|
+
const _hoisted_1 = { class: "create-version-form-wrapper" };
|
|
531
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
532
|
+
__name: "CreateVersionForm",
|
|
533
|
+
props: {
|
|
534
|
+
isCreationPending: { type: Boolean, default: false }
|
|
535
|
+
},
|
|
536
|
+
emits: ["create", "cancel"],
|
|
537
|
+
setup(__props, { emit: __emit }) {
|
|
538
|
+
const emit = __emit;
|
|
539
|
+
const versionName = ref("");
|
|
540
|
+
const versionDescription = ref("");
|
|
541
|
+
const doValidate = ref(false);
|
|
542
|
+
const isVersionNameInvalid = computed(() => {
|
|
543
|
+
return doValidate.value && versionName.value.trim().length <= 0;
|
|
544
|
+
});
|
|
545
|
+
const hasUnsavedChanges = computed(() => {
|
|
546
|
+
return versionName.value !== "" || versionDescription.value !== "";
|
|
547
|
+
});
|
|
548
|
+
const onCreate = async () => {
|
|
549
|
+
doValidate.value = true;
|
|
550
|
+
await nextTick();
|
|
551
|
+
if (!isVersionNameInvalid.value) {
|
|
552
|
+
emit("create", {
|
|
553
|
+
name: versionName.value.trim(),
|
|
554
|
+
description: versionDescription.value
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
const headlineTrailingActions = computed(
|
|
559
|
+
() => [
|
|
560
|
+
{
|
|
561
|
+
type: "button",
|
|
562
|
+
props: {
|
|
563
|
+
leadingIcon: "x-close",
|
|
564
|
+
ariaLabel: "Close",
|
|
565
|
+
variant: "transparent"
|
|
566
|
+
},
|
|
567
|
+
onClick: () => emit("cancel", hasUnsavedChanges.value)
|
|
568
|
+
}
|
|
569
|
+
]
|
|
570
|
+
);
|
|
571
|
+
const footerLeadingActions = computed(() => [
|
|
572
|
+
{
|
|
573
|
+
type: "button",
|
|
574
|
+
props: {
|
|
575
|
+
label: "Cancel",
|
|
576
|
+
variant: "outlined"
|
|
577
|
+
},
|
|
578
|
+
onClick: () => emit("cancel", hasUnsavedChanges.value)
|
|
579
|
+
}
|
|
580
|
+
]);
|
|
581
|
+
const footerTrailingActions = computed(() => [
|
|
582
|
+
{
|
|
583
|
+
type: "button",
|
|
584
|
+
props: {
|
|
585
|
+
label: "Create",
|
|
586
|
+
variant: "filled",
|
|
587
|
+
disabled: isVersionNameInvalid.value || __props.isCreationPending
|
|
588
|
+
},
|
|
589
|
+
onClick: onCreate
|
|
590
|
+
}
|
|
591
|
+
]);
|
|
592
|
+
return (_ctx, _cache) => {
|
|
593
|
+
return openBlock(), createBlock(unref(KdsPanel), {
|
|
594
|
+
headline: "Create version",
|
|
595
|
+
"headline-trailing-actions": headlineTrailingActions.value,
|
|
596
|
+
"footer-leading-actions": footerLeadingActions.value,
|
|
597
|
+
"footer-trailing-actions": footerTrailingActions.value
|
|
598
|
+
}, {
|
|
599
|
+
default: withCtx(() => [
|
|
600
|
+
createElementVNode("div", _hoisted_1, [
|
|
601
|
+
createVNode(unref(KdsDescription), {
|
|
602
|
+
text: "Give your version a name and description. Versions can be used to create a deployment.",
|
|
603
|
+
class: "create-version-form-description"
|
|
604
|
+
}),
|
|
605
|
+
createVNode(unref(KdsTextInput), {
|
|
606
|
+
modelValue: versionName.value,
|
|
607
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => versionName.value = $event),
|
|
608
|
+
label: "Version name",
|
|
609
|
+
type: "text",
|
|
610
|
+
error: isVersionNameInvalid.value,
|
|
611
|
+
"sub-text": isVersionNameInvalid.value ? "Please enter at least 1 character." : void 0
|
|
612
|
+
}, null, 8, ["modelValue", "error", "sub-text"]),
|
|
613
|
+
createVNode(unref(KdsTextarea), {
|
|
614
|
+
modelValue: versionDescription.value,
|
|
615
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => versionDescription.value = $event),
|
|
616
|
+
label: "Description",
|
|
617
|
+
class: "description"
|
|
618
|
+
}, null, 8, ["modelValue"])
|
|
619
|
+
])
|
|
620
|
+
]),
|
|
621
|
+
_: 1
|
|
622
|
+
}, 8, ["headline-trailing-actions", "footer-leading-actions", "footer-trailing-actions"]);
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
const CreateVersionForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0c0f6ba1"]]);
|
|
628
|
+
|
|
629
|
+
export { CURRENT_STATE_VERSION, CreateVersionForm, MOST_RECENT_VERSION, VERSION_DEFAULT_LIMIT, VersionHistory };
|
|
630
|
+
//# sourceMappingURL=versions.js.map
|