@citruslime/ui 2.0.0-beta.14 → 2.0.0-beta.18
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/citrus-lime-ui.es.js +1435 -1704
- package/dist/citrus-lime-ui.umd.js +2 -2
- package/dist/{src/components → components}/accordion/cl-ui-accordion.vue.d.ts +0 -0
- package/dist/{src/components → components}/accordion/index.d.ts +0 -0
- package/dist/{src/components → components}/accordion/item/cl-ui-accordion-item.vue.d.ts +0 -0
- package/dist/{src/components → components}/accordion/types.d.ts +0 -0
- package/dist/{src/components → components}/app/cl-ui-app.vue.d.ts +0 -0
- package/dist/{src/components → components}/app/index.d.ts +0 -0
- package/dist/{src/components → components}/button/cl-ui-button.vue.d.ts +0 -0
- package/dist/{src/components → components}/button/index.d.ts +0 -0
- package/dist/{src/components → components}/button/types.d.ts +0 -0
- package/dist/{src/components → components}/calendar/cl-ui-calendar.vue.d.ts +0 -0
- package/dist/{src/components → components}/calendar/index.d.ts +0 -0
- package/dist/{src/components → components}/calendar/types.d.ts +0 -0
- package/dist/{src/components → components}/calendar/utils.d.ts +0 -0
- package/dist/{src/components → components}/card/cl-ui-card.vue.d.ts +0 -0
- package/dist/{src/components → components}/card/index.d.ts +0 -0
- package/dist/{src/components → components}/card/types.d.ts +0 -0
- package/dist/{src/components → components}/combo-box/cl-ui-combo-box.vue.d.ts +13 -15
- package/dist/{src/components → components}/combo-box/index.d.ts +0 -0
- package/dist/{src/components → components}/combo-box/search-container/cl-ui-combo-box-search.vue.d.ts +4 -4
- package/dist/{src/components → components}/combo-box/search-container/header/cl-ui-combo-box-header.vue.d.ts +2 -2
- package/dist/{src/components → components}/combo-box/search-container/selectable/cl-ui-combo-box-selectable.vue.d.ts +1 -1
- package/dist/{src/components → components}/combo-box/types.d.ts +0 -0
- package/dist/{src/components → components}/footer/index.d.ts +0 -0
- package/dist/{src/components → components}/grid/cell/cl-ui-grid-cell.vue.d.ts +2 -1
- package/dist/{src/components → components}/grid/cl-ui-grid.vue.d.ts +13 -7
- package/dist/{src/components → components}/grid/filter/cl-ui-grid-filter.vue.d.ts +4 -2
- package/dist/{src/utils → components/grid/filter}/filter-methods.d.ts +1 -1
- package/dist/{src/components → components}/grid/footer/cl-ui-grid-footer.vue.d.ts +5 -3
- package/dist/{src/components → components}/grid/header/cl-ui-grid-header.vue.d.ts +1 -0
- package/dist/{src/components → components}/grid/index.d.ts +0 -0
- package/dist/{src/components → components}/grid/types.d.ts +0 -0
- package/dist/{src/components → components}/grid/view-manager/cl-ui-grid-view-manager.vue.d.ts +1 -0
- package/dist/{src/components → components}/header/index.d.ts +0 -0
- package/dist/{src/components → components}/header/menu/cl-ui-header-menu.vue.d.ts +2 -2
- package/dist/{src/components → components}/header/menu/index.d.ts +0 -0
- package/dist/{src/components → components}/index.d.ts +0 -2
- package/dist/components/input/cl-ui-input.vue.d.ts +2 -0
- package/dist/{src/components → components}/input/index.d.ts +0 -0
- package/dist/{src/components → components}/input/types.d.ts +0 -0
- package/dist/{src/components → components}/input/utils.d.ts +1 -1
- package/dist/{src/components → components}/language-switcher/cl-ui-language-switcher.vue.d.ts +0 -0
- package/dist/{src/components → components}/language-switcher/index.d.ts +0 -0
- package/dist/{src/components → components}/language-switcher/types.d.ts +0 -0
- package/dist/{src/components → components}/loading-spinner/index.d.ts +0 -0
- package/dist/{src/components → components}/login/cl-ui-login.vue.d.ts +5 -1
- package/dist/{src/components → components}/login/index.d.ts +0 -0
- package/dist/{src/components → components}/login/types.d.ts +0 -0
- package/dist/{src/components → components}/modal/cl-ui-modal.vue.d.ts +0 -0
- package/dist/{src/components → components}/modal/index.d.ts +0 -0
- package/dist/{src/components → components}/modal/types.d.ts +0 -0
- package/dist/{src/components → components}/navigation/cl-ui-navigation.vue.d.ts +0 -0
- package/dist/{src/components → components}/navigation/group/cl-ui-navigation-group.vue.d.ts +0 -0
- package/dist/{src/components → components}/navigation/icon/cl-ui-navigation-icon.vue.d.ts +0 -0
- package/dist/{src/components → components}/navigation/index.d.ts +0 -0
- package/dist/{src/components → components}/notification/cl-ui-notification.vue.d.ts +0 -0
- package/dist/{src/components → components}/notification/index.d.ts +0 -0
- package/dist/{src/components → components}/notification/types.d.ts +0 -0
- package/dist/{src/components → components}/slider/cl-ui-slider.vue.d.ts +2 -1
- package/dist/{src/components → components}/slider/index.d.ts +0 -0
- package/dist/{src/composables → composables}/index.d.ts +0 -0
- package/dist/{src/composables → composables}/notification.d.ts +0 -0
- package/dist/{src/main.d.ts → main.d.ts} +0 -2
- package/dist/style.css +1 -1
- package/dist/{src/utils → utils}/i18n/config.d.ts +0 -0
- package/dist/{src/utils → utils}/i18n/defaults.d.ts +0 -0
- package/dist/{src/utils → utils}/i18n/index.d.ts +0 -0
- package/dist/{src/utils → utils}/i18n/types.d.ts +0 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/{src/utils → utils}/validation.d.ts +0 -0
- package/package.json +12 -13
- package/dist/.eslintrc.js +0 -465
- package/dist/.stylelintrc.js +0 -119
- package/dist/src/components/input/cl-ui-input.vue.d.ts +0 -303
- package/dist/src/utils/copy.d.ts +0 -8
- package/dist/src/utils/debouncer.d.ts +0 -13
- package/dist/src/utils/extensions/date/index.d.ts +0 -1
- package/dist/src/utils/extensions/date/types.d.ts +0 -8
- package/dist/src/utils/extensions/string/types.d.ts +0 -48
- package/dist/src/utils/extensions/string/utils.d.ts +0 -83
- package/dist/src/utils/id.d.ts +0 -6
- package/dist/src/utils/index.d.ts +0 -9
- package/dist/src/utils/name-of.d.ts +0 -7
- package/dist/src/utils/sort.d.ts +0 -9
- package/dist/src/utils/url-params.d.ts +0 -8
- package/dist/theme.js +0 -121
|
@@ -31,9 +31,11 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
return target;
|
|
32
32
|
};
|
|
33
33
|
import { Icon } from "@iconify/vue";
|
|
34
|
-
import { defineComponent, ref, openBlock, createElementBlock, renderSlot, normalizeProps, guardReactiveProps, resolveComponent, Fragment, createElementVNode, normalizeClass, createVNode, Transition, withCtx, withDirectives, vShow,
|
|
34
|
+
import { defineComponent, ref, openBlock, createElementBlock, renderSlot, normalizeProps, guardReactiveProps, resolveComponent, Fragment, createElementVNode, normalizeClass, createVNode, Transition, withCtx, withDirectives, vShow, createBlock, Teleport, renderList, unref, mergeProps, toDisplayString, createCommentVNode, nextTick, computed, watch, onMounted, onUnmounted, isRef, normalizeStyle, vModelText, withModifiers, vModelDynamic, withKeys, createTextVNode, watchEffect, createSlots } from "vue";
|
|
35
|
+
import { generateStringId } from "@citruslime/utils";
|
|
35
36
|
import { createI18n, useI18n } from "vue-i18n";
|
|
36
37
|
import Flatpickr from "flatpickr";
|
|
38
|
+
import { useDebouncer, copy } from "@citruslime/vue-utils";
|
|
37
39
|
const _hoisted_1$u = { class: "cl-overflow-hidden" };
|
|
38
40
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
39
41
|
props: {
|
|
@@ -76,7 +78,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
76
78
|
const _hoisted_1$t = { class: "cl-absolute cl-left-5 cl-top-5" };
|
|
77
79
|
const _hoisted_2$n = { class: "cl-font-semibold cl-ml-10 cl-p-4 cl-select-none cl-text-grey-5" };
|
|
78
80
|
const _hoisted_3$h = { class: "cl-overflow-hidden" };
|
|
79
|
-
const _hoisted_4$
|
|
81
|
+
const _hoisted_4$d = { class: "cl-ml-10 cl-p-4" };
|
|
80
82
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
81
83
|
props: {
|
|
82
84
|
open: { type: Boolean },
|
|
@@ -118,7 +120,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
118
120
|
createElementVNode("div", _hoisted_3$h, [
|
|
119
121
|
createVNode(Transition, { name: "grow-down" }, {
|
|
120
122
|
default: withCtx(() => [
|
|
121
|
-
withDirectives(createElementVNode("div", _hoisted_4$
|
|
123
|
+
withDirectives(createElementVNode("div", _hoisted_4$d, [
|
|
122
124
|
renderSlot(_ctx.$slots, "default")
|
|
123
125
|
], 512), [
|
|
124
126
|
[vShow, __props.open]
|
|
@@ -132,10 +134,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
136
|
var _export_sfc = (sfc, props) => {
|
|
137
|
+
const target = sfc.__vccOpts || sfc;
|
|
135
138
|
for (const [key, val] of props) {
|
|
136
|
-
|
|
139
|
+
target[key] = val;
|
|
137
140
|
}
|
|
138
|
-
return
|
|
141
|
+
return target;
|
|
139
142
|
};
|
|
140
143
|
const _sfc_main$t = {};
|
|
141
144
|
const _hoisted_1$s = { class: "cl-border-b cl-border-grey-1 cl-font-semibold cl-pl-14 cl-pr-4 cl-py-2 cl-text-grey-3 cl-text-sm" };
|
|
@@ -145,274 +148,211 @@ function _sfc_render$5(_ctx, _cache) {
|
|
|
145
148
|
]);
|
|
146
149
|
}
|
|
147
150
|
var clUiAccordionHeader = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$5]]);
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
});
|
|
156
|
-
function debounce(event, eventArgs) {
|
|
157
|
-
if (debouncerState.debouncer !== null) {
|
|
158
|
-
window.clearTimeout(debouncerState.debouncer);
|
|
159
|
-
}
|
|
160
|
-
debouncerState.debouncer = window.setTimeout(() => event(...eventArgs), debouncerState.timeout);
|
|
161
|
-
}
|
|
162
|
-
return __spreadProps(__spreadValues({}, toRefs(debouncerState)), {
|
|
163
|
-
debounce
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function generateStringId() {
|
|
167
|
-
return Math.random().toString(36).slice(2, 8);
|
|
168
|
-
}
|
|
169
|
-
function nameOf(name) {
|
|
170
|
-
return name;
|
|
171
|
-
}
|
|
172
|
-
function compareByProperty(firstValue, secondValue, property) {
|
|
173
|
-
return firstValue[property] < secondValue[property] ? -1 : firstValue[property] > secondValue[property] ? 1 : 0;
|
|
151
|
+
const notifications = ref([]);
|
|
152
|
+
function showNotification(notification) {
|
|
153
|
+
const newNotification = __spreadValues({
|
|
154
|
+
id: generateStringId()
|
|
155
|
+
}, notification);
|
|
156
|
+
notifications.value.push(newNotification);
|
|
157
|
+
setTimeout(() => removeNotification(newNotification), notification.duration);
|
|
174
158
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
const urlToSearch = decodeURIComponent(stringToSearch);
|
|
178
|
-
const regexS = "[\\?&]" + paramToFind + "=([^&#]*)";
|
|
179
|
-
const regex = new RegExp(regexS);
|
|
180
|
-
const results = regex.exec(urlToSearch);
|
|
181
|
-
if (results && results[1]) {
|
|
182
|
-
valueToReturn = decodeURIComponent(results[1].replace(/\+/g, " "));
|
|
183
|
-
}
|
|
184
|
-
return valueToReturn;
|
|
159
|
+
function removeNotification(notification) {
|
|
160
|
+
notifications.value = notifications.value.filter((n) => n.id !== notification.id);
|
|
185
161
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
162
|
+
const _hoisted_1$r = ["onClick"];
|
|
163
|
+
const _hoisted_2$m = { class: "cl-flex-1 cl-select-none cl-text-ellipsis cl-w-64" };
|
|
164
|
+
const __default__$4 = {
|
|
165
|
+
inheritAttrs: false
|
|
166
|
+
};
|
|
167
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
|
|
168
|
+
props: {
|
|
169
|
+
container: { default: "body" },
|
|
170
|
+
position: { default: "top-right" }
|
|
171
|
+
},
|
|
172
|
+
setup(__props) {
|
|
173
|
+
return (_ctx, _cache) => {
|
|
174
|
+
const _component_icon = resolveComponent("icon");
|
|
175
|
+
return openBlock(), createBlock(Teleport, { to: __props.container }, [
|
|
176
|
+
createElementVNode("div", {
|
|
177
|
+
class: normalizeClass(["cl-fixed cl-w-80 cl-z-40", {
|
|
178
|
+
"cl-top-5 cl-left-5": __props.position === "top-left",
|
|
179
|
+
"cl-top-5 cl-left-1/2": __props.position === "top-centre",
|
|
180
|
+
"cl-top-5 cl-right-5": __props.position === "top-right",
|
|
181
|
+
"cl-bottom-5 cl-left-5": __props.position === "bottom-left",
|
|
182
|
+
"cl-bottom-5 cl-left-1/2": __props.position === "bottom-centre",
|
|
183
|
+
"cl-bottom-5 cl-right-5": __props.position === "bottom-right"
|
|
184
|
+
}])
|
|
185
|
+
}, [
|
|
186
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(notifications), (notification, index) => {
|
|
187
|
+
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
|
|
188
|
+
key: index,
|
|
189
|
+
class: ["cl-break-words cl-cursor-pointer cl-flex cl-font-semibold cl-group cl-mb-2 cl-overflow-hidden cl-p-4 cl-rounded cl-shadow-lg cl-text-sm", {
|
|
190
|
+
"cl-bg-white": notification.colour === "default",
|
|
191
|
+
"cl-bg-primary-default": notification.colour === "primary",
|
|
192
|
+
"cl-bg-secondary-default": notification.colour === "secondary",
|
|
193
|
+
"cl-bg-danger-default": notification.colour === "danger",
|
|
194
|
+
"cl-bg-warning-default": notification.colour === "warning"
|
|
195
|
+
}],
|
|
196
|
+
onClick: ($event) => unref(removeNotification)(notification)
|
|
197
|
+
}), [
|
|
198
|
+
createElementVNode("span", _hoisted_2$m, toDisplayString(notification.message), 1),
|
|
199
|
+
createVNode(_component_icon, {
|
|
200
|
+
class: "cl-inline-block cl-opacity-0 cl-transition-opacity group-hover:cl-opacity-100",
|
|
201
|
+
icon: "ph:x",
|
|
202
|
+
size: 16,
|
|
203
|
+
weight: "bold"
|
|
204
|
+
})
|
|
205
|
+
], 16, _hoisted_1$r);
|
|
206
|
+
}), 128))
|
|
207
|
+
], 2)
|
|
208
|
+
], 8, ["to"]);
|
|
209
|
+
};
|
|
201
210
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
211
|
+
}));
|
|
212
|
+
const _hoisted_1$q = { class: "cl-absolute cl-flex cl-flex-wrap cl-h-screen cl-max-h-screen cl-max-w-full cl-min-h-screen cl-min-w-full cl-w-full" };
|
|
213
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
214
|
+
props: {
|
|
215
|
+
removePadding: { type: Boolean, default: false }
|
|
216
|
+
},
|
|
217
|
+
setup(__props) {
|
|
218
|
+
return (_ctx, _cache) => {
|
|
219
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
220
|
+
createVNode(_sfc_main$s),
|
|
221
|
+
createElementVNode("div", _hoisted_1$q, [
|
|
222
|
+
renderSlot(_ctx.$slots, "header"),
|
|
223
|
+
createElementVNode("div", {
|
|
224
|
+
class: normalizeClass(["cl-content-start cl-flex cl-flex-nowrap cl-items-stretch cl-max-h-screen cl-relative cl-w-full", {
|
|
225
|
+
"cl-pt-20": _ctx.$slots.header
|
|
226
|
+
}])
|
|
227
|
+
}, [
|
|
228
|
+
renderSlot(_ctx.$slots, "navigation"),
|
|
229
|
+
createElementVNode("div", {
|
|
230
|
+
class: normalizeClass(["cl-grow cl-max-h-full cl-overflow-x-hidden cl-overflow-y-auto cl-w-auto", {
|
|
231
|
+
"md:cl-p-8 cl-p-2": !__props.removePadding
|
|
232
|
+
}])
|
|
233
|
+
}, [
|
|
234
|
+
renderSlot(_ctx.$slots, "default")
|
|
235
|
+
], 2)
|
|
236
|
+
], 2)
|
|
237
|
+
])
|
|
238
|
+
], 64);
|
|
239
|
+
};
|
|
220
240
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return kebabCase.split(/(?=-)/g).map((s) => s.replace(/-/g, ""));
|
|
228
|
-
}
|
|
229
|
-
function pascalCaseToArray(pascalCase) {
|
|
230
|
-
return camelCaseToArray(pascalCase);
|
|
231
|
-
}
|
|
232
|
-
function sentenceCaseToArray(sentenceCase) {
|
|
233
|
-
return sentenceCase.split(/ /g).map((s) => s.replace(/[^A-Za-z0-9]/g, ""));
|
|
234
|
-
}
|
|
235
|
-
function snakeCaseToArray(snakeCase) {
|
|
236
|
-
return snakeCase.split(/(?=_)/g).map((s) => s.replace(/_/g, ""));
|
|
237
|
-
}
|
|
238
|
-
function titleCaseToArray(titleCase) {
|
|
239
|
-
return sentenceCaseToArray(titleCase);
|
|
240
|
-
}
|
|
241
|
-
function arrayToCamelCase(array, locale) {
|
|
242
|
-
let result = "";
|
|
243
|
-
array.forEach((s, i) => {
|
|
244
|
-
result += i === 0 ? s.toLocaleLowerCase(locale) : s.toLocaleLowerCase(locale).firstCharToUpperCase(locale);
|
|
245
|
-
});
|
|
246
|
-
return result;
|
|
247
|
-
}
|
|
248
|
-
function arrayToKebabCase(array, lowerCase, locale) {
|
|
249
|
-
let result = "";
|
|
250
|
-
array.forEach((s) => {
|
|
251
|
-
result += `${lowerCase ? s.toLocaleLowerCase(locale) : s.toLocaleUpperCase(locale)}-`;
|
|
252
|
-
});
|
|
253
|
-
return result.trimEndChar("-");
|
|
254
|
-
}
|
|
255
|
-
function arrayToSentenceCase(array, locale) {
|
|
256
|
-
let result = "";
|
|
257
|
-
array.forEach((s, i) => {
|
|
258
|
-
result += `${i === 0 ? s.toLowerCase().firstCharToUpperCase(locale) : s.toLocaleLowerCase(locale)} `;
|
|
259
|
-
});
|
|
260
|
-
return result.trimEndChar(" ");
|
|
261
|
-
}
|
|
262
|
-
function arrayToTitleCase(array, locale) {
|
|
263
|
-
let result = "";
|
|
264
|
-
array.forEach((s) => {
|
|
265
|
-
result += `${s.toLocaleLowerCase(locale).firstCharToUpperCase(locale)} `;
|
|
266
|
-
});
|
|
267
|
-
return result.trimEndChar(" ");
|
|
241
|
+
});
|
|
242
|
+
var clUiLoadingSpinner_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
243
|
+
const _sfc_main$q = {};
|
|
244
|
+
const _hoisted_1$p = { class: "loading-spinner" };
|
|
245
|
+
function _sfc_render$4(_ctx, _cache) {
|
|
246
|
+
return openBlock(), createElementBlock("div", _hoisted_1$p);
|
|
268
247
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
248
|
+
var ClUiLoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$4], ["__scopeId", "data-v-60d7cfd0"]]);
|
|
249
|
+
const _hoisted_1$o = ["disabled"];
|
|
250
|
+
const __default__$3 = {
|
|
251
|
+
inheritAttrs: false
|
|
252
|
+
};
|
|
253
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
|
|
254
|
+
props: {
|
|
255
|
+
colour: { default: "default" },
|
|
256
|
+
size: { default: "medium" },
|
|
257
|
+
loading: { type: Boolean, default: false },
|
|
258
|
+
disabled: { type: Boolean, default: false }
|
|
259
|
+
},
|
|
260
|
+
setup(__props) {
|
|
261
|
+
return (_ctx, _cache) => {
|
|
262
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
263
|
+
withDirectives(createVNode(ClUiLoadingSpinner, { class: "cl-absolute" }, null, 512), [
|
|
264
|
+
[vShow, __props.loading]
|
|
265
|
+
]),
|
|
266
|
+
withDirectives(createElementVNode("button", mergeProps(_ctx.$attrs, {
|
|
267
|
+
class: ["cl-align-middle cl-border cl-font-semibold cl-inline-block cl-overflow-visible cl-rounded cl-select-none cl-shadow cl-text-center cl-transition-colors", {
|
|
268
|
+
"cl-leading-8 cl-px-4 cl-text-sm": __props.size === "small",
|
|
269
|
+
"cl-leading-10 cl-px-8 cl-text-sm": __props.size === "medium",
|
|
270
|
+
"cl-leading-10 cl-px-10 cl-py-2": __props.size === "large",
|
|
271
|
+
"cl-bg-white cl-border-grey-0 hover:cl-border-grey-2 cl-text-secondary": __props.colour === "default",
|
|
272
|
+
"cl-border-primary-default cl-bg-primary-default cl-text-white hover:cl-bg-primary-light hover:cl-border-primary-light": __props.colour === "primary",
|
|
273
|
+
"cl-border-secondary-default cl-bg-secondary-default cl-text-white hover:cl-bg-secondary-light hover:cl-border-secondary-light": __props.colour === "secondary",
|
|
274
|
+
"cl-border-danger-default cl-bg-danger-default cl-text-white hover:cl-bg-danger-dark hover:cl-border-danger-dark": __props.colour === "danger",
|
|
275
|
+
"cl-border-link-default cl-bg-link-default cl-text-white hover:cl-bg-link-light hover:cl-border-link-light": __props.colour === "blue",
|
|
276
|
+
"!cl-border-grey-3 !cl-bg-grey-3 cl-text-grey-0 hover:!cl-bg-grey-3 hover:!cl-border-grey-3 cl-cursor-default": __props.disabled
|
|
277
|
+
}],
|
|
278
|
+
disabled: __props.disabled
|
|
279
|
+
}), [
|
|
280
|
+
renderSlot(_ctx.$slots, "default")
|
|
281
|
+
], 16, _hoisted_1$o), [
|
|
282
|
+
[vShow, !__props.loading]
|
|
283
|
+
])
|
|
284
|
+
], 64);
|
|
285
|
+
};
|
|
277
286
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
287
|
+
}));
|
|
288
|
+
const buttonColours = [
|
|
289
|
+
"default",
|
|
290
|
+
"primary",
|
|
291
|
+
"secondary",
|
|
292
|
+
"danger",
|
|
293
|
+
"blue"
|
|
294
|
+
];
|
|
295
|
+
const buttonSizes = [
|
|
296
|
+
"small",
|
|
297
|
+
"medium",
|
|
298
|
+
"large"
|
|
299
|
+
];
|
|
300
|
+
const _hoisted_1$n = { key: 0 };
|
|
301
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
302
|
+
props: {
|
|
303
|
+
size: { default: "medium" },
|
|
304
|
+
hover: { type: Boolean, default: false }
|
|
305
|
+
},
|
|
306
|
+
setup(__props) {
|
|
307
|
+
return (_ctx, _cache) => {
|
|
308
|
+
return openBlock(), createElementBlock("div", {
|
|
309
|
+
class: normalizeClass(["cl-border cl-border-transparent cl-overflow-hidden cl-relative cl-rounded-md cl-shadow-lg cl-transition-all", {
|
|
310
|
+
"cl-cursor-pointer hover:cl-shadow-xl hover:cl-border-grey-0": __props.hover
|
|
311
|
+
}])
|
|
312
|
+
}, [
|
|
313
|
+
_ctx.$slots.image ? (openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
314
|
+
renderSlot(_ctx.$slots, "image")
|
|
315
|
+
])) : createCommentVNode("", true),
|
|
316
|
+
_ctx.$slots.title ? (openBlock(), createElementBlock("div", {
|
|
317
|
+
key: 1,
|
|
318
|
+
class: normalizeClass(["cl-border-grey-2 cl-font-normal", {
|
|
319
|
+
"cl-p-2 cl-text-2xl cl-leading-8": __props.size === "small",
|
|
320
|
+
"cl-p-4 cl-text-3xl cl-leading-9": __props.size === "medium",
|
|
321
|
+
"cl-p-6 cl-text-4xl cl-leading-10": __props.size === "large",
|
|
322
|
+
"cl-border-t": _ctx.$slots.image
|
|
323
|
+
}])
|
|
324
|
+
}, [
|
|
325
|
+
renderSlot(_ctx.$slots, "title")
|
|
326
|
+
], 2)) : createCommentVNode("", true),
|
|
327
|
+
createElementVNode("div", {
|
|
328
|
+
class: normalizeClass(["cl-border-grey-2", {
|
|
329
|
+
"cl-p-2": __props.size === "small",
|
|
330
|
+
"cl-p-4": __props.size === "medium",
|
|
331
|
+
"cl-p-6": __props.size === "large",
|
|
332
|
+
"cl-border-t": _ctx.$slots.image || _ctx.$slots.title
|
|
333
|
+
}])
|
|
334
|
+
}, [
|
|
335
|
+
renderSlot(_ctx.$slots, "default")
|
|
336
|
+
], 2),
|
|
337
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
338
|
+
key: 2,
|
|
339
|
+
class: normalizeClass(["cl-border-grey-2 cl-border-t", {
|
|
340
|
+
"cl-p-2": __props.size === "small",
|
|
341
|
+
"cl-p-4": __props.size === "medium",
|
|
342
|
+
"cl-p-6": __props.size === "large"
|
|
343
|
+
}])
|
|
344
|
+
}, [
|
|
345
|
+
renderSlot(_ctx.$slots, "footer")
|
|
346
|
+
], 2)) : createCommentVNode("", true)
|
|
347
|
+
], 2);
|
|
348
|
+
};
|
|
283
349
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return character !== "" && this.startsWith(character) ? this.slice(1) : this;
|
|
291
|
-
};
|
|
292
|
-
String.prototype.trimEndChar = function(character) {
|
|
293
|
-
return character !== "" && this.endsWith(character) ? this.slice(0, -1) : this;
|
|
294
|
-
};
|
|
295
|
-
String.prototype.trimToLength = function(length, addEllipsis = false) {
|
|
296
|
-
const trimLength = this.length < length ? this.length : length;
|
|
297
|
-
return addEllipsis && trimLength >= 4 && trimLength < this.length ? `${this.slice(0, Math.max(trimLength - 3, 1))}...` : this.slice(0, Math.max(trimLength, 1));
|
|
298
|
-
};
|
|
299
|
-
String.prototype.firstCharToUpperCase = function(locale) {
|
|
300
|
-
return `${this.charAt(0).toLocaleUpperCase(locale)}${this.slice(1)}`;
|
|
301
|
-
};
|
|
302
|
-
String.prototype.firstCharToLowerCase = function(locale) {
|
|
303
|
-
return `${this.charAt(0).toLocaleLowerCase(locale)}${this.slice(1)}`;
|
|
304
|
-
};
|
|
305
|
-
String.prototype.removeWhitespace = function() {
|
|
306
|
-
return this.replace(/\s/g, "");
|
|
307
|
-
};
|
|
308
|
-
String.prototype.removeNonAlphanumeric = function() {
|
|
309
|
-
return this.replace(/[^a-zA-Z0-9]/g, "");
|
|
310
|
-
};
|
|
311
|
-
String.prototype.removeNonAlphabetic = function() {
|
|
312
|
-
return this.replace(/[^a-zA-Z]/g, "");
|
|
313
|
-
};
|
|
314
|
-
String.prototype.removeNonNumeric = function() {
|
|
315
|
-
return this.replace(/[^0-9]/g, "");
|
|
316
|
-
};
|
|
317
|
-
String.prototype.replacePlaceholders = function(...args) {
|
|
318
|
-
let i = 0;
|
|
319
|
-
return this.replace(/{\d+}/g, () => typeof args[i] !== "undefined" ? args[i++] : "");
|
|
320
|
-
};
|
|
321
|
-
String.prototype.camelCaseToKebabCase = function(lowerCase = true, locale) {
|
|
322
|
-
return arrayToKebabCase(camelCaseToArray(this), lowerCase, locale);
|
|
323
|
-
};
|
|
324
|
-
String.prototype.camelCaseToPascalCase = function(locale) {
|
|
325
|
-
return this.firstCharToUpperCase(locale);
|
|
326
|
-
};
|
|
327
|
-
String.prototype.camelCaseToSentenceCase = function(locale) {
|
|
328
|
-
return arrayToSentenceCase(camelCaseToArray(this), locale);
|
|
329
|
-
};
|
|
330
|
-
String.prototype.camelCaseToSnakeCase = function(lowerCase = true, locale) {
|
|
331
|
-
return this.camelCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
|
|
332
|
-
};
|
|
333
|
-
String.prototype.camelCaseToTitleCase = function(locale) {
|
|
334
|
-
return arrayToTitleCase(camelCaseToArray(this), locale);
|
|
335
|
-
};
|
|
336
|
-
String.prototype.kebabCaseToCamelCase = function(locale) {
|
|
337
|
-
return arrayToCamelCase(kebabCaseToArray(this), locale);
|
|
338
|
-
};
|
|
339
|
-
String.prototype.kebabCaseToPascalCase = function(locale) {
|
|
340
|
-
return this.kebabCaseToCamelCase().camelCaseToPascalCase(locale);
|
|
341
|
-
};
|
|
342
|
-
String.prototype.kebabCaseToSentenceCase = function(locale) {
|
|
343
|
-
return arrayToSentenceCase(kebabCaseToArray(this), locale);
|
|
344
|
-
};
|
|
345
|
-
String.prototype.kebabCaseToSnakeCase = function(lowerCase = true, locale) {
|
|
346
|
-
const result = this.replace(/-/g, "_");
|
|
347
|
-
return lowerCase ? result.toLocaleLowerCase(locale) : result.toLocaleUpperCase(locale);
|
|
348
|
-
};
|
|
349
|
-
String.prototype.kebabCaseToTitleCase = function(locale) {
|
|
350
|
-
return arrayToTitleCase(kebabCaseToArray(this), locale);
|
|
351
|
-
};
|
|
352
|
-
String.prototype.pascalCaseToCamelCase = function(locale) {
|
|
353
|
-
return arrayToCamelCase(pascalCaseToArray(this), locale);
|
|
354
|
-
};
|
|
355
|
-
String.prototype.pascalCaseToKebabCase = function(lowerCase = true, locale) {
|
|
356
|
-
return arrayToKebabCase(pascalCaseToArray(this), lowerCase, locale);
|
|
357
|
-
};
|
|
358
|
-
String.prototype.pascalCaseToSentenceCase = function(locale) {
|
|
359
|
-
return arrayToSentenceCase(pascalCaseToArray(this), locale);
|
|
360
|
-
};
|
|
361
|
-
String.prototype.pascalCaseToSnakeCase = function(lowerCase = true, locale) {
|
|
362
|
-
return this.pascalCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
|
|
363
|
-
};
|
|
364
|
-
String.prototype.pascalCaseToTitleCase = function(locale) {
|
|
365
|
-
return arrayToTitleCase(pascalCaseToArray(this), locale);
|
|
366
|
-
};
|
|
367
|
-
String.prototype.sentenceCaseToCamelCase = function(locale) {
|
|
368
|
-
return arrayToCamelCase(sentenceCaseToArray(this), locale);
|
|
369
|
-
};
|
|
370
|
-
String.prototype.sentenceCaseToKebabCase = function(lowerCase = true, locale) {
|
|
371
|
-
return arrayToKebabCase(sentenceCaseToArray(this), lowerCase, locale);
|
|
372
|
-
};
|
|
373
|
-
String.prototype.sentenceCaseToPascalCase = function(locale) {
|
|
374
|
-
return this.sentenceCaseToCamelCase().camelCaseToPascalCase(locale);
|
|
375
|
-
};
|
|
376
|
-
String.prototype.sentenceCaseToSnakeCase = function(lowerCase = true, locale) {
|
|
377
|
-
return this.sentenceCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
|
|
378
|
-
};
|
|
379
|
-
String.prototype.sentenceCaseToTitleCase = function(locale) {
|
|
380
|
-
return arrayToTitleCase(sentenceCaseToArray(this), locale);
|
|
381
|
-
};
|
|
382
|
-
String.prototype.snakeCaseToCamelCase = function(locale) {
|
|
383
|
-
return arrayToCamelCase(snakeCaseToArray(this), locale);
|
|
384
|
-
};
|
|
385
|
-
String.prototype.snakeCaseToKebabCase = function(lowerCase = true, locale) {
|
|
386
|
-
const result = this.replace(/_/g, "-");
|
|
387
|
-
return lowerCase ? result.toLocaleLowerCase(locale) : result.toLocaleUpperCase(locale);
|
|
388
|
-
};
|
|
389
|
-
String.prototype.snakeCaseToPascalCase = function(locale) {
|
|
390
|
-
return this.snakeCaseToCamelCase().camelCaseToPascalCase(locale);
|
|
391
|
-
};
|
|
392
|
-
String.prototype.snakeCaseToSentenceCase = function(locale) {
|
|
393
|
-
return arrayToSentenceCase(snakeCaseToArray(this), locale);
|
|
394
|
-
};
|
|
395
|
-
String.prototype.snakeCaseToTitleCase = function(locale) {
|
|
396
|
-
return arrayToTitleCase(snakeCaseToArray(this), locale);
|
|
397
|
-
};
|
|
398
|
-
String.prototype.titleCaseToCamelCase = function(locale) {
|
|
399
|
-
return arrayToCamelCase(titleCaseToArray(this), locale);
|
|
400
|
-
};
|
|
401
|
-
String.prototype.titleCaseToKebabCase = function(lowerCase = true, locale) {
|
|
402
|
-
return arrayToKebabCase(titleCaseToArray(this), lowerCase, locale);
|
|
403
|
-
};
|
|
404
|
-
String.prototype.titleCaseToPascalCase = function(locale) {
|
|
405
|
-
return this.titleCaseToCamelCase().camelCaseToPascalCase(locale);
|
|
406
|
-
};
|
|
407
|
-
String.prototype.titleCaseToSentenceCase = function(locale) {
|
|
408
|
-
return arrayToSentenceCase(titleCaseToArray(this), locale);
|
|
409
|
-
};
|
|
410
|
-
String.prototype.titleCaseToSnakeCase = function(lowerCase = true, locale) {
|
|
411
|
-
return this.titleCaseToKebabCase().kebabCaseToSnakeCase(lowerCase, locale);
|
|
412
|
-
};
|
|
413
|
-
String.prototype.toDateFromTime = function() {
|
|
414
|
-
return new Date(`${new Date().toISOString().substr(0, 11)}${this}`);
|
|
415
|
-
};
|
|
350
|
+
});
|
|
351
|
+
const cardSizes = [
|
|
352
|
+
"small",
|
|
353
|
+
"medium",
|
|
354
|
+
"large"
|
|
355
|
+
];
|
|
416
356
|
var NumberFormat;
|
|
417
357
|
(function(NumberFormat2) {
|
|
418
358
|
NumberFormat2["CURRENCY"] = "currency";
|
|
@@ -502,8 +442,7 @@ const messages = {
|
|
|
502
442
|
login: "Login",
|
|
503
443
|
email: "Email Address",
|
|
504
444
|
password: "Password",
|
|
505
|
-
validEmail: "Username is a valid email address."
|
|
506
|
-
invalidEmail: "Username must be a valid email address."
|
|
445
|
+
validEmail: "Username is a valid email address."
|
|
507
446
|
},
|
|
508
447
|
slider: {
|
|
509
448
|
invalidProps: "The current combination of props is invalid. Please confirm the values provided are correct."
|
|
@@ -639,12 +578,12 @@ function validateMinValue(minimumValue, typeOfValue, valueName, actualValue) {
|
|
|
639
578
|
break;
|
|
640
579
|
case "datetime":
|
|
641
580
|
isValid = actualValue >= new Date(minimumValue).getTime();
|
|
642
|
-
validatedState = getValidatedInputState(isValid, t("input.afterOrEqualToValue", { label: valueName, min: new Date(minimumValue).
|
|
581
|
+
validatedState = getValidatedInputState(isValid, t("input.afterOrEqualToValue", { label: valueName, min: i18n.global.d(new Date(minimumValue), DateFormat.DATETIME, locale != null ? locale : i18n.global.locale.value) }));
|
|
643
582
|
break;
|
|
644
583
|
case "time":
|
|
645
584
|
timeValue = minimumValue.toDateFromTime();
|
|
646
585
|
isValid = actualValue >= timeValue;
|
|
647
|
-
validatedState = getValidatedInputState(isValid, t("input.afterOrEqualToValue", { label: valueName, min: new Date(timeValue).
|
|
586
|
+
validatedState = getValidatedInputState(isValid, t("input.afterOrEqualToValue", { label: valueName, min: i18n.global.d(new Date(timeValue), DateFormat.TIME, locale != null ? locale : i18n.global.locale.value) }));
|
|
648
587
|
break;
|
|
649
588
|
default:
|
|
650
589
|
validatedState.valid = true;
|
|
@@ -689,12 +628,12 @@ function validateMaxValue(maximumValue, typeOfValue, valueName, actualValue) {
|
|
|
689
628
|
break;
|
|
690
629
|
case "datetime":
|
|
691
630
|
isValid = actualValue <= new Date(maximumValue).getTime();
|
|
692
|
-
validatedState = getValidatedInputState(isValid, t("input.
|
|
631
|
+
validatedState = getValidatedInputState(isValid, t("input.afterOrEqualToValue", { label: valueName, min: i18n.global.d(new Date(maximumValue), DateFormat.DATETIME, locale != null ? locale : i18n.global.locale.value) }));
|
|
693
632
|
break;
|
|
694
633
|
case "time":
|
|
695
634
|
timeValue = maximumValue.toDateFromTime();
|
|
696
635
|
isValid = actualValue <= timeValue;
|
|
697
|
-
validatedState = getValidatedInputState(isValid, t("input.
|
|
636
|
+
validatedState = getValidatedInputState(isValid, t("input.afterOrEqualToValue", { label: valueName, min: i18n.global.d(new Date(timeValue), DateFormat.TIME, locale != null ? locale : i18n.global.locale.value) }));
|
|
698
637
|
break;
|
|
699
638
|
default:
|
|
700
639
|
validatedState.valid = true;
|
|
@@ -726,157 +665,6 @@ function getValidatedInputState(validationCheck, message) {
|
|
|
726
665
|
};
|
|
727
666
|
return validation;
|
|
728
667
|
}
|
|
729
|
-
const notifications = ref([]);
|
|
730
|
-
function showNotification(notification) {
|
|
731
|
-
const newNotification = __spreadValues({
|
|
732
|
-
id: generateStringId()
|
|
733
|
-
}, notification);
|
|
734
|
-
notifications.value.push(newNotification);
|
|
735
|
-
setTimeout(() => removeNotification(newNotification), notification.duration);
|
|
736
|
-
}
|
|
737
|
-
function removeNotification(notification) {
|
|
738
|
-
notifications.value = notifications.value.filter((n) => n.id !== notification.id);
|
|
739
|
-
}
|
|
740
|
-
const _hoisted_1$r = ["onClick"];
|
|
741
|
-
const _hoisted_2$m = { class: "cl-flex-1 cl-overflow-ellipsis cl-select-none cl-w-64" };
|
|
742
|
-
const __default__$4 = {
|
|
743
|
-
inheritAttrs: false
|
|
744
|
-
};
|
|
745
|
-
function setup$4(__props) {
|
|
746
|
-
return (_ctx, _cache) => {
|
|
747
|
-
const _component_icon = resolveComponent("icon");
|
|
748
|
-
return openBlock(), createBlock(Teleport, { to: __props.container }, [
|
|
749
|
-
createElementVNode("div", {
|
|
750
|
-
class: normalizeClass(["cl-fixed cl-w-80 cl-z-40", {
|
|
751
|
-
"cl-top-5 cl-left-5": __props.position === "top-left",
|
|
752
|
-
"cl-top-5 cl-left-1/2": __props.position === "top-centre",
|
|
753
|
-
"cl-top-5 cl-right-5": __props.position === "top-right",
|
|
754
|
-
"cl-bottom-5 cl-left-5": __props.position === "bottom-left",
|
|
755
|
-
"cl-bottom-5 cl-left-1/2": __props.position === "bottom-centre",
|
|
756
|
-
"cl-bottom-5 cl-right-5": __props.position === "bottom-right"
|
|
757
|
-
}])
|
|
758
|
-
}, [
|
|
759
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(notifications), (notification, index) => {
|
|
760
|
-
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, {
|
|
761
|
-
key: index,
|
|
762
|
-
class: ["cl-break-words cl-cursor-pointer cl-flex cl-font-semibold cl-group cl-mb-2 cl-overflow-hidden cl-p-4 cl-rounded cl-shadow-lg cl-text-sm", {
|
|
763
|
-
"cl-bg-white": notification.colour === "default",
|
|
764
|
-
"cl-bg-primary-default": notification.colour === "primary",
|
|
765
|
-
"cl-bg-secondary-default": notification.colour === "secondary",
|
|
766
|
-
"cl-bg-danger-default": notification.colour === "danger",
|
|
767
|
-
"cl-bg-warning-default": notification.colour === "warning"
|
|
768
|
-
}],
|
|
769
|
-
onClick: ($event) => unref(removeNotification)(notification)
|
|
770
|
-
}), [
|
|
771
|
-
createElementVNode("span", _hoisted_2$m, toDisplayString(notification.message), 1),
|
|
772
|
-
createVNode(_component_icon, {
|
|
773
|
-
class: "cl-inline-block cl-opacity-0 cl-transition-opacity group-hover:cl-opacity-100",
|
|
774
|
-
icon: "ph:x",
|
|
775
|
-
size: 16,
|
|
776
|
-
weight: "bold"
|
|
777
|
-
})
|
|
778
|
-
], 16, _hoisted_1$r);
|
|
779
|
-
}), 128))
|
|
780
|
-
], 2)
|
|
781
|
-
], 8, ["to"]);
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
const _sfc_main$s = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
|
|
785
|
-
props: {
|
|
786
|
-
container: { default: "body" },
|
|
787
|
-
position: { default: "top-right" }
|
|
788
|
-
},
|
|
789
|
-
setup: setup$4
|
|
790
|
-
}));
|
|
791
|
-
const _hoisted_1$q = { class: "cl-absolute cl-flex cl-flex-wrap cl-h-screen cl-max-h-screen cl-max-w-full cl-min-h-screen cl-min-w-full cl-w-full" };
|
|
792
|
-
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
793
|
-
props: {
|
|
794
|
-
removePadding: { type: Boolean, default: false }
|
|
795
|
-
},
|
|
796
|
-
setup(__props) {
|
|
797
|
-
return (_ctx, _cache) => {
|
|
798
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
799
|
-
createVNode(_sfc_main$s),
|
|
800
|
-
createElementVNode("div", _hoisted_1$q, [
|
|
801
|
-
renderSlot(_ctx.$slots, "header"),
|
|
802
|
-
createElementVNode("div", {
|
|
803
|
-
class: normalizeClass(["cl-content-start cl-flex cl-flex-nowrap cl-items-stretch cl-max-h-screen cl-relative cl-w-full", {
|
|
804
|
-
"cl-pt-20": _ctx.$slots.header
|
|
805
|
-
}])
|
|
806
|
-
}, [
|
|
807
|
-
renderSlot(_ctx.$slots, "navigation"),
|
|
808
|
-
createElementVNode("div", {
|
|
809
|
-
class: normalizeClass(["cl-flex-grow cl-max-h-full cl-overflow-x-hidden cl-overflow-y-auto cl-w-auto", {
|
|
810
|
-
"md:cl-p-8 cl-p-2": !__props.removePadding
|
|
811
|
-
}])
|
|
812
|
-
}, [
|
|
813
|
-
renderSlot(_ctx.$slots, "default")
|
|
814
|
-
], 2)
|
|
815
|
-
], 2)
|
|
816
|
-
])
|
|
817
|
-
], 64);
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
});
|
|
821
|
-
var clUiLoadingSpinner_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
822
|
-
const _sfc_main$q = {};
|
|
823
|
-
const _hoisted_1$p = { class: "loading-spinner" };
|
|
824
|
-
function _sfc_render$4(_ctx, _cache) {
|
|
825
|
-
return openBlock(), createElementBlock("div", _hoisted_1$p);
|
|
826
|
-
}
|
|
827
|
-
var ClUiLoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$4], ["__scopeId", "data-v-60d7cfd0"]]);
|
|
828
|
-
const _hoisted_1$o = ["disabled"];
|
|
829
|
-
const __default__$3 = {
|
|
830
|
-
inheritAttrs: false
|
|
831
|
-
};
|
|
832
|
-
function setup$3(__props) {
|
|
833
|
-
return (_ctx, _cache) => {
|
|
834
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
835
|
-
withDirectives(createVNode(ClUiLoadingSpinner, { class: "cl-absolute" }, null, 512), [
|
|
836
|
-
[vShow, __props.loading]
|
|
837
|
-
]),
|
|
838
|
-
withDirectives(createElementVNode("button", mergeProps(_ctx.$attrs, {
|
|
839
|
-
class: ["cl-align-middle cl-border cl-font-semibold cl-inline-block cl-overflow-visible cl-rounded cl-select-none cl-shadow cl-text-center cl-transition-colors", {
|
|
840
|
-
"cl-leading-8 cl-px-4 cl-text-sm": __props.size === "small",
|
|
841
|
-
"cl-leading-10 cl-px-8 cl-text-sm": __props.size === "medium",
|
|
842
|
-
"cl-leading-10 cl-px-10 cl-py-2": __props.size === "large",
|
|
843
|
-
"cl-bg-white cl-border-grey-0 hover:cl-border-grey-2 cl-text-secondary": __props.colour === "default",
|
|
844
|
-
"cl-border-primary-default cl-bg-primary-default cl-text-white hover:cl-bg-primary-light hover:cl-border-primary-light": __props.colour === "primary",
|
|
845
|
-
"cl-border-secondary-default cl-bg-secondary-default cl-text-white hover:cl-bg-secondary-light hover:cl-border-secondary-light": __props.colour === "secondary",
|
|
846
|
-
"cl-border-danger-default cl-bg-danger-default cl-text-white hover:cl-bg-danger-dark hover:cl-border-danger-dark": __props.colour === "danger",
|
|
847
|
-
"cl-border-link-default cl-bg-link-default cl-text-white hover:cl-bg-link-light hover:cl-border-link-light": __props.colour === "blue",
|
|
848
|
-
"!cl-border-grey-3 !cl-bg-grey-3 cl-text-grey-0 hover:!cl-bg-grey-3 hover:!cl-border-grey-3 cl-cursor-default": __props.disabled
|
|
849
|
-
}],
|
|
850
|
-
disabled: __props.disabled
|
|
851
|
-
}), [
|
|
852
|
-
renderSlot(_ctx.$slots, "default")
|
|
853
|
-
], 16, _hoisted_1$o), [
|
|
854
|
-
[vShow, !__props.loading]
|
|
855
|
-
])
|
|
856
|
-
], 64);
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
const _sfc_main$p = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
|
|
860
|
-
props: {
|
|
861
|
-
colour: { default: "default" },
|
|
862
|
-
size: { default: "medium" },
|
|
863
|
-
loading: { type: Boolean, default: false },
|
|
864
|
-
disabled: { type: Boolean, default: false }
|
|
865
|
-
},
|
|
866
|
-
setup: setup$3
|
|
867
|
-
}));
|
|
868
|
-
const buttonColours = [
|
|
869
|
-
"default",
|
|
870
|
-
"primary",
|
|
871
|
-
"secondary",
|
|
872
|
-
"danger",
|
|
873
|
-
"blue"
|
|
874
|
-
];
|
|
875
|
-
const buttonSizes = [
|
|
876
|
-
"small",
|
|
877
|
-
"medium",
|
|
878
|
-
"large"
|
|
879
|
-
];
|
|
880
668
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
881
669
|
var de = { exports: {} };
|
|
882
670
|
(function(module, exports) {
|
|
@@ -1312,7 +1100,7 @@ function generateFixedDate() {
|
|
|
1312
1100
|
return new Date(`${FixedDate.YEAR}-${FixedDate.MONTH}-${FixedDate.DAY}T${FixedDate.HOUR}:${FixedDate.MINUTE}`);
|
|
1313
1101
|
}
|
|
1314
1102
|
function replaceDateWithPlaceholders(date, hourPlaceholder, yearPlaceholder) {
|
|
1315
|
-
return date.replace(FixedDate.YEAR, yearPlaceholder).replace(FixedDate.HOUR, hourPlaceholder).replace(FixedDate.MONTH, "m").replace(FixedDate.MONTH_SHORT, "n").replace(FixedDate.DAY, "d").replace(FixedDate.DAY_SHORT, "j").replace(FixedDate.MINUTE, "i").replace(FixedDate.SUFFIX, "K")
|
|
1103
|
+
return date.replace(FixedDate.YEAR, yearPlaceholder).replace(FixedDate.HOUR, hourPlaceholder).replace(FixedDate.MONTH, "m").replace(FixedDate.MONTH_SHORT, "n").replace(FixedDate.DAY, "d").replace(FixedDate.DAY_SHORT, "j").replace(FixedDate.MINUTE, "i").replace(FixedDate.SUFFIX, "K");
|
|
1316
1104
|
}
|
|
1317
1105
|
function getLocale(locale) {
|
|
1318
1106
|
let result;
|
|
@@ -1366,11 +1154,11 @@ function getFormattedTimeForMinMax(date) {
|
|
|
1366
1154
|
return formatted;
|
|
1367
1155
|
}
|
|
1368
1156
|
var clUiCalendar_vue_vue_type_style_index_0_lang = "";
|
|
1369
|
-
const _hoisted_1$
|
|
1370
|
-
const _hoisted_2$l = { class: "cl-absolute cl-bg-white cl-flex cl-right-2 cl-text-grey-4 cl-top-3" };
|
|
1371
|
-
const _sfc_main$
|
|
1157
|
+
const _hoisted_1$m = ["placeholder", "disabled"];
|
|
1158
|
+
const _hoisted_2$l = { class: "cl-absolute cl-bg-white cl-flex cl-right-2 cl-text-grey-4 cl-top-3.5" };
|
|
1159
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
1372
1160
|
props: {
|
|
1373
|
-
date: { default:
|
|
1161
|
+
date: { default: null },
|
|
1374
1162
|
datePlaceholder: { default: "Select date." },
|
|
1375
1163
|
dateTimePlaceholder: { default: "Select date & time." },
|
|
1376
1164
|
timePlaceholder: { default: "Select time." },
|
|
@@ -1547,21 +1335,16 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1547
1335
|
const _component_icon = resolveComponent("icon");
|
|
1548
1336
|
return openBlock(), createElementBlock("div", mergeProps(_ctx.$attrs, { class: "cl-relative" }), [
|
|
1549
1337
|
createElementVNode("input", mergeProps({
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
element.value = _value;
|
|
1553
|
-
}
|
|
1338
|
+
ref_key: "element",
|
|
1339
|
+
ref: element
|
|
1554
1340
|
}, _ctx.$attrs, {
|
|
1555
|
-
class: ["!cl-text-sm", {
|
|
1556
|
-
"!cl-pr-12": __props.date !== null,
|
|
1557
|
-
"!cl-pr-8": __props.date === null
|
|
1558
|
-
}],
|
|
1341
|
+
class: ["!cl-text-sm cl-border-grey-1 cl-rounded-lg focus:cl-border-blue-light focus:cl-ring-0", { "cl-bg-off-white": __props.disabled }],
|
|
1559
1342
|
type: "text",
|
|
1560
1343
|
placeholder: unref(placeholder),
|
|
1561
1344
|
disabled: __props.disabled
|
|
1562
|
-
}), null, 16, _hoisted_1$
|
|
1345
|
+
}), null, 16, _hoisted_1$m),
|
|
1563
1346
|
withDirectives(createVNode(_component_icon, {
|
|
1564
|
-
class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3", {
|
|
1347
|
+
class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3.5", {
|
|
1565
1348
|
"!cl-bg-off-white": __props.disabled
|
|
1566
1349
|
}]),
|
|
1567
1350
|
icon: "ph:calendar",
|
|
@@ -1571,7 +1354,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1571
1354
|
[vShow, (__props.date === null || __props.disabled) && __props.type !== "time"]
|
|
1572
1355
|
]),
|
|
1573
1356
|
withDirectives(createVNode(_component_icon, {
|
|
1574
|
-
class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3", {
|
|
1357
|
+
class: normalizeClass(["cl-absolute cl-bg-white cl-right-2 cl-text-grey-4 cl-top-3.5", {
|
|
1575
1358
|
"!cl-bg-off-white": __props.disabled
|
|
1576
1359
|
}]),
|
|
1577
1360
|
icon: "ph-clock",
|
|
@@ -1605,153 +1388,599 @@ const calendarTypes = [
|
|
|
1605
1388
|
"datetime",
|
|
1606
1389
|
"time"
|
|
1607
1390
|
];
|
|
1608
|
-
|
|
1609
|
-
const
|
|
1391
|
+
var clUiSlider_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1392
|
+
const _hoisted_1$l = { class: "cl-flex cl-flex-wrap cl-items-center" };
|
|
1393
|
+
const _hoisted_2$k = { class: "cl-flex cl-flex-1 cl-flex-wrap cl-items-center cl-mb-2 cl-mt-3 cl-relative md:cl-mt-0" };
|
|
1394
|
+
const _hoisted_3$g = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-0 cl-px-3 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
|
|
1395
|
+
const _hoisted_4$c = {
|
|
1396
|
+
key: 0,
|
|
1397
|
+
class: "cl-w-full"
|
|
1398
|
+
};
|
|
1399
|
+
const _hoisted_5$9 = ["min", "max", "step", "disabled"];
|
|
1400
|
+
const _hoisted_6$7 = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-2 cl-px-3 cl-right-0 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
|
|
1401
|
+
const _hoisted_7$7 = {
|
|
1402
|
+
key: 1,
|
|
1403
|
+
class: "emphasis-danger text-sm w-full"
|
|
1404
|
+
};
|
|
1405
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
1610
1406
|
props: {
|
|
1611
|
-
|
|
1612
|
-
|
|
1407
|
+
value: null,
|
|
1408
|
+
min: null,
|
|
1409
|
+
max: null,
|
|
1410
|
+
step: { default: 1 },
|
|
1411
|
+
enforceStep: { type: Boolean, default: false },
|
|
1412
|
+
disabled: { type: Boolean, default: false },
|
|
1413
|
+
showNumericInput: { type: Boolean, default: true }
|
|
1613
1414
|
},
|
|
1614
|
-
|
|
1415
|
+
emits: {
|
|
1416
|
+
"update:value": null
|
|
1417
|
+
},
|
|
1418
|
+
setup(__props, { emit }) {
|
|
1419
|
+
const props = __props;
|
|
1420
|
+
const { n, t: t2 } = useI18n();
|
|
1421
|
+
const { debounce } = useDebouncer();
|
|
1422
|
+
const numericInputValue = ref(props.value);
|
|
1423
|
+
const currentValue = computed({
|
|
1424
|
+
get: () => props.value,
|
|
1425
|
+
set: (value) => emit("update:value", value)
|
|
1426
|
+
});
|
|
1427
|
+
const colour = computed(() => props.disabled ? "rgba(153, 153, 153, 0.8)" : "#9acd32");
|
|
1428
|
+
const percentage = computed(() => {
|
|
1429
|
+
let value = (currentValue.value - props.min) / (props.max - props.min) * 100;
|
|
1430
|
+
if (value < 35 && value > 0) {
|
|
1431
|
+
if (value < 20) {
|
|
1432
|
+
value += 0.5;
|
|
1433
|
+
} else {
|
|
1434
|
+
value += 0.25;
|
|
1435
|
+
}
|
|
1436
|
+
} else if (value > 65 && value < 100) {
|
|
1437
|
+
if (value > 80) {
|
|
1438
|
+
value -= 0.5;
|
|
1439
|
+
} else {
|
|
1440
|
+
value -= 0.25;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
return value;
|
|
1444
|
+
});
|
|
1445
|
+
const validProps = computed(() => props.min <= props.max && props.step > 0);
|
|
1446
|
+
function updateCurrentValue(target, forceUpdate) {
|
|
1447
|
+
var _a;
|
|
1448
|
+
const inputValue = (_a = target == null ? void 0 : target.value) != null ? _a : "";
|
|
1449
|
+
const value = Math.max(Math.min(parseFloat(inputValue) || props.min, props.max), props.min);
|
|
1450
|
+
currentValue.value = props.enforceStep ? Math.ceil(value / props.step) * props.step : value;
|
|
1451
|
+
nextTick(() => forceUpdate());
|
|
1452
|
+
}
|
|
1453
|
+
watch(() => props.value, () => numericInputValue.value = props.value);
|
|
1615
1454
|
return (_ctx, _cache) => {
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
"
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1455
|
+
const _component_cl_ui_input = resolveComponent("cl-ui-input");
|
|
1456
|
+
return unref(validProps) ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), [
|
|
1457
|
+
withDirectives(createElementVNode("div", { class: "cl-bg-transparent cl-relative cl-text-center cl-text-sm" }, toDisplayString(unref(currentValue)), 513), [
|
|
1458
|
+
[vShow, !__props.showNumericInput]
|
|
1459
|
+
]),
|
|
1460
|
+
createElementVNode("div", _hoisted_1$l, [
|
|
1461
|
+
withDirectives(createVNode(_component_cl_ui_input, {
|
|
1462
|
+
modelValue: numericInputValue.value,
|
|
1463
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => numericInputValue.value = $event),
|
|
1464
|
+
class: "!cl-text-sm md:!cl-w-auto",
|
|
1465
|
+
"input-type": "number",
|
|
1466
|
+
min: __props.min,
|
|
1467
|
+
max: __props.max,
|
|
1468
|
+
step: __props.step,
|
|
1469
|
+
disabled: __props.disabled,
|
|
1470
|
+
onInput: _cache[1] || (_cache[1] = ($event) => unref(debounce)(updateCurrentValue, $event.target, _ctx.$forceUpdate))
|
|
1471
|
+
}, null, 8, ["modelValue", "min", "max", "step", "disabled"]), [
|
|
1472
|
+
[vShow, __props.showNumericInput]
|
|
1473
|
+
]),
|
|
1474
|
+
createElementVNode("div", _hoisted_2$k, [
|
|
1475
|
+
createElementVNode("span", _hoisted_3$g, toDisplayString(unref(n)(__props.min, Number.isInteger(__props.min) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1),
|
|
1476
|
+
typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
|
|
1477
|
+
withDirectives(createElementVNode("input", {
|
|
1478
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
|
|
1479
|
+
class: "cl-align-middle cl-appearance-none cl-bg-gradient-to-r cl-border cl-border-grey-2 cl-delay-500 cl-ease-in cl-flex-1 cl-h-5 cl-mb-2 cl-outline-none cl-rounded-full cl-transition-colors cl-w-full",
|
|
1480
|
+
style: normalizeStyle({
|
|
1481
|
+
background: `linear-gradient(to right, ${unref(colour)} 0%, ${unref(colour)} ${unref(percentage)}%, white ${unref(percentage)}%, white 100%)`
|
|
1482
|
+
}),
|
|
1483
|
+
type: "range",
|
|
1484
|
+
min: __props.min,
|
|
1485
|
+
max: __props.max,
|
|
1486
|
+
step: __props.step,
|
|
1487
|
+
disabled: __props.disabled
|
|
1488
|
+
}, null, 12, _hoisted_5$9), [
|
|
1489
|
+
[
|
|
1490
|
+
vModelText,
|
|
1491
|
+
unref(currentValue),
|
|
1492
|
+
void 0,
|
|
1493
|
+
{ number: true }
|
|
1494
|
+
]
|
|
1495
|
+
])
|
|
1496
|
+
])) : createCommentVNode("", true),
|
|
1497
|
+
createElementVNode("span", _hoisted_6$7, toDisplayString(unref(n)(__props.max, Number.isInteger(__props.max) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1)
|
|
1498
|
+
])
|
|
1499
|
+
])
|
|
1500
|
+
], 16)) : (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(unref(t2)("slider.invalidProps")), 1));
|
|
1656
1501
|
};
|
|
1657
1502
|
}
|
|
1658
1503
|
});
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
visible.value = true;
|
|
1675
|
-
document.addEventListener("keydown", closeOnKeyPress);
|
|
1504
|
+
var clUiSlider = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-26895858"]]);
|
|
1505
|
+
function isInputText(type) {
|
|
1506
|
+
let isText = false;
|
|
1507
|
+
switch (type) {
|
|
1508
|
+
case "email":
|
|
1509
|
+
case "password":
|
|
1510
|
+
case "search":
|
|
1511
|
+
case "tel":
|
|
1512
|
+
case "text":
|
|
1513
|
+
case "url":
|
|
1514
|
+
isText = true;
|
|
1515
|
+
break;
|
|
1516
|
+
default:
|
|
1517
|
+
isText = false;
|
|
1518
|
+
break;
|
|
1676
1519
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1520
|
+
return isText;
|
|
1521
|
+
}
|
|
1522
|
+
function isInputCalendarSupportedDate(type) {
|
|
1523
|
+
let isSupported = false;
|
|
1524
|
+
switch (type) {
|
|
1525
|
+
case "date":
|
|
1526
|
+
case "datetime":
|
|
1527
|
+
case "time":
|
|
1528
|
+
isSupported = true;
|
|
1529
|
+
break;
|
|
1530
|
+
default:
|
|
1531
|
+
isSupported = false;
|
|
1532
|
+
break;
|
|
1682
1533
|
}
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1534
|
+
return isSupported;
|
|
1535
|
+
}
|
|
1536
|
+
function isInputButton(type) {
|
|
1537
|
+
return type === "button" || type === "submit" || type === "reset";
|
|
1538
|
+
}
|
|
1539
|
+
function getInputTypeAsCalendarType(type) {
|
|
1540
|
+
let calendarType;
|
|
1541
|
+
switch (type) {
|
|
1542
|
+
case "datetime":
|
|
1543
|
+
calendarType = calendarTypes[1];
|
|
1544
|
+
break;
|
|
1545
|
+
case "time":
|
|
1546
|
+
calendarType = calendarTypes[2];
|
|
1547
|
+
break;
|
|
1548
|
+
case "date":
|
|
1549
|
+
default:
|
|
1550
|
+
calendarType = calendarTypes[0];
|
|
1551
|
+
break;
|
|
1552
|
+
}
|
|
1553
|
+
return calendarType;
|
|
1554
|
+
}
|
|
1555
|
+
var clUiInput_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1556
|
+
const _hoisted_1$k = { class: "cl-align-top cl-border-none cl-inline-block cl-mb-4 cl-mr-4 cl-text-left" };
|
|
1557
|
+
const _hoisted_2$j = { class: "cl-flex cl-justify-between" };
|
|
1558
|
+
const _hoisted_3$f = { class: "cl-w-full" };
|
|
1559
|
+
const _hoisted_4$b = {
|
|
1560
|
+
key: 0,
|
|
1561
|
+
class: "cl-block cl-left-auto cl-relative cl-text-danger-default"
|
|
1562
|
+
};
|
|
1563
|
+
const _hoisted_5$8 = {
|
|
1564
|
+
key: 1,
|
|
1565
|
+
class: "cl-bg-danger-light cl-block cl-max-h-6 cl-mb-1 cl-ml-2 cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-uppercase"
|
|
1566
|
+
};
|
|
1567
|
+
const _hoisted_6$6 = ["type", "disabled", "min", "max", "minlength", "maxlength", "step", "placeholder", "accept", "name", "autocomplete", "onBlur", "onMousewheel"];
|
|
1568
|
+
const _hoisted_7$6 = { class: "cl-relative" };
|
|
1569
|
+
const _hoisted_8$5 = {
|
|
1570
|
+
key: 2,
|
|
1571
|
+
class: "cl-h-[5.78rem] cl-pb-2 md:cl-h-20"
|
|
1572
|
+
};
|
|
1573
|
+
const _hoisted_9$5 = {
|
|
1574
|
+
key: 0,
|
|
1575
|
+
class: "cl-bg-primary-lighter cl-px-2 cl-rounded-md cl-text-center cl-text-secondary-light cl-text-xs cl-w-auto cl-whitespace-pre-line"
|
|
1576
|
+
};
|
|
1577
|
+
const _hoisted_10$5 = {
|
|
1578
|
+
key: 1,
|
|
1579
|
+
class: "cl-bg-danger-light cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-w-auto cl-whitespace-pre-line"
|
|
1580
|
+
};
|
|
1581
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
1582
|
+
props: {
|
|
1583
|
+
inputType: { default: "text" },
|
|
1584
|
+
modelValue: { type: [String, Number, Boolean, Date, null], default: void 0 },
|
|
1585
|
+
label: { default: "" },
|
|
1586
|
+
isRequired: { type: Boolean, default: false },
|
|
1587
|
+
customValidationFunction: { type: Function, default: void 0 },
|
|
1588
|
+
onInputFunction: { type: Function, default: void 0 },
|
|
1589
|
+
min: { default: -1e11 },
|
|
1590
|
+
max: { default: 1e11 },
|
|
1591
|
+
step: { default: 1 },
|
|
1592
|
+
validateImmediately: { type: Boolean, default: false },
|
|
1593
|
+
externalErrors: { default: () => [] },
|
|
1594
|
+
disabled: { type: Boolean, default: false },
|
|
1595
|
+
requiredText: { default: "" },
|
|
1596
|
+
placeholderText: { default: "" },
|
|
1597
|
+
fileExtensions: { default: "" },
|
|
1598
|
+
group: { default: "" },
|
|
1599
|
+
showLabel: { type: Boolean, default: true },
|
|
1600
|
+
showArrows: { type: Boolean, default: true },
|
|
1601
|
+
autocomplete: { default: "off" },
|
|
1602
|
+
highlightWhenValid: { type: Boolean, default: false },
|
|
1603
|
+
messageWhenValid: { default: "" },
|
|
1604
|
+
inputSpecificClasses: { default: "" }
|
|
1605
|
+
},
|
|
1606
|
+
emits: {
|
|
1607
|
+
"update:modelValue": null,
|
|
1608
|
+
click: null,
|
|
1609
|
+
focus: null,
|
|
1610
|
+
input: null,
|
|
1611
|
+
validated: null
|
|
1612
|
+
},
|
|
1613
|
+
setup(__props, { emit }) {
|
|
1614
|
+
const props = __props;
|
|
1615
|
+
const inputElement = ref(null);
|
|
1616
|
+
const focused = ref(false);
|
|
1617
|
+
const lostFocus = ref(false);
|
|
1618
|
+
const showRequiredAsterisk = computed(getShowAsteriskOrRequired);
|
|
1619
|
+
const placeholder = computed(() => props.placeholderText.trim() !== "" ? props.placeholderText : props.label);
|
|
1620
|
+
const dateFlaggedAsOutOfRange = ref(false);
|
|
1621
|
+
const { t: t2 } = useI18n();
|
|
1622
|
+
const currentValue = computed({
|
|
1623
|
+
get: () => props.modelValue,
|
|
1624
|
+
set: (value) => onValueChanged(value)
|
|
1625
|
+
});
|
|
1626
|
+
const currentDateValue = computed({
|
|
1627
|
+
get: () => props.modelValue,
|
|
1628
|
+
set: (value) => updateDateValue(value)
|
|
1629
|
+
});
|
|
1630
|
+
const minAsString = computed(() => typeof props.min === "number" ? props.min.toString() : props.min);
|
|
1631
|
+
const maxAsString = computed(() => typeof props.max === "number" ? props.max.toString() : props.max);
|
|
1632
|
+
const minAsNumber = computed(() => typeof props.min === "number" ? props.min : parseFloat(props.min));
|
|
1633
|
+
const maxAsNumber = computed(() => typeof props.max === "number" ? props.max : parseFloat(props.max));
|
|
1634
|
+
const validMessage = computed(() => props.messageWhenValid.trim() !== "" ? props.messageWhenValid : "");
|
|
1635
|
+
const isValid = ref(true);
|
|
1636
|
+
const internalErrors = ref([]);
|
|
1637
|
+
const errors = computed(() => {
|
|
1638
|
+
var _a, _b, _c, _d;
|
|
1639
|
+
return [
|
|
1640
|
+
...(_b = (_a = internalErrors.value) == null ? void 0 : _a.filter((e) => {
|
|
1641
|
+
var _a2;
|
|
1642
|
+
return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
|
|
1643
|
+
})) != null ? _b : [],
|
|
1644
|
+
...(_d = (_c = props.externalErrors) == null ? void 0 : _c.filter((e) => {
|
|
1645
|
+
var _a2;
|
|
1646
|
+
return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
|
|
1647
|
+
})) != null ? _d : []
|
|
1648
|
+
].join("\n");
|
|
1649
|
+
});
|
|
1650
|
+
function updateDateValue(value) {
|
|
1651
|
+
updateAndValidateValue(value);
|
|
1652
|
+
dateFlaggedAsOutOfRange.value = false;
|
|
1653
|
+
}
|
|
1654
|
+
function onValueChanged(value) {
|
|
1655
|
+
if (props.onInputFunction !== void 0) {
|
|
1656
|
+
value = props.onInputFunction(value);
|
|
1657
|
+
}
|
|
1658
|
+
updateAndValidateValue(value);
|
|
1659
|
+
}
|
|
1660
|
+
function updateAndValidateValue(value) {
|
|
1661
|
+
const defaultSuccess = {
|
|
1662
|
+
message: "",
|
|
1663
|
+
valid: true
|
|
1664
|
+
};
|
|
1665
|
+
const validationPromises = [props.customValidationFunction === null || props.customValidationFunction === void 0 ? new Promise((resolve) => {
|
|
1666
|
+
resolve(defaultSuccess);
|
|
1667
|
+
}) : new Promise((resolve) => {
|
|
1668
|
+
resolve(props.customValidationFunction(props.label, value));
|
|
1669
|
+
})];
|
|
1670
|
+
if (typeof value === "string" || typeof value === "number" || value instanceof Date) {
|
|
1671
|
+
validationPromises.push(validateMinValue(props.min, props.inputType, props.label, value));
|
|
1672
|
+
validationPromises.push(validateMaxValue(props.max, props.inputType, props.label, value));
|
|
1673
|
+
}
|
|
1674
|
+
if (props.isRequired) {
|
|
1675
|
+
validationPromises.push(validateRequired(props.label, value));
|
|
1676
|
+
}
|
|
1677
|
+
if (props.inputType === "email" && typeof value === "string") {
|
|
1678
|
+
validationPromises.push(validateEmail(props.label, value));
|
|
1679
|
+
}
|
|
1680
|
+
Promise.all(validationPromises).then((internalValidationResults) => {
|
|
1681
|
+
const messages2 = [...internalValidationResults.map((e) => e.message)];
|
|
1682
|
+
let invalid = internalValidationResults.some((e) => e.valid === false) || props.externalErrors.length > 0;
|
|
1683
|
+
if (dateFlaggedAsOutOfRange.value) {
|
|
1684
|
+
messages2.push(t2("input.dateOutOfRange"));
|
|
1685
|
+
invalid = true;
|
|
1686
|
+
}
|
|
1687
|
+
if (invalid) {
|
|
1688
|
+
internalErrors.value = messages2;
|
|
1689
|
+
emit("validated", false, value);
|
|
1690
|
+
} else {
|
|
1691
|
+
internalErrors.value = [];
|
|
1692
|
+
emit("validated", true, value);
|
|
1693
|
+
}
|
|
1694
|
+
isValid.value = !invalid;
|
|
1695
|
+
emit("update:modelValue", value);
|
|
1696
|
+
});
|
|
1686
1697
|
}
|
|
1698
|
+
function getStyle() {
|
|
1699
|
+
let style = "";
|
|
1700
|
+
if (props.inputType === "color" && currentValue.value) {
|
|
1701
|
+
if (props.disabled) {
|
|
1702
|
+
style = `background: #999999`;
|
|
1703
|
+
} else {
|
|
1704
|
+
style = `background: ${currentValue.value};`;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
return style;
|
|
1708
|
+
}
|
|
1709
|
+
function emitClickIfButton(event) {
|
|
1710
|
+
if (isInputButton(props.inputType)) {
|
|
1711
|
+
event.preventDefault();
|
|
1712
|
+
emit("click", event);
|
|
1713
|
+
} else if (props.inputType === "checkbox") {
|
|
1714
|
+
emit("click", event);
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
function incrementNumericValue() {
|
|
1718
|
+
if (inputElement.value) {
|
|
1719
|
+
inputElement.value.stepUp();
|
|
1720
|
+
inputElement.value.focus();
|
|
1721
|
+
onValueChanged(inputElement.value.valueAsNumber);
|
|
1722
|
+
const inputEvent = {
|
|
1723
|
+
target: inputElement.value
|
|
1724
|
+
};
|
|
1725
|
+
emit("input", inputEvent);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
function decrementNumericValue() {
|
|
1729
|
+
if (inputElement.value) {
|
|
1730
|
+
inputElement.value.stepDown();
|
|
1731
|
+
inputElement.value.focus();
|
|
1732
|
+
onValueChanged(inputElement.value.valueAsNumber);
|
|
1733
|
+
const inputEvent = {
|
|
1734
|
+
target: inputElement.value
|
|
1735
|
+
};
|
|
1736
|
+
emit("input", inputEvent);
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
function toggleFocus(focus) {
|
|
1740
|
+
focused.value = focus;
|
|
1741
|
+
}
|
|
1742
|
+
function onLostFocus() {
|
|
1743
|
+
lostFocus.value = true;
|
|
1744
|
+
toggleFocus(false);
|
|
1745
|
+
}
|
|
1746
|
+
function onMouseWheel(wheelEvent) {
|
|
1747
|
+
wheelEvent.target.blur();
|
|
1748
|
+
}
|
|
1749
|
+
function getShowAsteriskOrRequired() {
|
|
1750
|
+
var _a;
|
|
1751
|
+
let asterisk = true;
|
|
1752
|
+
const currentState = showRequiredAsterisk.value;
|
|
1753
|
+
if (focused.value) {
|
|
1754
|
+
asterisk = currentState;
|
|
1755
|
+
} else if (lostFocus.value && ((_a = currentValue.value) == null ? void 0 : _a.toString().trim()) === "") {
|
|
1756
|
+
asterisk = false;
|
|
1757
|
+
}
|
|
1758
|
+
return asterisk;
|
|
1759
|
+
}
|
|
1760
|
+
function onDateOutOfRange() {
|
|
1761
|
+
dateFlaggedAsOutOfRange.value = true;
|
|
1762
|
+
}
|
|
1763
|
+
onMounted(() => {
|
|
1764
|
+
if (props.validateImmediately) {
|
|
1765
|
+
onValueChanged(props.modelValue);
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
watch(() => props.isRequired, () => onValueChanged(props.modelValue));
|
|
1769
|
+
watch(() => props.externalErrors, () => updateAndValidateValue(currentValue.value));
|
|
1770
|
+
return (_ctx, _cache) => {
|
|
1771
|
+
const _component_icon = resolveComponent("icon");
|
|
1772
|
+
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
1773
|
+
createElementVNode("div", {
|
|
1774
|
+
onMouseenter: _cache[10] || (_cache[10] = ($event) => toggleFocus(true)),
|
|
1775
|
+
onMouseleave: _cache[11] || (_cache[11] = ($event) => toggleFocus(false))
|
|
1776
|
+
}, [
|
|
1777
|
+
createElementVNode("div", _hoisted_2$j, [
|
|
1778
|
+
createElementVNode("div", _hoisted_3$f, [
|
|
1779
|
+
withDirectives(createElementVNode("label", { class: "cl-block cl-mb-1 cl-text-gray-400 cl-text-xs cl-tracking-widest cl-uppercase" }, toDisplayString(__props.label), 513), [
|
|
1780
|
+
[vShow, __props.showLabel && __props.label !== ""]
|
|
1781
|
+
])
|
|
1782
|
+
]),
|
|
1783
|
+
__props.isRequired && unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_4$b, " * ")) : createCommentVNode("", true),
|
|
1784
|
+
__props.isRequired && !unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_5$8, toDisplayString(__props.requiredText), 1)) : createCommentVNode("", true)
|
|
1785
|
+
]),
|
|
1786
|
+
__props.inputType !== "range" && !unref(isInputCalendarSupportedDate)(__props.inputType) ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
1787
|
+
key: 0,
|
|
1788
|
+
ref_key: "inputElement",
|
|
1789
|
+
ref: inputElement,
|
|
1790
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentValue) ? currentValue.value = $event : null)
|
|
1791
|
+
}, _ctx.$attrs, {
|
|
1792
|
+
class: ["cl-block cl-border cl-duration-300 cl-h-full cl-mb-1 cl-transition cl-w-full focus:cl-outline-none", {
|
|
1793
|
+
"hover:!cl-border-grey-3": __props.disabled === false && !unref(isInputButton)(__props.inputType),
|
|
1794
|
+
"!cl-cursor-default": __props.disabled,
|
|
1795
|
+
"!cl-border-danger-default": !isValid.value,
|
|
1796
|
+
"!cl-border-primary-default": isValid.value && __props.highlightWhenValid,
|
|
1797
|
+
"cl-border-grey-0 focus:cl-border-blue-light": isValid.value && !unref(isInputButton)(__props.inputType),
|
|
1798
|
+
"!cl-p-2": __props.inputType === "checkbox" || __props.inputType === "radio",
|
|
1799
|
+
"cl-p-3 cl-rounded-lg": !unref(isInputButton)(__props.inputType),
|
|
1800
|
+
[`${__props.inputSpecificClasses}`]: __props.inputSpecificClasses !== ""
|
|
1801
|
+
}],
|
|
1802
|
+
style: getStyle(),
|
|
1803
|
+
type: __props.inputType,
|
|
1804
|
+
disabled: __props.disabled,
|
|
1805
|
+
min: __props.min,
|
|
1806
|
+
max: __props.max,
|
|
1807
|
+
minlength: unref(isInputText)(__props.inputType) ? __props.min : 0,
|
|
1808
|
+
maxlength: unref(isInputText)(__props.inputType) ? __props.max : 0,
|
|
1809
|
+
step: __props.step,
|
|
1810
|
+
placeholder: unref(placeholder),
|
|
1811
|
+
accept: __props.fileExtensions,
|
|
1812
|
+
name: __props.group,
|
|
1813
|
+
autocomplete: __props.autocomplete,
|
|
1814
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emitClickIfButton($event)),
|
|
1815
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => emit("focus")),
|
|
1816
|
+
onBlur: withModifiers(onLostFocus, ["self"]),
|
|
1817
|
+
onMousewheel: withModifiers(onMouseWheel, ["prevent"]),
|
|
1818
|
+
onInput: _cache[3] || (_cache[3] = ($event) => emit("input", $event))
|
|
1819
|
+
}), null, 16, _hoisted_6$6)), [
|
|
1820
|
+
[vModelDynamic, unref(currentValue)]
|
|
1821
|
+
]) : createCommentVNode("", true),
|
|
1822
|
+
unref(isInputCalendarSupportedDate)(__props.inputType) ? (openBlock(), createBlock(unref(_sfc_main$n), mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
1823
|
+
ref_key: "inputElement",
|
|
1824
|
+
ref: inputElement,
|
|
1825
|
+
date: unref(currentDateValue),
|
|
1826
|
+
"onUpdate:date": _cache[4] || (_cache[4] = ($event) => isRef(currentDateValue) ? currentDateValue.value = $event : null),
|
|
1827
|
+
class: ["cl-block cl-duration-300 cl-h-fit cl-mb-1 cl-rounded-lg cl-text-sm cl-transition cl-w-full focus:cl-outline-none", {
|
|
1828
|
+
"hover:cl-border-grey-3": !__props.disabled,
|
|
1829
|
+
"!cl-border-danger-default": !isValid.value,
|
|
1830
|
+
"!cl-border-primary-default": isValid.value && __props.highlightWhenValid
|
|
1831
|
+
}],
|
|
1832
|
+
disabled: __props.disabled,
|
|
1833
|
+
type: unref(getInputTypeAsCalendarType)(__props.inputType),
|
|
1834
|
+
min: unref(minAsString),
|
|
1835
|
+
max: unref(maxAsString),
|
|
1836
|
+
onBlur: withModifiers(onLostFocus, ["self"]),
|
|
1837
|
+
onValueOutOfRange: onDateOutOfRange,
|
|
1838
|
+
onFocus: _cache[5] || (_cache[5] = ($event) => emit("focus"))
|
|
1839
|
+
}), null, 16, ["date", "class", "disabled", "type", "min", "max", "onBlur"])) : createCommentVNode("", true),
|
|
1840
|
+
createElementVNode("div", _hoisted_7$6, [
|
|
1841
|
+
__props.inputType === "number" && !__props.disabled && __props.showArrows ? (openBlock(), createElementBlock("div", {
|
|
1842
|
+
key: 0,
|
|
1843
|
+
class: normalizeClass(["cl-absolute cl-duration-300 cl-right-1 cl-transition", {
|
|
1844
|
+
"cl-opacity-0": !focused.value
|
|
1845
|
+
}]),
|
|
1846
|
+
style: { "bottom": "1.625rem" }
|
|
1847
|
+
}, [
|
|
1848
|
+
createVNode(_component_icon, {
|
|
1849
|
+
icon: "ph:caret-up-bold",
|
|
1850
|
+
class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
|
|
1851
|
+
onClick: incrementNumericValue,
|
|
1852
|
+
onMousedown: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
1853
|
+
}, ["prevent"]))
|
|
1854
|
+
})
|
|
1855
|
+
], 2)) : createCommentVNode("", true),
|
|
1856
|
+
__props.inputType === "number" && !__props.disabled && __props.showArrows ? (openBlock(), createElementBlock("div", {
|
|
1857
|
+
key: 1,
|
|
1858
|
+
class: normalizeClass(["cl-absolute cl-bottom-2 cl-duration-300 cl-right-1 cl-transition", {
|
|
1859
|
+
"cl-opacity-0": !focused.value
|
|
1860
|
+
}])
|
|
1861
|
+
}, [
|
|
1862
|
+
createVNode(_component_icon, {
|
|
1863
|
+
icon: "ph:caret-down-bold",
|
|
1864
|
+
class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
|
|
1865
|
+
onClick: decrementNumericValue,
|
|
1866
|
+
onMousedown: _cache[7] || (_cache[7] = withModifiers(() => {
|
|
1867
|
+
}, ["prevent"]))
|
|
1868
|
+
})
|
|
1869
|
+
], 2)) : createCommentVNode("", true)
|
|
1870
|
+
]),
|
|
1871
|
+
__props.inputType === "range" && typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
|
|
1872
|
+
createVNode(unref(clUiSlider), {
|
|
1873
|
+
ref_key: "inputElement",
|
|
1874
|
+
ref: inputElement,
|
|
1875
|
+
value: unref(currentValue),
|
|
1876
|
+
"onUpdate:value": _cache[8] || (_cache[8] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
|
|
1877
|
+
min: unref(minAsNumber),
|
|
1878
|
+
max: unref(maxAsNumber),
|
|
1879
|
+
step: __props.step,
|
|
1880
|
+
disabled: __props.disabled,
|
|
1881
|
+
"show-numeric-input": false,
|
|
1882
|
+
onBlur: withModifiers(onLostFocus, ["self"]),
|
|
1883
|
+
onFocus: _cache[9] || (_cache[9] = ($event) => emit("focus"))
|
|
1884
|
+
}, null, 8, ["value", "min", "max", "step", "disabled", "onBlur"])
|
|
1885
|
+
])) : createCommentVNode("", true)
|
|
1886
|
+
], 32),
|
|
1887
|
+
isValid.value && unref(validMessage) ? (openBlock(), createElementBlock("div", _hoisted_9$5, toDisplayString(unref(validMessage)), 1)) : createCommentVNode("", true),
|
|
1888
|
+
!isValid.value && unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_10$5, toDisplayString(unref(errors)), 1)) : createCommentVNode("", true)
|
|
1889
|
+
]);
|
|
1890
|
+
};
|
|
1687
1891
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
class: ["cl-bg-white cl-flex cl-flex-wrap cl-mx-0 cl-my-auto cl-overflow-y-auto cl-relative cl-rounded-lg cl-shadow-lg", {
|
|
1698
|
-
"lg:cl-w-2/12 cl-w-10/12": __props.size === "x-small",
|
|
1699
|
-
"cl-w-6/12": __props.size === "small",
|
|
1700
|
-
"cl-w-8/12": __props.size === "medium",
|
|
1701
|
-
"cl-w-10/12": __props.size === "large"
|
|
1702
|
-
}]
|
|
1703
|
-
}), [
|
|
1704
|
-
withDirectives(createElementVNode("div", {
|
|
1705
|
-
class: normalizeClass(["cl-absolute cl-cursor-pointer cl-right-4 cl-top-4 cl-transition-colors cl-w-3", {
|
|
1706
|
-
"cl-text-white hover:cl-text-off-white": __props.headerColour === "secondary" || __props.headerColour === "primary",
|
|
1707
|
-
"cl-text-black hover:cl-text-grey-7": __props.headerColour === "white"
|
|
1708
|
-
}]),
|
|
1709
|
-
tabindex: 0,
|
|
1710
|
-
onKeypress: withKeys(close, ["enter"]),
|
|
1711
|
-
onClick: close
|
|
1712
|
-
}, [
|
|
1713
|
-
createVNode(_component_icon, { icon: "ph:x" })
|
|
1714
|
-
], 42, _hoisted_2$k), [
|
|
1715
|
-
[vShow, !__props.preventClose]
|
|
1716
|
-
]),
|
|
1717
|
-
createElementVNode("div", {
|
|
1718
|
-
class: normalizeClass(["cl-leading-[2.75rem] cl-min-h-12 cl-overflow-hidden cl-pl-3 cl-pr-8 cl-text-2xl cl-w-full", {
|
|
1719
|
-
"cl-border-b cl-border-grey-2": __props.headerColour === "white",
|
|
1720
|
-
"cl-bg-secondary-default cl-text-white": __props.headerColour === "secondary",
|
|
1721
|
-
"cl-bg-primary-default cl-text-white": __props.headerColour === "primary"
|
|
1722
|
-
}])
|
|
1723
|
-
}, [
|
|
1724
|
-
renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps({ close })))
|
|
1725
|
-
], 2),
|
|
1726
|
-
createElementVNode("div", _hoisted_3$g, [
|
|
1727
|
-
renderSlot(_ctx.$slots, "default")
|
|
1728
|
-
]),
|
|
1729
|
-
renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({ close })))
|
|
1730
|
-
], 16)
|
|
1731
|
-
], 512), [
|
|
1732
|
-
[vShow, visible.value]
|
|
1733
|
-
])
|
|
1734
|
-
]),
|
|
1735
|
-
_: 3
|
|
1736
|
-
})
|
|
1737
|
-
]))
|
|
1738
|
-
], 64);
|
|
1739
|
-
};
|
|
1740
|
-
}
|
|
1741
|
-
const _sfc_main$m = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
1892
|
+
});
|
|
1893
|
+
var ClUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-438103cc"]]);
|
|
1894
|
+
const _hoisted_1$j = { class: "cl-align-items-center cl-bg-black cl-bg-opacity-40 cl-bottom-0 cl-fixed cl-flex cl-h-screen cl-justify-center cl-left-0 cl-right-0 cl-top-0 cl-w-full cl-z-40" };
|
|
1895
|
+
const _hoisted_2$i = ["onKeypress"];
|
|
1896
|
+
const _hoisted_3$e = { class: "cl-overflow-y-auto cl-p-2 cl-w-full" };
|
|
1897
|
+
const __default__$2 = {
|
|
1898
|
+
inheritAttrs: false
|
|
1899
|
+
};
|
|
1900
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
1742
1901
|
props: {
|
|
1743
1902
|
headerColour: { default: "white" },
|
|
1744
1903
|
preventClose: { type: Boolean, default: false },
|
|
1745
1904
|
size: { default: "medium" }
|
|
1746
1905
|
},
|
|
1747
|
-
setup
|
|
1906
|
+
setup(__props) {
|
|
1907
|
+
const props = __props;
|
|
1908
|
+
const visible = ref(false);
|
|
1909
|
+
function open() {
|
|
1910
|
+
visible.value = true;
|
|
1911
|
+
document.addEventListener("keydown", closeOnKeyPress);
|
|
1912
|
+
}
|
|
1913
|
+
function close() {
|
|
1914
|
+
if (!props.preventClose) {
|
|
1915
|
+
visible.value = false;
|
|
1916
|
+
document.removeEventListener("keydown", closeOnKeyPress);
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
function closeOnKeyPress(event) {
|
|
1920
|
+
if (event.key === "Escape") {
|
|
1921
|
+
close();
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
return (_ctx, _cache) => {
|
|
1925
|
+
const _component_icon = resolveComponent("icon");
|
|
1926
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1927
|
+
renderSlot(_ctx.$slots, "trigger", normalizeProps(guardReactiveProps({ open }))),
|
|
1928
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1929
|
+
createVNode(Transition, { name: "fade" }, {
|
|
1930
|
+
default: withCtx(() => [
|
|
1931
|
+
withDirectives(createElementVNode("div", _hoisted_1$j, [
|
|
1932
|
+
createElementVNode("div", mergeProps(_ctx.$attrs, {
|
|
1933
|
+
class: ["cl-bg-white cl-flex cl-flex-wrap cl-mx-0 cl-my-auto cl-overflow-y-auto cl-relative cl-rounded-lg cl-shadow-lg", {
|
|
1934
|
+
"lg:cl-w-2/12 cl-w-10/12": __props.size === "x-small",
|
|
1935
|
+
"cl-w-6/12": __props.size === "small",
|
|
1936
|
+
"cl-w-8/12": __props.size === "medium",
|
|
1937
|
+
"cl-w-10/12": __props.size === "large"
|
|
1938
|
+
}]
|
|
1939
|
+
}), [
|
|
1940
|
+
withDirectives(createElementVNode("div", {
|
|
1941
|
+
class: normalizeClass(["cl-absolute cl-cursor-pointer cl-right-4 cl-top-4 cl-transition-colors cl-w-3", {
|
|
1942
|
+
"cl-text-white hover:cl-text-off-white": __props.headerColour === "secondary" || __props.headerColour === "primary",
|
|
1943
|
+
"cl-text-black hover:cl-text-grey-7": __props.headerColour === "white"
|
|
1944
|
+
}]),
|
|
1945
|
+
tabindex: 0,
|
|
1946
|
+
onKeypress: withKeys(close, ["enter"]),
|
|
1947
|
+
onClick: close
|
|
1948
|
+
}, [
|
|
1949
|
+
createVNode(_component_icon, { icon: "ph:x" })
|
|
1950
|
+
], 42, _hoisted_2$i), [
|
|
1951
|
+
[vShow, !__props.preventClose]
|
|
1952
|
+
]),
|
|
1953
|
+
createElementVNode("div", {
|
|
1954
|
+
class: normalizeClass(["cl-leading-[2.75rem] cl-min-h-12 cl-overflow-hidden cl-pl-3 cl-pr-8 cl-text-2xl cl-w-full", {
|
|
1955
|
+
"cl-border-b cl-border-grey-2": __props.headerColour === "white",
|
|
1956
|
+
"cl-bg-secondary-default cl-text-white": __props.headerColour === "secondary",
|
|
1957
|
+
"cl-bg-primary-default cl-text-white": __props.headerColour === "primary"
|
|
1958
|
+
}])
|
|
1959
|
+
}, [
|
|
1960
|
+
renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps({ close })))
|
|
1961
|
+
], 2),
|
|
1962
|
+
createElementVNode("div", _hoisted_3$e, [
|
|
1963
|
+
renderSlot(_ctx.$slots, "default")
|
|
1964
|
+
]),
|
|
1965
|
+
renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({ close })))
|
|
1966
|
+
], 16)
|
|
1967
|
+
], 512), [
|
|
1968
|
+
[vShow, visible.value]
|
|
1969
|
+
])
|
|
1970
|
+
]),
|
|
1971
|
+
_: 3
|
|
1972
|
+
})
|
|
1973
|
+
]))
|
|
1974
|
+
], 64);
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1748
1977
|
}));
|
|
1749
|
-
const _hoisted_1$
|
|
1750
|
-
const _hoisted_2$
|
|
1978
|
+
const _hoisted_1$i = { class: "cl-bg-grey-2 cl-border-b cl-border-grey-2 cl-border-t cl-flex cl-p-1" };
|
|
1979
|
+
const _hoisted_2$h = {
|
|
1751
1980
|
key: 0,
|
|
1752
1981
|
class: "cl-w-1/2"
|
|
1753
1982
|
};
|
|
1754
|
-
const _sfc_main$
|
|
1983
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1755
1984
|
props: {
|
|
1756
1985
|
showClearButton: { type: Boolean, default: false },
|
|
1757
1986
|
text: { default: "" },
|
|
@@ -1763,8 +1992,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
1763
1992
|
setup(__props) {
|
|
1764
1993
|
return (_ctx, _cache) => {
|
|
1765
1994
|
const _component_icon = resolveComponent("icon");
|
|
1766
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1767
|
-
__props.additionalText !== "" ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
1995
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
1996
|
+
__props.additionalText !== "" ? (openBlock(), createElementBlock("div", _hoisted_2$h, toDisplayString(__props.additionalText), 1)) : createCommentVNode("", true),
|
|
1768
1997
|
createElementVNode("div", {
|
|
1769
1998
|
class: normalizeClass({
|
|
1770
1999
|
"cl-w-1/2": __props.additionalText !== "",
|
|
@@ -1786,17 +2015,17 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
1786
2015
|
};
|
|
1787
2016
|
}
|
|
1788
2017
|
});
|
|
1789
|
-
const _hoisted_1$
|
|
2018
|
+
const _hoisted_1$h = {
|
|
1790
2019
|
key: 0,
|
|
1791
2020
|
class: "cl-w-1/2"
|
|
1792
2021
|
};
|
|
1793
|
-
const _hoisted_2$
|
|
1794
|
-
const _sfc_main$
|
|
2022
|
+
const _hoisted_2$g = { class: "cl-float-right cl-py-1.5" };
|
|
2023
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
1795
2024
|
props: {
|
|
1796
2025
|
isCreateNewOption: { type: Boolean, default: false },
|
|
1797
2026
|
selectedIndex: { default: -1 },
|
|
1798
2027
|
text: { default: "" },
|
|
1799
|
-
option: { default:
|
|
2028
|
+
option: { default: null },
|
|
1800
2029
|
index: null
|
|
1801
2030
|
},
|
|
1802
2031
|
emits: {
|
|
@@ -1853,14 +2082,14 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
1853
2082
|
onMousemove: _cache[0] || (_cache[0] = ($event) => onHover(true)),
|
|
1854
2083
|
onMouseleave: _cache[1] || (_cache[1] = ($event) => onHover(false))
|
|
1855
2084
|
}, [
|
|
1856
|
-
__props.option !== null && ((_a = __props.option) == null ? void 0 : _a.parentId) !== 0 && ((_b = __props.option) == null ? void 0 : _b.parentId) !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2085
|
+
__props.option !== null && ((_a = __props.option) == null ? void 0 : _a.parentId) !== 0 && ((_b = __props.option) == null ? void 0 : _b.parentId) !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$h, toDisplayString(unref(displayedParent)), 1)) : createCommentVNode("", true),
|
|
1857
2086
|
createElementVNode("div", {
|
|
1858
2087
|
class: normalizeClass({
|
|
1859
2088
|
"cl-w-1/2": unref(displayedParent) !== "",
|
|
1860
2089
|
"cl-w-full": unref(displayedParent) === ""
|
|
1861
2090
|
})
|
|
1862
2091
|
}, toDisplayString(unref(displayedText)), 3),
|
|
1863
|
-
withDirectives(createElementVNode("div", _hoisted_2$
|
|
2092
|
+
withDirectives(createElementVNode("div", _hoisted_2$g, [
|
|
1864
2093
|
createVNode(_component_icon, {
|
|
1865
2094
|
class: "cl-bg-primary-default cl-rounded-full cl-text-white",
|
|
1866
2095
|
icon: "ph:plus-circle"
|
|
@@ -1872,11 +2101,10 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
1872
2101
|
};
|
|
1873
2102
|
}
|
|
1874
2103
|
});
|
|
1875
|
-
const _hoisted_1$
|
|
1876
|
-
const _hoisted_2$
|
|
1877
|
-
const _hoisted_3$
|
|
1878
|
-
const
|
|
1879
|
-
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
2104
|
+
const _hoisted_1$g = ["onKeyup"];
|
|
2105
|
+
const _hoisted_2$f = { class: "cl-flex" };
|
|
2106
|
+
const _hoisted_3$d = { key: 5 };
|
|
2107
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1880
2108
|
props: {
|
|
1881
2109
|
loading: { type: Boolean, default: false },
|
|
1882
2110
|
objectType: null,
|
|
@@ -1903,7 +2131,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
1903
2131
|
const currentSelection = ref(-1);
|
|
1904
2132
|
const firstIndexInResults = computed(() => showAddNewOption.value ? -1 : 0);
|
|
1905
2133
|
const container = ref();
|
|
1906
|
-
const searchBox = ref();
|
|
1907
2134
|
function search(keyboardEvent) {
|
|
1908
2135
|
if (keyboardEvent === void 0 || (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Arrow")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Control")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Shift")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code.startsWith("Tab")) === false && (keyboardEvent == null ? void 0 : keyboardEvent.code) !== "Enter") {
|
|
1909
2136
|
emit("search", searchText.value);
|
|
@@ -1983,8 +2210,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
1983
2210
|
searchText.value = "";
|
|
1984
2211
|
search();
|
|
1985
2212
|
nextTick(() => {
|
|
1986
|
-
var _a;
|
|
1987
|
-
return (_a =
|
|
2213
|
+
var _a, _b;
|
|
2214
|
+
return (_b = (_a = container.value) == null ? void 0 : _a.querySelector("input")) == null ? void 0 : _b.focus();
|
|
1988
2215
|
});
|
|
1989
2216
|
}
|
|
1990
2217
|
}
|
|
@@ -2003,56 +2230,50 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2003
2230
|
var _a;
|
|
2004
2231
|
const _component_cl_ui_loading_spinner = resolveComponent("cl-ui-loading-spinner");
|
|
2005
2232
|
return openBlock(), createElementBlock("div", {
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
},
|
|
2010
|
-
class: "cl-bg-white cl-border cl-border-collapse cl-border-grey-0 cl-h-52 cl-overflow-y-auto cl-p-2 cl-text-sm",
|
|
2233
|
+
ref_key: "container",
|
|
2234
|
+
ref: container,
|
|
2235
|
+
class: "cl-bg-white cl-border cl-border-collapse cl-border-grey-0 cl-h-52 cl-overflow-y-auto cl-p-2 cl-rounded cl-text-sm",
|
|
2011
2236
|
onKeydown: [
|
|
2012
2237
|
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => onKeyboardArrowUp(unref(firstIndexInResults)), ["prevent", "stop"]), ["up"])),
|
|
2013
2238
|
_cache[3] || (_cache[3] = withKeys(withModifiers(($event) => onKeyboardArrowDown(unref(firstIndexInResults)), ["prevent", "stop"]), ["down"]))
|
|
2014
2239
|
],
|
|
2015
2240
|
onKeyup: withKeys(withModifiers(onKeyboardEnter, ["prevent", "stop"]), ["enter"])
|
|
2016
2241
|
}, [
|
|
2017
|
-
createElementVNode("div", _hoisted_2$
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
_refs["searchBox"] = _value;
|
|
2021
|
-
searchBox.value = _value;
|
|
2022
|
-
},
|
|
2242
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
2243
|
+
createVNode(ClUiInput, {
|
|
2244
|
+
modelValue: searchText.value,
|
|
2023
2245
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchText.value = $event),
|
|
2024
|
-
|
|
2025
|
-
|
|
2246
|
+
class: "!cl-mr-0 cl-mb-1 cl-w-full",
|
|
2247
|
+
"input-type": "text",
|
|
2248
|
+
"placeholder-text": unref(t2)("comboBox.searchHint", { object: __props.objectType }),
|
|
2026
2249
|
onKeyup: search,
|
|
2027
2250
|
onBlur: hideDropdown
|
|
2028
|
-
}, null,
|
|
2029
|
-
[vModelText, searchText.value]
|
|
2030
|
-
]),
|
|
2251
|
+
}, null, 8, ["modelValue", "placeholder-text"]),
|
|
2031
2252
|
withDirectives(createVNode(_component_cl_ui_loading_spinner, { class: "cl-absolute cl-ml-2 cl-mt-11" }, null, 512), [
|
|
2032
2253
|
[vShow, __props.loading]
|
|
2033
2254
|
])
|
|
2034
2255
|
]),
|
|
2035
|
-
__props.currentObjectName !== "" ? (openBlock(), createBlock(_sfc_main$
|
|
2256
|
+
__props.currentObjectName !== "" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2036
2257
|
key: 0,
|
|
2037
2258
|
"show-clear-button": __props.canClearSelectedObject,
|
|
2038
2259
|
text: __props.currentObjectName,
|
|
2039
2260
|
onClearObject: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("clear-object"))
|
|
2040
2261
|
}, null, 8, ["show-clear-button", "text"])) : createCommentVNode("", true),
|
|
2041
|
-
__props.objectParentType !== "" && __props.results !== void 0 && __props.results.length > 0 && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$
|
|
2262
|
+
__props.objectParentType !== "" && __props.results !== void 0 && __props.results.length > 0 && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2042
2263
|
key: 1,
|
|
2043
2264
|
text: __props.objectType,
|
|
2044
2265
|
"additional-text": __props.objectParentType
|
|
2045
2266
|
}, null, 8, ["text", "additional-text"])) : createCommentVNode("", true),
|
|
2046
|
-
__props.results !== null && ((_a = __props.results) == null ? void 0 : _a.length) === 0 && searchText.value.trim() !== "" && __props.canCreateNewObject === false && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$
|
|
2267
|
+
__props.results !== null && ((_a = __props.results) == null ? void 0 : _a.length) === 0 && searchText.value.trim() !== "" && __props.canCreateNewObject === false && __props.errorMessage === "" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2047
2268
|
key: 2,
|
|
2048
|
-
text: unref(t2)("comboBox.noResults", {
|
|
2269
|
+
text: unref(t2)("comboBox.noResults", { value: searchText.value })
|
|
2049
2270
|
}, null, 8, ["text"])) : createCommentVNode("", true),
|
|
2050
|
-
__props.errorMessage !== "" ? (openBlock(), createBlock(_sfc_main$
|
|
2271
|
+
__props.errorMessage !== "" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2051
2272
|
key: 3,
|
|
2052
|
-
class: "!cl-bg-danger-light cl-text-danger-dark",
|
|
2273
|
+
class: "!cl-bg-danger-light cl-border-danger-light cl-rounded cl-text-danger-dark",
|
|
2053
2274
|
text: unref(t2)("comboBox.errorMessage", { error: __props.errorMessage })
|
|
2054
2275
|
}, null, 8, ["text"])) : createCommentVNode("", true),
|
|
2055
|
-
showAddNewOption.value ? (openBlock(), createBlock(_sfc_main$
|
|
2276
|
+
showAddNewOption.value ? (openBlock(), createBlock(_sfc_main$i, {
|
|
2056
2277
|
key: 4,
|
|
2057
2278
|
"is-create-new-option": true,
|
|
2058
2279
|
text: unref(t2)("comboBox.addPrompt", { value: searchText.value, object: __props.objectType }),
|
|
@@ -2061,9 +2282,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2061
2282
|
onCreateObject: createObject,
|
|
2062
2283
|
onOptionHighlighted: updateSelectedObjectIndex
|
|
2063
2284
|
}, null, 8, ["text", "selected-index"])) : createCommentVNode("", true),
|
|
2064
|
-
__props.errorMessage === "" && __props.results !== null ? (openBlock(), createElementBlock("div",
|
|
2285
|
+
__props.errorMessage === "" && __props.results !== null ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
|
|
2065
2286
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.results, (result, index) => {
|
|
2066
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2287
|
+
return openBlock(), createBlock(_sfc_main$i, {
|
|
2067
2288
|
key: index,
|
|
2068
2289
|
option: result,
|
|
2069
2290
|
index,
|
|
@@ -2073,17 +2294,16 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
2073
2294
|
}, null, 8, ["option", "index", "selected-index"]);
|
|
2074
2295
|
}), 128))
|
|
2075
2296
|
])) : createCommentVNode("", true)
|
|
2076
|
-
], 40, _hoisted_1$
|
|
2297
|
+
], 40, _hoisted_1$g);
|
|
2077
2298
|
};
|
|
2078
2299
|
}
|
|
2079
2300
|
});
|
|
2080
|
-
const _hoisted_1$
|
|
2081
|
-
const _hoisted_2$
|
|
2082
|
-
const _hoisted_3$
|
|
2083
|
-
const _hoisted_4$
|
|
2084
|
-
const _hoisted_5$
|
|
2085
|
-
const
|
|
2086
|
-
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
2301
|
+
const _hoisted_1$f = { class: "cl-flex" };
|
|
2302
|
+
const _hoisted_2$e = { class: "cl-relative cl-right-20 cl-top-0.5" };
|
|
2303
|
+
const _hoisted_3$c = { class: "cl-absolute cl-flex cl-float-right cl-font-semibold cl-mt-2 cl-text-danger-default cl-text-sm" };
|
|
2304
|
+
const _hoisted_4$a = { class: "cl-ml-4 cl-w-11/12" };
|
|
2305
|
+
const _hoisted_5$7 = { class: "cl-p-2 cl-text-right cl-w-full" };
|
|
2306
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
2087
2307
|
props: {
|
|
2088
2308
|
loading: { type: Boolean, default: false },
|
|
2089
2309
|
disabled: { type: Boolean, default: false },
|
|
@@ -2093,8 +2313,8 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2093
2313
|
canCreateNewObject: { type: Boolean, default: false },
|
|
2094
2314
|
canClearSelectedObject: { type: Boolean, default: true },
|
|
2095
2315
|
errorMessage: { default: "" },
|
|
2096
|
-
objectCreatedResponse: { default:
|
|
2097
|
-
parentObjectCreatedResponse: { default:
|
|
2316
|
+
objectCreatedResponse: { default: null },
|
|
2317
|
+
parentObjectCreatedResponse: { default: null },
|
|
2098
2318
|
results: { default: () => [] },
|
|
2099
2319
|
parentResults: { default: () => [] },
|
|
2100
2320
|
currentObject: null
|
|
@@ -2178,7 +2398,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2178
2398
|
var _a, _b;
|
|
2179
2399
|
if ((_a = props.objectCreatedResponse) == null ? void 0 : _a.error) {
|
|
2180
2400
|
showNotification({
|
|
2181
|
-
message: t2("comboBox.
|
|
2401
|
+
message: t2("comboBox.createFailed", { name: objectToCreateValue.value, error: props.objectCreatedResponse.error }),
|
|
2182
2402
|
colour: "danger",
|
|
2183
2403
|
duration: 1e4
|
|
2184
2404
|
});
|
|
@@ -2198,7 +2418,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2198
2418
|
function handleSuccessfulObjectCreation() {
|
|
2199
2419
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2200
2420
|
showNotification({
|
|
2201
|
-
message: t2("comboBox.
|
|
2421
|
+
message: t2("comboBox.createSuccessful", { object: props.objectType, name: (_b = (_a = props.objectCreatedResponse) == null ? void 0 : _a.name) != null ? _b : "" }),
|
|
2202
2422
|
colour: "primary",
|
|
2203
2423
|
duration: 1e4
|
|
2204
2424
|
});
|
|
@@ -2242,24 +2462,22 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2242
2462
|
const _component_icon = resolveComponent("icon");
|
|
2243
2463
|
const _component_cl_ui_combo_box = resolveComponent("cl-ui-combo-box", true);
|
|
2244
2464
|
return openBlock(), createElementBlock("div", null, [
|
|
2245
|
-
createElementVNode("div", _hoisted_1$
|
|
2246
|
-
|
|
2465
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
2466
|
+
createVNode(ClUiInput, {
|
|
2467
|
+
modelValue: unref(currentText),
|
|
2247
2468
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentText) ? currentText.value = $event : null),
|
|
2248
|
-
class: normalizeClass(["!cl-bg-transparent cl-z-10", {
|
|
2469
|
+
class: normalizeClass(["!cl-bg-transparent !cl-mr-0 cl-mb-0 cl-rounded-r-none cl-w-full cl-z-10", {
|
|
2249
2470
|
"cl-cursor-pointer": __props.disabled === false
|
|
2250
2471
|
}]),
|
|
2251
|
-
type: "text",
|
|
2252
|
-
placeholder: unref(t2)("comboBox.emptyHintText", { object: __props.objectType }),
|
|
2253
|
-
disabled: __props.disabled,
|
|
2472
|
+
"input-type": "text",
|
|
2473
|
+
"placeholder-text": unref(t2)("comboBox.emptyHintText", { object: __props.objectType }),
|
|
2254
2474
|
onFocus: _cache[1] || (_cache[1] = ($event) => {
|
|
2255
2475
|
toggleDropdown(true);
|
|
2256
2476
|
_ctx.$emit("focus");
|
|
2257
2477
|
})
|
|
2258
|
-
}, null,
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
withDirectives(createElementVNode("div", _hoisted_3$e, [
|
|
2262
|
-
createElementVNode("div", _hoisted_4$c, [
|
|
2478
|
+
}, null, 8, ["modelValue", "class", "placeholder-text"]),
|
|
2479
|
+
withDirectives(createElementVNode("div", _hoisted_2$e, [
|
|
2480
|
+
createElementVNode("div", _hoisted_3$c, [
|
|
2263
2481
|
createTextVNode(toDisplayString(unref(t2)("comboBox.required")) + " ", 1),
|
|
2264
2482
|
createVNode(_component_icon, {
|
|
2265
2483
|
class: "cl-ml-1 cl-mt-1",
|
|
@@ -2270,7 +2488,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2270
2488
|
[vShow, __props.required && __props.disabled === false && __props.currentObject === null]
|
|
2271
2489
|
]),
|
|
2272
2490
|
createElementVNode("div", {
|
|
2273
|
-
class: normalizeClass(["cl-border cl-border-grey-1 cl-float-right cl-px-1 cl-py-2.5 cl-text-grey-3 cl-transition-colors cl-w-min hover:cl-bg-primary-default hover:cl-text-white", {
|
|
2491
|
+
class: normalizeClass(["cl-border cl-border-grey-1 cl-float-right cl-h-10 cl-px-1 cl-py-2.5 cl-rounded cl-rounded-l-none cl-text-grey-3 cl-transition-colors cl-w-min hover:cl-bg-primary-default hover:cl-text-white", {
|
|
2274
2492
|
"cl-bg-off-white cl-cursor-default hover:cl-bg-off-white hover:cl-text-grey-3": __props.disabled,
|
|
2275
2493
|
"cl-cursor-pointer": __props.disabled === false
|
|
2276
2494
|
}]),
|
|
@@ -2282,12 +2500,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2282
2500
|
})
|
|
2283
2501
|
], 2)
|
|
2284
2502
|
]),
|
|
2285
|
-
createVNode(_sfc_main$
|
|
2503
|
+
createVNode(_sfc_main$k, { size: "x-small" }, {
|
|
2286
2504
|
title: withCtx(() => [
|
|
2287
2505
|
createTextVNode(toDisplayString(unref(t2)("comboBox.createTitle", { object: __props.objectType })), 1)
|
|
2288
2506
|
]),
|
|
2289
2507
|
trigger: withCtx(({ open }) => [
|
|
2290
|
-
withDirectives(createVNode(_sfc_main$
|
|
2508
|
+
withDirectives(createVNode(_sfc_main$h, {
|
|
2291
2509
|
"can-create-new-object": __props.canCreateNewObject,
|
|
2292
2510
|
"can-clear-selected-object": __props.canClearSelectedObject,
|
|
2293
2511
|
loading: __props.loading,
|
|
@@ -2307,7 +2525,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2307
2525
|
])
|
|
2308
2526
|
]),
|
|
2309
2527
|
footer: withCtx(({ close }) => [
|
|
2310
|
-
createElementVNode("div",
|
|
2528
|
+
createElementVNode("div", _hoisted_5$7, [
|
|
2311
2529
|
createVNode(_sfc_main$p, {
|
|
2312
2530
|
class: "cl-mr-4",
|
|
2313
2531
|
colour: "primary",
|
|
@@ -2336,28 +2554,29 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
2336
2554
|
])
|
|
2337
2555
|
]),
|
|
2338
2556
|
default: withCtx(() => [
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2557
|
+
createElementVNode("div", _hoisted_4$a, [
|
|
2558
|
+
__props.objectParentType ? (openBlock(), createBlock(_component_cl_ui_combo_box, {
|
|
2559
|
+
key: 0,
|
|
2560
|
+
"current-object": parentItem.value,
|
|
2561
|
+
"onUpdate:current-object": _cache[4] || (_cache[4] = ($event) => parentItem.value = $event),
|
|
2562
|
+
class: "cl-mt-3",
|
|
2563
|
+
results: __props.parentResults,
|
|
2564
|
+
loading: __props.loading,
|
|
2565
|
+
"object-type": __props.objectParentType,
|
|
2566
|
+
"object-created-response": __props.parentObjectCreatedResponse,
|
|
2567
|
+
"can-create-new-object": __props.canCreateNewObject,
|
|
2568
|
+
"can-clear-selected-object": __props.canClearSelectedObject,
|
|
2569
|
+
"error-message": __props.errorMessage,
|
|
2570
|
+
onSearch: searchParent,
|
|
2571
|
+
onCreateObject: createParentObject
|
|
2572
|
+
}, null, 8, ["current-object", "results", "loading", "object-type", "object-created-response", "can-create-new-object", "can-clear-selected-object", "error-message"])) : createCommentVNode("", true),
|
|
2573
|
+
createVNode(ClUiInput, {
|
|
2574
|
+
modelValue: objectToCreateValue.value,
|
|
2575
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => objectToCreateValue.value = $event),
|
|
2576
|
+
label: unref(t2)("comboBox.createProperty"),
|
|
2577
|
+
class: "cl-mb-2 cl-pt-2 cl-w-full",
|
|
2578
|
+
"input-type": "text"
|
|
2579
|
+
}, null, 8, ["modelValue", "label"])
|
|
2361
2580
|
])
|
|
2362
2581
|
]),
|
|
2363
2582
|
_: 1
|
|
@@ -2372,125 +2591,48 @@ function isComboBoxItem(objectToTest) {
|
|
|
2372
2591
|
function isComboBoxCreateRequest(objectToTest) {
|
|
2373
2592
|
return typeof objectToTest.name === "string";
|
|
2374
2593
|
}
|
|
2375
|
-
const _sfc_main$
|
|
2376
|
-
const _hoisted_1$
|
|
2377
|
-
const _hoisted_2$
|
|
2594
|
+
const _sfc_main$f = {};
|
|
2595
|
+
const _hoisted_1$e = { class: "cl-flex cl-flex-wrap cl-left-0 cl-mt-4 cl-w-full" };
|
|
2596
|
+
const _hoisted_2$d = {
|
|
2378
2597
|
key: 0,
|
|
2379
2598
|
class: "cl-w-full"
|
|
2380
2599
|
};
|
|
2381
|
-
const _hoisted_3$
|
|
2600
|
+
const _hoisted_3$b = {
|
|
2382
2601
|
key: 1,
|
|
2383
2602
|
class: "cl-leading-10 cl-text-sm cl-w-full"
|
|
2384
2603
|
};
|
|
2385
|
-
const _hoisted_4$
|
|
2386
|
-
const _hoisted_5$
|
|
2604
|
+
const _hoisted_4$9 = { class: "cl-float-left" };
|
|
2605
|
+
const _hoisted_5$6 = { class: "cl-float-right" };
|
|
2387
2606
|
function _sfc_render$3(_ctx, _cache) {
|
|
2388
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2389
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2607
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
2608
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
|
|
2390
2609
|
renderSlot(_ctx.$slots, "default")
|
|
2391
2610
|
])) : createCommentVNode("", true),
|
|
2392
|
-
_ctx.$slots.left || _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2393
|
-
createElementVNode("span", _hoisted_4$
|
|
2611
|
+
_ctx.$slots.left || _ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_3$b, [
|
|
2612
|
+
createElementVNode("span", _hoisted_4$9, [
|
|
2394
2613
|
renderSlot(_ctx.$slots, "left")
|
|
2395
2614
|
]),
|
|
2396
|
-
createElementVNode("span", _hoisted_5$
|
|
2615
|
+
createElementVNode("span", _hoisted_5$6, [
|
|
2397
2616
|
renderSlot(_ctx.$slots, "right")
|
|
2398
2617
|
])
|
|
2399
2618
|
])) : createCommentVNode("", true)
|
|
2400
2619
|
]);
|
|
2401
2620
|
}
|
|
2402
|
-
var clUiFooter = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2403
|
-
const _hoisted_1$
|
|
2404
|
-
const _hoisted_2$
|
|
2405
|
-
const _hoisted_3$
|
|
2406
|
-
const _hoisted_4$a = {
|
|
2621
|
+
var clUiFooter = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$3]]);
|
|
2622
|
+
const _hoisted_1$d = { class: "cl-mr-2 lg:cl-hidden" };
|
|
2623
|
+
const _hoisted_2$c = { class: "cl-mr-2 lg:cl-hidden" };
|
|
2624
|
+
const _hoisted_3$a = {
|
|
2407
2625
|
key: 0,
|
|
2408
2626
|
class: "cl-inline-block cl-whitespace-nowrap"
|
|
2409
2627
|
};
|
|
2410
|
-
const
|
|
2628
|
+
const _hoisted_4$8 = {
|
|
2411
2629
|
key: 1,
|
|
2412
2630
|
class: "cl-inline-block cl-whitespace-nowrap"
|
|
2413
2631
|
};
|
|
2414
2632
|
const __default__$1 = {
|
|
2415
2633
|
inheritAttrs: false
|
|
2416
2634
|
};
|
|
2417
|
-
|
|
2418
|
-
const props = __props;
|
|
2419
|
-
const { d, n } = useI18n();
|
|
2420
|
-
const currentRecord = ref(copy(props.record));
|
|
2421
|
-
const edited = computed(() => {
|
|
2422
|
-
var _a, _b;
|
|
2423
|
-
return currentRecord.value[(_a = props.column.field) != null ? _a : ""] !== props.record[(_b = props.column.field) != null ? _b : ""];
|
|
2424
|
-
});
|
|
2425
|
-
function getStringValue(record, key) {
|
|
2426
|
-
return record[key];
|
|
2427
|
-
}
|
|
2428
|
-
function getNumericValue(record, key) {
|
|
2429
|
-
return record[key];
|
|
2430
|
-
}
|
|
2431
|
-
function getBooleanValue(record, key) {
|
|
2432
|
-
return record[key];
|
|
2433
|
-
}
|
|
2434
|
-
function cellFocused() {
|
|
2435
|
-
emit("focus");
|
|
2436
|
-
}
|
|
2437
|
-
watchEffect(() => currentRecord.value = copy(props.record));
|
|
2438
|
-
watch(currentRecord, (newValue) => {
|
|
2439
|
-
var _a;
|
|
2440
|
-
const property = (_a = props.column.field) != null ? _a : "";
|
|
2441
|
-
if (property !== "") {
|
|
2442
|
-
if (newValue[property] !== props.record[property]) {
|
|
2443
|
-
emit("edit", newValue[property]);
|
|
2444
|
-
} else {
|
|
2445
|
-
emit("undo-edit");
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
}, {
|
|
2449
|
-
deep: true
|
|
2450
|
-
});
|
|
2451
|
-
return (_ctx, _cache) => {
|
|
2452
|
-
return __props.editMode && __props.column.field && __props.column.editable ? (openBlock(), createElementBlock("td", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
2453
|
-
class: ["cl-transition-colours", {
|
|
2454
|
-
"cl-bg-link-lighter": unref(edited)
|
|
2455
|
-
}]
|
|
2456
|
-
}), [
|
|
2457
|
-
createElementVNode("strong", _hoisted_1$f, toDisplayString(__props.column.caption), 1),
|
|
2458
|
-
renderSlot(_ctx.$slots, `${__props.column.name}Edit`, normalizeProps(guardReactiveProps({
|
|
2459
|
-
cellFocused,
|
|
2460
|
-
column: __props.column,
|
|
2461
|
-
edited: unref(edited),
|
|
2462
|
-
record: currentRecord.value
|
|
2463
|
-
})))
|
|
2464
|
-
], 16)) : (openBlock(), createElementBlock("td", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)), [
|
|
2465
|
-
createElementVNode("strong", _hoisted_2$e, toDisplayString(__props.column.caption), 1),
|
|
2466
|
-
__props.column.type === "slot" ? renderSlot(_ctx.$slots, __props.column.name, normalizeProps(mergeProps({ key: 0 }, { column: __props.column, record: __props.record }))) : __props.column.type === "boolean" && __props.column.field !== void 0 ? (openBlock(), createElementBlock("input", {
|
|
2467
|
-
key: 1,
|
|
2468
|
-
type: "checkbox",
|
|
2469
|
-
checked: getBooleanValue(__props.record, __props.column.field),
|
|
2470
|
-
disabled: ""
|
|
2471
|
-
}, null, 8, _hoisted_3$c)) : (__props.column.type === "date" || __props.column.type === "datetime") && __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2472
|
-
__props.column.format !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2473
|
-
createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), __props.column.format)), 1)
|
|
2474
|
-
], 64)) : __props.column.type === "date" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2475
|
-
createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), unref(DateFormat).DATE)), 1)
|
|
2476
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2477
|
-
createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), unref(DateFormat).DATETIME)), 1)
|
|
2478
|
-
], 64))
|
|
2479
|
-
], 64)) : __props.column.type === "number" && __props.column.field ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
2480
|
-
__props.column.format === unref(NumberFormat).MULTIPLIER ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2481
|
-
createTextVNode(" \xD7" + toDisplayString(getNumericValue(__props.record, __props.column.field)), 1)
|
|
2482
|
-
], 64)) : __props.column.format !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2483
|
-
createTextVNode(toDisplayString(unref(n)(getNumericValue(__props.record, __props.column.field), __props.column.format)), 1)
|
|
2484
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2485
|
-
createTextVNode(toDisplayString(getNumericValue(__props.record, __props.column.field)), 1)
|
|
2486
|
-
], 64))
|
|
2487
|
-
], 64)) : __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2488
|
-
__props.column.maxLength !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_4$a, toDisplayString(getStringValue(__props.record, __props.column.field).trimToLength(__props.column.maxLength, __props.column.format !== void 0 ? __props.column.format === "ellipsis" : false)), 1)) : (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString(getStringValue(__props.record, __props.column.field)), 1))
|
|
2489
|
-
], 64)) : createCommentVNode("", true)
|
|
2490
|
-
], 16));
|
|
2491
|
-
};
|
|
2492
|
-
}
|
|
2493
|
-
const _sfc_main$g = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
2635
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
2494
2636
|
props: {
|
|
2495
2637
|
column: null,
|
|
2496
2638
|
record: null,
|
|
@@ -2501,8 +2643,162 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
2501
2643
|
focus: null,
|
|
2502
2644
|
"undo-edit": null
|
|
2503
2645
|
},
|
|
2504
|
-
setup
|
|
2646
|
+
setup(__props, { emit }) {
|
|
2647
|
+
const props = __props;
|
|
2648
|
+
const { d, n } = useI18n();
|
|
2649
|
+
const currentRecord = ref(copy(props.record));
|
|
2650
|
+
const edited = computed(() => {
|
|
2651
|
+
var _a, _b;
|
|
2652
|
+
return currentRecord.value[(_a = props.column.field) != null ? _a : ""] !== props.record[(_b = props.column.field) != null ? _b : ""];
|
|
2653
|
+
});
|
|
2654
|
+
function getStringValue(record, key) {
|
|
2655
|
+
return record[key];
|
|
2656
|
+
}
|
|
2657
|
+
function getNumericValue(record, key) {
|
|
2658
|
+
return record[key];
|
|
2659
|
+
}
|
|
2660
|
+
function getBooleanValue(record, key) {
|
|
2661
|
+
return record[key];
|
|
2662
|
+
}
|
|
2663
|
+
function cellFocused() {
|
|
2664
|
+
emit("focus");
|
|
2665
|
+
}
|
|
2666
|
+
watchEffect(() => currentRecord.value = copy(props.record));
|
|
2667
|
+
watch(currentRecord, (newValue) => {
|
|
2668
|
+
var _a;
|
|
2669
|
+
const property = (_a = props.column.field) != null ? _a : "";
|
|
2670
|
+
if (property !== "") {
|
|
2671
|
+
if (newValue[property] !== props.record[property]) {
|
|
2672
|
+
emit("edit", newValue[property]);
|
|
2673
|
+
} else {
|
|
2674
|
+
emit("undo-edit");
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
}, {
|
|
2678
|
+
deep: true
|
|
2679
|
+
});
|
|
2680
|
+
return (_ctx, _cache) => {
|
|
2681
|
+
return __props.editMode && __props.column.field && __props.column.editable ? (openBlock(), createElementBlock("td", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
2682
|
+
class: ["cl-transition-colours", {
|
|
2683
|
+
"cl-bg-link-lighter": unref(edited)
|
|
2684
|
+
}]
|
|
2685
|
+
}), [
|
|
2686
|
+
createElementVNode("strong", _hoisted_1$d, toDisplayString(__props.column.caption), 1),
|
|
2687
|
+
renderSlot(_ctx.$slots, `${__props.column.name}Edit`, normalizeProps(guardReactiveProps({
|
|
2688
|
+
cellFocused,
|
|
2689
|
+
column: __props.column,
|
|
2690
|
+
edited: unref(edited),
|
|
2691
|
+
record: currentRecord.value
|
|
2692
|
+
})))
|
|
2693
|
+
], 16)) : (openBlock(), createElementBlock("td", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)), [
|
|
2694
|
+
createElementVNode("strong", _hoisted_2$c, toDisplayString(__props.column.caption), 1),
|
|
2695
|
+
__props.column.type === "slot" ? renderSlot(_ctx.$slots, __props.column.name, normalizeProps(mergeProps({ key: 0 }, { column: __props.column, record: __props.record }))) : __props.column.type === "boolean" && __props.column.field !== void 0 ? (openBlock(), createBlock(ClUiInput, {
|
|
2696
|
+
key: 1,
|
|
2697
|
+
"input-type": "checkbox",
|
|
2698
|
+
"model-value": getBooleanValue(__props.record, __props.column.field),
|
|
2699
|
+
disabled: true
|
|
2700
|
+
}, null, 8, ["model-value"])) : (__props.column.type === "date" || __props.column.type === "datetime") && __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2701
|
+
__props.column.format !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2702
|
+
createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), __props.column.format)), 1)
|
|
2703
|
+
], 64)) : __props.column.type === "date" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2704
|
+
createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), unref(DateFormat).DATE)), 1)
|
|
2705
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2706
|
+
createTextVNode(toDisplayString(unref(d)(new Date(getStringValue(__props.record, __props.column.field)), unref(DateFormat).DATETIME)), 1)
|
|
2707
|
+
], 64))
|
|
2708
|
+
], 64)) : __props.column.type === "number" && __props.column.field ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
2709
|
+
__props.column.format === unref(NumberFormat).MULTIPLIER ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2710
|
+
createTextVNode(" \xD7" + toDisplayString(getNumericValue(__props.record, __props.column.field)), 1)
|
|
2711
|
+
], 64)) : __props.column.format !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2712
|
+
createTextVNode(toDisplayString(unref(n)(getNumericValue(__props.record, __props.column.field), __props.column.format)), 1)
|
|
2713
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2714
|
+
createTextVNode(toDisplayString(getNumericValue(__props.record, __props.column.field)), 1)
|
|
2715
|
+
], 64))
|
|
2716
|
+
], 64)) : __props.column.field !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2717
|
+
__props.column.maxLength !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_3$a, toDisplayString(getStringValue(__props.record, __props.column.field).trimToLength(__props.column.maxLength, __props.column.format !== void 0 ? __props.column.format === "ellipsis" : false)), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$8, toDisplayString(getStringValue(__props.record, __props.column.field)), 1))
|
|
2718
|
+
], 64)) : createCommentVNode("", true)
|
|
2719
|
+
], 16));
|
|
2720
|
+
};
|
|
2721
|
+
}
|
|
2505
2722
|
}));
|
|
2723
|
+
const gridColumnTypes = [
|
|
2724
|
+
"string",
|
|
2725
|
+
"boolean",
|
|
2726
|
+
"number",
|
|
2727
|
+
"date",
|
|
2728
|
+
"datetime",
|
|
2729
|
+
"slot"
|
|
2730
|
+
];
|
|
2731
|
+
function isGridColumn(objectToTest) {
|
|
2732
|
+
return typeof objectToTest.caption === "string" && typeof objectToTest.name === "string" && typeof objectToTest.type === "string";
|
|
2733
|
+
}
|
|
2734
|
+
function isGridColumnArray(arrayToTest) {
|
|
2735
|
+
let arrayIsValid = Array.isArray(arrayToTest);
|
|
2736
|
+
if (arrayIsValid) {
|
|
2737
|
+
for (const objectToTest of arrayToTest) {
|
|
2738
|
+
if (!isGridColumn(objectToTest)) {
|
|
2739
|
+
arrayIsValid = false;
|
|
2740
|
+
break;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
return arrayIsValid;
|
|
2745
|
+
}
|
|
2746
|
+
const stringFormats = ["ellipsis"];
|
|
2747
|
+
var FilterOperation;
|
|
2748
|
+
(function(FilterOperation2) {
|
|
2749
|
+
FilterOperation2[FilterOperation2["CONTAINS"] = 0] = "CONTAINS";
|
|
2750
|
+
FilterOperation2[FilterOperation2["NOT_CONTAINS"] = 1] = "NOT_CONTAINS";
|
|
2751
|
+
FilterOperation2[FilterOperation2["EQUAL"] = 2] = "EQUAL";
|
|
2752
|
+
FilterOperation2[FilterOperation2["NOT_EQUAL"] = 3] = "NOT_EQUAL";
|
|
2753
|
+
FilterOperation2[FilterOperation2["STARTS_WITH"] = 4] = "STARTS_WITH";
|
|
2754
|
+
FilterOperation2[FilterOperation2["ENDS_WITH"] = 5] = "ENDS_WITH";
|
|
2755
|
+
FilterOperation2[FilterOperation2["GREATER_THAN"] = 6] = "GREATER_THAN";
|
|
2756
|
+
FilterOperation2[FilterOperation2["LESS_THAN"] = 7] = "LESS_THAN";
|
|
2757
|
+
FilterOperation2[FilterOperation2["EQUAL_OR_GREATER_THAN"] = 8] = "EQUAL_OR_GREATER_THAN";
|
|
2758
|
+
FilterOperation2[FilterOperation2["EQUAL_OR_LESS_THAN"] = 9] = "EQUAL_OR_LESS_THAN";
|
|
2759
|
+
})(FilterOperation || (FilterOperation = {}));
|
|
2760
|
+
const filterMethodTypes = [
|
|
2761
|
+
"equal",
|
|
2762
|
+
"notequal",
|
|
2763
|
+
"contains",
|
|
2764
|
+
"notcontains",
|
|
2765
|
+
"lessthan",
|
|
2766
|
+
"greaterthan",
|
|
2767
|
+
"startswith",
|
|
2768
|
+
"endswith",
|
|
2769
|
+
"equalorlessthan",
|
|
2770
|
+
"equalorgreaterthan"
|
|
2771
|
+
];
|
|
2772
|
+
function isFilterArgs(objectToTest) {
|
|
2773
|
+
return typeof objectToTest.filterOnColumn === "string" && typeof objectToTest.filterOperation === "number" && typeof objectToTest.filterValue === "string";
|
|
2774
|
+
}
|
|
2775
|
+
function isSortArgs(objectToTest) {
|
|
2776
|
+
return objectToTest === null || typeof objectToTest.sortByAscending === "boolean" && typeof objectToTest.sortOnColumn === "string";
|
|
2777
|
+
}
|
|
2778
|
+
function isFilterRequest(objectToTest) {
|
|
2779
|
+
let objectValid = typeof objectToTest.filters === "object" && Array.isArray(objectToTest.filters) && typeof objectToTest.pageNumber === "number" && typeof objectToTest.pageSize === "number" && typeof objectToTest.sort === "object" && isSortArgs(objectToTest.sort);
|
|
2780
|
+
if (objectValid) {
|
|
2781
|
+
for (const filterArgs of objectToTest.filters) {
|
|
2782
|
+
if (!isFilterArgs(filterArgs)) {
|
|
2783
|
+
objectValid = false;
|
|
2784
|
+
break;
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
return objectValid;
|
|
2789
|
+
}
|
|
2790
|
+
function isFilterResponse(objectToTest, resultValidator) {
|
|
2791
|
+
let objectValid = typeof objectToTest.results === "object" && Array.isArray(objectToTest.results) && typeof objectToTest.totalRecords === "number";
|
|
2792
|
+
if (objectValid) {
|
|
2793
|
+
for (const result of objectToTest.results) {
|
|
2794
|
+
if (!resultValidator(result)) {
|
|
2795
|
+
objectValid = false;
|
|
2796
|
+
break;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
return objectValid;
|
|
2801
|
+
}
|
|
2506
2802
|
const defaultFilterMethod = {
|
|
2507
2803
|
method: "equal",
|
|
2508
2804
|
icon: "=",
|
|
@@ -2594,106 +2890,25 @@ const filterMethods = [
|
|
|
2594
2890
|
]
|
|
2595
2891
|
}
|
|
2596
2892
|
];
|
|
2597
|
-
const
|
|
2598
|
-
"string",
|
|
2599
|
-
"boolean",
|
|
2600
|
-
"number",
|
|
2601
|
-
"date",
|
|
2602
|
-
"datetime",
|
|
2603
|
-
"slot"
|
|
2604
|
-
];
|
|
2605
|
-
function isGridColumn(objectToTest) {
|
|
2606
|
-
return typeof objectToTest.caption === "string" && typeof objectToTest.name === "string" && typeof objectToTest.type === "string";
|
|
2607
|
-
}
|
|
2608
|
-
function isGridColumnArray(arrayToTest) {
|
|
2609
|
-
let arrayIsValid = Array.isArray(arrayToTest);
|
|
2610
|
-
if (arrayIsValid) {
|
|
2611
|
-
for (const objectToTest of arrayToTest) {
|
|
2612
|
-
if (!isGridColumn(objectToTest)) {
|
|
2613
|
-
arrayIsValid = false;
|
|
2614
|
-
break;
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
}
|
|
2618
|
-
return arrayIsValid;
|
|
2619
|
-
}
|
|
2620
|
-
const stringFormats = ["ellipsis"];
|
|
2621
|
-
var FilterOperation;
|
|
2622
|
-
(function(FilterOperation2) {
|
|
2623
|
-
FilterOperation2[FilterOperation2["CONTAINS"] = 0] = "CONTAINS";
|
|
2624
|
-
FilterOperation2[FilterOperation2["NOT_CONTAINS"] = 1] = "NOT_CONTAINS";
|
|
2625
|
-
FilterOperation2[FilterOperation2["EQUAL"] = 2] = "EQUAL";
|
|
2626
|
-
FilterOperation2[FilterOperation2["NOT_EQUAL"] = 3] = "NOT_EQUAL";
|
|
2627
|
-
FilterOperation2[FilterOperation2["STARTS_WITH"] = 4] = "STARTS_WITH";
|
|
2628
|
-
FilterOperation2[FilterOperation2["ENDS_WITH"] = 5] = "ENDS_WITH";
|
|
2629
|
-
FilterOperation2[FilterOperation2["GREATER_THAN"] = 6] = "GREATER_THAN";
|
|
2630
|
-
FilterOperation2[FilterOperation2["LESS_THAN"] = 7] = "LESS_THAN";
|
|
2631
|
-
FilterOperation2[FilterOperation2["EQUAL_OR_GREATER_THAN"] = 8] = "EQUAL_OR_GREATER_THAN";
|
|
2632
|
-
FilterOperation2[FilterOperation2["EQUAL_OR_LESS_THAN"] = 9] = "EQUAL_OR_LESS_THAN";
|
|
2633
|
-
})(FilterOperation || (FilterOperation = {}));
|
|
2634
|
-
const filterMethodTypes = [
|
|
2635
|
-
"equal",
|
|
2636
|
-
"notequal",
|
|
2637
|
-
"contains",
|
|
2638
|
-
"notcontains",
|
|
2639
|
-
"lessthan",
|
|
2640
|
-
"greaterthan",
|
|
2641
|
-
"startswith",
|
|
2642
|
-
"endswith",
|
|
2643
|
-
"equalorlessthan",
|
|
2644
|
-
"equalorgreaterthan"
|
|
2645
|
-
];
|
|
2646
|
-
function isFilterArgs(objectToTest) {
|
|
2647
|
-
return typeof objectToTest.filterOnColumn === "string" && typeof objectToTest.filterOperation === "number" && typeof objectToTest.filterValue === "string";
|
|
2648
|
-
}
|
|
2649
|
-
function isSortArgs(objectToTest) {
|
|
2650
|
-
return objectToTest === null || typeof objectToTest.sortByAscending === "boolean" && typeof objectToTest.sortOnColumn === "string";
|
|
2651
|
-
}
|
|
2652
|
-
function isFilterRequest(objectToTest) {
|
|
2653
|
-
let objectValid = typeof objectToTest.filters === "object" && Array.isArray(objectToTest.filters) && typeof objectToTest.pageNumber === "number" && typeof objectToTest.pageSize === "number" && typeof objectToTest.sort === "object" && isSortArgs(objectToTest.sort);
|
|
2654
|
-
if (objectValid) {
|
|
2655
|
-
for (const filterArgs of objectToTest.filters) {
|
|
2656
|
-
if (!isFilterArgs(filterArgs)) {
|
|
2657
|
-
objectValid = false;
|
|
2658
|
-
break;
|
|
2659
|
-
}
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
return objectValid;
|
|
2663
|
-
}
|
|
2664
|
-
function isFilterResponse(objectToTest, resultValidator) {
|
|
2665
|
-
let objectValid = typeof objectToTest.results === "object" && Array.isArray(objectToTest.results) && typeof objectToTest.totalRecords === "number";
|
|
2666
|
-
if (objectValid) {
|
|
2667
|
-
for (const result of objectToTest.results) {
|
|
2668
|
-
if (!resultValidator(result)) {
|
|
2669
|
-
objectValid = false;
|
|
2670
|
-
break;
|
|
2671
|
-
}
|
|
2672
|
-
}
|
|
2673
|
-
}
|
|
2674
|
-
return objectValid;
|
|
2675
|
-
}
|
|
2676
|
-
const _hoisted_1$e = {
|
|
2893
|
+
const _hoisted_1$c = {
|
|
2677
2894
|
key: 0,
|
|
2678
2895
|
class: "cl-border-grey-2 cl-border-r cl-capitalize cl-group cl-inline cl-relative cl-w-auto"
|
|
2679
2896
|
};
|
|
2680
|
-
const _hoisted_2$
|
|
2681
|
-
const _hoisted_3$
|
|
2682
|
-
const _hoisted_4$
|
|
2683
|
-
const _hoisted_5$
|
|
2684
|
-
const _hoisted_6$
|
|
2685
|
-
const _hoisted_7$
|
|
2686
|
-
const _hoisted_8$
|
|
2897
|
+
const _hoisted_2$b = { class: "cl-bg-off-white cl-flex cl-h-full cl-items-center cl-justify-center cl-w-10" };
|
|
2898
|
+
const _hoisted_3$9 = { class: "cl-p-3" };
|
|
2899
|
+
const _hoisted_4$7 = { class: "cl-px-4 cl-py-1 cl-w-full" };
|
|
2900
|
+
const _hoisted_5$5 = ["innerHTML"];
|
|
2901
|
+
const _hoisted_6$5 = { class: "cl-p-3" };
|
|
2902
|
+
const _hoisted_7$5 = ["onClick"];
|
|
2903
|
+
const _hoisted_8$4 = ["innerHTML"];
|
|
2687
2904
|
const _hoisted_9$4 = /* @__PURE__ */ createElementVNode("option", { value: void 0 }, null, -1);
|
|
2688
2905
|
const _hoisted_10$4 = ["selected"];
|
|
2689
|
-
const _hoisted_11$
|
|
2690
|
-
const _hoisted_12$
|
|
2691
|
-
const _hoisted_13$4 = ["value"];
|
|
2692
|
-
const _hoisted_14$3 = {
|
|
2906
|
+
const _hoisted_11$3 = ["selected"];
|
|
2907
|
+
const _hoisted_12$3 = {
|
|
2693
2908
|
key: 1,
|
|
2694
2909
|
class: "cl-flex cl-w-full"
|
|
2695
2910
|
};
|
|
2696
|
-
const _sfc_main$
|
|
2911
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2697
2912
|
props: {
|
|
2698
2913
|
request: null,
|
|
2699
2914
|
column: null,
|
|
@@ -2728,9 +2943,18 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2728
2943
|
var _a, _b;
|
|
2729
2944
|
return (_b = (_a = props.request.filters.find((f) => f.filterOnColumn === props.column.field)) == null ? void 0 : _a.filterValue) != null ? _b : "";
|
|
2730
2945
|
});
|
|
2731
|
-
const currentNumberFilter = computed(() => Number(currentFilter.value));
|
|
2732
2946
|
const currentDateFilter = computed(() => currentFilter.value !== "" ? new Date(currentFilter.value) : null);
|
|
2947
|
+
const filterInput = ref(currentFilter.value);
|
|
2733
2948
|
const decimalSeparator = computed(() => Intl.NumberFormat(locale.value).format(1.1).replace(/[0-9]+/g, ""));
|
|
2949
|
+
const columnInputType = computed(() => {
|
|
2950
|
+
let inputType = "text";
|
|
2951
|
+
if (props.column.slotType === "date" || props.column.type === "date") {
|
|
2952
|
+
inputType = "date";
|
|
2953
|
+
} else if (props.column.slotType === "datetime" || props.column.type === "datetime") {
|
|
2954
|
+
inputType = "datetime";
|
|
2955
|
+
}
|
|
2956
|
+
return inputType;
|
|
2957
|
+
});
|
|
2734
2958
|
function getDefaultFilterOperation() {
|
|
2735
2959
|
return props.column.type === "string" || props.column.slotType === "string" ? FilterOperation.CONTAINS : props.column.type === "datetime" || props.column.slotType === "datetime" ? FilterOperation.LESS_THAN : FilterOperation.EQUAL;
|
|
2736
2960
|
}
|
|
@@ -2804,7 +3028,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2804
3028
|
return (_ctx, _cache) => {
|
|
2805
3029
|
var _a, _b;
|
|
2806
3030
|
const _component_icon = resolveComponent("icon");
|
|
2807
|
-
const _component_cl_ui_calendar = resolveComponent("cl-ui-calendar");
|
|
2808
3031
|
return __props.column.filterable === void 0 || __props.column.filterable === true ? (openBlock(), createElementBlock("div", {
|
|
2809
3032
|
key: 0,
|
|
2810
3033
|
class: normalizeClass(["cl-border-grey-2 cl-flex cl-rounded cl-w-full", {
|
|
@@ -2812,8 +3035,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2812
3035
|
"cl-border": __props.column.type !== "slot" || __props.column.slotType !== void 0 && __props.column.field !== void 0
|
|
2813
3036
|
}])
|
|
2814
3037
|
}, [
|
|
2815
|
-
__props.column.type !== "slot" || __props.column.slotType !== void 0 && __props.column.field !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2816
|
-
createElementVNode("div", _hoisted_2$
|
|
3038
|
+
__props.column.type !== "slot" || __props.column.slotType !== void 0 && __props.column.field !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
3039
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
2817
3040
|
createVNode(_component_icon, {
|
|
2818
3041
|
icon: "ph:sliders-horizontal",
|
|
2819
3042
|
size: 20
|
|
@@ -2825,15 +3048,15 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2825
3048
|
"cl--left-44": !__props.firstHalf
|
|
2826
3049
|
}])
|
|
2827
3050
|
}, [
|
|
2828
|
-
createElementVNode("strong", _hoisted_3$
|
|
2829
|
-
createElementVNode("span", _hoisted_4$
|
|
3051
|
+
createElementVNode("strong", _hoisted_3$9, toDisplayString(unref(t2)("grid.currentMethod")), 1),
|
|
3052
|
+
createElementVNode("span", _hoisted_4$7, [
|
|
2830
3053
|
createTextVNode(toDisplayString((_a = unref(currentFilterMethod)) == null ? void 0 : _a.description) + " ", 1),
|
|
2831
3054
|
createElementVNode("span", {
|
|
2832
3055
|
class: "cl-float-right",
|
|
2833
3056
|
innerHTML: (_b = unref(currentFilterMethod)) == null ? void 0 : _b.icon
|
|
2834
|
-
}, null, 8, _hoisted_5$
|
|
3057
|
+
}, null, 8, _hoisted_5$5)
|
|
2835
3058
|
]),
|
|
2836
|
-
createElementVNode("strong", _hoisted_6$
|
|
3059
|
+
createElementVNode("strong", _hoisted_6$5, toDisplayString(unref(t2)("grid.availableMethods")), 1),
|
|
2837
3060
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(allowedFilterMethods), (filterMethod, index) => {
|
|
2838
3061
|
return openBlock(), createElementBlock("span", {
|
|
2839
3062
|
key: index,
|
|
@@ -2844,8 +3067,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2844
3067
|
createElementVNode("span", {
|
|
2845
3068
|
class: "cl-float-right",
|
|
2846
3069
|
innerHTML: filterMethod.icon
|
|
2847
|
-
}, null, 8, _hoisted_8$
|
|
2848
|
-
], 8, _hoisted_7$
|
|
3070
|
+
}, null, 8, _hoisted_8$4)
|
|
3071
|
+
], 8, _hoisted_7$5);
|
|
2849
3072
|
}), 128))
|
|
2850
3073
|
], 2)
|
|
2851
3074
|
])) : createCommentVNode("", true),
|
|
@@ -2862,60 +3085,60 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
2862
3085
|
createElementVNode("option", {
|
|
2863
3086
|
value: "false",
|
|
2864
3087
|
selected: unref(currentFilter) === "false"
|
|
2865
|
-
}, toDisplayString(unref(t2)("grid.false")), 9, _hoisted_11$
|
|
2866
|
-
], 32)) : __props.column.type === "date" || __props.column.type === "datetime" || (__props.column.slotType === "date" || __props.column.slotType === "datetime") && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(
|
|
3088
|
+
}, toDisplayString(unref(t2)("grid.false")), 9, _hoisted_11$3)
|
|
3089
|
+
], 32)) : __props.column.type === "date" || __props.column.type === "datetime" || (__props.column.slotType === "date" || __props.column.slotType === "datetime") && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
|
|
2867
3090
|
key: 2,
|
|
2868
|
-
|
|
2869
|
-
class: "cl-border-none cl-w-full",
|
|
2870
|
-
|
|
2871
|
-
"
|
|
2872
|
-
|
|
2873
|
-
"
|
|
2874
|
-
|
|
3091
|
+
"model-value": unref(currentDateFilter),
|
|
3092
|
+
class: "!cl-border-none !cl-mb-0 !cl-mr-0 cl-w-full",
|
|
3093
|
+
min: "1900-01-01",
|
|
3094
|
+
max: "2999-12-31T23:59",
|
|
3095
|
+
label: __props.column.name,
|
|
3096
|
+
"show-label": false,
|
|
3097
|
+
"input-type": unref(columnInputType),
|
|
3098
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => setDateFilter($event))
|
|
3099
|
+
}, null, 8, ["model-value", "label", "input-type"])) : __props.column.type === "number" || __props.column.slotType === "number" && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
|
|
2875
3100
|
key: 3,
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
], 2)) : (openBlock(), createElementBlock("div", _hoisted_14$3, " \xA0 "));
|
|
3101
|
+
modelValue: filterInput.value,
|
|
3102
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filterInput.value = $event),
|
|
3103
|
+
class: "cl-border-none cl-mb-0 cl-w-full",
|
|
3104
|
+
"input-type": "number",
|
|
3105
|
+
"show-arrows": false,
|
|
3106
|
+
onInput: _cache[3] || (_cache[3] = ($event) => unref(debounce)(setNumberFilter, $event.target))
|
|
3107
|
+
}, null, 8, ["modelValue"])) : __props.column.type !== "slot" || __props.column.slotType === "string" && typeof __props.column.field !== "undefined" ? (openBlock(), createBlock(ClUiInput, {
|
|
3108
|
+
key: 4,
|
|
3109
|
+
modelValue: filterInput.value,
|
|
3110
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filterInput.value = $event),
|
|
3111
|
+
class: "cl-border-none cl-mb-0 cl-w-full",
|
|
3112
|
+
"input-type": "text",
|
|
3113
|
+
onInput: _cache[5] || (_cache[5] = ($event) => unref(debounce)(setFilter, $event.target))
|
|
3114
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("", true)
|
|
3115
|
+
], 2)) : (openBlock(), createElementBlock("div", _hoisted_12$3, " \xA0 "));
|
|
2892
3116
|
};
|
|
2893
3117
|
}
|
|
2894
3118
|
});
|
|
2895
|
-
const _hoisted_1$
|
|
3119
|
+
const _hoisted_1$b = {
|
|
2896
3120
|
key: 0,
|
|
2897
3121
|
class: "cl-flex cl-flex-wrap cl-justify-end cl-mt-4 cl-w-full"
|
|
2898
3122
|
};
|
|
2899
|
-
const _hoisted_2$
|
|
2900
|
-
const _hoisted_3$
|
|
2901
|
-
const _hoisted_4$
|
|
2902
|
-
const _hoisted_5$
|
|
2903
|
-
const _hoisted_6$
|
|
2904
|
-
const _hoisted_7$
|
|
2905
|
-
const _hoisted_8$
|
|
2906
|
-
const _hoisted_9$3 = { class: "cl-
|
|
2907
|
-
const _hoisted_10$3 =
|
|
2908
|
-
const _hoisted_11$
|
|
2909
|
-
const _hoisted_12$
|
|
2910
|
-
const _hoisted_13$
|
|
2911
|
-
const _hoisted_14$
|
|
2912
|
-
const _hoisted_15$
|
|
2913
|
-
const _hoisted_16$
|
|
2914
|
-
const
|
|
2915
|
-
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
3123
|
+
const _hoisted_2$a = { class: "cl-bg-off-white cl-border cl-border-grey-0 cl-flex cl-items-center cl-mb-2 cl-px-3 cl-rounded cl-shadow-md cl-text-sm cl-w-full lg:cl-w-auto" };
|
|
3124
|
+
const _hoisted_3$8 = { class: "cl-text-grey-3 cl-w-max" };
|
|
3125
|
+
const _hoisted_4$6 = { class: "cl-bg-off-white cl-border cl-border-grey-0 cl-flex cl-flex-wrap cl-items-center cl-mb-2 cl-px-3 cl-py-2 cl-rounded cl-shadow-md cl-text-sm cl-w-full lg:cl-ml-2 lg:cl-w-auto mb:cl-flex-nowrap" };
|
|
3126
|
+
const _hoisted_5$4 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
|
|
3127
|
+
const _hoisted_6$4 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
|
|
3128
|
+
const _hoisted_7$4 = { class: "cl-text-grey-3 cl-w-full lg:cl-mr-2 lg:cl-w-auto" };
|
|
3129
|
+
const _hoisted_8$3 = { class: "cl-flex cl-flex-wrap cl-text-sm mb:cl-flex-nowrap" };
|
|
3130
|
+
const _hoisted_9$3 = { class: "cl-pr-2" };
|
|
3131
|
+
const _hoisted_10$3 = ["onClick"];
|
|
3132
|
+
const _hoisted_11$2 = { class: "cl-flex cl-flex-wrap cl-mb-2 cl-text-sm cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
|
|
3133
|
+
const _hoisted_12$2 = { class: "cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-mb-0 lg:cl-mr-2 lg:cl-w-auto" };
|
|
3134
|
+
const _hoisted_13$1 = ["onClick"];
|
|
3135
|
+
const _hoisted_14$1 = { class: "cl-mb-2 cl-w-full lg:cl-p-2 md:cl-mb-0 md:cl-w-auto" };
|
|
3136
|
+
const _hoisted_15$1 = { class: "cl-block cl-mb-2 cl-text-grey-3 cl-w-full lg:cl-inline-block lg:cl-mb-0 lg:cl-mr-1 lg:cl-w-auto" };
|
|
3137
|
+
const _hoisted_16$1 = { class: "cl-block lg:cl-inline-block" };
|
|
3138
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2916
3139
|
props: {
|
|
2917
3140
|
request: null,
|
|
2918
|
-
data: { default:
|
|
3141
|
+
data: { default: null }
|
|
2919
3142
|
},
|
|
2920
3143
|
emits: {
|
|
2921
3144
|
"update:request": null
|
|
@@ -2931,7 +3154,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
2931
3154
|
];
|
|
2932
3155
|
const { n, t: t2 } = useI18n();
|
|
2933
3156
|
const { debounce } = useDebouncer();
|
|
2934
|
-
const
|
|
3157
|
+
const currentPage = ref(props.request.pageNumber);
|
|
3158
|
+
const totalPages = computed(() => {
|
|
3159
|
+
var _a, _b;
|
|
3160
|
+
return props.data !== null ? Math.ceil((_b = (_a = props.data) == null ? void 0 : _a.totalRecords) != null ? _b : 0 / props.request.pageSize) : 1;
|
|
3161
|
+
});
|
|
2935
3162
|
const pageNumbers = computed(() => {
|
|
2936
3163
|
const calculatedPageNumbers = Array.from(Array(totalPages.value + 1).keys());
|
|
2937
3164
|
let results = [];
|
|
@@ -2960,29 +3187,35 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
2960
3187
|
filterRequest.pageNumber = 1;
|
|
2961
3188
|
emit("update:request", filterRequest);
|
|
2962
3189
|
}
|
|
3190
|
+
watch(() => props.request.pageNumber, () => currentPage.value = props.request.pageNumber);
|
|
2963
3191
|
return (_ctx, _cache) => {
|
|
2964
3192
|
var _a;
|
|
2965
3193
|
const _component_icon = resolveComponent("icon");
|
|
2966
|
-
return __props.data && ((_a = __props.data.results) == null ? void 0 : _a.length) && __props.request ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2967
|
-
createElementVNode("div", _hoisted_2$
|
|
2968
|
-
createElementVNode("span", _hoisted_3$
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
3194
|
+
return __props.data && ((_a = __props.data.results) == null ? void 0 : _a.length) && __props.request ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
3195
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
3196
|
+
createElementVNode("span", _hoisted_3$8, toDisplayString(unref(t2)("grid.jumpToPage")), 1),
|
|
3197
|
+
createVNode(ClUiInput, {
|
|
3198
|
+
modelValue: currentPage.value,
|
|
3199
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
|
|
3200
|
+
class: "!cl-inline-block !cl-ml-2 !cl-mt-2 !cl-text-sm !cl-w-max",
|
|
3201
|
+
"input-type": "number",
|
|
3202
|
+
label: "Page",
|
|
3203
|
+
"show-label": false,
|
|
3204
|
+
min: "1",
|
|
3205
|
+
max: unref(totalPages),
|
|
3206
|
+
onInput: _cache[1] || (_cache[1] = ($event) => unref(debounce)(setPageFromInput, $event.target))
|
|
3207
|
+
}, null, 8, ["modelValue", "max"])
|
|
2975
3208
|
]),
|
|
2976
|
-
createElementVNode("div",
|
|
2977
|
-
createElementVNode("div",
|
|
2978
|
-
createElementVNode("li",
|
|
2979
|
-
createElementVNode("span",
|
|
3209
|
+
createElementVNode("div", _hoisted_4$6, [
|
|
3210
|
+
createElementVNode("div", _hoisted_5$4, [
|
|
3211
|
+
createElementVNode("li", _hoisted_6$4, [
|
|
3212
|
+
createElementVNode("span", _hoisted_7$4, toDisplayString(unref(t2)("grid.page")), 1)
|
|
2980
3213
|
]),
|
|
2981
|
-
createElementVNode("ul",
|
|
2982
|
-
createElementVNode("li",
|
|
3214
|
+
createElementVNode("ul", _hoisted_8$3, [
|
|
3215
|
+
createElementVNode("li", _hoisted_9$3, toDisplayString(unref(n)(__props.request.pageNumber, unref(NumberFormat).INTEGER)) + " / " + toDisplayString(unref(n)(unref(totalPages), unref(NumberFormat).INTEGER)), 1),
|
|
2983
3216
|
withDirectives(createElementVNode("li", {
|
|
2984
3217
|
class: "cl-cursor-pointer cl-mr-1 cl-mt-1 lg:cl-mr-2",
|
|
2985
|
-
onClick: _cache[
|
|
3218
|
+
onClick: _cache[2] || (_cache[2] = ($event) => setPage(1))
|
|
2986
3219
|
}, [
|
|
2987
3220
|
createVNode(_component_icon, {
|
|
2988
3221
|
icon: "ph:caret-double-left",
|
|
@@ -2993,7 +3226,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
2993
3226
|
]),
|
|
2994
3227
|
withDirectives(createElementVNode("li", {
|
|
2995
3228
|
class: "cl-cursor-pointer cl-mt-1 lg:cl-mr-2 mr-1",
|
|
2996
|
-
onClick: _cache[
|
|
3229
|
+
onClick: _cache[3] || (_cache[3] = ($event) => setPage(__props.request.pageNumber - 1))
|
|
2997
3230
|
}, [
|
|
2998
3231
|
createVNode(_component_icon, {
|
|
2999
3232
|
icon: "ph:caret-left",
|
|
@@ -3010,11 +3243,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3010
3243
|
"cl-text-grey-6": __props.request.pageNumber !== number
|
|
3011
3244
|
}]),
|
|
3012
3245
|
onClick: ($event) => setPage(number)
|
|
3013
|
-
}, toDisplayString(unref(n)(number, unref(NumberFormat).INTEGER)), 11,
|
|
3246
|
+
}, toDisplayString(unref(n)(number, unref(NumberFormat).INTEGER)), 11, _hoisted_10$3);
|
|
3014
3247
|
}), 128)),
|
|
3015
3248
|
withDirectives(createElementVNode("li", {
|
|
3016
3249
|
class: "cl-cursor-pointer cl-mr-1 cl-mt-1 lg:cl-mr-2",
|
|
3017
|
-
onClick: _cache[
|
|
3250
|
+
onClick: _cache[4] || (_cache[4] = ($event) => setPage(__props.request.pageNumber + 1))
|
|
3018
3251
|
}, [
|
|
3019
3252
|
createVNode(_component_icon, {
|
|
3020
3253
|
icon: "ph:caret-right",
|
|
@@ -3025,7 +3258,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3025
3258
|
]),
|
|
3026
3259
|
withDirectives(createElementVNode("li", {
|
|
3027
3260
|
class: "cl-cursor-pointer cl-mr-1 cl-mt-1 lg:cl-mr-2",
|
|
3028
|
-
onClick: _cache[
|
|
3261
|
+
onClick: _cache[5] || (_cache[5] = ($event) => setPage(unref(totalPages)))
|
|
3029
3262
|
}, [
|
|
3030
3263
|
createVNode(_component_icon, {
|
|
3031
3264
|
icon: "ph:caret-double-right",
|
|
@@ -3036,8 +3269,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3036
3269
|
])
|
|
3037
3270
|
])
|
|
3038
3271
|
]),
|
|
3039
|
-
createElementVNode("ul",
|
|
3040
|
-
createElementVNode("li",
|
|
3272
|
+
createElementVNode("ul", _hoisted_11$2, [
|
|
3273
|
+
createElementVNode("li", _hoisted_12$2, toDisplayString(unref(t2)("grid.pageSize")), 1),
|
|
3041
3274
|
(openBlock(), createElementBlock(Fragment, null, renderList(pageSizes, (size, index) => {
|
|
3042
3275
|
return createElementVNode("li", {
|
|
3043
3276
|
key: index,
|
|
@@ -3046,150 +3279,148 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
3046
3279
|
"cl-text-grey-6": __props.request.pageSize !== size
|
|
3047
3280
|
}]),
|
|
3048
3281
|
onClick: ($event) => setPageSize(size)
|
|
3049
|
-
}, toDisplayString(unref(n)(size, unref(NumberFormat).INTEGER)), 11,
|
|
3282
|
+
}, toDisplayString(unref(n)(size, unref(NumberFormat).INTEGER)), 11, _hoisted_13$1);
|
|
3050
3283
|
}), 64))
|
|
3051
3284
|
]),
|
|
3052
|
-
createElementVNode("ul",
|
|
3053
|
-
createElementVNode("li",
|
|
3054
|
-
createElementVNode("li",
|
|
3285
|
+
createElementVNode("ul", _hoisted_14$1, [
|
|
3286
|
+
createElementVNode("li", _hoisted_15$1, toDisplayString(unref(t2)("grid.totalRecords")), 1),
|
|
3287
|
+
createElementVNode("li", _hoisted_16$1, toDisplayString(unref(n)(__props.data.totalRecords, unref(NumberFormat).INTEGER)), 1)
|
|
3055
3288
|
])
|
|
3056
3289
|
])
|
|
3057
3290
|
])) : createCommentVNode("", true);
|
|
3058
3291
|
};
|
|
3059
3292
|
}
|
|
3060
3293
|
});
|
|
3061
|
-
const _hoisted_1$
|
|
3062
|
-
const _hoisted_2$
|
|
3063
|
-
const _hoisted_3$
|
|
3064
|
-
const _hoisted_4$
|
|
3065
|
-
const _hoisted_5$
|
|
3066
|
-
const _hoisted_6$
|
|
3067
|
-
const _hoisted_7$
|
|
3068
|
-
const _hoisted_8$
|
|
3294
|
+
const _hoisted_1$a = { class: "cl-fixed cl-flex cl-h-full cl-justify-end cl-right-0 cl-shadow-lg cl-top-0 cl-z-40" };
|
|
3295
|
+
const _hoisted_2$9 = { class: "cl-bg-secondary-default cl-h-full cl-overflow-y-auto cl-px-10 cl-py-20 cl-relative cl-text-grey-2 cl-w-80" };
|
|
3296
|
+
const _hoisted_3$7 = { class: "cl-mb-4 cl-text-2xl cl-text-off-white" };
|
|
3297
|
+
const _hoisted_4$5 = { class: "cl-border-grey-3 cl-border-t cl-flex cl-flex-wrap cl-text-sm cl-w-full" };
|
|
3298
|
+
const _hoisted_5$3 = { class: "cl-border-b cl-border-grey-2 cl-flex cl-py-2 cl-text-sm cl-w-full" };
|
|
3299
|
+
const _hoisted_6$3 = { class: "cl-flex-1 cl-py-2" };
|
|
3300
|
+
const _hoisted_7$3 = { class: "cl-py-2 cl-w-1/4" };
|
|
3301
|
+
const _hoisted_8$2 = { class: "cl-py-2 cl-w-1/5" };
|
|
3069
3302
|
const _hoisted_9$2 = { class: "cl-flex-1 cl-py-2" };
|
|
3070
3303
|
const _hoisted_10$2 = { class: "cl-py-2 cl-w-1/4" };
|
|
3071
|
-
const _hoisted_11$
|
|
3072
|
-
const _hoisted_12$
|
|
3073
|
-
const _hoisted_13$2 = { key: 1 };
|
|
3304
|
+
const _hoisted_11$1 = { class: "cl-py-2 cl-text-off-white cl-w-1/5" };
|
|
3305
|
+
const _hoisted_12$1 = { key: 1 };
|
|
3074
3306
|
const __default__ = {
|
|
3075
3307
|
inheritAttrs: false
|
|
3076
3308
|
};
|
|
3077
|
-
|
|
3078
|
-
const props = __props;
|
|
3079
|
-
const { t: t2 } = useI18n();
|
|
3080
|
-
const visible = ref(false);
|
|
3081
|
-
function moveColumn(columns, oldIndex, newIndex) {
|
|
3082
|
-
if (newIndex < columns.length && newIndex >= 0) {
|
|
3083
|
-
columns.splice(newIndex, 0, columns.splice(oldIndex, 1)[0]);
|
|
3084
|
-
}
|
|
3085
|
-
}
|
|
3086
|
-
function updateColumnVisibility(target, column) {
|
|
3087
|
-
var _a;
|
|
3088
|
-
const gridColumns = copy(props.columns);
|
|
3089
|
-
const checked = (_a = target == null ? void 0 : target.checked) != null ? _a : false;
|
|
3090
|
-
const targetColumnIndex = gridColumns.findIndex((c) => c.name === column.name);
|
|
3091
|
-
if (targetColumnIndex >= 0) {
|
|
3092
|
-
gridColumns[targetColumnIndex].visible = checked;
|
|
3093
|
-
}
|
|
3094
|
-
emit("update:columns", gridColumns);
|
|
3095
|
-
}
|
|
3096
|
-
function changeColumnOrder(columnIndex, direction) {
|
|
3097
|
-
const gridColumns = copy(props.columns);
|
|
3098
|
-
const newIndex = direction === "up" ? columnIndex + 1 : columnIndex - 1;
|
|
3099
|
-
moveColumn(gridColumns, columnIndex, newIndex);
|
|
3100
|
-
emit("update:columns", gridColumns);
|
|
3101
|
-
}
|
|
3102
|
-
return (_ctx, _cache) => {
|
|
3103
|
-
const _component_icon = resolveComponent("icon");
|
|
3104
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
3105
|
-
createVNode(_sfc_main$p, mergeProps(_ctx.$attrs, {
|
|
3106
|
-
class: "cl-w-full",
|
|
3107
|
-
size: "small",
|
|
3108
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => visible.value = true, ["prevent"]))
|
|
3109
|
-
}), {
|
|
3110
|
-
default: withCtx(() => [
|
|
3111
|
-
createTextVNode(toDisplayString(unref(t2)("grid.manageView")), 1)
|
|
3112
|
-
]),
|
|
3113
|
-
_: 1
|
|
3114
|
-
}, 16),
|
|
3115
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3116
|
-
createVNode(Transition, { name: "slide-left" }, {
|
|
3117
|
-
default: withCtx(() => [
|
|
3118
|
-
withDirectives(createElementVNode("div", _hoisted_1$c, [
|
|
3119
|
-
createElementVNode("div", _hoisted_2$b, [
|
|
3120
|
-
createVNode(_component_icon, {
|
|
3121
|
-
class: "cl-absolute cl-cursor-pointer cl-right-3 cl-text-off-white cl-top-3",
|
|
3122
|
-
icon: "ph:x",
|
|
3123
|
-
size: 16,
|
|
3124
|
-
onClick: _cache[1] || (_cache[1] = ($event) => visible.value = false)
|
|
3125
|
-
}),
|
|
3126
|
-
createElementVNode("h3", _hoisted_3$9, toDisplayString(unref(t2)("grid.manageView")), 1),
|
|
3127
|
-
createElementVNode("ul", _hoisted_4$7, [
|
|
3128
|
-
createElementVNode("li", _hoisted_5$5, [
|
|
3129
|
-
createElementVNode("strong", _hoisted_6$5, toDisplayString(unref(t2)("grid.column")), 1),
|
|
3130
|
-
createElementVNode("strong", _hoisted_7$5, toDisplayString(unref(t2)("grid.visible")), 1),
|
|
3131
|
-
createElementVNode("strong", _hoisted_8$4, toDisplayString(unref(t2)("grid.order")), 1)
|
|
3132
|
-
]),
|
|
3133
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column, index) => {
|
|
3134
|
-
return openBlock(), createElementBlock("li", {
|
|
3135
|
-
key: index,
|
|
3136
|
-
class: "cl-border-b cl-border-grey-2 cl-flex cl-py-2 cl-text-sm cl-w-full"
|
|
3137
|
-
}, [
|
|
3138
|
-
createElementVNode("div", _hoisted_9$2, toDisplayString(column.caption), 1),
|
|
3139
|
-
createElementVNode("div", _hoisted_10$2, [
|
|
3140
|
-
createElementVNode("input", {
|
|
3141
|
-
checked: column.visible === void 0 || column.visible === true,
|
|
3142
|
-
type: "checkbox",
|
|
3143
|
-
onClick: ($event) => updateColumnVisibility($event.target, column)
|
|
3144
|
-
}, null, 8, _hoisted_11$2)
|
|
3145
|
-
]),
|
|
3146
|
-
createElementVNode("div", _hoisted_12$2, [
|
|
3147
|
-
column.visible === void 0 || column.visible === true ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3148
|
-
index !== 0 ? (openBlock(), createBlock(_component_icon, {
|
|
3149
|
-
key: 0,
|
|
3150
|
-
class: "cl-cursor-pointer cl-inline-block cl-mr-2",
|
|
3151
|
-
icon: "ph:arrow-left",
|
|
3152
|
-
onClick: ($event) => changeColumnOrder(index, "down")
|
|
3153
|
-
}, null, 8, ["onClick"])) : createCommentVNode("", true),
|
|
3154
|
-
index !== __props.columns.length - 1 ? (openBlock(), createBlock(_component_icon, {
|
|
3155
|
-
key: 1,
|
|
3156
|
-
class: "cl-cursor-pointer cl-inline-block",
|
|
3157
|
-
icon: "ph:arrow-right",
|
|
3158
|
-
onClick: ($event) => changeColumnOrder(index, "up")
|
|
3159
|
-
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3160
|
-
], 64)) : (openBlock(), createElementBlock("em", _hoisted_13$2, toDisplayString(unref(t2)("grid.hidden")), 1))
|
|
3161
|
-
])
|
|
3162
|
-
]);
|
|
3163
|
-
}), 128))
|
|
3164
|
-
])
|
|
3165
|
-
])
|
|
3166
|
-
], 512), [
|
|
3167
|
-
[vShow, visible.value]
|
|
3168
|
-
])
|
|
3169
|
-
]),
|
|
3170
|
-
_: 1
|
|
3171
|
-
})
|
|
3172
|
-
]))
|
|
3173
|
-
], 64);
|
|
3174
|
-
};
|
|
3175
|
-
}
|
|
3176
|
-
const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
3309
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
3177
3310
|
props: {
|
|
3178
3311
|
columns: null
|
|
3179
3312
|
},
|
|
3180
3313
|
emits: {
|
|
3181
3314
|
"update:columns": null
|
|
3182
3315
|
},
|
|
3183
|
-
setup
|
|
3316
|
+
setup(__props, { emit }) {
|
|
3317
|
+
const props = __props;
|
|
3318
|
+
const { t: t2 } = useI18n();
|
|
3319
|
+
const visible = ref(false);
|
|
3320
|
+
function moveColumn(columns, oldIndex, newIndex) {
|
|
3321
|
+
if (newIndex < columns.length && newIndex >= 0) {
|
|
3322
|
+
columns.splice(newIndex, 0, columns.splice(oldIndex, 1)[0]);
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
function updateColumnVisibility(target, column) {
|
|
3326
|
+
var _a;
|
|
3327
|
+
const gridColumns = copy(props.columns);
|
|
3328
|
+
const checked = (_a = target == null ? void 0 : target.checked) != null ? _a : false;
|
|
3329
|
+
const targetColumnIndex = gridColumns.findIndex((c) => c.name === column.name);
|
|
3330
|
+
if (targetColumnIndex >= 0) {
|
|
3331
|
+
gridColumns[targetColumnIndex].visible = checked;
|
|
3332
|
+
}
|
|
3333
|
+
emit("update:columns", gridColumns);
|
|
3334
|
+
}
|
|
3335
|
+
function changeColumnOrder(columnIndex, direction) {
|
|
3336
|
+
const gridColumns = copy(props.columns);
|
|
3337
|
+
const newIndex = direction === "up" ? columnIndex + 1 : columnIndex - 1;
|
|
3338
|
+
moveColumn(gridColumns, columnIndex, newIndex);
|
|
3339
|
+
emit("update:columns", gridColumns);
|
|
3340
|
+
}
|
|
3341
|
+
return (_ctx, _cache) => {
|
|
3342
|
+
const _component_icon = resolveComponent("icon");
|
|
3343
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
3344
|
+
createVNode(_sfc_main$p, mergeProps(_ctx.$attrs, {
|
|
3345
|
+
class: "cl-w-full",
|
|
3346
|
+
size: "small",
|
|
3347
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => visible.value = true, ["prevent"]))
|
|
3348
|
+
}), {
|
|
3349
|
+
default: withCtx(() => [
|
|
3350
|
+
createTextVNode(toDisplayString(unref(t2)("grid.manageView")), 1)
|
|
3351
|
+
]),
|
|
3352
|
+
_: 1
|
|
3353
|
+
}, 16),
|
|
3354
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3355
|
+
createVNode(Transition, { name: "slide-left" }, {
|
|
3356
|
+
default: withCtx(() => [
|
|
3357
|
+
withDirectives(createElementVNode("div", _hoisted_1$a, [
|
|
3358
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
3359
|
+
createVNode(_component_icon, {
|
|
3360
|
+
class: "cl-absolute cl-cursor-pointer cl-right-3 cl-text-off-white cl-top-3",
|
|
3361
|
+
icon: "ph:x",
|
|
3362
|
+
size: 16,
|
|
3363
|
+
onClick: _cache[1] || (_cache[1] = ($event) => visible.value = false)
|
|
3364
|
+
}),
|
|
3365
|
+
createElementVNode("h3", _hoisted_3$7, toDisplayString(unref(t2)("grid.manageView")), 1),
|
|
3366
|
+
createElementVNode("ul", _hoisted_4$5, [
|
|
3367
|
+
createElementVNode("li", _hoisted_5$3, [
|
|
3368
|
+
createElementVNode("strong", _hoisted_6$3, toDisplayString(unref(t2)("grid.column")), 1),
|
|
3369
|
+
createElementVNode("strong", _hoisted_7$3, toDisplayString(unref(t2)("grid.visible")), 1),
|
|
3370
|
+
createElementVNode("strong", _hoisted_8$2, toDisplayString(unref(t2)("grid.order")), 1)
|
|
3371
|
+
]),
|
|
3372
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column, index) => {
|
|
3373
|
+
return openBlock(), createElementBlock("li", {
|
|
3374
|
+
key: index,
|
|
3375
|
+
class: "cl-border-b cl-border-grey-2 cl-flex cl-py-2 cl-text-sm cl-w-full"
|
|
3376
|
+
}, [
|
|
3377
|
+
createElementVNode("div", _hoisted_9$2, toDisplayString(column.caption), 1),
|
|
3378
|
+
createElementVNode("div", _hoisted_10$2, [
|
|
3379
|
+
createVNode(ClUiInput, {
|
|
3380
|
+
"model-value": column.visible === void 0 || column.visible === true,
|
|
3381
|
+
"input-type": "checkbox",
|
|
3382
|
+
onClick: ($event) => updateColumnVisibility($event.target, column)
|
|
3383
|
+
}, null, 8, ["model-value", "onClick"])
|
|
3384
|
+
]),
|
|
3385
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
3386
|
+
column.visible === void 0 || column.visible === true ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3387
|
+
index !== 0 ? (openBlock(), createBlock(_component_icon, {
|
|
3388
|
+
key: 0,
|
|
3389
|
+
class: "cl-cursor-pointer cl-inline-block cl-mr-2",
|
|
3390
|
+
icon: "ph:arrow-left",
|
|
3391
|
+
onClick: ($event) => changeColumnOrder(index, "down")
|
|
3392
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", true),
|
|
3393
|
+
index !== __props.columns.length - 1 ? (openBlock(), createBlock(_component_icon, {
|
|
3394
|
+
key: 1,
|
|
3395
|
+
class: "cl-cursor-pointer cl-inline-block",
|
|
3396
|
+
icon: "ph:arrow-right",
|
|
3397
|
+
onClick: ($event) => changeColumnOrder(index, "up")
|
|
3398
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
3399
|
+
], 64)) : (openBlock(), createElementBlock("em", _hoisted_12$1, toDisplayString(unref(t2)("grid.hidden")), 1))
|
|
3400
|
+
])
|
|
3401
|
+
]);
|
|
3402
|
+
}), 128))
|
|
3403
|
+
])
|
|
3404
|
+
])
|
|
3405
|
+
], 512), [
|
|
3406
|
+
[vShow, visible.value]
|
|
3407
|
+
])
|
|
3408
|
+
]),
|
|
3409
|
+
_: 1
|
|
3410
|
+
})
|
|
3411
|
+
]))
|
|
3412
|
+
], 64);
|
|
3413
|
+
};
|
|
3414
|
+
}
|
|
3184
3415
|
}));
|
|
3185
|
-
const _hoisted_1$
|
|
3416
|
+
const _hoisted_1$9 = {
|
|
3186
3417
|
key: 0,
|
|
3187
3418
|
class: "cl-pb-2 cl-pr-2 cl-w-1/2 lg:cl-pb-0 lg:cl-w-auto"
|
|
3188
3419
|
};
|
|
3189
|
-
const _hoisted_2$
|
|
3190
|
-
const _hoisted_3$
|
|
3191
|
-
const _hoisted_4$
|
|
3192
|
-
const _sfc_main$
|
|
3420
|
+
const _hoisted_2$8 = { class: "cl-hidden cl-pr-2 lg:cl-inline-block" };
|
|
3421
|
+
const _hoisted_3$6 = { class: "cl-pb-2 cl-pr-2 cl-w-1/2 lg:cl-pb-0 lg:cl-pr-0 lg:cl-w-auto" };
|
|
3422
|
+
const _hoisted_4$4 = { class: "cl-pr-2 cl-w-full lg:cl-hidden md:cl-w-1/2" };
|
|
3423
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
3193
3424
|
props: {
|
|
3194
3425
|
columns: null,
|
|
3195
3426
|
editMode: { type: Boolean },
|
|
@@ -3211,7 +3442,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3211
3442
|
});
|
|
3212
3443
|
return (_ctx, _cache) => {
|
|
3213
3444
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3214
|
-
__props.editEnabled ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
3445
|
+
__props.editEnabled ? (openBlock(), createElementBlock("span", _hoisted_1$9, [
|
|
3215
3446
|
createVNode(_sfc_main$p, {
|
|
3216
3447
|
class: "cl-w-full lg:cl-w-auto",
|
|
3217
3448
|
size: "small",
|
|
@@ -3228,13 +3459,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3228
3459
|
_: 1
|
|
3229
3460
|
})
|
|
3230
3461
|
])) : createCommentVNode("", true),
|
|
3231
|
-
createElementVNode("span", _hoisted_2$
|
|
3232
|
-
createVNode(_sfc_main$
|
|
3462
|
+
createElementVNode("span", _hoisted_2$8, [
|
|
3463
|
+
createVNode(_sfc_main$b, {
|
|
3233
3464
|
columns: unref(currentColumns),
|
|
3234
3465
|
"onUpdate:columns": _cache[1] || (_cache[1] = ($event) => isRef(currentColumns) ? currentColumns.value = $event : null)
|
|
3235
3466
|
}, null, 8, ["columns"])
|
|
3236
3467
|
]),
|
|
3237
|
-
createElementVNode("span", _hoisted_3$
|
|
3468
|
+
createElementVNode("span", _hoisted_3$6, [
|
|
3238
3469
|
createVNode(_sfc_main$p, {
|
|
3239
3470
|
class: "cl-w-full lg:cl-w-auto",
|
|
3240
3471
|
size: "small",
|
|
@@ -3246,7 +3477,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3246
3477
|
_: 1
|
|
3247
3478
|
})
|
|
3248
3479
|
]),
|
|
3249
|
-
createElementVNode("span", _hoisted_4$
|
|
3480
|
+
createElementVNode("span", _hoisted_4$4, [
|
|
3250
3481
|
createVNode(_sfc_main$p, {
|
|
3251
3482
|
class: "cl-w-full",
|
|
3252
3483
|
colour: "blue",
|
|
@@ -3264,26 +3495,26 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3264
3495
|
}
|
|
3265
3496
|
});
|
|
3266
3497
|
var clUiGrid_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
3267
|
-
const _hoisted_1$
|
|
3268
|
-
const _hoisted_2$
|
|
3269
|
-
const _hoisted_3$
|
|
3270
|
-
const _hoisted_4$
|
|
3271
|
-
const _hoisted_5$
|
|
3272
|
-
const _hoisted_6$
|
|
3273
|
-
const _hoisted_7$
|
|
3274
|
-
const _hoisted_8$
|
|
3498
|
+
const _hoisted_1$8 = { class: "cl-hidden cl-mb-4 cl-w-full lg:cl-block lg:cl-text-right" };
|
|
3499
|
+
const _hoisted_2$7 = ["data-loading"];
|
|
3500
|
+
const _hoisted_3$5 = { class: "cl-absolute cl-bg-white cl-h-full cl-opacity-40 cl-w-full cl-z-20" };
|
|
3501
|
+
const _hoisted_4$3 = { class: "cl-bg-white cl-flex cl-flex-wrap cl-sticky cl-top-0 cl-w-full lg:cl-hidden" };
|
|
3502
|
+
const _hoisted_5$2 = { class: "cl-border-b cl-border-grey-2 cl-flex cl-flex-wrap cl-px-2 cl-py-4 cl-w-full" };
|
|
3503
|
+
const _hoisted_6$2 = { class: "cl-mb-4 cl-text-sm cl-w-full" };
|
|
3504
|
+
const _hoisted_7$2 = { class: "cl-flex cl-flex-wrap cl-w-full" };
|
|
3505
|
+
const _hoisted_8$1 = { class: "!cl-bg-white cl-absolute cl-h-screen cl-overflow-x-auto cl-p-4 cl-text-sm cl-w-full cl-z-10" };
|
|
3275
3506
|
const _hoisted_9$1 = { class: "cl-border-b cl-border-grey-2 cl-mb-2 cl-pb-2 cl-text-right cl-w-full" };
|
|
3276
3507
|
const _hoisted_10$1 = { class: "cl-grid cl-grid-cols-3" };
|
|
3277
|
-
const _hoisted_11
|
|
3508
|
+
const _hoisted_11 = {
|
|
3278
3509
|
key: 1,
|
|
3279
3510
|
class: "cl-ml-2"
|
|
3280
3511
|
};
|
|
3281
|
-
const _hoisted_12
|
|
3282
|
-
const _hoisted_13
|
|
3283
|
-
const _hoisted_14
|
|
3284
|
-
const _hoisted_15
|
|
3285
|
-
const _hoisted_16
|
|
3286
|
-
const _hoisted_17
|
|
3512
|
+
const _hoisted_12 = { class: "cl-overflow-auto cl-w-full" };
|
|
3513
|
+
const _hoisted_13 = { class: "cl-min-w-full cl-table-fixed" };
|
|
3514
|
+
const _hoisted_14 = { class: "cl-hidden lg:cl-table-column-group" };
|
|
3515
|
+
const _hoisted_15 = { class: "cl-hidden lg:cl-table-header-group" };
|
|
3516
|
+
const _hoisted_16 = ["onClick"];
|
|
3517
|
+
const _hoisted_17 = { key: 1 };
|
|
3287
3518
|
const _hoisted_18 = { key: 0 };
|
|
3288
3519
|
const _hoisted_19 = { key: 1 };
|
|
3289
3520
|
const _hoisted_20 = ["colspan"];
|
|
@@ -3292,12 +3523,12 @@ const _hoisted_22 = {
|
|
|
3292
3523
|
key: 0,
|
|
3293
3524
|
class: "cl-w-full"
|
|
3294
3525
|
};
|
|
3295
|
-
const _sfc_main$
|
|
3526
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3296
3527
|
props: {
|
|
3297
3528
|
columns: null,
|
|
3298
3529
|
request: null,
|
|
3299
3530
|
loading: { type: Boolean },
|
|
3300
|
-
data: { default:
|
|
3531
|
+
data: { default: null }
|
|
3301
3532
|
},
|
|
3302
3533
|
emits: {
|
|
3303
3534
|
"update:columns": null,
|
|
@@ -3408,8 +3639,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3408
3639
|
var _a, _b;
|
|
3409
3640
|
const _component_icon = resolveComponent("icon");
|
|
3410
3641
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3411
|
-
createElementVNode("div", _hoisted_1$
|
|
3412
|
-
createVNode(_sfc_main$
|
|
3642
|
+
createElementVNode("div", _hoisted_1$8, [
|
|
3643
|
+
createVNode(_sfc_main$a, {
|
|
3413
3644
|
columns: unref(currentColumns),
|
|
3414
3645
|
"onUpdate:columns": _cache[0] || (_cache[0] = ($event) => isRef(currentColumns) ? currentColumns.value = $event : null),
|
|
3415
3646
|
"edit-mode": editMode.value,
|
|
@@ -3424,17 +3655,17 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3424
3655
|
}, [
|
|
3425
3656
|
createVNode(Transition, { name: "fade" }, {
|
|
3426
3657
|
default: withCtx(() => [
|
|
3427
|
-
withDirectives(createElementVNode("div", _hoisted_3$
|
|
3658
|
+
withDirectives(createElementVNode("div", _hoisted_3$5, null, 512), [
|
|
3428
3659
|
[vShow, __props.loading]
|
|
3429
3660
|
])
|
|
3430
3661
|
]),
|
|
3431
3662
|
_: 1
|
|
3432
3663
|
}),
|
|
3433
|
-
createElementVNode("div", _hoisted_4$
|
|
3434
|
-
createElementVNode("div", _hoisted_5$
|
|
3435
|
-
createElementVNode("strong", _hoisted_6$
|
|
3436
|
-
createElementVNode("div", _hoisted_7$
|
|
3437
|
-
createVNode(_sfc_main$
|
|
3664
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
3665
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
3666
|
+
createElementVNode("strong", _hoisted_6$2, toDisplayString(unref(t2)("grid.gridTools")), 1),
|
|
3667
|
+
createElementVNode("div", _hoisted_7$2, [
|
|
3668
|
+
createVNode(_sfc_main$a, {
|
|
3438
3669
|
columns: unref(currentColumns),
|
|
3439
3670
|
"onUpdate:columns": _cache[2] || (_cache[2] = ($event) => isRef(currentColumns) ? currentColumns.value = $event : null),
|
|
3440
3671
|
"edit-mode": editMode.value,
|
|
@@ -3448,7 +3679,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3448
3679
|
]),
|
|
3449
3680
|
createVNode(Transition, { name: "grow-down" }, {
|
|
3450
3681
|
default: withCtx(() => [
|
|
3451
|
-
withDirectives(createElementVNode("div", _hoisted_8$
|
|
3682
|
+
withDirectives(createElementVNode("div", _hoisted_8$1, [
|
|
3452
3683
|
createElementVNode("div", _hoisted_9$1, [
|
|
3453
3684
|
createVNode(_component_icon, {
|
|
3454
3685
|
class: "cl--mt-1 cl-inline-block cl-text-grey-5",
|
|
@@ -3470,7 +3701,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3470
3701
|
class: "cl-grid cl-grid-cols-3 cl-mb-4 cl-w-full"
|
|
3471
3702
|
}, [
|
|
3472
3703
|
createElementVNode("div", null, toDisplayString(column.caption), 1),
|
|
3473
|
-
createVNode(_sfc_main$
|
|
3704
|
+
createVNode(_sfc_main$d, {
|
|
3474
3705
|
request: unref(currentRequest),
|
|
3475
3706
|
"onUpdate:request": _cache[6] || (_cache[6] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
|
|
3476
3707
|
column
|
|
@@ -3492,7 +3723,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3492
3723
|
icon: "ph:caret-up",
|
|
3493
3724
|
onClick: ($event) => setSort(column.field)
|
|
3494
3725
|
}, null, 8, ["onClick"]))
|
|
3495
|
-
], 64)) : (openBlock(), createElementBlock("div", _hoisted_11
|
|
3726
|
+
], 64)) : (openBlock(), createElementBlock("div", _hoisted_11, " \xA0 "))
|
|
3496
3727
|
]);
|
|
3497
3728
|
}), 128))
|
|
3498
3729
|
], 512), [
|
|
@@ -3502,9 +3733,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3502
3733
|
_: 1
|
|
3503
3734
|
})
|
|
3504
3735
|
]),
|
|
3505
|
-
createElementVNode("div", _hoisted_12
|
|
3506
|
-
createElementVNode("table", _hoisted_13
|
|
3507
|
-
createElementVNode("colgroup", _hoisted_14
|
|
3736
|
+
createElementVNode("div", _hoisted_12, [
|
|
3737
|
+
createElementVNode("table", _hoisted_13, [
|
|
3738
|
+
createElementVNode("colgroup", _hoisted_14, [
|
|
3508
3739
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, index) => {
|
|
3509
3740
|
return openBlock(), createElementBlock("col", {
|
|
3510
3741
|
key: index,
|
|
@@ -3513,7 +3744,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3513
3744
|
}, null, 4);
|
|
3514
3745
|
}), 128))
|
|
3515
3746
|
]),
|
|
3516
|
-
createElementVNode("thead", _hoisted_15
|
|
3747
|
+
createElementVNode("thead", _hoisted_15, [
|
|
3517
3748
|
createElementVNode("tr", null, [
|
|
3518
3749
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, index) => {
|
|
3519
3750
|
var _a2;
|
|
@@ -3540,7 +3771,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3540
3771
|
}, null, 512), [
|
|
3541
3772
|
[vShow, unref(currentRequest).sort !== null && unref(currentRequest).sort.sortOnColumn === column.field && unref(currentRequest).sort.sortByAscending === false]
|
|
3542
3773
|
])
|
|
3543
|
-
], 8, _hoisted_16
|
|
3774
|
+
], 8, _hoisted_16)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(column.caption), 1))
|
|
3544
3775
|
], 4);
|
|
3545
3776
|
}), 128))
|
|
3546
3777
|
]),
|
|
@@ -3551,7 +3782,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3551
3782
|
class: "cl-p-1",
|
|
3552
3783
|
style: normalizeStyle(getStyleForColumn(column.name))
|
|
3553
3784
|
}, [
|
|
3554
|
-
createVNode(_sfc_main$
|
|
3785
|
+
createVNode(_sfc_main$d, {
|
|
3555
3786
|
request: unref(currentRequest),
|
|
3556
3787
|
"onUpdate:request": _cache[7] || (_cache[7] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
|
|
3557
3788
|
column,
|
|
@@ -3571,7 +3802,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3571
3802
|
})
|
|
3572
3803
|
}, [
|
|
3573
3804
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(visibleColumns), (column, columnIndex) => {
|
|
3574
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3805
|
+
return openBlock(), createBlock(_sfc_main$e, {
|
|
3575
3806
|
key: columnIndex,
|
|
3576
3807
|
class: "cl-align-top cl-p-2 cl-rounded cl-whitespace-nowrap",
|
|
3577
3808
|
style: normalizeStyle(getStyleForColumn(column.name)),
|
|
@@ -3620,563 +3851,96 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
3620
3851
|
])
|
|
3621
3852
|
])
|
|
3622
3853
|
]),
|
|
3623
|
-
createVNode(_sfc_main$
|
|
3854
|
+
createVNode(_sfc_main$c, {
|
|
3624
3855
|
request: unref(currentRequest),
|
|
3625
3856
|
"onUpdate:request": _cache[8] || (_cache[8] = ($event) => isRef(currentRequest) ? currentRequest.value = $event : null),
|
|
3626
3857
|
data: __props.data
|
|
3627
3858
|
}, null, 8, ["request", "data"])
|
|
3628
|
-
], 8, _hoisted_2$
|
|
3859
|
+
], 8, _hoisted_2$7)
|
|
3629
3860
|
], 64);
|
|
3630
3861
|
};
|
|
3631
3862
|
}
|
|
3632
3863
|
});
|
|
3633
|
-
var clUiGrid = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3634
|
-
const _sfc_main$
|
|
3635
|
-
const _hoisted_1$
|
|
3636
|
-
const _hoisted_2$
|
|
3864
|
+
var clUiGrid = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-7df0fada"]]);
|
|
3865
|
+
const _sfc_main$8 = {};
|
|
3866
|
+
const _hoisted_1$7 = { class: "cl-absolute cl-bg-secondary-default cl-flex cl-h-20 cl-items-center cl-justify-between cl-left-0 cl-top-0 cl-w-full cl-z-40" };
|
|
3867
|
+
const _hoisted_2$6 = { class: "cl-flex cl-flex-nowrap" };
|
|
3637
3868
|
function _sfc_render$2(_ctx, _cache) {
|
|
3638
|
-
return openBlock(), createElementBlock("header", _hoisted_1$
|
|
3869
|
+
return openBlock(), createElementBlock("header", _hoisted_1$7, [
|
|
3639
3870
|
renderSlot(_ctx.$slots, "logo"),
|
|
3640
|
-
createElementVNode("div", _hoisted_2$
|
|
3871
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
3641
3872
|
renderSlot(_ctx.$slots, "menu"),
|
|
3642
3873
|
renderSlot(_ctx.$slots, "icon")
|
|
3643
3874
|
])
|
|
3644
3875
|
]);
|
|
3645
3876
|
}
|
|
3646
|
-
var clUiHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3647
|
-
const _hoisted_1$
|
|
3648
|
-
const _hoisted_2$
|
|
3649
|
-
const _hoisted_3$
|
|
3650
|
-
const _hoisted_4$
|
|
3651
|
-
const _hoisted_5$3 = {
|
|
3652
|
-
key: 0,
|
|
3653
|
-
class: "cl-cursor-default cl-overflow-ellipsis cl-whitespace-nowrap"
|
|
3654
|
-
};
|
|
3655
|
-
const _hoisted_6$3 = {
|
|
3656
|
-
key: 1,
|
|
3657
|
-
class: "cl-cursor-default cl-overflow-ellipsis cl-text-xs cl-whitespace-nowrap"
|
|
3658
|
-
};
|
|
3659
|
-
const _hoisted_7$3 = { class: "cl-absolute cl-bg-white cl-right-0 cl-shadow-2xl cl-top-20 cl-w-full cl-z-20" };
|
|
3660
|
-
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3661
|
-
props: {
|
|
3662
|
-
username: { default: "" },
|
|
3663
|
-
group: { default: "" },
|
|
3664
|
-
image: { default: "" }
|
|
3665
|
-
},
|
|
3666
|
-
setup(__props) {
|
|
3667
|
-
const isOpen = ref(false);
|
|
3668
|
-
return (_ctx, _cache) => {
|
|
3669
|
-
const _component_icon = resolveComponent("icon");
|
|
3670
|
-
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
3671
|
-
createElementVNode("div", _hoisted_2$7, [
|
|
3672
|
-
__props.image ? (openBlock(), createElementBlock("img", {
|
|
3673
|
-
key: 0,
|
|
3674
|
-
src: __props.image,
|
|
3675
|
-
class: "cl-hidden cl-m-4 cl-max-h-12 cl-max-w-12 cl-ring-2 cl-ring-white cl-rounded-full md:cl-block"
|
|
3676
|
-
}, null, 8, _hoisted_3$6)) : (openBlock(), createBlock(_component_icon, {
|
|
3677
|
-
key: 1,
|
|
3678
|
-
class: "cl-hidden cl-m-4 cl-text-white md:cl-block",
|
|
3679
|
-
icon: "ph:user-circle",
|
|
3680
|
-
width: "48",
|
|
3681
|
-
height: "48"
|
|
3682
|
-
})),
|
|
3683
|
-
createElementVNode("div", _hoisted_4$4, [
|
|
3684
|
-
__props.username ? (openBlock(), createElementBlock("div", _hoisted_5$3, toDisplayString(__props.username), 1)) : createCommentVNode("", true),
|
|
3685
|
-
__props.group ? (openBlock(), createElementBlock("div", _hoisted_6$3, toDisplayString(__props.group), 1)) : createCommentVNode("", true)
|
|
3686
|
-
]),
|
|
3687
|
-
createElementVNode("div", {
|
|
3688
|
-
class: "cl-bg-transparent cl-content-center cl-cursor-pointer cl-flex cl-h-20 cl-items-center cl-justify-center cl-justify-items-center cl-transition-all cl-w-10 hover:cl-bg-opacity-10 hover:cl-bg-white md:cl-ml-4 md:cl-w-20",
|
|
3689
|
-
onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
|
|
3690
|
-
}, [
|
|
3691
|
-
createVNode(_component_icon, {
|
|
3692
|
-
class: normalizeClass(["cl-text-white cl-transform-gpu cl-transition-transform", {
|
|
3693
|
-
"cl-rotate-180": isOpen.value
|
|
3694
|
-
}]),
|
|
3695
|
-
icon: "ph:caret-down"
|
|
3696
|
-
}, null, 8, ["class"])
|
|
3697
|
-
])
|
|
3698
|
-
]),
|
|
3699
|
-
createVNode(Transition, { name: "fade" }, {
|
|
3700
|
-
default: withCtx(() => [
|
|
3701
|
-
withDirectives(createElementVNode("div", _hoisted_7$3, [
|
|
3702
|
-
renderSlot(_ctx.$slots, "default")
|
|
3703
|
-
], 512), [
|
|
3704
|
-
[vShow, isOpen.value]
|
|
3705
|
-
])
|
|
3706
|
-
]),
|
|
3707
|
-
_: 3
|
|
3708
|
-
})
|
|
3709
|
-
]);
|
|
3710
|
-
};
|
|
3711
|
-
}
|
|
3712
|
-
});
|
|
3713
|
-
var clUiSlider_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
3714
|
-
const _hoisted_1$7 = { class: "cl-flex cl-flex-wrap cl-items-center" };
|
|
3715
|
-
const _hoisted_2$6 = ["value", "min", "max", "step", "disabled"];
|
|
3716
|
-
const _hoisted_3$5 = { class: "cl-flex cl-flex-1 cl-flex-wrap cl-items-center cl-mb-2 cl-mt-3 cl-relative md:cl-mt-0" };
|
|
3717
|
-
const _hoisted_4$3 = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-0 cl-px-3 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
|
|
3718
|
-
const _hoisted_5$2 = { key: 0 };
|
|
3719
|
-
const _hoisted_6$2 = ["min", "max", "step", "disabled"];
|
|
3720
|
-
const _hoisted_7$2 = { class: "cl-absolute cl-bg-grey-0 cl-leading-6 cl-ml-2 cl-px-3 cl-right-0 cl-rounded-full cl-text-center cl-text-xs cl-top-full" };
|
|
3721
|
-
const _hoisted_8$2 = {
|
|
3722
|
-
key: 1,
|
|
3723
|
-
class: "emphasis-danger text-sm w-full"
|
|
3724
|
-
};
|
|
3725
|
-
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
3726
|
-
props: {
|
|
3727
|
-
value: null,
|
|
3728
|
-
min: null,
|
|
3729
|
-
max: null,
|
|
3730
|
-
step: { default: 1 },
|
|
3731
|
-
enforceStep: { type: Boolean, default: false },
|
|
3732
|
-
disabled: { type: Boolean, default: false },
|
|
3733
|
-
showNumericInput: { type: Boolean, default: true }
|
|
3734
|
-
},
|
|
3735
|
-
emits: {
|
|
3736
|
-
"update:value": null
|
|
3737
|
-
},
|
|
3738
|
-
setup(__props, { emit }) {
|
|
3739
|
-
const props = __props;
|
|
3740
|
-
const { n, t: t2 } = useI18n();
|
|
3741
|
-
const { debounce } = useDebouncer();
|
|
3742
|
-
const currentValue = computed({
|
|
3743
|
-
get: () => props.value,
|
|
3744
|
-
set: (value) => emit("update:value", value)
|
|
3745
|
-
});
|
|
3746
|
-
const colour = computed(() => props.disabled ? "rgba(153, 153, 153, 0.8)" : "#9acd32");
|
|
3747
|
-
const percentage = computed(() => {
|
|
3748
|
-
let value = (currentValue.value - props.min) / (props.max - props.min) * 100;
|
|
3749
|
-
if (value < 35 && value > 0) {
|
|
3750
|
-
if (value < 20) {
|
|
3751
|
-
value += 0.5;
|
|
3752
|
-
} else {
|
|
3753
|
-
value += 0.25;
|
|
3754
|
-
}
|
|
3755
|
-
} else if (value > 65 && value < 100) {
|
|
3756
|
-
if (value > 80) {
|
|
3757
|
-
value -= 0.5;
|
|
3758
|
-
} else {
|
|
3759
|
-
value -= 0.25;
|
|
3760
|
-
}
|
|
3761
|
-
}
|
|
3762
|
-
return value;
|
|
3763
|
-
});
|
|
3764
|
-
const validProps = computed(() => props.min <= props.max && props.step > 0);
|
|
3765
|
-
function updateCurrentValue(target, forceUpdate) {
|
|
3766
|
-
var _a;
|
|
3767
|
-
const inputValue = (_a = target == null ? void 0 : target.value) != null ? _a : "";
|
|
3768
|
-
const value = Math.max(Math.min(parseFloat(inputValue) || props.min, props.max), props.min);
|
|
3769
|
-
currentValue.value = props.enforceStep ? Math.ceil(value / props.step) * props.step : value;
|
|
3770
|
-
nextTick(() => forceUpdate());
|
|
3771
|
-
}
|
|
3772
|
-
return (_ctx, _cache) => {
|
|
3773
|
-
return unref(validProps) ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), [
|
|
3774
|
-
withDirectives(createElementVNode("div", { class: "cl-bg-transparent cl-relative cl-text-center cl-text-sm" }, toDisplayString(unref(currentValue)), 513), [
|
|
3775
|
-
[vShow, !__props.showNumericInput]
|
|
3776
|
-
]),
|
|
3777
|
-
createElementVNode("div", _hoisted_1$7, [
|
|
3778
|
-
withDirectives(createElementVNode("input", {
|
|
3779
|
-
class: "!cl-text-sm md:!cl-h-8 md:!cl-w-auto",
|
|
3780
|
-
type: "number",
|
|
3781
|
-
value: unref(currentValue),
|
|
3782
|
-
min: __props.min,
|
|
3783
|
-
max: __props.max,
|
|
3784
|
-
step: __props.step,
|
|
3785
|
-
disabled: __props.disabled,
|
|
3786
|
-
onInput: _cache[0] || (_cache[0] = ($event) => unref(debounce)(updateCurrentValue, [$event.target, _ctx.$forceUpdate]))
|
|
3787
|
-
}, null, 40, _hoisted_2$6), [
|
|
3788
|
-
[vShow, __props.showNumericInput]
|
|
3789
|
-
]),
|
|
3790
|
-
createElementVNode("div", _hoisted_3$5, [
|
|
3791
|
-
createElementVNode("span", _hoisted_4$3, toDisplayString(unref(n)(__props.min, Number.isInteger(__props.min) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1),
|
|
3792
|
-
typeof unref(currentValue) === "number" ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
|
|
3793
|
-
withDirectives(createElementVNode("input", {
|
|
3794
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
|
|
3795
|
-
class: "cl-align-middle cl-appearance-none cl-bg-gradient-to-r cl-border cl-border-grey-2 cl-delay-500 cl-ease-in cl-flex-1 cl-h-5 cl-mb-2 cl-outline-none cl-rounded-full cl-transition-colors",
|
|
3796
|
-
style: normalizeStyle({
|
|
3797
|
-
background: `linear-gradient(to right, ${unref(colour)} 0%, ${unref(colour)} ${unref(percentage)}%, white ${unref(percentage)}%, white 100%)`
|
|
3798
|
-
}),
|
|
3799
|
-
type: "range",
|
|
3800
|
-
min: __props.min,
|
|
3801
|
-
max: __props.max,
|
|
3802
|
-
step: __props.step,
|
|
3803
|
-
disabled: __props.disabled
|
|
3804
|
-
}, null, 12, _hoisted_6$2), [
|
|
3805
|
-
[
|
|
3806
|
-
vModelText,
|
|
3807
|
-
unref(currentValue),
|
|
3808
|
-
void 0,
|
|
3809
|
-
{ number: true }
|
|
3810
|
-
]
|
|
3811
|
-
])
|
|
3812
|
-
])) : createCommentVNode("", true),
|
|
3813
|
-
createElementVNode("span", _hoisted_7$2, toDisplayString(unref(n)(__props.max, Number.isInteger(__props.max) ? unref(NumberFormat).INTEGER : unref(NumberFormat).DECIMAL)), 1)
|
|
3814
|
-
])
|
|
3815
|
-
])
|
|
3816
|
-
], 16)) : (openBlock(), createElementBlock("div", _hoisted_8$2, toDisplayString(unref(t2)("slider.invalidProps")), 1));
|
|
3817
|
-
};
|
|
3818
|
-
}
|
|
3819
|
-
});
|
|
3820
|
-
var clUiSlider = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-3cc89ae4"]]);
|
|
3821
|
-
function isInputText(type) {
|
|
3822
|
-
let isText = false;
|
|
3823
|
-
switch (type) {
|
|
3824
|
-
case "email":
|
|
3825
|
-
case "password":
|
|
3826
|
-
case "search":
|
|
3827
|
-
case "tel":
|
|
3828
|
-
case "text":
|
|
3829
|
-
case "url":
|
|
3830
|
-
isText = true;
|
|
3831
|
-
break;
|
|
3832
|
-
default:
|
|
3833
|
-
isText = false;
|
|
3834
|
-
break;
|
|
3835
|
-
}
|
|
3836
|
-
return isText;
|
|
3837
|
-
}
|
|
3838
|
-
function isInputCalendarSupportedDate(type) {
|
|
3839
|
-
let isSupported = false;
|
|
3840
|
-
switch (type) {
|
|
3841
|
-
case "date":
|
|
3842
|
-
case "datetime":
|
|
3843
|
-
case "time":
|
|
3844
|
-
isSupported = true;
|
|
3845
|
-
break;
|
|
3846
|
-
default:
|
|
3847
|
-
isSupported = false;
|
|
3848
|
-
break;
|
|
3849
|
-
}
|
|
3850
|
-
return isSupported;
|
|
3851
|
-
}
|
|
3852
|
-
function isInputButton(type) {
|
|
3853
|
-
return type === "button" || type === "submit" || type === "reset";
|
|
3854
|
-
}
|
|
3855
|
-
function getInputTypeAsCalendarType(type) {
|
|
3856
|
-
let calendarType;
|
|
3857
|
-
switch (type) {
|
|
3858
|
-
case "datetime":
|
|
3859
|
-
calendarType = calendarTypes[1];
|
|
3860
|
-
break;
|
|
3861
|
-
case "time":
|
|
3862
|
-
calendarType = calendarTypes[2];
|
|
3863
|
-
break;
|
|
3864
|
-
case "date":
|
|
3865
|
-
default:
|
|
3866
|
-
calendarType = calendarTypes[0];
|
|
3867
|
-
break;
|
|
3868
|
-
}
|
|
3869
|
-
return calendarType;
|
|
3870
|
-
}
|
|
3871
|
-
var clUiInput_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
3872
|
-
const _hoisted_1$6 = { class: "cl-align-top cl-inline-block cl-mb-4 cl-mr-4 cl-text-left" };
|
|
3873
|
-
const _hoisted_2$5 = { class: "cl-flex cl-justify-between" };
|
|
3874
|
-
const _hoisted_3$4 = { class: "cl-text-gray-400 cl-text-xs cl-tracking-widest cl-uppercase cl-w:70%" };
|
|
3875
|
-
const _hoisted_4$2 = {
|
|
3876
|
-
key: 0,
|
|
3877
|
-
class: "cl-left-auto cl-relative cl-text-danger-default"
|
|
3878
|
-
};
|
|
3877
|
+
var clUiHeader = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$2]]);
|
|
3878
|
+
const _hoisted_1$6 = { class: "md:cl-relative" };
|
|
3879
|
+
const _hoisted_2$5 = { class: "cl-bg-blue-light cl-flex cl-items-center cl-select-none md:cl-min-w-[320px]" };
|
|
3880
|
+
const _hoisted_3$4 = ["src"];
|
|
3881
|
+
const _hoisted_4$2 = { class: "cl-cursor-default cl-grow cl-hidden cl-my-4 cl-text-white md:cl-block" };
|
|
3879
3882
|
const _hoisted_5$1 = {
|
|
3880
|
-
key: 1,
|
|
3881
|
-
class: "cl-bg-danger-light cl-block cl-max-h-6 cl-ml-2 cl-px-2 cl-rounded-md cl-text-center cl-text-danger-default cl-text-xs cl-uppercase"
|
|
3882
|
-
};
|
|
3883
|
-
const _hoisted_6$1 = ["type", "disabled", "min", "max", "minlength", "maxlength", "step", "placeholder", "accept", "name", "onBlur"];
|
|
3884
|
-
const _hoisted_7$1 = {
|
|
3885
|
-
key: 4,
|
|
3886
|
-
class: "cl-pb-2"
|
|
3887
|
-
};
|
|
3888
|
-
const _hoisted_8$1 = {
|
|
3889
3883
|
key: 0,
|
|
3890
|
-
class: "cl-
|
|
3884
|
+
class: "cl-cursor-default cl-text-ellipsis cl-whitespace-nowrap"
|
|
3885
|
+
};
|
|
3886
|
+
const _hoisted_6$1 = {
|
|
3887
|
+
key: 1,
|
|
3888
|
+
class: "cl-cursor-default cl-text-ellipsis cl-text-xs cl-whitespace-nowrap"
|
|
3891
3889
|
};
|
|
3890
|
+
const _hoisted_7$1 = { class: "cl-absolute cl-bg-white cl-right-0 cl-shadow-2xl cl-top-20 cl-w-full cl-z-20" };
|
|
3892
3891
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
3893
3892
|
props: {
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
isRequired: { type: Boolean, default: false },
|
|
3898
|
-
customValidationFunction: { type: Function, default: void 0 },
|
|
3899
|
-
onInputFunction: { type: Function, default: void 0 },
|
|
3900
|
-
min: { default: 0 },
|
|
3901
|
-
max: { default: 512 },
|
|
3902
|
-
step: { default: 1 },
|
|
3903
|
-
validateImmediately: { type: Boolean, default: false },
|
|
3904
|
-
externalErrors: { default: () => [] },
|
|
3905
|
-
disabled: { type: Boolean, default: false },
|
|
3906
|
-
requiredText: { default: "" },
|
|
3907
|
-
placeholderText: { default: "" },
|
|
3908
|
-
fileExtensions: { default: "" },
|
|
3909
|
-
group: { default: "" }
|
|
3910
|
-
},
|
|
3911
|
-
emits: {
|
|
3912
|
-
"update:modelValue": null,
|
|
3913
|
-
click: null,
|
|
3914
|
-
focus: null,
|
|
3915
|
-
validated: null
|
|
3893
|
+
username: { default: "" },
|
|
3894
|
+
group: { default: "" },
|
|
3895
|
+
image: { default: "" }
|
|
3916
3896
|
},
|
|
3917
|
-
setup(__props
|
|
3918
|
-
const
|
|
3919
|
-
const inputElement = ref(null);
|
|
3920
|
-
const focused = ref(false);
|
|
3921
|
-
const lostFocus = ref(false);
|
|
3922
|
-
const showRequiredAsterisk = computed(getShowAsteriskOrRequired);
|
|
3923
|
-
const dateFlaggedAsOutOfRange = ref(false);
|
|
3924
|
-
const { t: t2 } = useI18n();
|
|
3925
|
-
const currentValue = computed({
|
|
3926
|
-
get: () => props.modelValue,
|
|
3927
|
-
set: (value) => onValueChanged(value)
|
|
3928
|
-
});
|
|
3929
|
-
const currentDateValue = computed({
|
|
3930
|
-
get: () => props.modelValue,
|
|
3931
|
-
set: (value) => updateDateValue(value)
|
|
3932
|
-
});
|
|
3933
|
-
const minAsString = computed(() => typeof props.min === "number" ? props.min.toString() : props.min);
|
|
3934
|
-
const maxAsString = computed(() => typeof props.max === "number" ? props.max.toString() : props.max);
|
|
3935
|
-
const minAsNumber = computed(() => typeof props.min === "number" ? props.min : parseFloat(props.min));
|
|
3936
|
-
const maxAsNumber = computed(() => typeof props.max === "number" ? props.max : parseFloat(props.max));
|
|
3937
|
-
const internalErrors = ref([]);
|
|
3938
|
-
const errors = computed(() => {
|
|
3939
|
-
var _a, _b, _c, _d;
|
|
3940
|
-
return [
|
|
3941
|
-
...(_b = (_a = internalErrors.value) == null ? void 0 : _a.filter((e) => {
|
|
3942
|
-
var _a2;
|
|
3943
|
-
return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
|
|
3944
|
-
})) != null ? _b : [],
|
|
3945
|
-
...(_d = (_c = props.externalErrors) == null ? void 0 : _c.filter((e) => {
|
|
3946
|
-
var _a2;
|
|
3947
|
-
return ((_a2 = e == null ? void 0 : e.length) != null ? _a2 : 0) > 0;
|
|
3948
|
-
})) != null ? _d : []
|
|
3949
|
-
].join("\n");
|
|
3950
|
-
});
|
|
3951
|
-
function updateDateValue(value) {
|
|
3952
|
-
updateAndValidateValue(value);
|
|
3953
|
-
dateFlaggedAsOutOfRange.value = false;
|
|
3954
|
-
}
|
|
3955
|
-
function onValueChanged(value) {
|
|
3956
|
-
if (props.onInputFunction !== void 0) {
|
|
3957
|
-
value = props.onInputFunction(value);
|
|
3958
|
-
}
|
|
3959
|
-
updateAndValidateValue(value);
|
|
3960
|
-
}
|
|
3961
|
-
function updateAndValidateValue(value) {
|
|
3962
|
-
const defaultSuccess = {
|
|
3963
|
-
message: "",
|
|
3964
|
-
valid: true
|
|
3965
|
-
};
|
|
3966
|
-
const customValidationSuccess = props.customValidationFunction === null || props.customValidationFunction === void 0 ? defaultSuccess : props.customValidationFunction(props.label, value);
|
|
3967
|
-
const validationPromises = [props.customValidationFunction === null || props.customValidationFunction === void 0 ? new Promise((resolve) => {
|
|
3968
|
-
resolve(defaultSuccess);
|
|
3969
|
-
}) : new Promise((resolve) => {
|
|
3970
|
-
resolve(props.customValidationFunction(props.label, value));
|
|
3971
|
-
})];
|
|
3972
|
-
if (typeof value === "string" || typeof value === "number" || value instanceof Date) {
|
|
3973
|
-
validationPromises.push(validateMinValue(props.min, props.inputType, props.label, value));
|
|
3974
|
-
validationPromises.push(validateMaxValue(props.max, props.inputType, props.label, value));
|
|
3975
|
-
}
|
|
3976
|
-
if (props.isRequired) {
|
|
3977
|
-
validationPromises.push(validateRequired(props.label, value));
|
|
3978
|
-
}
|
|
3979
|
-
if (props.inputType === "email" && typeof value === "string") {
|
|
3980
|
-
validationPromises.push(validateEmail(props.label, value));
|
|
3981
|
-
}
|
|
3982
|
-
Promise.all(validationPromises).then((internalValidationResults) => {
|
|
3983
|
-
const messages2 = [...internalValidationResults.map((e) => e.message)];
|
|
3984
|
-
let invalid = internalValidationResults.some((e) => e.valid === false) || !customValidationSuccess.valid;
|
|
3985
|
-
if (dateFlaggedAsOutOfRange.value) {
|
|
3986
|
-
messages2.push(t2("input.dateOutOfRange"));
|
|
3987
|
-
invalid = true;
|
|
3988
|
-
}
|
|
3989
|
-
if (invalid) {
|
|
3990
|
-
internalErrors.value = messages2;
|
|
3991
|
-
emit("validated", false);
|
|
3992
|
-
} else {
|
|
3993
|
-
internalErrors.value = [];
|
|
3994
|
-
emit("validated", true);
|
|
3995
|
-
}
|
|
3996
|
-
emit("update:modelValue", value);
|
|
3997
|
-
});
|
|
3998
|
-
}
|
|
3999
|
-
function getStyle() {
|
|
4000
|
-
let style = "";
|
|
4001
|
-
if (props.inputType === "color" && currentValue.value) {
|
|
4002
|
-
if (props.disabled) {
|
|
4003
|
-
style = `background: #999999`;
|
|
4004
|
-
} else {
|
|
4005
|
-
style = `background: ${currentValue.value};`;
|
|
4006
|
-
}
|
|
4007
|
-
}
|
|
4008
|
-
return style;
|
|
4009
|
-
}
|
|
4010
|
-
function emitClickIfButton(event) {
|
|
4011
|
-
if (isInputButton(props.inputType)) {
|
|
4012
|
-
event.preventDefault();
|
|
4013
|
-
emit("click");
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
function incrementNumericValue() {
|
|
4017
|
-
if (inputElement.value) {
|
|
4018
|
-
inputElement.value.stepUp();
|
|
4019
|
-
inputElement.value.focus();
|
|
4020
|
-
onValueChanged(inputElement.value.valueAsNumber);
|
|
4021
|
-
}
|
|
4022
|
-
}
|
|
4023
|
-
function decrementNumericValue() {
|
|
4024
|
-
if (inputElement.value) {
|
|
4025
|
-
inputElement.value.stepDown();
|
|
4026
|
-
inputElement.value.focus();
|
|
4027
|
-
onValueChanged(inputElement.value.valueAsNumber);
|
|
4028
|
-
}
|
|
4029
|
-
}
|
|
4030
|
-
function toggleFocus(focus) {
|
|
4031
|
-
focused.value = focus;
|
|
4032
|
-
}
|
|
4033
|
-
function onLostFocus() {
|
|
4034
|
-
lostFocus.value = true;
|
|
4035
|
-
toggleFocus(false);
|
|
4036
|
-
}
|
|
4037
|
-
function onMouseWheel(wheelEvent) {
|
|
4038
|
-
wheelEvent.target.blur();
|
|
4039
|
-
}
|
|
4040
|
-
function getShowAsteriskOrRequired() {
|
|
4041
|
-
var _a;
|
|
4042
|
-
let asterisk = true;
|
|
4043
|
-
const currentState = showRequiredAsterisk.value;
|
|
4044
|
-
if (focused.value) {
|
|
4045
|
-
asterisk = currentState;
|
|
4046
|
-
} else if (lostFocus.value && ((_a = currentValue.value) == null ? void 0 : _a.toString().trim()) === "") {
|
|
4047
|
-
asterisk = false;
|
|
4048
|
-
}
|
|
4049
|
-
return asterisk;
|
|
4050
|
-
}
|
|
4051
|
-
function onDateOutOfRange() {
|
|
4052
|
-
dateFlaggedAsOutOfRange.value = true;
|
|
4053
|
-
}
|
|
4054
|
-
onMounted(() => {
|
|
4055
|
-
if (props.validateImmediately) {
|
|
4056
|
-
onValueChanged(props.modelValue);
|
|
4057
|
-
}
|
|
4058
|
-
});
|
|
4059
|
-
watch(() => props.isRequired, () => onValueChanged(props.modelValue));
|
|
3897
|
+
setup(__props) {
|
|
3898
|
+
const isOpen = ref(false);
|
|
4060
3899
|
return (_ctx, _cache) => {
|
|
4061
3900
|
const _component_icon = resolveComponent("icon");
|
|
4062
3901
|
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
4063
|
-
createElementVNode("div",
|
|
4064
|
-
|
|
4065
|
-
onMouseenter: _cache[7] || (_cache[7] = ($event) => toggleFocus(true)),
|
|
4066
|
-
onMouseleave: _cache[8] || (_cache[8] = ($event) => toggleFocus(false))
|
|
4067
|
-
}, [
|
|
4068
|
-
createElementVNode("div", _hoisted_2$5, [
|
|
4069
|
-
createElementVNode("label", _hoisted_3$4, toDisplayString(__props.label), 1),
|
|
4070
|
-
__props.isRequired && unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_4$2, " * ")) : createCommentVNode("", true),
|
|
4071
|
-
__props.isRequired && !unref(showRequiredAsterisk) ? (openBlock(), createElementBlock("label", _hoisted_5$1, toDisplayString(__props.requiredText), 1)) : createCommentVNode("", true)
|
|
4072
|
-
]),
|
|
4073
|
-
__props.inputType !== "range" && !unref(isInputCalendarSupportedDate)(__props.inputType) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
3902
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
3903
|
+
__props.image ? (openBlock(), createElementBlock("img", {
|
|
4074
3904
|
key: 0,
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
},
|
|
4079
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(currentValue) ? currentValue.value = $event : null),
|
|
4080
|
-
class: normalizeClass(["cl-block cl-border cl-duration-300 cl-h-fit cl-mb-1 cl-transition cl-w-full focus:cl-outline-none", {
|
|
4081
|
-
"hover:!cl-border-grey-3": __props.disabled === false && !unref(isInputButton)(__props.inputType),
|
|
4082
|
-
"!cl-cursor-default": __props.disabled,
|
|
4083
|
-
"!cl-border-danger-default": unref(errors).length > 0,
|
|
4084
|
-
"cl-border-grey-0 focus:cl-border-blue-light": unref(errors).length === 0 && !unref(isInputButton)(__props.inputType),
|
|
4085
|
-
"!cl-p-2": __props.inputType === "checkbox" || __props.inputType === "radio",
|
|
4086
|
-
"cl-p-3 cl-rounded-lg": !unref(isInputButton)(__props.inputType)
|
|
4087
|
-
}]),
|
|
4088
|
-
style: normalizeStyle(getStyle()),
|
|
4089
|
-
type: __props.inputType,
|
|
4090
|
-
disabled: __props.disabled,
|
|
4091
|
-
min: __props.min,
|
|
4092
|
-
max: __props.max,
|
|
4093
|
-
minlength: unref(isInputText)(__props.inputType) ? __props.min : 0,
|
|
4094
|
-
maxlength: unref(isInputText)(__props.inputType) ? __props.max : 0,
|
|
4095
|
-
step: __props.step,
|
|
4096
|
-
placeholder: __props.placeholderText,
|
|
4097
|
-
accept: __props.fileExtensions,
|
|
4098
|
-
name: __props.group,
|
|
4099
|
-
onClick: _cache[1] || (_cache[1] = ($event) => emitClickIfButton($event)),
|
|
4100
|
-
onFocus: _cache[2] || (_cache[2] = ($event) => {
|
|
4101
|
-
toggleFocus(true);
|
|
4102
|
-
_ctx.$emit("focus");
|
|
4103
|
-
}),
|
|
4104
|
-
onBlur: withModifiers(onLostFocus, ["self"]),
|
|
4105
|
-
onMousewheel: onMouseWheel
|
|
4106
|
-
}, null, 46, _hoisted_6$1)), [
|
|
4107
|
-
[vModelDynamic, unref(currentValue)]
|
|
4108
|
-
]) : createCommentVNode("", true),
|
|
4109
|
-
unref(isInputCalendarSupportedDate)(__props.inputType) ? (openBlock(), createBlock(unref(_sfc_main$o), {
|
|
3905
|
+
src: __props.image,
|
|
3906
|
+
class: "cl-hidden cl-m-4 cl-max-h-12 cl-max-w-12 cl-ring-2 cl-ring-white cl-rounded-full md:cl-block"
|
|
3907
|
+
}, null, 8, _hoisted_3$4)) : (openBlock(), createBlock(_component_icon, {
|
|
4110
3908
|
key: 1,
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
min: unref(minAsString),
|
|
4124
|
-
max: unref(maxAsString),
|
|
4125
|
-
onBlur: withModifiers(onLostFocus, ["self"]),
|
|
4126
|
-
onValueOutOfRange: onDateOutOfRange
|
|
4127
|
-
}, null, 8, ["date", "class", "disabled", "type", "min", "max", "onBlur"])) : createCommentVNode("", true),
|
|
4128
|
-
__props.inputType === "number" && !__props.disabled ? (openBlock(), createElementBlock("div", {
|
|
4129
|
-
key: 2,
|
|
4130
|
-
class: normalizeClass(["cl-absolute cl-duration-300 cl-right-1 cl-transition", {
|
|
4131
|
-
"cl-opacity-0": !focused.value
|
|
4132
|
-
}]),
|
|
4133
|
-
style: { "bottom": "1.625rem" }
|
|
4134
|
-
}, [
|
|
4135
|
-
createVNode(_component_icon, {
|
|
4136
|
-
icon: "ph:caret-up-bold",
|
|
4137
|
-
class: "cl-bg-link-default cl-rounded-md cl-text-sm cl-text-white hover:cl-bg-link-light hover:cl-cursor-pointer",
|
|
4138
|
-
onClick: incrementNumericValue,
|
|
4139
|
-
onMousedown: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
4140
|
-
}, ["prevent"]))
|
|
4141
|
-
})
|
|
4142
|
-
], 2)) : createCommentVNode("", true),
|
|
4143
|
-
__props.inputType === "number" && !__props.disabled ? (openBlock(), createElementBlock("div", {
|
|
4144
|
-
key: 3,
|
|
4145
|
-
class: normalizeClass(["cl-absolute cl-bottom-2 cl-duration-300 cl-right-1 cl-transition", {
|
|
4146
|
-
"cl-opacity-0": !focused.value
|
|
4147
|
-
}])
|
|
3909
|
+
class: "cl-hidden cl-m-4 cl-text-white md:cl-block",
|
|
3910
|
+
icon: "ph:user-circle",
|
|
3911
|
+
width: "48",
|
|
3912
|
+
height: "48"
|
|
3913
|
+
})),
|
|
3914
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
3915
|
+
__props.username ? (openBlock(), createElementBlock("div", _hoisted_5$1, toDisplayString(__props.username), 1)) : createCommentVNode("", true),
|
|
3916
|
+
__props.group ? (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(__props.group), 1)) : createCommentVNode("", true)
|
|
3917
|
+
]),
|
|
3918
|
+
createElementVNode("div", {
|
|
3919
|
+
class: "cl-bg-transparent cl-content-center cl-cursor-pointer cl-flex cl-h-20 cl-items-center cl-justify-center cl-justify-items-center cl-transition-all cl-w-10 hover:cl-bg-opacity-10 hover:cl-bg-white md:cl-ml-4 md:cl-w-20",
|
|
3920
|
+
onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
|
|
4148
3921
|
}, [
|
|
4149
3922
|
createVNode(_component_icon, {
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
step: __props.step,
|
|
4168
|
-
disabled: __props.disabled,
|
|
4169
|
-
"show-numeric-input": false,
|
|
4170
|
-
onBlur: withModifiers(onLostFocus, ["self"])
|
|
4171
|
-
}, null, 8, ["value", "min", "max", "step", "disabled", "onBlur"])
|
|
4172
|
-
])) : createCommentVNode("", true)
|
|
4173
|
-
], 32),
|
|
4174
|
-
unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, toDisplayString(unref(errors)), 1)) : createCommentVNode("", true)
|
|
3923
|
+
class: normalizeClass(["cl-text-white cl-transform-gpu cl-transition-transform", {
|
|
3924
|
+
"cl-rotate-180": isOpen.value
|
|
3925
|
+
}]),
|
|
3926
|
+
icon: "ph:caret-down"
|
|
3927
|
+
}, null, 8, ["class"])
|
|
3928
|
+
])
|
|
3929
|
+
]),
|
|
3930
|
+
createVNode(Transition, { name: "fade" }, {
|
|
3931
|
+
default: withCtx(() => [
|
|
3932
|
+
withDirectives(createElementVNode("div", _hoisted_7$1, [
|
|
3933
|
+
renderSlot(_ctx.$slots, "default")
|
|
3934
|
+
], 512), [
|
|
3935
|
+
[vShow, isOpen.value]
|
|
3936
|
+
])
|
|
3937
|
+
]),
|
|
3938
|
+
_: 3
|
|
3939
|
+
})
|
|
4175
3940
|
]);
|
|
4176
3941
|
};
|
|
4177
3942
|
}
|
|
4178
3943
|
});
|
|
4179
|
-
var clUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-22c48b29"]]);
|
|
4180
3944
|
const inputTypes = [
|
|
4181
3945
|
"button",
|
|
4182
3946
|
"checkbox",
|
|
@@ -4288,7 +4052,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
4288
4052
|
};
|
|
4289
4053
|
}
|
|
4290
4054
|
});
|
|
4291
|
-
var clUiLogin_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
4292
4055
|
const _hoisted_1$4 = { class: "cl-relative" };
|
|
4293
4056
|
const _hoisted_2$3 = { class: "cl-h-screen cl-z-0" };
|
|
4294
4057
|
const _hoisted_3$2 = { class: "cl-absolute cl-bg-secondary-default cl-gap-y-1 cl-grid cl-grid-cols-1 cl-left-0 cl-opacity-95 cl-p-6 cl-top-0 cl-w-full cl-z-10 lg:cl-gap-x-1 lg:cl-grid-cols-10 lg:cl-p-10" };
|
|
@@ -4299,16 +4062,9 @@ const _hoisted_5 = {
|
|
|
4299
4062
|
};
|
|
4300
4063
|
const _hoisted_6 = { class: "cl-col-span-3" };
|
|
4301
4064
|
const _hoisted_7 = { class: "cl-inline cl-relative cl-text-grey-4" };
|
|
4302
|
-
const _hoisted_8 =
|
|
4303
|
-
const _hoisted_9 = { class: "cl-
|
|
4304
|
-
const _hoisted_10 = { class: "cl-
|
|
4305
|
-
const _hoisted_11 = { class: "cl-align-middle cl-inline-block cl-ml-2" };
|
|
4306
|
-
const _hoisted_12 = { class: "cl-flex cl-mt-2" };
|
|
4307
|
-
const _hoisted_13 = { class: "cl-align-middle cl-inline-block cl-ml-2" };
|
|
4308
|
-
const _hoisted_14 = { class: "cl-col-span-3" };
|
|
4309
|
-
const _hoisted_15 = { class: "cl-inline cl-relative cl-text-grey-4" };
|
|
4310
|
-
const _hoisted_16 = ["type", "data-valid", "placeholder"];
|
|
4311
|
-
const _hoisted_17 = { class: "cl-col-span-10 cl-emphasis-danger cl-mt-10 cl-p-3 cl-rounded-md cl-text-sm md:cl-mt-3" };
|
|
4065
|
+
const _hoisted_8 = { class: "cl-col-span-3" };
|
|
4066
|
+
const _hoisted_9 = { class: "cl-inline cl-relative cl-text-grey-4" };
|
|
4067
|
+
const _hoisted_10 = { class: "cl-col-span-10 cl-emphasis-danger cl-mt-10 cl-p-3 cl-rounded-md cl-text-sm md:cl-mt-3" };
|
|
4312
4068
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
4313
4069
|
props: {
|
|
4314
4070
|
errors: { default: () => [] },
|
|
@@ -4323,7 +4079,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4323
4079
|
const username = ref("");
|
|
4324
4080
|
const password = ref("");
|
|
4325
4081
|
const passwordFieldType = ref("password");
|
|
4326
|
-
const usernameValid =
|
|
4082
|
+
const usernameValid = ref();
|
|
4327
4083
|
function login() {
|
|
4328
4084
|
const authentication = {
|
|
4329
4085
|
username: username.value,
|
|
@@ -4334,18 +4090,31 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4334
4090
|
function clearErrors() {
|
|
4335
4091
|
emit("update:errors", []);
|
|
4336
4092
|
}
|
|
4093
|
+
function emptyIsInvalidValidation(_, value) {
|
|
4094
|
+
const state = {
|
|
4095
|
+
valid: true,
|
|
4096
|
+
message: ""
|
|
4097
|
+
};
|
|
4098
|
+
if (typeof value === "string" && value.trim() === "") {
|
|
4099
|
+
state.valid = false;
|
|
4100
|
+
}
|
|
4101
|
+
return state;
|
|
4102
|
+
}
|
|
4103
|
+
function onUsernameValidated(valid, _) {
|
|
4104
|
+
usernameValid.value = valid;
|
|
4105
|
+
}
|
|
4337
4106
|
return (_ctx, _cache) => {
|
|
4338
4107
|
const _component_icon = resolveComponent("icon");
|
|
4339
4108
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
4340
4109
|
createElementVNode("div", _hoisted_2$3, [
|
|
4341
|
-
renderSlot(_ctx.$slots, "background"
|
|
4110
|
+
renderSlot(_ctx.$slots, "background")
|
|
4342
4111
|
]),
|
|
4343
4112
|
createElementVNode("form", _hoisted_3$2, [
|
|
4344
4113
|
createElementVNode("div", _hoisted_4, [
|
|
4345
|
-
renderSlot(_ctx.$slots, "logo"
|
|
4114
|
+
renderSlot(_ctx.$slots, "logo")
|
|
4346
4115
|
]),
|
|
4347
4116
|
_ctx.$slots["language-switcher"] ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
4348
|
-
renderSlot(_ctx.$slots, "language-switcher"
|
|
4117
|
+
renderSlot(_ctx.$slots, "language-switcher")
|
|
4349
4118
|
])) : createCommentVNode("", true),
|
|
4350
4119
|
createElementVNode("div", {
|
|
4351
4120
|
class: normalizeClass(["cl-gap-y-4 cl-grid cl-grid-cols-1 lg:cl-gap-x-2 lg:cl-grid-cols-8", {
|
|
@@ -4356,66 +4125,39 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4356
4125
|
createElementVNode("div", _hoisted_6, [
|
|
4357
4126
|
createElementVNode("div", _hoisted_7, [
|
|
4358
4127
|
createVNode(_component_icon, {
|
|
4359
|
-
class: "cl-absolute cl-left-3 cl-top-2",
|
|
4128
|
+
class: "cl-absolute cl-left-3 cl-top-2.5",
|
|
4360
4129
|
icon: "ph:user",
|
|
4361
4130
|
size: 18
|
|
4362
4131
|
}),
|
|
4363
|
-
|
|
4132
|
+
createVNode(ClUiInput, {
|
|
4133
|
+
modelValue: username.value,
|
|
4364
4134
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => username.value = $event),
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
"
|
|
4368
|
-
|
|
4135
|
+
modelModifiers: { trim: true },
|
|
4136
|
+
class: "!cl-border-2 !cl-mb-1 cl-w-full",
|
|
4137
|
+
"input-type": "email",
|
|
4138
|
+
"highlight-when-valid": true,
|
|
4139
|
+
label: "Username",
|
|
4140
|
+
"show-label": false,
|
|
4141
|
+
"placeholder-text": unref(t2)("login.email"),
|
|
4369
4142
|
autocomplete: "username",
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
])
|
|
4379
|
-
]),
|
|
4380
|
-
createVNode(Transition, { name: "fade" }, {
|
|
4381
|
-
default: withCtx(() => [
|
|
4382
|
-
withDirectives(createElementVNode("div", _hoisted_9, [
|
|
4383
|
-
withDirectives(createElementVNode("div", _hoisted_10, [
|
|
4384
|
-
createVNode(_component_icon, {
|
|
4385
|
-
class: "cl-mt-1 cl-text-primary-default",
|
|
4386
|
-
icon: "ph:check",
|
|
4387
|
-
size: 16
|
|
4388
|
-
}),
|
|
4389
|
-
createElementVNode("em", _hoisted_11, toDisplayString(unref(t2)("login.validEmail")), 1)
|
|
4390
|
-
], 512), [
|
|
4391
|
-
[vShow, unref(usernameValid)]
|
|
4392
|
-
]),
|
|
4393
|
-
withDirectives(createElementVNode("div", _hoisted_12, [
|
|
4394
|
-
createVNode(_component_icon, {
|
|
4395
|
-
class: "cl-mt-1 cl-text-danger-default",
|
|
4396
|
-
icon: "ph:x",
|
|
4397
|
-
size: 16
|
|
4398
|
-
}),
|
|
4399
|
-
createElementVNode("em", _hoisted_13, toDisplayString(unref(t2)("login.invalidEmail")), 1)
|
|
4400
|
-
], 512), [
|
|
4401
|
-
[vShow, !unref(usernameValid)]
|
|
4402
|
-
])
|
|
4403
|
-
], 512), [
|
|
4404
|
-
[vShow, username.value !== ""]
|
|
4405
|
-
])
|
|
4406
|
-
]),
|
|
4407
|
-
_: 1
|
|
4408
|
-
})
|
|
4143
|
+
"validate-immediately": true,
|
|
4144
|
+
"custom-validation-function": emptyIsInvalidValidation,
|
|
4145
|
+
"input-specific-classes": "!cl-pl-9",
|
|
4146
|
+
"message-when-valid": unref(t2)("login.validEmail"),
|
|
4147
|
+
onInput: clearErrors,
|
|
4148
|
+
onValidated: onUsernameValidated
|
|
4149
|
+
}, null, 8, ["modelValue", "placeholder-text", "message-when-valid"])
|
|
4150
|
+
])
|
|
4409
4151
|
]),
|
|
4410
|
-
createElementVNode("div",
|
|
4411
|
-
createElementVNode("div",
|
|
4152
|
+
createElementVNode("div", _hoisted_8, [
|
|
4153
|
+
createElementVNode("div", _hoisted_9, [
|
|
4412
4154
|
createVNode(_component_icon, {
|
|
4413
|
-
class: "cl-absolute cl-left-3 cl-top-2",
|
|
4155
|
+
class: "cl-absolute cl-left-3 cl-top-2.5",
|
|
4414
4156
|
icon: "ph:lock",
|
|
4415
4157
|
size: 18
|
|
4416
4158
|
}),
|
|
4417
4159
|
withDirectives(createVNode(_component_icon, {
|
|
4418
|
-
class: "cl-absolute cl-cursor-pointer cl-right-
|
|
4160
|
+
class: "cl-absolute cl-cursor-pointer cl-right-6 cl-top-2.5",
|
|
4419
4161
|
icon: "ph:eye",
|
|
4420
4162
|
size: 18,
|
|
4421
4163
|
onClick: _cache[1] || (_cache[1] = ($event) => passwordFieldType.value = "text")
|
|
@@ -4423,24 +4165,26 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4423
4165
|
[vShow, passwordFieldType.value === "password"]
|
|
4424
4166
|
]),
|
|
4425
4167
|
withDirectives(createVNode(_component_icon, {
|
|
4426
|
-
class: "cl-absolute cl-cursor-pointer cl-right-
|
|
4168
|
+
class: "cl-absolute cl-cursor-pointer cl-right-6 cl-top-2.5",
|
|
4427
4169
|
icon: "ph:eye-slash",
|
|
4428
4170
|
size: 18,
|
|
4429
4171
|
onClick: _cache[2] || (_cache[2] = ($event) => passwordFieldType.value = "password")
|
|
4430
4172
|
}, null, 512), [
|
|
4431
4173
|
[vShow, passwordFieldType.value === "text"]
|
|
4432
4174
|
]),
|
|
4433
|
-
|
|
4175
|
+
createVNode(ClUiInput, {
|
|
4176
|
+
modelValue: password.value,
|
|
4434
4177
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => password.value = $event),
|
|
4435
|
-
class: "!cl-
|
|
4436
|
-
type: passwordFieldType.value,
|
|
4437
|
-
"
|
|
4438
|
-
placeholder: unref(t2)("login.password"),
|
|
4178
|
+
class: "!cl-border-2 cl-w-full",
|
|
4179
|
+
"input-type": passwordFieldType.value,
|
|
4180
|
+
"highlight-when-valid": true,
|
|
4181
|
+
"placeholder-text": unref(t2)("login.password"),
|
|
4439
4182
|
autocomplete: "current-password",
|
|
4183
|
+
"validate-immediately": true,
|
|
4184
|
+
"input-specific-classes": "!cl-pl-9 !cl-pr-9",
|
|
4185
|
+
"custom-validation-function": emptyIsInvalidValidation,
|
|
4440
4186
|
onInput: clearErrors
|
|
4441
|
-
}, null,
|
|
4442
|
-
[vModelDynamic, password.value]
|
|
4443
|
-
])
|
|
4187
|
+
}, null, 8, ["modelValue", "input-type", "placeholder-text"])
|
|
4444
4188
|
])
|
|
4445
4189
|
]),
|
|
4446
4190
|
createElementVNode("div", {
|
|
@@ -4449,10 +4193,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4449
4193
|
}])
|
|
4450
4194
|
}, [
|
|
4451
4195
|
createVNode(_sfc_main$p, {
|
|
4452
|
-
class: "cl-w-full",
|
|
4196
|
+
class: "!cl-leading-9 cl-w-full",
|
|
4453
4197
|
colour: "blue",
|
|
4454
4198
|
loading: __props.loading,
|
|
4455
|
-
disabled: !
|
|
4199
|
+
disabled: !usernameValid.value || password.value === "",
|
|
4456
4200
|
onClick: withModifiers(login, ["prevent"])
|
|
4457
4201
|
}, {
|
|
4458
4202
|
default: withCtx(() => [
|
|
@@ -4466,7 +4210,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4466
4210
|
default: withCtx(() => {
|
|
4467
4211
|
var _a;
|
|
4468
4212
|
return [
|
|
4469
|
-
withDirectives(createElementVNode("span",
|
|
4213
|
+
withDirectives(createElementVNode("span", _hoisted_10, [
|
|
4470
4214
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.errors, (error, index) => {
|
|
4471
4215
|
return openBlock(), createElementBlock("div", {
|
|
4472
4216
|
key: index,
|
|
@@ -4485,7 +4229,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
4485
4229
|
};
|
|
4486
4230
|
}
|
|
4487
4231
|
});
|
|
4488
|
-
var clUiLogin = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2e5cd708"]]);
|
|
4489
4232
|
const modalSizes = [
|
|
4490
4233
|
"x-small",
|
|
4491
4234
|
"small",
|
|
@@ -4653,11 +4396,9 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
4653
4396
|
clUiButton: _sfc_main$p,
|
|
4654
4397
|
buttonColours,
|
|
4655
4398
|
buttonSizes,
|
|
4656
|
-
|
|
4657
|
-
calendarTypes,
|
|
4658
|
-
clUiCard: _sfc_main$n,
|
|
4399
|
+
clUiCard: _sfc_main$o,
|
|
4659
4400
|
cardSizes,
|
|
4660
|
-
clUiComboBox: _sfc_main$
|
|
4401
|
+
clUiComboBox: _sfc_main$g,
|
|
4661
4402
|
isComboBoxItem,
|
|
4662
4403
|
isComboBoxCreateRequest,
|
|
4663
4404
|
clUiFooter,
|
|
@@ -4673,15 +4414,15 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
4673
4414
|
isFilterRequest,
|
|
4674
4415
|
isFilterResponse,
|
|
4675
4416
|
clUiHeader,
|
|
4676
|
-
clUiHeaderMenu: _sfc_main$
|
|
4677
|
-
clUiInput,
|
|
4417
|
+
clUiHeaderMenu: _sfc_main$7,
|
|
4418
|
+
clUiInput: ClUiInput,
|
|
4678
4419
|
inputTypes,
|
|
4679
4420
|
clUiLanguageSwitcher: _sfc_main$6,
|
|
4680
4421
|
isLanguageLocaleFormat,
|
|
4681
4422
|
isLanguageArray,
|
|
4682
4423
|
clUiLoadingSpinner: ClUiLoadingSpinner,
|
|
4683
|
-
clUiLogin,
|
|
4684
|
-
clUiModal: _sfc_main$
|
|
4424
|
+
clUiLogin: _sfc_main$5,
|
|
4425
|
+
clUiModal: _sfc_main$k,
|
|
4685
4426
|
modalSizes,
|
|
4686
4427
|
modalColours,
|
|
4687
4428
|
clUiNavigation,
|
|
@@ -4689,18 +4430,8 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
4689
4430
|
clUiNavigationGroup: _sfc_main$2,
|
|
4690
4431
|
clUiNavigationSection,
|
|
4691
4432
|
clUiNavigationItem,
|
|
4692
|
-
clUiNotification: _sfc_main$s
|
|
4693
|
-
clUiSlider
|
|
4433
|
+
clUiNotification: _sfc_main$s
|
|
4694
4434
|
});
|
|
4695
|
-
Date.prototype.toLocaleMonthString = function(locale) {
|
|
4696
|
-
return i18n.global.d(this, DateFormat.MONTH_YEAR, locale != null ? locale : i18n.global.locale.value);
|
|
4697
|
-
};
|
|
4698
|
-
Date.prototype.toLocaleTimeStringWithoutMilliseconds = function(locale) {
|
|
4699
|
-
return i18n.global.d(this, DateFormat.TIME, locale != null ? locale : i18n.global.locale.value);
|
|
4700
|
-
};
|
|
4701
|
-
Date.prototype.toLocaleStringWithoutMilliseconds = function(locale) {
|
|
4702
|
-
return i18n.global.d(this, DateFormat.DATETIME, locale != null ? locale : i18n.global.locale.value);
|
|
4703
|
-
};
|
|
4704
4435
|
var main = "";
|
|
4705
4436
|
const install = (app) => {
|
|
4706
4437
|
app.use(i18n);
|
|
@@ -4712,4 +4443,4 @@ const install = (app) => {
|
|
|
4712
4443
|
app.component(name, component);
|
|
4713
4444
|
});
|
|
4714
4445
|
};
|
|
4715
|
-
export { DateFormat, FilterOperation, NumberFormat, buttonColours, buttonSizes,
|
|
4446
|
+
export { DateFormat, FilterOperation, NumberFormat, buttonColours, buttonSizes, cardSizes, _sfc_main$v as clUiAccordion, clUiAccordionHeader, _sfc_main$u as clUiAccordionItem, _sfc_main$r as clUiApp, _sfc_main$p as clUiButton, _sfc_main$o as clUiCard, _sfc_main$g as clUiComboBox, clUiFooter, clUiGrid, clUiHeader, _sfc_main$7 as clUiHeaderMenu, ClUiInput as clUiInput, _sfc_main$6 as clUiLanguageSwitcher, ClUiLoadingSpinner as clUiLoadingSpinner, _sfc_main$5 as clUiLogin, _sfc_main$k as clUiModal, clUiNavigation, _sfc_main$2 as clUiNavigationGroup, _sfc_main$3 as clUiNavigationIcon, clUiNavigationItem, clUiNavigationSection, _sfc_main$s as clUiNotification, datetimeFormats, install as default, filterMethodTypes, gridColumnTypes, i18n, inputTypes, isComboBoxCreateRequest, isComboBoxItem, isFilterRequest, isFilterResponse, isGridColumn, isGridColumnArray, isLanguageArray, isLanguageLocaleFormat, messages, modalColours, modalSizes, numberFormats, setCurrentLocale, setLocaleDateTimeFormats, setLocaleMessages, setLocaleNumberFormats, showNotification, stringFormats, validateEmail, validateMaxValue, validateMinValue };
|