@hbdlzy/ui-core 0.1.1 → 0.1.3
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/README.md +37 -2
- package/components.manifest.json +198 -161
- package/dist/components/BaseCard/BaseCard.types.d.ts +36 -0
- package/dist/components/BaseCard/BaseCard.vue.d.ts +122 -0
- package/dist/components/BaseCard/index.d.ts +3 -0
- package/dist/components/BaseEChart/BaseEChart.types.d.ts +26 -0
- package/dist/components/BaseEChart/BaseEChart.vue.d.ts +66 -0
- package/dist/components/BaseEChart/index.d.ts +3 -0
- package/dist/components/BaseExportButton/BaseExportButton.types.d.ts +21 -0
- package/dist/components/BaseExportButton/BaseExportButton.utils.d.ts +4 -0
- package/dist/components/BaseExportButton/BaseExportButton.vue.d.ts +128 -0
- package/dist/components/BaseExportButton/index.d.ts +5 -0
- package/dist/components/BaseTable/BaseTable.types.d.ts +163 -0
- package/dist/components/BaseTable/BaseTable.vue.d.ts +157 -0
- package/dist/components/BaseTable/index.d.ts +3 -0
- package/dist/components/OutlinedCascader/OutlinedCascader.types.d.ts +25 -0
- package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +85 -0
- package/dist/components/OutlinedCascader/index.d.ts +3 -0
- package/dist/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +27 -0
- package/dist/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +88 -0
- package/dist/components/OutlinedDatePicker/index.d.ts +3 -0
- package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +26 -0
- package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +97 -0
- package/dist/components/OutlinedDateTimePicker/index.d.ts +3 -0
- package/dist/components/OutlinedInput/OutlinedInput.types.d.ts +29 -0
- package/dist/components/OutlinedInput/OutlinedInput.vue.d.ts +97 -0
- package/dist/components/OutlinedInput/index.d.ts +3 -0
- package/dist/components/OutlinedSelect/OutlinedSelect.types.d.ts +38 -0
- package/dist/components/OutlinedSelect/OutlinedSelect.vue.d.ts +116 -0
- package/dist/components/OutlinedSelect/index.d.ts +3 -0
- package/dist/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +28 -0
- package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +94 -0
- package/dist/components/OutlinedTimePicker/index.d.ts +3 -0
- package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +46 -0
- package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +137 -0
- package/dist/components/OutlinedTreeSelect/index.d.ts +3 -0
- package/dist/echarts/index.d.ts +9 -0
- package/dist/excel/exportExcel.d.ts +18 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -0
- package/dist/index.js +2181 -41
- package/dist/style.css +1 -1
- package/package.json +6 -4
- package/src/components/BaseCard/BaseCard.types.d.ts +36 -0
- package/src/components/BaseCard/BaseCard.vue.d.ts +122 -0
- package/src/components/BaseCard/index.d.ts +3 -0
- package/src/components/BaseEChart/BaseEChart.types.d.ts +26 -0
- package/src/components/BaseEChart/BaseEChart.vue.d.ts +66 -0
- package/src/components/BaseEChart/index.d.ts +3 -0
- package/src/components/BaseExportButton/BaseExportButton.types.d.ts +21 -0
- package/src/components/BaseExportButton/BaseExportButton.utils.d.ts +4 -0
- package/src/components/BaseExportButton/BaseExportButton.vue.d.ts +128 -0
- package/src/components/BaseExportButton/index.d.ts +5 -0
- package/src/components/BaseTable/BaseTable.types.d.ts +163 -0
- package/src/components/BaseTable/BaseTable.types.ts +12 -0
- package/src/components/BaseTable/BaseTable.vue +412 -13
- package/src/components/BaseTable/BaseTable.vue.d.ts +157 -0
- package/src/components/BaseTable/README.md +106 -120
- package/src/components/BaseTable/index.d.ts +3 -0
- package/src/components/OutlinedCascader/OutlinedCascader.types.d.ts +25 -0
- package/src/components/OutlinedCascader/OutlinedCascader.types.ts +28 -0
- package/src/components/OutlinedCascader/OutlinedCascader.vue +250 -0
- package/src/components/OutlinedCascader/OutlinedCascader.vue.d.ts +85 -0
- package/src/components/OutlinedCascader/README.md +91 -0
- package/src/components/OutlinedCascader/index.d.ts +3 -0
- package/src/components/OutlinedCascader/index.ts +10 -0
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +27 -0
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.ts +40 -0
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue +365 -0
- package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +88 -0
- package/src/components/OutlinedDatePicker/README.md +137 -0
- package/src/components/OutlinedDatePicker/index.d.ts +3 -0
- package/src/components/OutlinedDatePicker/index.ts +11 -0
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +26 -0
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.ts +34 -0
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue +421 -0
- package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +97 -0
- package/src/components/OutlinedDateTimePicker/README.md +88 -0
- package/src/components/OutlinedDateTimePicker/index.d.ts +3 -0
- package/src/components/OutlinedDateTimePicker/index.ts +11 -0
- package/src/components/OutlinedInput/OutlinedInput.types.d.ts +29 -0
- package/src/components/OutlinedInput/OutlinedInput.types.ts +32 -0
- package/src/components/OutlinedInput/OutlinedInput.vue +307 -0
- package/src/components/OutlinedInput/OutlinedInput.vue.d.ts +97 -0
- package/src/components/OutlinedInput/README.md +154 -0
- package/src/components/OutlinedInput/index.d.ts +3 -0
- package/src/components/OutlinedInput/index.ts +10 -0
- package/src/components/OutlinedSelect/OutlinedSelect.types.d.ts +38 -0
- package/src/components/OutlinedSelect/OutlinedSelect.types.ts +48 -0
- package/src/components/OutlinedSelect/OutlinedSelect.vue +359 -0
- package/src/components/OutlinedSelect/OutlinedSelect.vue.d.ts +116 -0
- package/src/components/OutlinedSelect/README.md +166 -0
- package/src/components/OutlinedSelect/index.d.ts +3 -0
- package/src/components/OutlinedSelect/index.ts +12 -0
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +28 -0
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.ts +36 -0
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue +303 -0
- package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +94 -0
- package/src/components/OutlinedTimePicker/README.md +93 -0
- package/src/components/OutlinedTimePicker/index.d.ts +3 -0
- package/src/components/OutlinedTimePicker/index.ts +10 -0
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +46 -0
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.ts +56 -0
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue +354 -0
- package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +137 -0
- package/src/components/OutlinedTreeSelect/README.md +107 -0
- package/src/components/OutlinedTreeSelect/index.d.ts +3 -0
- package/src/components/OutlinedTreeSelect/index.ts +12 -0
- package/src/echarts/index.d.ts +9 -0
- package/src/echarts/index.ts +13 -8
- package/src/excel/exportExcel.d.ts +18 -0
- package/src/index.d.ts +26 -0
- package/src/index.ts +14 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as echarts from "echarts";
|
|
2
2
|
export { echarts };
|
|
3
|
-
import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, renderSlot, toDisplayString, ref, reactive, watch, onMounted, resolveComponent, resolveDirective, createVNode, withDirectives, createBlock, withCtx, Fragment, renderList, createSlots, createTextVNode, mergeProps, shallowRef, nextTick, onUnmounted } from "vue";
|
|
3
|
+
import { defineComponent, useSlots, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, renderSlot, toDisplayString, ref, reactive, watch, onMounted, resolveComponent, resolveDirective, createVNode, withDirectives, createBlock, withCtx, Fragment, renderList, createSlots, createTextVNode, mergeProps, withModifiers, withKeys, normalizeClass, shallowRef, nextTick, onUnmounted, useAttrs, normalizeProps, guardReactiveProps } from "vue";
|
|
4
4
|
import { ElMessage } from "element-plus";
|
|
5
5
|
import ExcelJS from "exceljs";
|
|
6
6
|
import { saveAs } from "file-saver";
|
|
@@ -12,7 +12,7 @@ var _export_sfc = (sfc, props) => {
|
|
|
12
12
|
}
|
|
13
13
|
return target;
|
|
14
14
|
};
|
|
15
|
-
const _hoisted_1$
|
|
15
|
+
const _hoisted_1$3 = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "base-card__header"
|
|
18
18
|
};
|
|
@@ -43,8 +43,8 @@ const _hoisted_10$1 = {
|
|
|
43
43
|
key: 0,
|
|
44
44
|
class: "base-card__tip"
|
|
45
45
|
};
|
|
46
|
-
const _hoisted_11 = { class: "base-card__content" };
|
|
47
|
-
const _sfc_main$
|
|
46
|
+
const _hoisted_11$1 = { class: "base-card__content" };
|
|
47
|
+
const _sfc_main$a = defineComponent({
|
|
48
48
|
...{
|
|
49
49
|
name: "BaseCard"
|
|
50
50
|
},
|
|
@@ -140,7 +140,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
140
140
|
class: "base-card",
|
|
141
141
|
style: normalizeStyle(cardStyles.value)
|
|
142
142
|
}, [
|
|
143
|
-
shouldRenderHeader.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
143
|
+
shouldRenderHeader.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
144
144
|
createElementVNode("div", _hoisted_2$1, [
|
|
145
145
|
hasTitleBlock.value ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
146
146
|
__props.showTitleMarker ? (openBlock(), createElementBlock("span", _hoisted_4$1)) : createCommentVNode("", true),
|
|
@@ -164,7 +164,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
164
164
|
_ctx.$slots.tip ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
|
|
165
165
|
renderSlot(_ctx.$slots, "tip", {}, void 0, true)
|
|
166
166
|
])) : createCommentVNode("", true),
|
|
167
|
-
createElementVNode("div", _hoisted_11, [
|
|
167
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
168
168
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
169
169
|
])
|
|
170
170
|
])
|
|
@@ -172,9 +172,9 @@ const _sfc_main$3 = defineComponent({
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
|
-
var BaseCard = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
175
|
+
var BaseCard = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-6bfddf1c"]]);
|
|
176
176
|
var BaseTable_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
177
|
-
const _hoisted_1 = { class: "base-table" };
|
|
177
|
+
const _hoisted_1$2 = { class: "base-table" };
|
|
178
178
|
const _hoisted_2 = {
|
|
179
179
|
key: 0,
|
|
180
180
|
class: "base-table__toolbar"
|
|
@@ -184,22 +184,26 @@ const _hoisted_4 = {
|
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "base-table__toolbar-right"
|
|
186
186
|
};
|
|
187
|
-
const _hoisted_5 = {
|
|
187
|
+
const _hoisted_5 = { class: "base-table__header" };
|
|
188
|
+
const _hoisted_6 = { class: "base-table__header-label" };
|
|
189
|
+
const _hoisted_7 = { class: "base-table__header-actions" };
|
|
190
|
+
const _hoisted_8 = { class: "base-table__header-search-footer" };
|
|
191
|
+
const _hoisted_9 = {
|
|
188
192
|
key: 0,
|
|
189
193
|
class: "base-table__actions"
|
|
190
194
|
};
|
|
191
|
-
const
|
|
195
|
+
const _hoisted_10 = {
|
|
192
196
|
key: 2,
|
|
193
197
|
class: "base-table__tags"
|
|
194
198
|
};
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
+
const _hoisted_11 = { key: 1 };
|
|
200
|
+
const _hoisted_12 = ["innerHTML"];
|
|
201
|
+
const _hoisted_13 = ["onClick"];
|
|
202
|
+
const _hoisted_14 = {
|
|
199
203
|
key: 6,
|
|
200
204
|
class: "base-table__text"
|
|
201
205
|
};
|
|
202
|
-
const _sfc_main$
|
|
206
|
+
const _sfc_main$9 = defineComponent({
|
|
203
207
|
...{
|
|
204
208
|
name: "BaseTable"
|
|
205
209
|
},
|
|
@@ -250,8 +254,11 @@ const _sfc_main$2 = defineComponent({
|
|
|
250
254
|
const slots = useSlots();
|
|
251
255
|
const tableRef = ref();
|
|
252
256
|
const loading = ref(false);
|
|
257
|
+
const sourceRows = ref(normalizeRows(props.data));
|
|
253
258
|
const rows = ref(normalizeRows(props.data));
|
|
254
259
|
const selectionRows = ref([]);
|
|
260
|
+
const headerSearchValues = reactive({});
|
|
261
|
+
const headerSearchDropdownRefs = ref({});
|
|
255
262
|
const sortState = reactive({
|
|
256
263
|
prop: (_a = props.defaultSort) == null ? void 0 : _a.prop,
|
|
257
264
|
order: ((_b = props.defaultSort) == null ? void 0 : _b.order) || null
|
|
@@ -309,24 +316,20 @@ const _sfc_main$2 = defineComponent({
|
|
|
309
316
|
{ deep: true }
|
|
310
317
|
);
|
|
311
318
|
onMounted(() => {
|
|
312
|
-
var _a2;
|
|
313
319
|
if (props.request && props.autoLoad) {
|
|
314
320
|
void load();
|
|
315
321
|
return;
|
|
316
322
|
}
|
|
317
323
|
if (!props.request) {
|
|
318
|
-
|
|
319
|
-
if (!((_a2 = props.pagination) == null ? void 0 : _a2.total)) {
|
|
320
|
-
paginationState.total = rows.value.length;
|
|
321
|
-
emitPagination();
|
|
322
|
-
}
|
|
324
|
+
setData(props.data || []);
|
|
323
325
|
}
|
|
324
326
|
});
|
|
325
327
|
function syncPagination(value) {
|
|
328
|
+
const nextPageSizes = value == null ? void 0 : value.pageSizes;
|
|
326
329
|
paginationState.currentPage = Number((value == null ? void 0 : value.currentPage) || paginationState.currentPage || 1);
|
|
327
330
|
paginationState.pageSize = Number((value == null ? void 0 : value.pageSize) || paginationState.pageSize || 20);
|
|
328
331
|
paginationState.total = Number((value == null ? void 0 : value.total) || (value == null ? void 0 : value.total) === 0 ? value.total : paginationState.total || rows.value.length);
|
|
329
|
-
paginationState.pageSizes = Array.isArray(
|
|
332
|
+
paginationState.pageSizes = Array.isArray(nextPageSizes) && nextPageSizes.length ? [...nextPageSizes] : [...paginationState.pageSizes.length ? paginationState.pageSizes : [10, 20, 50, 100]];
|
|
330
333
|
}
|
|
331
334
|
function emitPagination() {
|
|
332
335
|
emit("update:pagination", {
|
|
@@ -342,7 +345,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
342
345
|
return;
|
|
343
346
|
}
|
|
344
347
|
if (!props.request) {
|
|
345
|
-
|
|
348
|
+
applyLocalRows();
|
|
346
349
|
return;
|
|
347
350
|
}
|
|
348
351
|
loading.value = true;
|
|
@@ -368,6 +371,10 @@ const _sfc_main$2 = defineComponent({
|
|
|
368
371
|
}
|
|
369
372
|
}
|
|
370
373
|
async function refresh() {
|
|
374
|
+
if (!props.request) {
|
|
375
|
+
applyLocalRows();
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
371
378
|
await load();
|
|
372
379
|
}
|
|
373
380
|
async function resetPage() {
|
|
@@ -376,12 +383,8 @@ const _sfc_main$2 = defineComponent({
|
|
|
376
383
|
await load();
|
|
377
384
|
}
|
|
378
385
|
function setData(data) {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
if (!props.request) {
|
|
382
|
-
paginationState.total = Number((_b2 = (_a2 = props.pagination) == null ? void 0 : _a2.total) != null ? _b2 : rows.value.length);
|
|
383
|
-
emitPagination();
|
|
384
|
-
}
|
|
386
|
+
sourceRows.value = normalizeRows(data);
|
|
387
|
+
applyLocalRows();
|
|
385
388
|
}
|
|
386
389
|
function clearSelection() {
|
|
387
390
|
var _a2;
|
|
@@ -460,6 +463,146 @@ const _sfc_main$2 = defineComponent({
|
|
|
460
463
|
value
|
|
461
464
|
});
|
|
462
465
|
}
|
|
466
|
+
function shouldRenderBuiltInHeader(column) {
|
|
467
|
+
return hasHeaderSearch(column);
|
|
468
|
+
}
|
|
469
|
+
function hasHeaderSearch(column) {
|
|
470
|
+
return Boolean(getHeaderSearchConfig(column));
|
|
471
|
+
}
|
|
472
|
+
function getHeaderSearchConfig(column) {
|
|
473
|
+
if (!column.headerSearch) {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
if (column.headerSearch === true) {
|
|
477
|
+
return {};
|
|
478
|
+
}
|
|
479
|
+
return column.headerSearch;
|
|
480
|
+
}
|
|
481
|
+
function getHeaderSearchStateKey(column) {
|
|
482
|
+
return resolveHeaderSearchParamKey(column) || getColumnProp(column) || getColumnKey(column);
|
|
483
|
+
}
|
|
484
|
+
function setHeaderSearchDropdownRef(instance, column) {
|
|
485
|
+
const stateKey = getHeaderSearchStateKey(column);
|
|
486
|
+
if (!instance) {
|
|
487
|
+
delete headerSearchDropdownRefs.value[stateKey];
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
headerSearchDropdownRefs.value[stateKey] = instance;
|
|
491
|
+
}
|
|
492
|
+
function bindHeaderSearchDropdown(column) {
|
|
493
|
+
return (instance) => {
|
|
494
|
+
setHeaderSearchDropdownRef(instance, column);
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
function resolveHeaderSearchParamKey(column) {
|
|
498
|
+
const config = getHeaderSearchConfig(column);
|
|
499
|
+
const legacyParamKey = column.otherProps;
|
|
500
|
+
return (config == null ? void 0 : config.paramKey) || legacyParamKey || getColumnProp(column) || "";
|
|
501
|
+
}
|
|
502
|
+
function getHeaderSearchValue(column) {
|
|
503
|
+
return headerSearchValues[getHeaderSearchStateKey(column)] || "";
|
|
504
|
+
}
|
|
505
|
+
function hasHeaderSearchValue(column) {
|
|
506
|
+
return Boolean(getHeaderSearchValue(column).trim());
|
|
507
|
+
}
|
|
508
|
+
function updateHeaderSearchValue(column, value) {
|
|
509
|
+
headerSearchValues[getHeaderSearchStateKey(column)] = normalizeHeaderSearchValue(value);
|
|
510
|
+
}
|
|
511
|
+
function getHeaderSearchPlaceholder(column) {
|
|
512
|
+
var _a2;
|
|
513
|
+
return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.placeholder) || "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9";
|
|
514
|
+
}
|
|
515
|
+
function getHeaderSearchWidth(column) {
|
|
516
|
+
var _a2;
|
|
517
|
+
return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.width) || 280;
|
|
518
|
+
}
|
|
519
|
+
function getHeaderSearchSearchText(column) {
|
|
520
|
+
var _a2;
|
|
521
|
+
return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.searchText) || "\u641C\u7D22";
|
|
522
|
+
}
|
|
523
|
+
function getHeaderSearchResetText(column) {
|
|
524
|
+
var _a2;
|
|
525
|
+
return ((_a2 = getHeaderSearchConfig(column)) == null ? void 0 : _a2.resetText) || "\u91CD\u7F6E";
|
|
526
|
+
}
|
|
527
|
+
async function handleHeaderSearch(column) {
|
|
528
|
+
closeHeaderSearch(column);
|
|
529
|
+
paginationState.currentPage = 1;
|
|
530
|
+
emitPagination();
|
|
531
|
+
if (props.request) {
|
|
532
|
+
await load();
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
applyLocalRows();
|
|
536
|
+
}
|
|
537
|
+
async function handleHeaderSearchReset(column) {
|
|
538
|
+
updateHeaderSearchValue(column, "");
|
|
539
|
+
closeHeaderSearch(column);
|
|
540
|
+
paginationState.currentPage = 1;
|
|
541
|
+
emitPagination();
|
|
542
|
+
if (props.request) {
|
|
543
|
+
await load();
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
applyLocalRows();
|
|
547
|
+
}
|
|
548
|
+
function closeHeaderSearch(column) {
|
|
549
|
+
var _a2, _b2;
|
|
550
|
+
(_b2 = (_a2 = headerSearchDropdownRefs.value[getHeaderSearchStateKey(column)]) == null ? void 0 : _a2.handleClose) == null ? void 0 : _b2.call(_a2);
|
|
551
|
+
}
|
|
552
|
+
function buildHeaderSearchParams() {
|
|
553
|
+
return props.columns.reduce((result, column) => {
|
|
554
|
+
if (!hasHeaderSearch(column)) {
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
const paramKey = resolveHeaderSearchParamKey(column);
|
|
558
|
+
const value = getHeaderSearchValue(column).trim();
|
|
559
|
+
if (!paramKey || !value) {
|
|
560
|
+
return result;
|
|
561
|
+
}
|
|
562
|
+
result[paramKey] = value;
|
|
563
|
+
return result;
|
|
564
|
+
}, {});
|
|
565
|
+
}
|
|
566
|
+
function applyLocalRows() {
|
|
567
|
+
const filteredRows = filterLocalRows(sourceRows.value);
|
|
568
|
+
rows.value = filteredRows;
|
|
569
|
+
paginationState.total = filteredRows.length;
|
|
570
|
+
emitPagination();
|
|
571
|
+
}
|
|
572
|
+
function filterLocalRows(data) {
|
|
573
|
+
const activeColumns = props.columns.filter((column) => hasHeaderSearch(column) && hasHeaderSearchValue(column)).map((column) => ({
|
|
574
|
+
column,
|
|
575
|
+
keyword: getHeaderSearchValue(column).trim().toLowerCase()
|
|
576
|
+
}));
|
|
577
|
+
if (!activeColumns.length) {
|
|
578
|
+
return normalizeRows(data);
|
|
579
|
+
}
|
|
580
|
+
return normalizeRows(data).filter((row) => {
|
|
581
|
+
return activeColumns.every(({ column, keyword }) => {
|
|
582
|
+
const columnProp = getColumnProp(column);
|
|
583
|
+
if (!columnProp) {
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
const value = getCellValue2(row, column);
|
|
587
|
+
return toSearchableText(value).includes(keyword);
|
|
588
|
+
});
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
function normalizeHeaderSearchValue(value) {
|
|
592
|
+
if (value === void 0 || value === null) {
|
|
593
|
+
return "";
|
|
594
|
+
}
|
|
595
|
+
return String(value);
|
|
596
|
+
}
|
|
597
|
+
function toSearchableText(value) {
|
|
598
|
+
if (value === void 0 || value === null) {
|
|
599
|
+
return "";
|
|
600
|
+
}
|
|
601
|
+
if (Array.isArray(value)) {
|
|
602
|
+
return value.map((item) => toSearchableText(item)).join(" ").toLowerCase();
|
|
603
|
+
}
|
|
604
|
+
return String(value).toLowerCase();
|
|
605
|
+
}
|
|
463
606
|
function buildRequestParams() {
|
|
464
607
|
const params = {
|
|
465
608
|
...props.requestParams,
|
|
@@ -470,9 +613,11 @@ const _sfc_main$2 = defineComponent({
|
|
|
470
613
|
};
|
|
471
614
|
const currentColumn = props.columns.find((item) => String(item.prop || "") === String(sortState.prop || ""));
|
|
472
615
|
const sortPayload = buildSortPayload(currentColumn, sortState.prop, sortState.order);
|
|
616
|
+
const headerSearchParams = buildHeaderSearchParams();
|
|
473
617
|
const sortParams = buildSortParams(sortPayload);
|
|
474
618
|
return {
|
|
475
619
|
...params,
|
|
620
|
+
...headerSearchParams,
|
|
476
621
|
...sortParams
|
|
477
622
|
};
|
|
478
623
|
}
|
|
@@ -669,11 +814,66 @@ const _sfc_main$2 = defineComponent({
|
|
|
669
814
|
}
|
|
670
815
|
return typeof value === "number" ? `${value}px` : value;
|
|
671
816
|
}
|
|
817
|
+
function findHeaderSearchColumn(key) {
|
|
818
|
+
return props.columns.find((column) => {
|
|
819
|
+
return getHeaderSearchStateKey(column) === key || getColumnProp(column) === key;
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
async function setHeaderSearchValue(key, value, shouldReload = true) {
|
|
823
|
+
const matchedColumn = findHeaderSearchColumn(key);
|
|
824
|
+
const stateKey = matchedColumn ? getHeaderSearchStateKey(matchedColumn) : key;
|
|
825
|
+
headerSearchValues[stateKey] = normalizeHeaderSearchValue(value);
|
|
826
|
+
if (!shouldReload) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (matchedColumn) {
|
|
830
|
+
await handleHeaderSearch(matchedColumn);
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
paginationState.currentPage = 1;
|
|
834
|
+
emitPagination();
|
|
835
|
+
if (props.request) {
|
|
836
|
+
await load();
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
applyLocalRows();
|
|
840
|
+
}
|
|
841
|
+
async function resetHeaderSearch(key) {
|
|
842
|
+
if (key) {
|
|
843
|
+
const matchedColumn = findHeaderSearchColumn(key);
|
|
844
|
+
if (matchedColumn) {
|
|
845
|
+
await handleHeaderSearchReset(matchedColumn);
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
delete headerSearchValues[key];
|
|
849
|
+
} else {
|
|
850
|
+
Object.keys(headerSearchValues).forEach((stateKey) => {
|
|
851
|
+
delete headerSearchValues[stateKey];
|
|
852
|
+
});
|
|
853
|
+
Object.keys(headerSearchDropdownRefs.value).forEach((stateKey) => {
|
|
854
|
+
var _a2, _b2;
|
|
855
|
+
(_b2 = (_a2 = headerSearchDropdownRefs.value[stateKey]) == null ? void 0 : _a2.handleClose) == null ? void 0 : _b2.call(_a2);
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
paginationState.currentPage = 1;
|
|
859
|
+
emitPagination();
|
|
860
|
+
if (props.request) {
|
|
861
|
+
await load();
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
applyLocalRows();
|
|
865
|
+
}
|
|
866
|
+
function getHeaderSearchValues() {
|
|
867
|
+
return { ...headerSearchValues };
|
|
868
|
+
}
|
|
672
869
|
__expose({
|
|
673
870
|
load,
|
|
674
871
|
refresh,
|
|
675
872
|
setData,
|
|
676
873
|
resetPage,
|
|
874
|
+
setHeaderSearchValue,
|
|
875
|
+
resetHeaderSearch,
|
|
876
|
+
getHeaderSearchValues,
|
|
677
877
|
clearSelection,
|
|
678
878
|
toggleRowSelection,
|
|
679
879
|
getSelectionRows,
|
|
@@ -683,13 +883,15 @@ const _sfc_main$2 = defineComponent({
|
|
|
683
883
|
const _component_el_pagination = resolveComponent("el-pagination");
|
|
684
884
|
const _component_el_empty = resolveComponent("el-empty");
|
|
685
885
|
const _component_el_table_column = resolveComponent("el-table-column");
|
|
886
|
+
const _component_el_input = resolveComponent("el-input");
|
|
686
887
|
const _component_el_button = resolveComponent("el-button");
|
|
888
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
889
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
687
890
|
const _component_el_image = resolveComponent("el-image");
|
|
688
891
|
const _component_el_tag = resolveComponent("el-tag");
|
|
689
|
-
const _component_el_input = resolveComponent("el-input");
|
|
690
892
|
const _component_el_table = resolveComponent("el-table");
|
|
691
893
|
const _directive_loading = resolveDirective("loading");
|
|
692
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
894
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
693
895
|
shouldRenderToolbar.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
694
896
|
createElementVNode("div", _hoisted_3, [
|
|
695
897
|
renderSlot(_ctx.$slots, "toolbar", {}, void 0, true)
|
|
@@ -766,7 +968,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
766
968
|
columnIndex: scope.$index,
|
|
767
969
|
value: getCellValue2(scope.row, column)
|
|
768
970
|
}, void 0, true) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
769
|
-
isActionColumn(column) ? (openBlock(), createElementBlock("div",
|
|
971
|
+
isActionColumn(column) ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
770
972
|
(openBlock(true), createElementBlock(Fragment, null, renderList(getVisibleActions(column, scope.row), (action) => {
|
|
771
973
|
return openBlock(), createBlock(_component_el_button, {
|
|
772
974
|
key: `${action.type}-${action.label}`,
|
|
@@ -788,7 +990,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
788
990
|
src: toImageSrc(getCellValue2(scope.row, column)),
|
|
789
991
|
"preview-src-list": getPreviewSrcList(scope.row, column),
|
|
790
992
|
fit: column.imageFit || "cover"
|
|
791
|
-
}, null, 8, ["style", "src", "preview-src-list", "fit"])) : column.kind === "tag" ? (openBlock(), createElementBlock("div",
|
|
993
|
+
}, null, 8, ["style", "src", "preview-src-list", "fit"])) : column.kind === "tag" ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
792
994
|
getMatchedOptions(scope.row, column).length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(getMatchedOptions(scope.row, column), (option) => {
|
|
793
995
|
return openBlock(), createBlock(_component_el_tag, {
|
|
794
996
|
key: String(option.value),
|
|
@@ -801,11 +1003,11 @@ const _sfc_main$2 = defineComponent({
|
|
|
801
1003
|
]),
|
|
802
1004
|
_: 2
|
|
803
1005
|
}, 1032, ["type", "style"]);
|
|
804
|
-
}), 128)) : (openBlock(), createElementBlock("span",
|
|
1006
|
+
}), 128)) : (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(resolveEmptyText(column)), 1))
|
|
805
1007
|
])) : column.kind === "html" ? (openBlock(), createElementBlock("div", {
|
|
806
1008
|
key: 3,
|
|
807
1009
|
innerHTML: getHtmlContent(scope.row, column)
|
|
808
|
-
}, null, 8,
|
|
1010
|
+
}, null, 8, _hoisted_12)) : column.kind === "input" ? (openBlock(), createBlock(_component_el_input, {
|
|
809
1011
|
key: 4,
|
|
810
1012
|
"model-value": toDisplayValue(getCellValue2(scope.row, column), ""),
|
|
811
1013
|
type: column.inputType || "text",
|
|
@@ -815,7 +1017,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
815
1017
|
class: "base-table__link",
|
|
816
1018
|
type: "button",
|
|
817
1019
|
onClick: ($event) => handleCellClick(scope.row, column)
|
|
818
|
-
}, toDisplayString(formatCellDisplay(scope.row, column)), 9,
|
|
1020
|
+
}, toDisplayString(formatCellDisplay(scope.row, column)), 9, _hoisted_13)) : (openBlock(), createElementBlock("div", _hoisted_14, toDisplayString(formatCellDisplay(scope.row, column)), 1))
|
|
819
1021
|
], 64))
|
|
820
1022
|
]),
|
|
821
1023
|
_: 2
|
|
@@ -826,6 +1028,80 @@ const _sfc_main$2 = defineComponent({
|
|
|
826
1028
|
renderSlot(_ctx.$slots, resolveHeaderSlotName(column), mergeProps({ ref_for: true }, headerScope, { columnConfig: column }), void 0, true)
|
|
827
1029
|
]),
|
|
828
1030
|
key: "0"
|
|
1031
|
+
} : shouldRenderBuiltInHeader(column) ? {
|
|
1032
|
+
name: "header",
|
|
1033
|
+
fn: withCtx(() => [
|
|
1034
|
+
createElementVNode("div", _hoisted_5, [
|
|
1035
|
+
createElementVNode("span", _hoisted_6, toDisplayString(column.label), 1),
|
|
1036
|
+
createElementVNode("div", _hoisted_7, [
|
|
1037
|
+
createVNode(_component_el_dropdown, {
|
|
1038
|
+
ref_for: true,
|
|
1039
|
+
ref: bindHeaderSearchDropdown(column),
|
|
1040
|
+
class: "base-table__header-dropdown",
|
|
1041
|
+
trigger: "click",
|
|
1042
|
+
"hide-on-click": false,
|
|
1043
|
+
placement: "bottom",
|
|
1044
|
+
"popper-class": "base-table__header-search-dropdown"
|
|
1045
|
+
}, {
|
|
1046
|
+
dropdown: withCtx(() => [
|
|
1047
|
+
createVNode(_component_el_dropdown_menu, { class: "base-table__header-search-menu" }, {
|
|
1048
|
+
default: withCtx(() => [
|
|
1049
|
+
createElementVNode("div", {
|
|
1050
|
+
class: "base-table__header-search-panel",
|
|
1051
|
+
style: normalizeStyle({ width: toCssValue(getHeaderSearchWidth(column)) || "280px" }),
|
|
1052
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1053
|
+
}, ["stop"]))
|
|
1054
|
+
}, [
|
|
1055
|
+
createVNode(_component_el_input, {
|
|
1056
|
+
"model-value": getHeaderSearchValue(column),
|
|
1057
|
+
placeholder: getHeaderSearchPlaceholder(column),
|
|
1058
|
+
clearable: "",
|
|
1059
|
+
"onUpdate:modelValue": ($event) => updateHeaderSearchValue(column, $event),
|
|
1060
|
+
onKeyup: withKeys(($event) => handleHeaderSearch(column), ["enter"])
|
|
1061
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue", "onKeyup"]),
|
|
1062
|
+
createElementVNode("div", _hoisted_8, [
|
|
1063
|
+
createVNode(_component_el_button, {
|
|
1064
|
+
link: "",
|
|
1065
|
+
type: "primary",
|
|
1066
|
+
onClick: ($event) => handleHeaderSearch(column)
|
|
1067
|
+
}, {
|
|
1068
|
+
default: withCtx(() => [
|
|
1069
|
+
createTextVNode(toDisplayString(getHeaderSearchSearchText(column)), 1)
|
|
1070
|
+
]),
|
|
1071
|
+
_: 2
|
|
1072
|
+
}, 1032, ["onClick"]),
|
|
1073
|
+
createVNode(_component_el_button, {
|
|
1074
|
+
link: "",
|
|
1075
|
+
onClick: ($event) => handleHeaderSearchReset(column)
|
|
1076
|
+
}, {
|
|
1077
|
+
default: withCtx(() => [
|
|
1078
|
+
createTextVNode(toDisplayString(getHeaderSearchResetText(column)), 1)
|
|
1079
|
+
]),
|
|
1080
|
+
_: 2
|
|
1081
|
+
}, 1032, ["onClick"])
|
|
1082
|
+
])
|
|
1083
|
+
], 4)
|
|
1084
|
+
]),
|
|
1085
|
+
_: 2
|
|
1086
|
+
}, 1024)
|
|
1087
|
+
]),
|
|
1088
|
+
default: withCtx(() => [
|
|
1089
|
+
createElementVNode("button", {
|
|
1090
|
+
class: normalizeClass(["base-table__header-icon", { "is-active": hasHeaderSearchValue(column) }]),
|
|
1091
|
+
type: "button"
|
|
1092
|
+
}, [..._cache[1] || (_cache[1] = [
|
|
1093
|
+
createElementVNode("span", {
|
|
1094
|
+
class: "base-table__header-icon-mark",
|
|
1095
|
+
"aria-hidden": "true"
|
|
1096
|
+
}, null, -1)
|
|
1097
|
+
])], 2)
|
|
1098
|
+
]),
|
|
1099
|
+
_: 2
|
|
1100
|
+
}, 1536)
|
|
1101
|
+
])
|
|
1102
|
+
])
|
|
1103
|
+
]),
|
|
1104
|
+
key: "1"
|
|
829
1105
|
} : void 0
|
|
830
1106
|
]), 1032, ["prop", "label", "type", "width", "min-width", "fixed", "align", "header-align", "sortable", "show-overflow-tooltip", "class-name", "label-class-name"]);
|
|
831
1107
|
}), 128))
|
|
@@ -838,9 +1114,9 @@ const _sfc_main$2 = defineComponent({
|
|
|
838
1114
|
};
|
|
839
1115
|
}
|
|
840
1116
|
});
|
|
841
|
-
var BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1117
|
+
var BaseTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-7ae8d382"]]);
|
|
842
1118
|
var BaseEChart_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
843
|
-
const _sfc_main$
|
|
1119
|
+
const _sfc_main$8 = defineComponent({
|
|
844
1120
|
__name: "BaseEChart",
|
|
845
1121
|
props: {
|
|
846
1122
|
option: { default: () => ({}) },
|
|
@@ -1113,7 +1389,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
1113
1389
|
};
|
|
1114
1390
|
}
|
|
1115
1391
|
});
|
|
1116
|
-
var BaseEChart = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1392
|
+
var BaseEChart = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-51bc4772"]]);
|
|
1117
1393
|
const DEFAULT_SHEET_NAME = "Sheet1";
|
|
1118
1394
|
const DEFAULT_COLUMN_WIDTH = 16;
|
|
1119
1395
|
const EXCEL_MIME_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
@@ -1281,7 +1557,7 @@ function downloadExportResponse(response, fallbackFileName = "") {
|
|
|
1281
1557
|
saveAs(toBlob(response.data), fileName);
|
|
1282
1558
|
return fileName;
|
|
1283
1559
|
}
|
|
1284
|
-
const _sfc_main = defineComponent({
|
|
1560
|
+
const _sfc_main$7 = defineComponent({
|
|
1285
1561
|
__name: "BaseExportButton",
|
|
1286
1562
|
props: {
|
|
1287
1563
|
label: {
|
|
@@ -1433,4 +1709,1868 @@ const _sfc_main = defineComponent({
|
|
|
1433
1709
|
};
|
|
1434
1710
|
}
|
|
1435
1711
|
});
|
|
1436
|
-
|
|
1712
|
+
var OutlinedInput_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1713
|
+
const _hoisted_1$1 = { class: "outlined-input__suffix-text" };
|
|
1714
|
+
const _sfc_main$6 = defineComponent({
|
|
1715
|
+
...{
|
|
1716
|
+
name: "OutlinedInput",
|
|
1717
|
+
inheritAttrs: false
|
|
1718
|
+
},
|
|
1719
|
+
__name: "OutlinedInput",
|
|
1720
|
+
props: {
|
|
1721
|
+
value: { default: "" },
|
|
1722
|
+
disabled: { type: Boolean, default: false },
|
|
1723
|
+
regex: {},
|
|
1724
|
+
placeholder: { default: "" },
|
|
1725
|
+
label: { default: "" },
|
|
1726
|
+
maxlength: {},
|
|
1727
|
+
max: {},
|
|
1728
|
+
min: {},
|
|
1729
|
+
typeInput: { default: "text" },
|
|
1730
|
+
showPassword: { type: Boolean, default: false },
|
|
1731
|
+
isNumber: { type: Boolean, default: false },
|
|
1732
|
+
inputHeight: { default: 40 },
|
|
1733
|
+
isBorder: { type: Boolean, default: false },
|
|
1734
|
+
suffixText: { default: "" },
|
|
1735
|
+
clearable: { type: Boolean, default: false },
|
|
1736
|
+
showWordLimit: { type: Boolean, default: true },
|
|
1737
|
+
marginBottom: { default: 20 },
|
|
1738
|
+
paddingTop: { default: 20 }
|
|
1739
|
+
},
|
|
1740
|
+
emits: ["input", "update:value", "warning", "focus", "blur", "change", "clear"],
|
|
1741
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1742
|
+
var _a;
|
|
1743
|
+
const DEFAULT_REGEX = /^\d+$/;
|
|
1744
|
+
const props = __props;
|
|
1745
|
+
const emit = __emit;
|
|
1746
|
+
const attrs = useAttrs();
|
|
1747
|
+
const inputRef = ref(null);
|
|
1748
|
+
const inputValue = ref((_a = props.value) != null ? _a : "");
|
|
1749
|
+
const focused = ref(false);
|
|
1750
|
+
watch(
|
|
1751
|
+
() => props.value,
|
|
1752
|
+
(value) => {
|
|
1753
|
+
inputValue.value = value != null ? value : "";
|
|
1754
|
+
},
|
|
1755
|
+
{ immediate: true }
|
|
1756
|
+
);
|
|
1757
|
+
const rootClass = computed(() => attrs.class);
|
|
1758
|
+
const rootStyle = computed(() => attrs.style);
|
|
1759
|
+
const inputAttrs = computed(() => {
|
|
1760
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
1761
|
+
return rest;
|
|
1762
|
+
});
|
|
1763
|
+
const resolvedType = computed(() => props.typeInput || "text");
|
|
1764
|
+
const hasTextareaAutosize = computed(() => {
|
|
1765
|
+
const autosize = inputAttrs.value.autosize;
|
|
1766
|
+
return autosize !== void 0 && autosize !== false;
|
|
1767
|
+
});
|
|
1768
|
+
const containerClasses = computed(() => ({
|
|
1769
|
+
"outlined-input--bordered": props.isBorder,
|
|
1770
|
+
"outlined-input--textarea-default": resolvedType.value === "textarea" && !hasTextareaAutosize.value
|
|
1771
|
+
}));
|
|
1772
|
+
const containerStyle = computed(() => ({
|
|
1773
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
1774
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
1775
|
+
}));
|
|
1776
|
+
const inputStyle = computed(() => {
|
|
1777
|
+
if (resolvedType.value === "textarea") {
|
|
1778
|
+
return void 0;
|
|
1779
|
+
}
|
|
1780
|
+
return {
|
|
1781
|
+
height: `${props.inputHeight}px`
|
|
1782
|
+
};
|
|
1783
|
+
});
|
|
1784
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
1785
|
+
const hasContent = computed(() => hasFilledValue(inputValue.value));
|
|
1786
|
+
const labelClasses = computed(() => ({
|
|
1787
|
+
"outlined-input__label--floating": focused.value || hasContent.value,
|
|
1788
|
+
"outlined-input__label--placeholder": !focused.value && !hasContent.value,
|
|
1789
|
+
"outlined-input__label--filled": hasContent.value && !focused.value
|
|
1790
|
+
}));
|
|
1791
|
+
function handleModelValueUpdate(value) {
|
|
1792
|
+
const normalizedValue = normalizeValue(value);
|
|
1793
|
+
inputValue.value = normalizedValue;
|
|
1794
|
+
emitModelValue(normalizedValue);
|
|
1795
|
+
}
|
|
1796
|
+
function handleFocus(event) {
|
|
1797
|
+
focused.value = true;
|
|
1798
|
+
emit("focus", event);
|
|
1799
|
+
}
|
|
1800
|
+
function handleBlur(event) {
|
|
1801
|
+
focused.value = false;
|
|
1802
|
+
emitModelValue(inputValue.value);
|
|
1803
|
+
emit("blur", event);
|
|
1804
|
+
}
|
|
1805
|
+
function handleChange(value) {
|
|
1806
|
+
const normalizedValue = normalizeValue(value);
|
|
1807
|
+
inputValue.value = normalizedValue;
|
|
1808
|
+
emit("change", normalizedValue);
|
|
1809
|
+
}
|
|
1810
|
+
function handleClear() {
|
|
1811
|
+
emit("clear");
|
|
1812
|
+
}
|
|
1813
|
+
function emitModelValue(value) {
|
|
1814
|
+
emit("input", value);
|
|
1815
|
+
emit("update:value", value);
|
|
1816
|
+
}
|
|
1817
|
+
function normalizeValue(value) {
|
|
1818
|
+
const normalizedValue = value != null ? value : "";
|
|
1819
|
+
if (!props.isNumber) {
|
|
1820
|
+
return normalizedValue;
|
|
1821
|
+
}
|
|
1822
|
+
const nextText = String(normalizedValue);
|
|
1823
|
+
if (!nextText) {
|
|
1824
|
+
return "";
|
|
1825
|
+
}
|
|
1826
|
+
const regex = props.regex || DEFAULT_REGEX;
|
|
1827
|
+
if (!regex.test(nextText)) {
|
|
1828
|
+
emit("warning", nextText);
|
|
1829
|
+
return "";
|
|
1830
|
+
}
|
|
1831
|
+
return normalizedValue;
|
|
1832
|
+
}
|
|
1833
|
+
function hasFilledValue(value) {
|
|
1834
|
+
return value !== void 0 && value !== null && String(value) !== "";
|
|
1835
|
+
}
|
|
1836
|
+
function toCssValue(value) {
|
|
1837
|
+
if (typeof value === "number") {
|
|
1838
|
+
return `${value}px`;
|
|
1839
|
+
}
|
|
1840
|
+
return value;
|
|
1841
|
+
}
|
|
1842
|
+
__expose({
|
|
1843
|
+
focus: () => {
|
|
1844
|
+
var _a2;
|
|
1845
|
+
(_a2 = inputRef.value) == null ? void 0 : _a2.focus();
|
|
1846
|
+
},
|
|
1847
|
+
blur: () => {
|
|
1848
|
+
var _a2;
|
|
1849
|
+
(_a2 = inputRef.value) == null ? void 0 : _a2.blur();
|
|
1850
|
+
},
|
|
1851
|
+
clear: () => {
|
|
1852
|
+
var _a2;
|
|
1853
|
+
(_a2 = inputRef.value) == null ? void 0 : _a2.clear();
|
|
1854
|
+
},
|
|
1855
|
+
select: () => {
|
|
1856
|
+
var _a2;
|
|
1857
|
+
(_a2 = inputRef.value) == null ? void 0 : _a2.select();
|
|
1858
|
+
},
|
|
1859
|
+
getInputRef: () => inputRef.value
|
|
1860
|
+
});
|
|
1861
|
+
return (_ctx, _cache) => {
|
|
1862
|
+
const _component_el_input = resolveComponent("el-input");
|
|
1863
|
+
return openBlock(), createElementBlock("div", {
|
|
1864
|
+
class: normalizeClass(["outlined-input", [containerClasses.value, rootClass.value]]),
|
|
1865
|
+
style: normalizeStyle([containerStyle.value, rootStyle.value])
|
|
1866
|
+
}, [
|
|
1867
|
+
createVNode(_component_el_input, mergeProps({
|
|
1868
|
+
ref_key: "inputRef",
|
|
1869
|
+
ref: inputRef
|
|
1870
|
+
}, inputAttrs.value, {
|
|
1871
|
+
"model-value": inputValue.value,
|
|
1872
|
+
type: resolvedType.value,
|
|
1873
|
+
placeholder: __props.placeholder,
|
|
1874
|
+
disabled: __props.disabled,
|
|
1875
|
+
maxlength: __props.maxlength,
|
|
1876
|
+
max: __props.max,
|
|
1877
|
+
min: __props.min,
|
|
1878
|
+
"show-password": __props.showPassword,
|
|
1879
|
+
"show-word-limit": __props.showWordLimit,
|
|
1880
|
+
clearable: __props.clearable,
|
|
1881
|
+
style: inputStyle.value,
|
|
1882
|
+
"onUpdate:modelValue": handleModelValueUpdate,
|
|
1883
|
+
onFocus: handleFocus,
|
|
1884
|
+
onBlur: handleBlur,
|
|
1885
|
+
onChange: handleChange,
|
|
1886
|
+
onClear: handleClear
|
|
1887
|
+
}), createSlots({ _: 2 }, [
|
|
1888
|
+
_ctx.$slots.prefix ? {
|
|
1889
|
+
name: "prefix",
|
|
1890
|
+
fn: withCtx(() => [
|
|
1891
|
+
renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
1892
|
+
]),
|
|
1893
|
+
key: "0"
|
|
1894
|
+
} : void 0,
|
|
1895
|
+
_ctx.$slots.prepend ? {
|
|
1896
|
+
name: "prepend",
|
|
1897
|
+
fn: withCtx(() => [
|
|
1898
|
+
renderSlot(_ctx.$slots, "prepend", {}, void 0, true)
|
|
1899
|
+
]),
|
|
1900
|
+
key: "1"
|
|
1901
|
+
} : void 0,
|
|
1902
|
+
_ctx.$slots.append ? {
|
|
1903
|
+
name: "append",
|
|
1904
|
+
fn: withCtx(() => [
|
|
1905
|
+
renderSlot(_ctx.$slots, "append", {}, void 0, true)
|
|
1906
|
+
]),
|
|
1907
|
+
key: "2"
|
|
1908
|
+
} : void 0,
|
|
1909
|
+
_ctx.$slots.suffix || __props.suffixText ? {
|
|
1910
|
+
name: "suffix",
|
|
1911
|
+
fn: withCtx(() => [
|
|
1912
|
+
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
1913
|
+
createElementVNode("span", _hoisted_1$1, toDisplayString(__props.suffixText), 1)
|
|
1914
|
+
], true)
|
|
1915
|
+
]),
|
|
1916
|
+
key: "3"
|
|
1917
|
+
} : void 0
|
|
1918
|
+
]), 1040, ["model-value", "type", "placeholder", "disabled", "maxlength", "max", "min", "show-password", "show-word-limit", "clearable", "style"]),
|
|
1919
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
1920
|
+
key: 0,
|
|
1921
|
+
class: normalizeClass(["outlined-input__label", labelClasses.value])
|
|
1922
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
1923
|
+
], 6);
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
});
|
|
1927
|
+
var OutlinedInput = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-2bf89ccd"]]);
|
|
1928
|
+
var OutlinedSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1929
|
+
const _sfc_main$5 = defineComponent({
|
|
1930
|
+
...{
|
|
1931
|
+
name: "OutlinedSelect",
|
|
1932
|
+
inheritAttrs: false
|
|
1933
|
+
},
|
|
1934
|
+
__name: "OutlinedSelect",
|
|
1935
|
+
props: {
|
|
1936
|
+
value: { type: [String, Number, Boolean, Object, null, Array], default: void 0 },
|
|
1937
|
+
options: { default: () => [] },
|
|
1938
|
+
placeholder: { default: "" },
|
|
1939
|
+
label: { default: "" },
|
|
1940
|
+
disabled: { type: Boolean, default: false },
|
|
1941
|
+
typeInput: { default: "" },
|
|
1942
|
+
showPassword: { type: Boolean, default: false },
|
|
1943
|
+
collapseTags: { type: Boolean, default: false },
|
|
1944
|
+
collapseTagsTooltip: { type: Boolean, default: true },
|
|
1945
|
+
filterable: { type: Boolean, default: true },
|
|
1946
|
+
clearable: { type: Boolean, default: true },
|
|
1947
|
+
multiple: { type: Boolean, default: false },
|
|
1948
|
+
inputHeight: { default: 40 },
|
|
1949
|
+
isBorder: { type: Boolean, default: false },
|
|
1950
|
+
keyValue: { default: "value" },
|
|
1951
|
+
labelValue: { default: "label" },
|
|
1952
|
+
noCheck: { type: Boolean, default: false },
|
|
1953
|
+
maxCollapseTags: { default: 5 },
|
|
1954
|
+
marginBottom: { default: 20 },
|
|
1955
|
+
paddingTop: { default: 20 }
|
|
1956
|
+
},
|
|
1957
|
+
emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
|
|
1958
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1959
|
+
const props = __props;
|
|
1960
|
+
const emit = __emit;
|
|
1961
|
+
const attrs = useAttrs();
|
|
1962
|
+
const slots = useSlots();
|
|
1963
|
+
const selectRef = ref(null);
|
|
1964
|
+
const selectValue = ref(normalizeSelectValue(props.value, props.multiple));
|
|
1965
|
+
const focused = ref(false);
|
|
1966
|
+
const blurred = ref(false);
|
|
1967
|
+
const visible = ref(false);
|
|
1968
|
+
watch(
|
|
1969
|
+
() => [props.value, props.multiple],
|
|
1970
|
+
([value, multiple]) => {
|
|
1971
|
+
selectValue.value = normalizeSelectValue(value, multiple);
|
|
1972
|
+
},
|
|
1973
|
+
{ immediate: true }
|
|
1974
|
+
);
|
|
1975
|
+
const rootClass = computed(() => attrs.class);
|
|
1976
|
+
const rootStyle = computed(() => attrs.style);
|
|
1977
|
+
const selectAttrs = computed(() => {
|
|
1978
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
1979
|
+
return rest;
|
|
1980
|
+
});
|
|
1981
|
+
const containerClasses = computed(() => ({
|
|
1982
|
+
"outlined-select--bordered": props.isBorder
|
|
1983
|
+
}));
|
|
1984
|
+
const containerStyle = computed(() => ({
|
|
1985
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
1986
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
1987
|
+
}));
|
|
1988
|
+
const selectStyle = computed(() => ({
|
|
1989
|
+
minHeight: `${props.inputHeight}px`,
|
|
1990
|
+
height: props.multiple ? "auto" : `${props.inputHeight}px`
|
|
1991
|
+
}));
|
|
1992
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
1993
|
+
const hasCustomOptionsSlot = computed(() => Boolean(slots.default));
|
|
1994
|
+
const hasContent = computed(() => {
|
|
1995
|
+
if (props.multiple) {
|
|
1996
|
+
return Array.isArray(selectValue.value) && selectValue.value.length > 0;
|
|
1997
|
+
}
|
|
1998
|
+
return hasFilledValue(selectValue.value);
|
|
1999
|
+
});
|
|
2000
|
+
const shouldFloat = computed(() => props.noCheck ? focused.value : focused.value || hasContent.value);
|
|
2001
|
+
const labelClasses = computed(() => ({
|
|
2002
|
+
"outlined-select__label--floating": shouldFloat.value,
|
|
2003
|
+
"outlined-select__label--placeholder": !shouldFloat.value,
|
|
2004
|
+
"outlined-select__label--filled": !props.noCheck && hasContent.value && !focused.value
|
|
2005
|
+
}));
|
|
2006
|
+
function handleModelValueUpdate(value) {
|
|
2007
|
+
const normalizedValue = normalizeSelectValue(value, props.multiple);
|
|
2008
|
+
selectValue.value = normalizedValue;
|
|
2009
|
+
emitModelValue(normalizedValue);
|
|
2010
|
+
}
|
|
2011
|
+
function handleChange(value) {
|
|
2012
|
+
const normalizedValue = normalizeSelectValue(value, props.multiple);
|
|
2013
|
+
selectValue.value = normalizedValue;
|
|
2014
|
+
emit("change", normalizedValue);
|
|
2015
|
+
}
|
|
2016
|
+
function handleFocus(event) {
|
|
2017
|
+
blurred.value = false;
|
|
2018
|
+
focused.value = true;
|
|
2019
|
+
emit("focus", event);
|
|
2020
|
+
}
|
|
2021
|
+
function handleBlur(event) {
|
|
2022
|
+
blurred.value = true;
|
|
2023
|
+
if (!visible.value) {
|
|
2024
|
+
focused.value = false;
|
|
2025
|
+
emitModelValue(selectValue.value);
|
|
2026
|
+
}
|
|
2027
|
+
emit("blur", event);
|
|
2028
|
+
}
|
|
2029
|
+
function handleVisibleChange(nextVisible) {
|
|
2030
|
+
visible.value = nextVisible;
|
|
2031
|
+
if (!nextVisible && blurred.value) {
|
|
2032
|
+
focused.value = false;
|
|
2033
|
+
}
|
|
2034
|
+
emit("visible-change", nextVisible);
|
|
2035
|
+
}
|
|
2036
|
+
function handleClear() {
|
|
2037
|
+
emit("clear");
|
|
2038
|
+
}
|
|
2039
|
+
function emitModelValue(value) {
|
|
2040
|
+
emit("input", value);
|
|
2041
|
+
emit("update:value", value);
|
|
2042
|
+
}
|
|
2043
|
+
function normalizeSelectValue(value, multiple) {
|
|
2044
|
+
if (multiple) {
|
|
2045
|
+
if (Array.isArray(value)) {
|
|
2046
|
+
return value;
|
|
2047
|
+
}
|
|
2048
|
+
if (value === void 0 || value === null || value === "") {
|
|
2049
|
+
return [];
|
|
2050
|
+
}
|
|
2051
|
+
return [value];
|
|
2052
|
+
}
|
|
2053
|
+
return value != null ? value : "";
|
|
2054
|
+
}
|
|
2055
|
+
function resolveOptionLabel(option) {
|
|
2056
|
+
const label = option[props.labelValue];
|
|
2057
|
+
return label === void 0 || label === null ? "" : String(label);
|
|
2058
|
+
}
|
|
2059
|
+
function resolveOptionValue(option) {
|
|
2060
|
+
var _a;
|
|
2061
|
+
return (_a = option[props.keyValue]) != null ? _a : null;
|
|
2062
|
+
}
|
|
2063
|
+
function createOptionKey(option, index) {
|
|
2064
|
+
const value = resolveOptionValue(option);
|
|
2065
|
+
return `${index}-${typeof value === "object" ? JSON.stringify(value) : String(value)}`;
|
|
2066
|
+
}
|
|
2067
|
+
function hasFilledValue(value) {
|
|
2068
|
+
return value !== void 0 && value !== null && String(value) !== "";
|
|
2069
|
+
}
|
|
2070
|
+
function toCssValue(value) {
|
|
2071
|
+
if (typeof value === "number") {
|
|
2072
|
+
return `${value}px`;
|
|
2073
|
+
}
|
|
2074
|
+
return value;
|
|
2075
|
+
}
|
|
2076
|
+
__expose({
|
|
2077
|
+
focus: () => {
|
|
2078
|
+
var _a, _b;
|
|
2079
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
2080
|
+
},
|
|
2081
|
+
blur: () => {
|
|
2082
|
+
var _a, _b;
|
|
2083
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
2084
|
+
},
|
|
2085
|
+
clear: () => {
|
|
2086
|
+
var _a, _b;
|
|
2087
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
2088
|
+
if (props.multiple) {
|
|
2089
|
+
selectValue.value = [];
|
|
2090
|
+
emitModelValue([]);
|
|
2091
|
+
emit("change", []);
|
|
2092
|
+
emit("clear");
|
|
2093
|
+
return;
|
|
2094
|
+
}
|
|
2095
|
+
selectValue.value = "";
|
|
2096
|
+
emitModelValue("");
|
|
2097
|
+
emit("change", "");
|
|
2098
|
+
emit("clear");
|
|
2099
|
+
},
|
|
2100
|
+
toggleMenu: () => {
|
|
2101
|
+
var _a, _b;
|
|
2102
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.toggleMenu) == null ? void 0 : _b.call(_a);
|
|
2103
|
+
},
|
|
2104
|
+
getSelectRef: () => selectRef.value
|
|
2105
|
+
});
|
|
2106
|
+
return (_ctx, _cache) => {
|
|
2107
|
+
const _component_el_option = resolveComponent("el-option");
|
|
2108
|
+
const _component_el_select = resolveComponent("el-select");
|
|
2109
|
+
return openBlock(), createElementBlock("div", {
|
|
2110
|
+
class: normalizeClass(["outlined-select", [containerClasses.value, rootClass.value]]),
|
|
2111
|
+
style: normalizeStyle([containerStyle.value, rootStyle.value])
|
|
2112
|
+
}, [
|
|
2113
|
+
createVNode(_component_el_select, mergeProps({
|
|
2114
|
+
ref_key: "selectRef",
|
|
2115
|
+
ref: selectRef
|
|
2116
|
+
}, selectAttrs.value, {
|
|
2117
|
+
class: "outlined-select__control",
|
|
2118
|
+
"model-value": selectValue.value,
|
|
2119
|
+
placeholder: __props.placeholder,
|
|
2120
|
+
disabled: __props.disabled,
|
|
2121
|
+
multiple: __props.multiple,
|
|
2122
|
+
filterable: __props.filterable,
|
|
2123
|
+
clearable: __props.clearable,
|
|
2124
|
+
"collapse-tags": __props.collapseTags,
|
|
2125
|
+
"collapse-tags-tooltip": __props.collapseTagsTooltip,
|
|
2126
|
+
"max-collapse-tags": __props.maxCollapseTags,
|
|
2127
|
+
style: selectStyle.value,
|
|
2128
|
+
"onUpdate:modelValue": handleModelValueUpdate,
|
|
2129
|
+
onFocus: handleFocus,
|
|
2130
|
+
onBlur: handleBlur,
|
|
2131
|
+
onChange: handleChange,
|
|
2132
|
+
onVisibleChange: handleVisibleChange,
|
|
2133
|
+
onClear: handleClear
|
|
2134
|
+
}), {
|
|
2135
|
+
empty: withCtx(() => [
|
|
2136
|
+
renderSlot(_ctx.$slots, "empty", {}, void 0, true)
|
|
2137
|
+
]),
|
|
2138
|
+
header: withCtx(() => [
|
|
2139
|
+
renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
2140
|
+
]),
|
|
2141
|
+
footer: withCtx(() => [
|
|
2142
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
2143
|
+
]),
|
|
2144
|
+
tag: withCtx((slotProps) => [
|
|
2145
|
+
renderSlot(_ctx.$slots, "tag", normalizeProps(guardReactiveProps(slotProps)), void 0, true)
|
|
2146
|
+
]),
|
|
2147
|
+
default: withCtx(() => [
|
|
2148
|
+
hasCustomOptionsSlot.value ? renderSlot(_ctx.$slots, "default", { key: 0 }, void 0, true) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.options, (item, index) => {
|
|
2149
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
2150
|
+
key: createOptionKey(item, index),
|
|
2151
|
+
label: resolveOptionLabel(item),
|
|
2152
|
+
value: resolveOptionValue(item),
|
|
2153
|
+
disabled: Boolean(item.disabled)
|
|
2154
|
+
}, null, 8, ["label", "value", "disabled"]);
|
|
2155
|
+
}), 128))
|
|
2156
|
+
]),
|
|
2157
|
+
_: 3
|
|
2158
|
+
}, 16, ["model-value", "placeholder", "disabled", "multiple", "filterable", "clearable", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "style"]),
|
|
2159
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
2160
|
+
key: 0,
|
|
2161
|
+
class: normalizeClass(["outlined-select__label", labelClasses.value])
|
|
2162
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
2163
|
+
], 6);
|
|
2164
|
+
};
|
|
2165
|
+
}
|
|
2166
|
+
});
|
|
2167
|
+
var OutlinedSelect = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7bd2b5f2"]]);
|
|
2168
|
+
var OutlinedDatePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
2169
|
+
const _sfc_main$4 = defineComponent({
|
|
2170
|
+
...{
|
|
2171
|
+
name: "OutlinedDatePicker",
|
|
2172
|
+
inheritAttrs: false
|
|
2173
|
+
},
|
|
2174
|
+
__name: "OutlinedDatePicker",
|
|
2175
|
+
props: {
|
|
2176
|
+
value: { default: "" },
|
|
2177
|
+
placeholder: { default: "" },
|
|
2178
|
+
label: { default: "" },
|
|
2179
|
+
disabled: { type: Boolean, default: false },
|
|
2180
|
+
timeValue: { type: Boolean, default: false },
|
|
2181
|
+
typeDate: { default: "date" },
|
|
2182
|
+
format: { default: "YYYY-MM-DD" },
|
|
2183
|
+
valueFormat: { default: "" },
|
|
2184
|
+
showPassword: { type: Boolean, default: false },
|
|
2185
|
+
multiple: { type: Boolean, default: false },
|
|
2186
|
+
inputHeight: { default: 40 },
|
|
2187
|
+
isBorder: { type: Boolean, default: false },
|
|
2188
|
+
disabledDate: { type: [String, Number, Date, Function], default: void 0 },
|
|
2189
|
+
marginBottom: { default: 20 },
|
|
2190
|
+
paddingTop: { default: 20 }
|
|
2191
|
+
},
|
|
2192
|
+
emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
|
|
2193
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2194
|
+
var _a;
|
|
2195
|
+
const props = __props;
|
|
2196
|
+
const emit = __emit;
|
|
2197
|
+
const attrs = useAttrs();
|
|
2198
|
+
const pickerRef = ref(null);
|
|
2199
|
+
const pickerValue = ref((_a = props.value) != null ? _a : "");
|
|
2200
|
+
const focused = ref(false);
|
|
2201
|
+
const blurred = ref(false);
|
|
2202
|
+
const visible = ref(false);
|
|
2203
|
+
watch(
|
|
2204
|
+
() => props.value,
|
|
2205
|
+
(value) => {
|
|
2206
|
+
pickerValue.value = value != null ? value : "";
|
|
2207
|
+
},
|
|
2208
|
+
{ immediate: true }
|
|
2209
|
+
);
|
|
2210
|
+
const rootClass = computed(() => attrs.class);
|
|
2211
|
+
const rootStyle = computed(() => attrs.style);
|
|
2212
|
+
const resolvedValueFormat = computed(() => props.valueFormat || props.format);
|
|
2213
|
+
const resolvedDisabledDate = computed(() => createDisabledDateHandler(props.disabledDate));
|
|
2214
|
+
const resolvedDefaultTime = computed(() => {
|
|
2215
|
+
if (attrs.defaultTime !== void 0) {
|
|
2216
|
+
return attrs.defaultTime;
|
|
2217
|
+
}
|
|
2218
|
+
if (attrs["default-time"] !== void 0) {
|
|
2219
|
+
return attrs["default-time"];
|
|
2220
|
+
}
|
|
2221
|
+
return props.timeValue ? new Date().setHours(0, 0, 0, 0) : new Date();
|
|
2222
|
+
});
|
|
2223
|
+
const resolvedDisabledHours = computed(() => {
|
|
2224
|
+
if (attrs.disabledHours !== void 0) {
|
|
2225
|
+
return attrs.disabledHours;
|
|
2226
|
+
}
|
|
2227
|
+
if (attrs["disabled-hours"] !== void 0) {
|
|
2228
|
+
return attrs["disabled-hours"];
|
|
2229
|
+
}
|
|
2230
|
+
if (!shouldLimitCurrentTime()) {
|
|
2231
|
+
return void 0;
|
|
2232
|
+
}
|
|
2233
|
+
return () => {
|
|
2234
|
+
const hours = new Date().getHours();
|
|
2235
|
+
return Array.from({ length: hours }, (_, index) => index);
|
|
2236
|
+
};
|
|
2237
|
+
});
|
|
2238
|
+
const resolvedDisabledMinutes = computed(() => {
|
|
2239
|
+
if (attrs.disabledMinutes !== void 0) {
|
|
2240
|
+
return attrs.disabledMinutes;
|
|
2241
|
+
}
|
|
2242
|
+
if (attrs["disabled-minutes"] !== void 0) {
|
|
2243
|
+
return attrs["disabled-minutes"];
|
|
2244
|
+
}
|
|
2245
|
+
if (!shouldLimitCurrentTime()) {
|
|
2246
|
+
return void 0;
|
|
2247
|
+
}
|
|
2248
|
+
return () => {
|
|
2249
|
+
const minutes = new Date().getMinutes();
|
|
2250
|
+
return Array.from({ length: minutes }, (_, index) => index);
|
|
2251
|
+
};
|
|
2252
|
+
});
|
|
2253
|
+
const pickerAttrs = computed(() => {
|
|
2254
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
2255
|
+
return {
|
|
2256
|
+
...rest,
|
|
2257
|
+
defaultTime: resolvedDefaultTime.value,
|
|
2258
|
+
disabledDate: resolvedDisabledDate.value,
|
|
2259
|
+
disabledHours: resolvedDisabledHours.value,
|
|
2260
|
+
disabledMinutes: resolvedDisabledMinutes.value
|
|
2261
|
+
};
|
|
2262
|
+
});
|
|
2263
|
+
const containerClasses = computed(() => ({
|
|
2264
|
+
"outlined-date-picker--bordered": props.isBorder
|
|
2265
|
+
}));
|
|
2266
|
+
const containerStyle = computed(() => ({
|
|
2267
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
2268
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
2269
|
+
}));
|
|
2270
|
+
const pickerStyle = computed(() => ({
|
|
2271
|
+
height: `${props.inputHeight}px`
|
|
2272
|
+
}));
|
|
2273
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
2274
|
+
const hasContent = computed(() => hasFilledValue(pickerValue.value));
|
|
2275
|
+
const labelClasses = computed(() => ({
|
|
2276
|
+
"outlined-date-picker__label--floating": focused.value || hasContent.value,
|
|
2277
|
+
"outlined-date-picker__label--placeholder": !focused.value && !hasContent.value,
|
|
2278
|
+
"outlined-date-picker__label--filled": hasContent.value && !focused.value
|
|
2279
|
+
}));
|
|
2280
|
+
function handleModelValueUpdate(value) {
|
|
2281
|
+
const normalizedValue = normalizeValue(value);
|
|
2282
|
+
pickerValue.value = normalizedValue;
|
|
2283
|
+
emitModelValue(normalizedValue);
|
|
2284
|
+
}
|
|
2285
|
+
function handleChange(value) {
|
|
2286
|
+
const normalizedValue = normalizeValue(value);
|
|
2287
|
+
pickerValue.value = normalizedValue;
|
|
2288
|
+
emit("change", normalizedValue);
|
|
2289
|
+
}
|
|
2290
|
+
function handleFocus(event) {
|
|
2291
|
+
blurred.value = false;
|
|
2292
|
+
focused.value = true;
|
|
2293
|
+
emit("focus", event);
|
|
2294
|
+
}
|
|
2295
|
+
function handleBlur(event) {
|
|
2296
|
+
blurred.value = true;
|
|
2297
|
+
if (!visible.value) {
|
|
2298
|
+
focused.value = false;
|
|
2299
|
+
emitModelValue(pickerValue.value);
|
|
2300
|
+
}
|
|
2301
|
+
emit("blur", event);
|
|
2302
|
+
}
|
|
2303
|
+
function handleVisibleChange(nextVisible) {
|
|
2304
|
+
visible.value = nextVisible;
|
|
2305
|
+
if (!nextVisible && blurred.value) {
|
|
2306
|
+
focused.value = false;
|
|
2307
|
+
}
|
|
2308
|
+
emit("visible-change", nextVisible);
|
|
2309
|
+
}
|
|
2310
|
+
function emitModelValue(value) {
|
|
2311
|
+
emit("input", value);
|
|
2312
|
+
emit("update:value", value);
|
|
2313
|
+
}
|
|
2314
|
+
function normalizeValue(value) {
|
|
2315
|
+
return value != null ? value : "";
|
|
2316
|
+
}
|
|
2317
|
+
function createDisabledDateHandler(disabledDate) {
|
|
2318
|
+
if (!disabledDate) {
|
|
2319
|
+
return void 0;
|
|
2320
|
+
}
|
|
2321
|
+
if (typeof disabledDate === "function") {
|
|
2322
|
+
return disabledDate;
|
|
2323
|
+
}
|
|
2324
|
+
const boundary = normalizeBoundary(disabledDate);
|
|
2325
|
+
return (value) => value.getTime() < boundary - 864e5;
|
|
2326
|
+
}
|
|
2327
|
+
function normalizeBoundary(value) {
|
|
2328
|
+
if (value === "nowDate") {
|
|
2329
|
+
return Date.now();
|
|
2330
|
+
}
|
|
2331
|
+
if (value instanceof Date) {
|
|
2332
|
+
return value.getTime();
|
|
2333
|
+
}
|
|
2334
|
+
if (typeof value === "number") {
|
|
2335
|
+
return value;
|
|
2336
|
+
}
|
|
2337
|
+
return new Date(value).getTime();
|
|
2338
|
+
}
|
|
2339
|
+
function shouldLimitCurrentTime() {
|
|
2340
|
+
return Boolean(props.disabledDate) && props.typeDate.toLowerCase().includes("time");
|
|
2341
|
+
}
|
|
2342
|
+
function hasFilledValue(value) {
|
|
2343
|
+
if (Array.isArray(value)) {
|
|
2344
|
+
return value.length > 0;
|
|
2345
|
+
}
|
|
2346
|
+
return value !== void 0 && value !== null && String(value) !== "";
|
|
2347
|
+
}
|
|
2348
|
+
function toCssValue(value) {
|
|
2349
|
+
if (typeof value === "number") {
|
|
2350
|
+
return `${value}px`;
|
|
2351
|
+
}
|
|
2352
|
+
return value;
|
|
2353
|
+
}
|
|
2354
|
+
__expose({
|
|
2355
|
+
focus: () => {
|
|
2356
|
+
var _a2, _b;
|
|
2357
|
+
(_b = (_a2 = pickerRef.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
|
|
2358
|
+
},
|
|
2359
|
+
blur: () => {
|
|
2360
|
+
var _a2, _b;
|
|
2361
|
+
(_b = (_a2 = pickerRef.value) == null ? void 0 : _a2.blur) == null ? void 0 : _b.call(_a2);
|
|
2362
|
+
},
|
|
2363
|
+
handleOpen: () => {
|
|
2364
|
+
var _a2, _b;
|
|
2365
|
+
(_b = (_a2 = pickerRef.value) == null ? void 0 : _a2.handleOpen) == null ? void 0 : _b.call(_a2);
|
|
2366
|
+
},
|
|
2367
|
+
handleClose: () => {
|
|
2368
|
+
var _a2, _b;
|
|
2369
|
+
(_b = (_a2 = pickerRef.value) == null ? void 0 : _a2.handleClose) == null ? void 0 : _b.call(_a2);
|
|
2370
|
+
},
|
|
2371
|
+
getPickerRef: () => pickerRef.value
|
|
2372
|
+
});
|
|
2373
|
+
return (_ctx, _cache) => {
|
|
2374
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2375
|
+
return openBlock(), createElementBlock("div", {
|
|
2376
|
+
class: normalizeClass(["outlined-date-picker", [containerClasses.value, rootClass.value]]),
|
|
2377
|
+
style: normalizeStyle([containerStyle.value, rootStyle.value])
|
|
2378
|
+
}, [
|
|
2379
|
+
createVNode(_component_el_date_picker, mergeProps({
|
|
2380
|
+
ref_key: "pickerRef",
|
|
2381
|
+
ref: pickerRef
|
|
2382
|
+
}, pickerAttrs.value, {
|
|
2383
|
+
class: "outlined-date-picker__control",
|
|
2384
|
+
"model-value": pickerValue.value,
|
|
2385
|
+
type: __props.typeDate,
|
|
2386
|
+
format: __props.format,
|
|
2387
|
+
"value-format": resolvedValueFormat.value,
|
|
2388
|
+
placeholder: __props.placeholder,
|
|
2389
|
+
disabled: __props.disabled,
|
|
2390
|
+
style: pickerStyle.value,
|
|
2391
|
+
"onUpdate:modelValue": handleModelValueUpdate,
|
|
2392
|
+
onFocus: handleFocus,
|
|
2393
|
+
onBlur: handleBlur,
|
|
2394
|
+
onChange: handleChange,
|
|
2395
|
+
onVisibleChange: handleVisibleChange
|
|
2396
|
+
}), null, 16, ["model-value", "type", "format", "value-format", "placeholder", "disabled", "style"]),
|
|
2397
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
2398
|
+
key: 0,
|
|
2399
|
+
class: normalizeClass(["outlined-date-picker__label", labelClasses.value])
|
|
2400
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
2401
|
+
], 6);
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
});
|
|
2405
|
+
var OutlinedDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c95a293c"]]);
|
|
2406
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2407
|
+
var dayjs_min = { exports: {} };
|
|
2408
|
+
(function(module, exports) {
|
|
2409
|
+
!function(t, e) {
|
|
2410
|
+
module.exports = e();
|
|
2411
|
+
}(commonjsGlobal, function() {
|
|
2412
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
2413
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
2414
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
2415
|
+
} }, m = function(t2, e2, n2) {
|
|
2416
|
+
var r2 = String(t2);
|
|
2417
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
2418
|
+
}, v = { s: m, z: function(t2) {
|
|
2419
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
2420
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
2421
|
+
}, m: function t2(e2, n2) {
|
|
2422
|
+
if (e2.date() < n2.date())
|
|
2423
|
+
return -t2(n2, e2);
|
|
2424
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
2425
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
2426
|
+
}, a: function(t2) {
|
|
2427
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
2428
|
+
}, p: function(t2) {
|
|
2429
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
2430
|
+
}, u: function(t2) {
|
|
2431
|
+
return void 0 === t2;
|
|
2432
|
+
} }, g = "en", D = {};
|
|
2433
|
+
D[g] = M;
|
|
2434
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
2435
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
2436
|
+
}, w = function t2(e2, n2, r2) {
|
|
2437
|
+
var i2;
|
|
2438
|
+
if (!e2)
|
|
2439
|
+
return g;
|
|
2440
|
+
if ("string" == typeof e2) {
|
|
2441
|
+
var s2 = e2.toLowerCase();
|
|
2442
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
2443
|
+
var u2 = e2.split("-");
|
|
2444
|
+
if (!i2 && u2.length > 1)
|
|
2445
|
+
return t2(u2[0]);
|
|
2446
|
+
} else {
|
|
2447
|
+
var a2 = e2.name;
|
|
2448
|
+
D[a2] = e2, i2 = a2;
|
|
2449
|
+
}
|
|
2450
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
2451
|
+
}, O = function(t2, e2) {
|
|
2452
|
+
if (S(t2))
|
|
2453
|
+
return t2.clone();
|
|
2454
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
2455
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
2456
|
+
}, b = v;
|
|
2457
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
2458
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
2459
|
+
};
|
|
2460
|
+
var _ = function() {
|
|
2461
|
+
function M2(t2) {
|
|
2462
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
2463
|
+
}
|
|
2464
|
+
var m2 = M2.prototype;
|
|
2465
|
+
return m2.parse = function(t2) {
|
|
2466
|
+
this.$d = function(t3) {
|
|
2467
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
2468
|
+
if (null === e2)
|
|
2469
|
+
return new Date(NaN);
|
|
2470
|
+
if (b.u(e2))
|
|
2471
|
+
return new Date();
|
|
2472
|
+
if (e2 instanceof Date)
|
|
2473
|
+
return new Date(e2);
|
|
2474
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
2475
|
+
var r2 = e2.match($);
|
|
2476
|
+
if (r2) {
|
|
2477
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
2478
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
return new Date(e2);
|
|
2482
|
+
}(t2), this.init();
|
|
2483
|
+
}, m2.init = function() {
|
|
2484
|
+
var t2 = this.$d;
|
|
2485
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
2486
|
+
}, m2.$utils = function() {
|
|
2487
|
+
return b;
|
|
2488
|
+
}, m2.isValid = function() {
|
|
2489
|
+
return !(this.$d.toString() === l);
|
|
2490
|
+
}, m2.isSame = function(t2, e2) {
|
|
2491
|
+
var n2 = O(t2);
|
|
2492
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
2493
|
+
}, m2.isAfter = function(t2, e2) {
|
|
2494
|
+
return O(t2) < this.startOf(e2);
|
|
2495
|
+
}, m2.isBefore = function(t2, e2) {
|
|
2496
|
+
return this.endOf(e2) < O(t2);
|
|
2497
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
2498
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
2499
|
+
}, m2.unix = function() {
|
|
2500
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
2501
|
+
}, m2.valueOf = function() {
|
|
2502
|
+
return this.$d.getTime();
|
|
2503
|
+
}, m2.startOf = function(t2, e2) {
|
|
2504
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
2505
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
2506
|
+
return r2 ? i2 : i2.endOf(a);
|
|
2507
|
+
}, $2 = function(t3, e3) {
|
|
2508
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
2509
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
2510
|
+
switch (f2) {
|
|
2511
|
+
case h:
|
|
2512
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
2513
|
+
case c:
|
|
2514
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
2515
|
+
case o:
|
|
2516
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
2517
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
2518
|
+
case a:
|
|
2519
|
+
case d:
|
|
2520
|
+
return $2(v2 + "Hours", 0);
|
|
2521
|
+
case u:
|
|
2522
|
+
return $2(v2 + "Minutes", 1);
|
|
2523
|
+
case s:
|
|
2524
|
+
return $2(v2 + "Seconds", 2);
|
|
2525
|
+
case i:
|
|
2526
|
+
return $2(v2 + "Milliseconds", 3);
|
|
2527
|
+
default:
|
|
2528
|
+
return this.clone();
|
|
2529
|
+
}
|
|
2530
|
+
}, m2.endOf = function(t2) {
|
|
2531
|
+
return this.startOf(t2, false);
|
|
2532
|
+
}, m2.$set = function(t2, e2) {
|
|
2533
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
2534
|
+
if (o2 === c || o2 === h) {
|
|
2535
|
+
var y2 = this.clone().set(d, 1);
|
|
2536
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
2537
|
+
} else
|
|
2538
|
+
l2 && this.$d[l2]($2);
|
|
2539
|
+
return this.init(), this;
|
|
2540
|
+
}, m2.set = function(t2, e2) {
|
|
2541
|
+
return this.clone().$set(t2, e2);
|
|
2542
|
+
}, m2.get = function(t2) {
|
|
2543
|
+
return this[b.p(t2)]();
|
|
2544
|
+
}, m2.add = function(r2, f2) {
|
|
2545
|
+
var d2, l2 = this;
|
|
2546
|
+
r2 = Number(r2);
|
|
2547
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
2548
|
+
var e2 = O(l2);
|
|
2549
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
2550
|
+
};
|
|
2551
|
+
if ($2 === c)
|
|
2552
|
+
return this.set(c, this.$M + r2);
|
|
2553
|
+
if ($2 === h)
|
|
2554
|
+
return this.set(h, this.$y + r2);
|
|
2555
|
+
if ($2 === a)
|
|
2556
|
+
return y2(1);
|
|
2557
|
+
if ($2 === o)
|
|
2558
|
+
return y2(7);
|
|
2559
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
2560
|
+
return b.w(m3, this);
|
|
2561
|
+
}, m2.subtract = function(t2, e2) {
|
|
2562
|
+
return this.add(-1 * t2, e2);
|
|
2563
|
+
}, m2.format = function(t2) {
|
|
2564
|
+
var e2 = this, n2 = this.$locale();
|
|
2565
|
+
if (!this.isValid())
|
|
2566
|
+
return n2.invalidDate || l;
|
|
2567
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
2568
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
2569
|
+
}, d2 = function(t3) {
|
|
2570
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
2571
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
2572
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
2573
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
2574
|
+
};
|
|
2575
|
+
return r2.replace(y, function(t3, r3) {
|
|
2576
|
+
return r3 || function(t4) {
|
|
2577
|
+
switch (t4) {
|
|
2578
|
+
case "YY":
|
|
2579
|
+
return String(e2.$y).slice(-2);
|
|
2580
|
+
case "YYYY":
|
|
2581
|
+
return b.s(e2.$y, 4, "0");
|
|
2582
|
+
case "M":
|
|
2583
|
+
return a2 + 1;
|
|
2584
|
+
case "MM":
|
|
2585
|
+
return b.s(a2 + 1, 2, "0");
|
|
2586
|
+
case "MMM":
|
|
2587
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
2588
|
+
case "MMMM":
|
|
2589
|
+
return h2(c2, a2);
|
|
2590
|
+
case "D":
|
|
2591
|
+
return e2.$D;
|
|
2592
|
+
case "DD":
|
|
2593
|
+
return b.s(e2.$D, 2, "0");
|
|
2594
|
+
case "d":
|
|
2595
|
+
return String(e2.$W);
|
|
2596
|
+
case "dd":
|
|
2597
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
2598
|
+
case "ddd":
|
|
2599
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
2600
|
+
case "dddd":
|
|
2601
|
+
return o2[e2.$W];
|
|
2602
|
+
case "H":
|
|
2603
|
+
return String(s2);
|
|
2604
|
+
case "HH":
|
|
2605
|
+
return b.s(s2, 2, "0");
|
|
2606
|
+
case "h":
|
|
2607
|
+
return d2(1);
|
|
2608
|
+
case "hh":
|
|
2609
|
+
return d2(2);
|
|
2610
|
+
case "a":
|
|
2611
|
+
return $2(s2, u2, true);
|
|
2612
|
+
case "A":
|
|
2613
|
+
return $2(s2, u2, false);
|
|
2614
|
+
case "m":
|
|
2615
|
+
return String(u2);
|
|
2616
|
+
case "mm":
|
|
2617
|
+
return b.s(u2, 2, "0");
|
|
2618
|
+
case "s":
|
|
2619
|
+
return String(e2.$s);
|
|
2620
|
+
case "ss":
|
|
2621
|
+
return b.s(e2.$s, 2, "0");
|
|
2622
|
+
case "SSS":
|
|
2623
|
+
return b.s(e2.$ms, 3, "0");
|
|
2624
|
+
case "Z":
|
|
2625
|
+
return i2;
|
|
2626
|
+
}
|
|
2627
|
+
return null;
|
|
2628
|
+
}(t3) || i2.replace(":", "");
|
|
2629
|
+
});
|
|
2630
|
+
}, m2.utcOffset = function() {
|
|
2631
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
2632
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
2633
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
2634
|
+
return b.m(y2, m3);
|
|
2635
|
+
};
|
|
2636
|
+
switch (M3) {
|
|
2637
|
+
case h:
|
|
2638
|
+
$2 = D2() / 12;
|
|
2639
|
+
break;
|
|
2640
|
+
case c:
|
|
2641
|
+
$2 = D2();
|
|
2642
|
+
break;
|
|
2643
|
+
case f:
|
|
2644
|
+
$2 = D2() / 3;
|
|
2645
|
+
break;
|
|
2646
|
+
case o:
|
|
2647
|
+
$2 = (g2 - v2) / 6048e5;
|
|
2648
|
+
break;
|
|
2649
|
+
case a:
|
|
2650
|
+
$2 = (g2 - v2) / 864e5;
|
|
2651
|
+
break;
|
|
2652
|
+
case u:
|
|
2653
|
+
$2 = g2 / n;
|
|
2654
|
+
break;
|
|
2655
|
+
case s:
|
|
2656
|
+
$2 = g2 / e;
|
|
2657
|
+
break;
|
|
2658
|
+
case i:
|
|
2659
|
+
$2 = g2 / t;
|
|
2660
|
+
break;
|
|
2661
|
+
default:
|
|
2662
|
+
$2 = g2;
|
|
2663
|
+
}
|
|
2664
|
+
return l2 ? $2 : b.a($2);
|
|
2665
|
+
}, m2.daysInMonth = function() {
|
|
2666
|
+
return this.endOf(c).$D;
|
|
2667
|
+
}, m2.$locale = function() {
|
|
2668
|
+
return D[this.$L];
|
|
2669
|
+
}, m2.locale = function(t2, e2) {
|
|
2670
|
+
if (!t2)
|
|
2671
|
+
return this.$L;
|
|
2672
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
2673
|
+
return r2 && (n2.$L = r2), n2;
|
|
2674
|
+
}, m2.clone = function() {
|
|
2675
|
+
return b.w(this.$d, this);
|
|
2676
|
+
}, m2.toDate = function() {
|
|
2677
|
+
return new Date(this.valueOf());
|
|
2678
|
+
}, m2.toJSON = function() {
|
|
2679
|
+
return this.isValid() ? this.toISOString() : null;
|
|
2680
|
+
}, m2.toISOString = function() {
|
|
2681
|
+
return this.$d.toISOString();
|
|
2682
|
+
}, m2.toString = function() {
|
|
2683
|
+
return this.$d.toUTCString();
|
|
2684
|
+
}, M2;
|
|
2685
|
+
}(), k = _.prototype;
|
|
2686
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
2687
|
+
k[t2[1]] = function(e2) {
|
|
2688
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
2689
|
+
};
|
|
2690
|
+
}), O.extend = function(t2, e2) {
|
|
2691
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
2692
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
2693
|
+
return O(1e3 * t2);
|
|
2694
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
2695
|
+
});
|
|
2696
|
+
})(dayjs_min);
|
|
2697
|
+
var dayjs = dayjs_min.exports;
|
|
2698
|
+
var OutlinedDateTimePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
2699
|
+
const _hoisted_1 = { class: "outlined-date-time-picker__separator" };
|
|
2700
|
+
const _sfc_main$3 = defineComponent({
|
|
2701
|
+
...{
|
|
2702
|
+
name: "OutlinedDateTimePicker",
|
|
2703
|
+
inheritAttrs: false
|
|
2704
|
+
},
|
|
2705
|
+
__name: "OutlinedDateTimePicker",
|
|
2706
|
+
props: {
|
|
2707
|
+
value: { default: "" },
|
|
2708
|
+
placeholder: { default: "" },
|
|
2709
|
+
label: { default: "" },
|
|
2710
|
+
inputHeight: { default: 40 },
|
|
2711
|
+
isBorder: { type: Boolean, default: false },
|
|
2712
|
+
disabledDate: { type: [String, Number, Date, Function], default: void 0 },
|
|
2713
|
+
separatorText: { default: "-" },
|
|
2714
|
+
timePlaceholder: { default: "\u65F6\u95F4" },
|
|
2715
|
+
clearable: { type: Boolean, default: false },
|
|
2716
|
+
marginBottom: { default: 20 },
|
|
2717
|
+
paddingTop: { default: 20 }
|
|
2718
|
+
},
|
|
2719
|
+
emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
|
|
2720
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2721
|
+
const props = __props;
|
|
2722
|
+
const emit = __emit;
|
|
2723
|
+
const attrs = useAttrs();
|
|
2724
|
+
const datePickerRef = ref(null);
|
|
2725
|
+
const timePickerRef = ref(null);
|
|
2726
|
+
const dateValue = ref(null);
|
|
2727
|
+
const timeValue = ref(null);
|
|
2728
|
+
const dateFocused = ref(false);
|
|
2729
|
+
const timeFocused = ref(false);
|
|
2730
|
+
const dateBlurred = ref(false);
|
|
2731
|
+
const timeBlurred = ref(false);
|
|
2732
|
+
const dateVisible = ref(false);
|
|
2733
|
+
const timeVisible = ref(false);
|
|
2734
|
+
watch(
|
|
2735
|
+
() => props.value,
|
|
2736
|
+
(value) => {
|
|
2737
|
+
syncFromValue(value);
|
|
2738
|
+
},
|
|
2739
|
+
{ immediate: true }
|
|
2740
|
+
);
|
|
2741
|
+
const rootClass = computed(() => attrs.class);
|
|
2742
|
+
const rootStyle = computed(() => attrs.style);
|
|
2743
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
2744
|
+
const fieldClasses = computed(() => ({
|
|
2745
|
+
"outlined-date-time-picker__field--bordered": props.isBorder
|
|
2746
|
+
}));
|
|
2747
|
+
const fieldStyle = computed(() => ({
|
|
2748
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
2749
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
2750
|
+
}));
|
|
2751
|
+
const controlStyle = computed(() => ({
|
|
2752
|
+
height: `${props.inputHeight}px`
|
|
2753
|
+
}));
|
|
2754
|
+
const resolvedDisabledDate = computed(() => createDisabledDateHandler(props.disabledDate));
|
|
2755
|
+
const resolvedDisabledHours = computed(() => {
|
|
2756
|
+
if (!shouldLimitCurrentTime()) {
|
|
2757
|
+
return void 0;
|
|
2758
|
+
}
|
|
2759
|
+
return () => {
|
|
2760
|
+
const hours = new Date().getHours();
|
|
2761
|
+
return Array.from({ length: hours }, (_, index) => index);
|
|
2762
|
+
};
|
|
2763
|
+
});
|
|
2764
|
+
const resolvedDisabledMinutes = computed(() => {
|
|
2765
|
+
if (!shouldLimitCurrentTime()) {
|
|
2766
|
+
return void 0;
|
|
2767
|
+
}
|
|
2768
|
+
return () => {
|
|
2769
|
+
const minutes = new Date().getMinutes();
|
|
2770
|
+
return Array.from({ length: minutes }, (_, index) => index);
|
|
2771
|
+
};
|
|
2772
|
+
});
|
|
2773
|
+
const dateLabelClasses = computed(() => ({
|
|
2774
|
+
"outlined-date-time-picker__label--floating": dateFocused.value || Boolean(dateValue.value),
|
|
2775
|
+
"outlined-date-time-picker__label--placeholder": !dateFocused.value && !dateValue.value,
|
|
2776
|
+
"outlined-date-time-picker__label--filled": Boolean(dateValue.value) && !dateFocused.value
|
|
2777
|
+
}));
|
|
2778
|
+
const timeLabelClasses = computed(() => ({
|
|
2779
|
+
"outlined-date-time-picker__label--floating": timeFocused.value || Boolean(timeValue.value),
|
|
2780
|
+
"outlined-date-time-picker__label--placeholder": !timeFocused.value && !timeValue.value,
|
|
2781
|
+
"outlined-date-time-picker__label--filled": Boolean(timeValue.value) && !timeFocused.value
|
|
2782
|
+
}));
|
|
2783
|
+
function syncFromValue(value) {
|
|
2784
|
+
if (!value) {
|
|
2785
|
+
dateValue.value = null;
|
|
2786
|
+
timeValue.value = null;
|
|
2787
|
+
return;
|
|
2788
|
+
}
|
|
2789
|
+
const [datePart, timePart] = value.split(" ");
|
|
2790
|
+
dateValue.value = datePart || null;
|
|
2791
|
+
timeValue.value = timePart || null;
|
|
2792
|
+
}
|
|
2793
|
+
function handleDateUpdate(value) {
|
|
2794
|
+
dateValue.value = value || null;
|
|
2795
|
+
}
|
|
2796
|
+
function handleTimeUpdate(value) {
|
|
2797
|
+
timeValue.value = value || null;
|
|
2798
|
+
}
|
|
2799
|
+
function handleDateChange() {
|
|
2800
|
+
if (dateValue.value && !timeValue.value) {
|
|
2801
|
+
timeValue.value = dayjs().format("HH:mm");
|
|
2802
|
+
}
|
|
2803
|
+
emitCombinedValue();
|
|
2804
|
+
}
|
|
2805
|
+
function handleTimeChange() {
|
|
2806
|
+
emitCombinedValue();
|
|
2807
|
+
}
|
|
2808
|
+
function handleFocus(field) {
|
|
2809
|
+
return (event) => {
|
|
2810
|
+
if (field === "date") {
|
|
2811
|
+
dateBlurred.value = false;
|
|
2812
|
+
dateFocused.value = true;
|
|
2813
|
+
} else {
|
|
2814
|
+
timeBlurred.value = false;
|
|
2815
|
+
timeFocused.value = true;
|
|
2816
|
+
}
|
|
2817
|
+
emit("focus", { field, event });
|
|
2818
|
+
};
|
|
2819
|
+
}
|
|
2820
|
+
function handleBlur(field, event) {
|
|
2821
|
+
if (field === "date") {
|
|
2822
|
+
dateBlurred.value = true;
|
|
2823
|
+
if (!dateVisible.value) {
|
|
2824
|
+
dateFocused.value = false;
|
|
2825
|
+
emitCombinedValue();
|
|
2826
|
+
}
|
|
2827
|
+
} else {
|
|
2828
|
+
timeBlurred.value = true;
|
|
2829
|
+
if (!timeVisible.value) {
|
|
2830
|
+
timeFocused.value = false;
|
|
2831
|
+
emitCombinedValue();
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
emit("blur", { field, event });
|
|
2835
|
+
}
|
|
2836
|
+
function handleVisibleChange(field, visible) {
|
|
2837
|
+
if (field === "date") {
|
|
2838
|
+
dateVisible.value = visible;
|
|
2839
|
+
if (!visible && dateBlurred.value) {
|
|
2840
|
+
dateFocused.value = false;
|
|
2841
|
+
}
|
|
2842
|
+
} else {
|
|
2843
|
+
timeVisible.value = visible;
|
|
2844
|
+
if (!visible && timeBlurred.value) {
|
|
2845
|
+
timeFocused.value = false;
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
emit("visible-change", { field, visible });
|
|
2849
|
+
}
|
|
2850
|
+
function emitCombinedValue() {
|
|
2851
|
+
const value = dateValue.value && timeValue.value ? `${dateValue.value} ${timeValue.value}` : "";
|
|
2852
|
+
emit("input", value);
|
|
2853
|
+
emit("update:value", value);
|
|
2854
|
+
emit("change", value);
|
|
2855
|
+
}
|
|
2856
|
+
function createDisabledDateHandler(disabledDate) {
|
|
2857
|
+
if (!disabledDate) {
|
|
2858
|
+
return void 0;
|
|
2859
|
+
}
|
|
2860
|
+
if (typeof disabledDate === "function") {
|
|
2861
|
+
return disabledDate;
|
|
2862
|
+
}
|
|
2863
|
+
const boundary = normalizeBoundary(disabledDate);
|
|
2864
|
+
return (value) => value.getTime() < boundary - 864e5;
|
|
2865
|
+
}
|
|
2866
|
+
function normalizeBoundary(value) {
|
|
2867
|
+
if (value === "nowDate") {
|
|
2868
|
+
return Date.now();
|
|
2869
|
+
}
|
|
2870
|
+
if (value instanceof Date) {
|
|
2871
|
+
return value.getTime();
|
|
2872
|
+
}
|
|
2873
|
+
if (typeof value === "number") {
|
|
2874
|
+
return value;
|
|
2875
|
+
}
|
|
2876
|
+
return new Date(value).getTime();
|
|
2877
|
+
}
|
|
2878
|
+
function shouldLimitCurrentTime() {
|
|
2879
|
+
return Boolean(props.disabledDate) && dateValue.value === dayjs().format("YYYY-MM-DD");
|
|
2880
|
+
}
|
|
2881
|
+
function toCssValue(value) {
|
|
2882
|
+
if (typeof value === "number") {
|
|
2883
|
+
return `${value}px`;
|
|
2884
|
+
}
|
|
2885
|
+
return value;
|
|
2886
|
+
}
|
|
2887
|
+
__expose({
|
|
2888
|
+
focusDate: () => {
|
|
2889
|
+
var _a, _b;
|
|
2890
|
+
(_b = (_a = datePickerRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
2891
|
+
},
|
|
2892
|
+
focusTime: () => {
|
|
2893
|
+
var _a, _b;
|
|
2894
|
+
(_b = (_a = timePickerRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
2895
|
+
},
|
|
2896
|
+
blurDate: () => {
|
|
2897
|
+
var _a, _b;
|
|
2898
|
+
(_b = (_a = datePickerRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
2899
|
+
},
|
|
2900
|
+
blurTime: () => {
|
|
2901
|
+
var _a, _b;
|
|
2902
|
+
(_b = (_a = timePickerRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
2903
|
+
},
|
|
2904
|
+
openDatePanel: () => {
|
|
2905
|
+
var _a, _b;
|
|
2906
|
+
(_b = (_a = datePickerRef.value) == null ? void 0 : _a.handleOpen) == null ? void 0 : _b.call(_a);
|
|
2907
|
+
},
|
|
2908
|
+
openTimePanel: () => {
|
|
2909
|
+
var _a, _b;
|
|
2910
|
+
(_b = (_a = timePickerRef.value) == null ? void 0 : _a.handleOpen) == null ? void 0 : _b.call(_a);
|
|
2911
|
+
},
|
|
2912
|
+
getDatePickerRef: () => datePickerRef.value,
|
|
2913
|
+
getTimePickerRef: () => timePickerRef.value
|
|
2914
|
+
});
|
|
2915
|
+
return (_ctx, _cache) => {
|
|
2916
|
+
const _component_el_date_picker = resolveComponent("el-date-picker");
|
|
2917
|
+
const _component_el_time_picker = resolveComponent("el-time-picker");
|
|
2918
|
+
return openBlock(), createElementBlock("div", {
|
|
2919
|
+
class: normalizeClass(["outlined-date-time-picker", [rootClass.value]]),
|
|
2920
|
+
style: normalizeStyle(rootStyle.value)
|
|
2921
|
+
}, [
|
|
2922
|
+
createElementVNode("div", {
|
|
2923
|
+
class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value]),
|
|
2924
|
+
style: normalizeStyle(fieldStyle.value)
|
|
2925
|
+
}, [
|
|
2926
|
+
createVNode(_component_el_date_picker, {
|
|
2927
|
+
ref_key: "datePickerRef",
|
|
2928
|
+
ref: datePickerRef,
|
|
2929
|
+
class: "outlined-date-time-picker__control",
|
|
2930
|
+
"model-value": dateValue.value,
|
|
2931
|
+
type: "date",
|
|
2932
|
+
format: "YYYY-MM-DD",
|
|
2933
|
+
"value-format": "YYYY-MM-DD",
|
|
2934
|
+
placeholder: __props.placeholder,
|
|
2935
|
+
clearable: __props.clearable,
|
|
2936
|
+
"disabled-date": resolvedDisabledDate.value,
|
|
2937
|
+
style: normalizeStyle(controlStyle.value),
|
|
2938
|
+
"onUpdate:modelValue": handleDateUpdate,
|
|
2939
|
+
onFocus: _cache[0] || (_cache[0] = ($event) => handleFocus("date")),
|
|
2940
|
+
onBlur: _cache[1] || (_cache[1] = ($event) => handleBlur("date", $event)),
|
|
2941
|
+
onChange: handleDateChange,
|
|
2942
|
+
onVisibleChange: _cache[2] || (_cache[2] = ($event) => handleVisibleChange("date", $event))
|
|
2943
|
+
}, null, 8, ["model-value", "placeholder", "clearable", "disabled-date", "style"]),
|
|
2944
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
2945
|
+
key: 0,
|
|
2946
|
+
class: normalizeClass(["outlined-date-time-picker__label", dateLabelClasses.value])
|
|
2947
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
2948
|
+
], 6),
|
|
2949
|
+
createElementVNode("span", _hoisted_1, toDisplayString(__props.separatorText), 1),
|
|
2950
|
+
createElementVNode("div", {
|
|
2951
|
+
class: normalizeClass(["outlined-date-time-picker__field", fieldClasses.value]),
|
|
2952
|
+
style: normalizeStyle(fieldStyle.value)
|
|
2953
|
+
}, [
|
|
2954
|
+
createVNode(_component_el_time_picker, {
|
|
2955
|
+
ref_key: "timePickerRef",
|
|
2956
|
+
ref: timePickerRef,
|
|
2957
|
+
class: "outlined-date-time-picker__control",
|
|
2958
|
+
"model-value": timeValue.value,
|
|
2959
|
+
format: "HH:mm",
|
|
2960
|
+
"value-format": "HH:mm",
|
|
2961
|
+
placeholder: __props.timePlaceholder,
|
|
2962
|
+
clearable: __props.clearable,
|
|
2963
|
+
disabled: !dateValue.value,
|
|
2964
|
+
"disabled-hours": resolvedDisabledHours.value,
|
|
2965
|
+
"disabled-minutes": resolvedDisabledMinutes.value,
|
|
2966
|
+
style: normalizeStyle(controlStyle.value),
|
|
2967
|
+
"onUpdate:modelValue": handleTimeUpdate,
|
|
2968
|
+
onFocus: _cache[3] || (_cache[3] = ($event) => handleFocus("time")),
|
|
2969
|
+
onBlur: _cache[4] || (_cache[4] = ($event) => handleBlur("time", $event)),
|
|
2970
|
+
onChange: handleTimeChange,
|
|
2971
|
+
onVisibleChange: _cache[5] || (_cache[5] = ($event) => handleVisibleChange("time", $event))
|
|
2972
|
+
}, null, 8, ["model-value", "placeholder", "clearable", "disabled", "disabled-hours", "disabled-minutes", "style"]),
|
|
2973
|
+
createElementVNode("div", {
|
|
2974
|
+
class: normalizeClass(["outlined-date-time-picker__label", timeLabelClasses.value])
|
|
2975
|
+
}, toDisplayString(__props.timePlaceholder), 3)
|
|
2976
|
+
], 6)
|
|
2977
|
+
], 6);
|
|
2978
|
+
};
|
|
2979
|
+
}
|
|
2980
|
+
});
|
|
2981
|
+
var OutlinedDateTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-f2fefd22"]]);
|
|
2982
|
+
var OutlinedTimePicker_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
2983
|
+
const _sfc_main$2 = defineComponent({
|
|
2984
|
+
...{
|
|
2985
|
+
name: "OutlinedTimePicker",
|
|
2986
|
+
inheritAttrs: false
|
|
2987
|
+
},
|
|
2988
|
+
__name: "OutlinedTimePicker",
|
|
2989
|
+
props: {
|
|
2990
|
+
value: { default: "" },
|
|
2991
|
+
placeholder: { default: "" },
|
|
2992
|
+
label: { default: "" },
|
|
2993
|
+
disabled: { type: Boolean, default: false },
|
|
2994
|
+
clearable: { type: Boolean, default: true },
|
|
2995
|
+
isRange: { type: Boolean, default: false },
|
|
2996
|
+
startPlaceholder: { default: "\u5F00\u59CB\u65F6\u95F4" },
|
|
2997
|
+
endPlaceholder: { default: "\u7ED3\u675F\u65F6\u95F4" },
|
|
2998
|
+
rangeSeparator: { default: "-" },
|
|
2999
|
+
format: { default: "HH:mm" },
|
|
3000
|
+
valueFormat: { default: "" },
|
|
3001
|
+
arrowControl: { type: Boolean, default: false },
|
|
3002
|
+
inputHeight: { default: 40 },
|
|
3003
|
+
isBorder: { type: Boolean, default: false },
|
|
3004
|
+
marginBottom: { default: 20 },
|
|
3005
|
+
paddingTop: { default: 20 }
|
|
3006
|
+
},
|
|
3007
|
+
emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
|
|
3008
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3009
|
+
const props = __props;
|
|
3010
|
+
const emit = __emit;
|
|
3011
|
+
const attrs = useAttrs();
|
|
3012
|
+
const pickerRef = ref(null);
|
|
3013
|
+
const pickerValue = ref(normalizeValue(props.value, props.isRange));
|
|
3014
|
+
const focused = ref(false);
|
|
3015
|
+
const blurred = ref(false);
|
|
3016
|
+
const visible = ref(false);
|
|
3017
|
+
watch(
|
|
3018
|
+
() => [props.value, props.isRange],
|
|
3019
|
+
([value, isRange]) => {
|
|
3020
|
+
pickerValue.value = normalizeValue(value, isRange);
|
|
3021
|
+
},
|
|
3022
|
+
{ immediate: true }
|
|
3023
|
+
);
|
|
3024
|
+
const rootClass = computed(() => attrs.class);
|
|
3025
|
+
const rootStyle = computed(() => attrs.style);
|
|
3026
|
+
const resolvedValueFormat = computed(() => props.valueFormat || props.format);
|
|
3027
|
+
const pickerAttrs = computed(() => {
|
|
3028
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
3029
|
+
return rest;
|
|
3030
|
+
});
|
|
3031
|
+
const containerClasses = computed(() => ({
|
|
3032
|
+
"outlined-time-picker--bordered": props.isBorder
|
|
3033
|
+
}));
|
|
3034
|
+
const containerStyle = computed(() => ({
|
|
3035
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
3036
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
3037
|
+
}));
|
|
3038
|
+
const pickerStyle = computed(() => ({
|
|
3039
|
+
height: `${props.inputHeight}px`
|
|
3040
|
+
}));
|
|
3041
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
3042
|
+
const hasContent = computed(() => {
|
|
3043
|
+
if (Array.isArray(pickerValue.value)) {
|
|
3044
|
+
return pickerValue.value.length > 0;
|
|
3045
|
+
}
|
|
3046
|
+
return hasFilledValue(pickerValue.value);
|
|
3047
|
+
});
|
|
3048
|
+
const labelClasses = computed(() => ({
|
|
3049
|
+
"outlined-time-picker__label--floating": focused.value || hasContent.value,
|
|
3050
|
+
"outlined-time-picker__label--placeholder": !focused.value && !hasContent.value,
|
|
3051
|
+
"outlined-time-picker__label--filled": hasContent.value && !focused.value
|
|
3052
|
+
}));
|
|
3053
|
+
function handleModelValueUpdate(value) {
|
|
3054
|
+
const normalizedValue = normalizeValue(value, props.isRange);
|
|
3055
|
+
pickerValue.value = normalizedValue;
|
|
3056
|
+
emitModelValue(normalizedValue);
|
|
3057
|
+
}
|
|
3058
|
+
function handleChange(value) {
|
|
3059
|
+
const normalizedValue = normalizeValue(value, props.isRange);
|
|
3060
|
+
pickerValue.value = normalizedValue;
|
|
3061
|
+
emit("change", normalizedValue);
|
|
3062
|
+
}
|
|
3063
|
+
function handleFocus(event) {
|
|
3064
|
+
blurred.value = false;
|
|
3065
|
+
focused.value = true;
|
|
3066
|
+
emit("focus", event);
|
|
3067
|
+
}
|
|
3068
|
+
function handleBlur(event) {
|
|
3069
|
+
blurred.value = true;
|
|
3070
|
+
if (!visible.value) {
|
|
3071
|
+
focused.value = false;
|
|
3072
|
+
emitModelValue(pickerValue.value);
|
|
3073
|
+
}
|
|
3074
|
+
emit("blur", event);
|
|
3075
|
+
}
|
|
3076
|
+
function handleVisibleChange(nextVisible) {
|
|
3077
|
+
visible.value = nextVisible;
|
|
3078
|
+
if (!nextVisible && blurred.value) {
|
|
3079
|
+
focused.value = false;
|
|
3080
|
+
}
|
|
3081
|
+
emit("visible-change", nextVisible);
|
|
3082
|
+
}
|
|
3083
|
+
function handleClear() {
|
|
3084
|
+
emit("clear");
|
|
3085
|
+
}
|
|
3086
|
+
function emitModelValue(value) {
|
|
3087
|
+
emit("input", value);
|
|
3088
|
+
emit("update:value", value);
|
|
3089
|
+
}
|
|
3090
|
+
function normalizeValue(value, isRange) {
|
|
3091
|
+
if (isRange) {
|
|
3092
|
+
if (Array.isArray(value)) {
|
|
3093
|
+
return value;
|
|
3094
|
+
}
|
|
3095
|
+
if (value === void 0 || value === null || value === "") {
|
|
3096
|
+
return [];
|
|
3097
|
+
}
|
|
3098
|
+
return [value];
|
|
3099
|
+
}
|
|
3100
|
+
return value != null ? value : "";
|
|
3101
|
+
}
|
|
3102
|
+
function hasFilledValue(value) {
|
|
3103
|
+
return value !== void 0 && value !== null && String(value) !== "";
|
|
3104
|
+
}
|
|
3105
|
+
function toCssValue(value) {
|
|
3106
|
+
if (typeof value === "number") {
|
|
3107
|
+
return `${value}px`;
|
|
3108
|
+
}
|
|
3109
|
+
return value;
|
|
3110
|
+
}
|
|
3111
|
+
__expose({
|
|
3112
|
+
focus: () => {
|
|
3113
|
+
var _a, _b;
|
|
3114
|
+
(_b = (_a = pickerRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
3115
|
+
},
|
|
3116
|
+
blur: () => {
|
|
3117
|
+
var _a, _b;
|
|
3118
|
+
(_b = (_a = pickerRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
3119
|
+
},
|
|
3120
|
+
handleOpen: () => {
|
|
3121
|
+
var _a, _b;
|
|
3122
|
+
(_b = (_a = pickerRef.value) == null ? void 0 : _a.handleOpen) == null ? void 0 : _b.call(_a);
|
|
3123
|
+
},
|
|
3124
|
+
handleClose: () => {
|
|
3125
|
+
var _a, _b;
|
|
3126
|
+
(_b = (_a = pickerRef.value) == null ? void 0 : _a.handleClose) == null ? void 0 : _b.call(_a);
|
|
3127
|
+
},
|
|
3128
|
+
clear: () => {
|
|
3129
|
+
const emptyValue = props.isRange ? [] : "";
|
|
3130
|
+
pickerValue.value = emptyValue;
|
|
3131
|
+
emitModelValue(emptyValue);
|
|
3132
|
+
emit("change", emptyValue);
|
|
3133
|
+
emit("clear");
|
|
3134
|
+
},
|
|
3135
|
+
getPickerRef: () => pickerRef.value
|
|
3136
|
+
});
|
|
3137
|
+
return (_ctx, _cache) => {
|
|
3138
|
+
const _component_el_time_picker = resolveComponent("el-time-picker");
|
|
3139
|
+
return openBlock(), createElementBlock("div", {
|
|
3140
|
+
class: normalizeClass(["outlined-time-picker", [containerClasses.value, rootClass.value]]),
|
|
3141
|
+
style: normalizeStyle([containerStyle.value, rootStyle.value])
|
|
3142
|
+
}, [
|
|
3143
|
+
createVNode(_component_el_time_picker, mergeProps({
|
|
3144
|
+
ref_key: "pickerRef",
|
|
3145
|
+
ref: pickerRef
|
|
3146
|
+
}, pickerAttrs.value, {
|
|
3147
|
+
class: "outlined-time-picker__control",
|
|
3148
|
+
"model-value": pickerValue.value,
|
|
3149
|
+
"is-range": __props.isRange,
|
|
3150
|
+
format: __props.format,
|
|
3151
|
+
"value-format": resolvedValueFormat.value,
|
|
3152
|
+
placeholder: __props.placeholder,
|
|
3153
|
+
"start-placeholder": __props.startPlaceholder,
|
|
3154
|
+
"end-placeholder": __props.endPlaceholder,
|
|
3155
|
+
"range-separator": __props.rangeSeparator,
|
|
3156
|
+
disabled: __props.disabled,
|
|
3157
|
+
clearable: __props.clearable,
|
|
3158
|
+
"arrow-control": __props.arrowControl,
|
|
3159
|
+
style: pickerStyle.value,
|
|
3160
|
+
"onUpdate:modelValue": handleModelValueUpdate,
|
|
3161
|
+
onFocus: handleFocus,
|
|
3162
|
+
onBlur: handleBlur,
|
|
3163
|
+
onChange: handleChange,
|
|
3164
|
+
onVisibleChange: handleVisibleChange,
|
|
3165
|
+
onClear: handleClear
|
|
3166
|
+
}), null, 16, ["model-value", "is-range", "format", "value-format", "placeholder", "start-placeholder", "end-placeholder", "range-separator", "disabled", "clearable", "arrow-control", "style"]),
|
|
3167
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
3168
|
+
key: 0,
|
|
3169
|
+
class: normalizeClass(["outlined-time-picker__label", labelClasses.value])
|
|
3170
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
3171
|
+
], 6);
|
|
3172
|
+
};
|
|
3173
|
+
}
|
|
3174
|
+
});
|
|
3175
|
+
var OutlinedTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6a467b88"]]);
|
|
3176
|
+
var OutlinedCascader_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
3177
|
+
const _sfc_main$1 = defineComponent({
|
|
3178
|
+
...{
|
|
3179
|
+
name: "OutlinedCascader",
|
|
3180
|
+
inheritAttrs: false
|
|
3181
|
+
},
|
|
3182
|
+
__name: "OutlinedCascader",
|
|
3183
|
+
props: {
|
|
3184
|
+
value: { default: () => [] },
|
|
3185
|
+
options: { default: () => [] },
|
|
3186
|
+
clearable: { type: Boolean, default: false },
|
|
3187
|
+
propsValue: { default: void 0 },
|
|
3188
|
+
placeholder: { default: "" },
|
|
3189
|
+
label: { default: "" },
|
|
3190
|
+
popperClass: { default: "" },
|
|
3191
|
+
disabled: { type: Boolean, default: false },
|
|
3192
|
+
inputHeight: { default: 40 },
|
|
3193
|
+
isBorder: { type: Boolean, default: false },
|
|
3194
|
+
filterable: { type: Boolean, default: true },
|
|
3195
|
+
levels: { type: Boolean, default: true },
|
|
3196
|
+
marginBottom: { default: 20 },
|
|
3197
|
+
paddingTop: { default: 20 }
|
|
3198
|
+
},
|
|
3199
|
+
emits: ["input", "update:value", "change", "focus", "blur", "visible-change"],
|
|
3200
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3201
|
+
const props = __props;
|
|
3202
|
+
const emit = __emit;
|
|
3203
|
+
const attrs = useAttrs();
|
|
3204
|
+
const cascaderRef = ref(null);
|
|
3205
|
+
const cascaderValue = ref(normalizeValue(props.value));
|
|
3206
|
+
const focused = ref(false);
|
|
3207
|
+
const blurred = ref(false);
|
|
3208
|
+
const visible = ref(false);
|
|
3209
|
+
watch(
|
|
3210
|
+
() => props.value,
|
|
3211
|
+
(value) => {
|
|
3212
|
+
cascaderValue.value = normalizeValue(value);
|
|
3213
|
+
},
|
|
3214
|
+
{ immediate: true }
|
|
3215
|
+
);
|
|
3216
|
+
const rootClass = computed(() => attrs.class);
|
|
3217
|
+
const rootStyle = computed(() => attrs.style);
|
|
3218
|
+
const cascaderAttrs = computed(() => {
|
|
3219
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
3220
|
+
return rest;
|
|
3221
|
+
});
|
|
3222
|
+
const containerClasses = computed(() => ({
|
|
3223
|
+
"outlined-cascader--bordered": props.isBorder
|
|
3224
|
+
}));
|
|
3225
|
+
const containerStyle = computed(() => ({
|
|
3226
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
3227
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
3228
|
+
}));
|
|
3229
|
+
const cascaderStyle = computed(() => ({
|
|
3230
|
+
width: "100%",
|
|
3231
|
+
height: `${props.inputHeight}px`
|
|
3232
|
+
}));
|
|
3233
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
3234
|
+
const hasContent = computed(() => cascaderValue.value.length > 0);
|
|
3235
|
+
const labelClasses = computed(() => ({
|
|
3236
|
+
"outlined-cascader__label--floating": focused.value || hasContent.value,
|
|
3237
|
+
"outlined-cascader__label--placeholder": !focused.value && !hasContent.value,
|
|
3238
|
+
"outlined-cascader__label--filled": hasContent.value && !focused.value
|
|
3239
|
+
}));
|
|
3240
|
+
function handleModelValueUpdate(value) {
|
|
3241
|
+
const normalizedValue = normalizeValue(value);
|
|
3242
|
+
cascaderValue.value = normalizedValue;
|
|
3243
|
+
emitModelValue(normalizedValue);
|
|
3244
|
+
}
|
|
3245
|
+
function handleChange(value) {
|
|
3246
|
+
const normalizedValue = normalizeValue(value);
|
|
3247
|
+
cascaderValue.value = normalizedValue;
|
|
3248
|
+
emit("change", normalizedValue);
|
|
3249
|
+
}
|
|
3250
|
+
function handleFocus(event) {
|
|
3251
|
+
blurred.value = false;
|
|
3252
|
+
focused.value = true;
|
|
3253
|
+
emit("focus", event);
|
|
3254
|
+
}
|
|
3255
|
+
function handleBlur(event) {
|
|
3256
|
+
blurred.value = true;
|
|
3257
|
+
if (!visible.value) {
|
|
3258
|
+
focused.value = false;
|
|
3259
|
+
emitModelValue(cascaderValue.value);
|
|
3260
|
+
}
|
|
3261
|
+
emit("blur", event);
|
|
3262
|
+
}
|
|
3263
|
+
function handleVisibleChange(nextVisible) {
|
|
3264
|
+
visible.value = nextVisible;
|
|
3265
|
+
if (!nextVisible && blurred.value) {
|
|
3266
|
+
focused.value = false;
|
|
3267
|
+
}
|
|
3268
|
+
emit("visible-change", nextVisible);
|
|
3269
|
+
}
|
|
3270
|
+
function emitModelValue(value) {
|
|
3271
|
+
emit("input", value);
|
|
3272
|
+
emit("update:value", value);
|
|
3273
|
+
}
|
|
3274
|
+
function normalizeValue(value) {
|
|
3275
|
+
return Array.isArray(value) ? value : [];
|
|
3276
|
+
}
|
|
3277
|
+
function toCssValue(value) {
|
|
3278
|
+
if (typeof value === "number") {
|
|
3279
|
+
return `${value}px`;
|
|
3280
|
+
}
|
|
3281
|
+
return value;
|
|
3282
|
+
}
|
|
3283
|
+
__expose({
|
|
3284
|
+
focus: () => {
|
|
3285
|
+
var _a, _b;
|
|
3286
|
+
(_b = (_a = cascaderRef.value) == null ? void 0 : _a.togglePopperVisible) == null ? void 0 : _b.call(_a, true);
|
|
3287
|
+
},
|
|
3288
|
+
blur: () => {
|
|
3289
|
+
var _a, _b;
|
|
3290
|
+
(_b = (_a = cascaderRef.value) == null ? void 0 : _a.togglePopperVisible) == null ? void 0 : _b.call(_a, false);
|
|
3291
|
+
},
|
|
3292
|
+
togglePopperVisible: () => {
|
|
3293
|
+
var _a, _b;
|
|
3294
|
+
(_b = (_a = cascaderRef.value) == null ? void 0 : _a.togglePopperVisible) == null ? void 0 : _b.call(_a);
|
|
3295
|
+
},
|
|
3296
|
+
clear: () => {
|
|
3297
|
+
cascaderValue.value = [];
|
|
3298
|
+
emitModelValue([]);
|
|
3299
|
+
emit("change", []);
|
|
3300
|
+
},
|
|
3301
|
+
getCascaderRef: () => cascaderRef.value
|
|
3302
|
+
});
|
|
3303
|
+
return (_ctx, _cache) => {
|
|
3304
|
+
const _component_el_cascader = resolveComponent("el-cascader");
|
|
3305
|
+
return openBlock(), createElementBlock("div", {
|
|
3306
|
+
class: normalizeClass(["outlined-cascader", [containerClasses.value, rootClass.value]]),
|
|
3307
|
+
style: normalizeStyle([containerStyle.value, rootStyle.value])
|
|
3308
|
+
}, [
|
|
3309
|
+
createVNode(_component_el_cascader, mergeProps({
|
|
3310
|
+
ref_key: "cascaderRef",
|
|
3311
|
+
ref: cascaderRef
|
|
3312
|
+
}, cascaderAttrs.value, {
|
|
3313
|
+
class: "outlined-cascader__control",
|
|
3314
|
+
"model-value": cascaderValue.value,
|
|
3315
|
+
options: __props.options,
|
|
3316
|
+
props: __props.propsValue,
|
|
3317
|
+
clearable: __props.clearable,
|
|
3318
|
+
placeholder: __props.placeholder,
|
|
3319
|
+
filterable: __props.filterable,
|
|
3320
|
+
"show-all-levels": __props.levels,
|
|
3321
|
+
disabled: __props.disabled,
|
|
3322
|
+
"popper-class": __props.popperClass,
|
|
3323
|
+
style: cascaderStyle.value,
|
|
3324
|
+
"onUpdate:modelValue": handleModelValueUpdate,
|
|
3325
|
+
onFocus: handleFocus,
|
|
3326
|
+
onBlur: handleBlur,
|
|
3327
|
+
onChange: handleChange,
|
|
3328
|
+
onVisibleChange: handleVisibleChange
|
|
3329
|
+
}), null, 16, ["model-value", "options", "props", "clearable", "placeholder", "filterable", "show-all-levels", "disabled", "popper-class", "style"]),
|
|
3330
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
3331
|
+
key: 0,
|
|
3332
|
+
class: normalizeClass(["outlined-cascader__label", labelClasses.value])
|
|
3333
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
3334
|
+
], 6);
|
|
3335
|
+
};
|
|
3336
|
+
}
|
|
3337
|
+
});
|
|
3338
|
+
var OutlinedCascader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-2c93c0e4"]]);
|
|
3339
|
+
var OutlinedTreeSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
3340
|
+
const _sfc_main = defineComponent({
|
|
3341
|
+
...{
|
|
3342
|
+
name: "OutlinedTreeSelect",
|
|
3343
|
+
inheritAttrs: false
|
|
3344
|
+
},
|
|
3345
|
+
__name: "OutlinedTreeSelect",
|
|
3346
|
+
props: {
|
|
3347
|
+
value: { type: [String, Number, Boolean, Object, null, Array], default: void 0 },
|
|
3348
|
+
data: { default: () => [] },
|
|
3349
|
+
propsValue: { default: void 0 },
|
|
3350
|
+
placeholder: { default: "" },
|
|
3351
|
+
label: { default: "" },
|
|
3352
|
+
disabled: { type: Boolean, default: false },
|
|
3353
|
+
clearable: { type: Boolean, default: true },
|
|
3354
|
+
filterable: { type: Boolean, default: true },
|
|
3355
|
+
multiple: { type: Boolean, default: false },
|
|
3356
|
+
showCheckbox: { type: Boolean, default: false },
|
|
3357
|
+
checkStrictly: { type: Boolean, default: false },
|
|
3358
|
+
checkOnClickNode: { type: Boolean, default: false },
|
|
3359
|
+
defaultExpandAll: { type: Boolean, default: false },
|
|
3360
|
+
expandOnClickNode: { type: Boolean, default: false },
|
|
3361
|
+
renderAfterExpand: { type: Boolean, default: false },
|
|
3362
|
+
collapseTags: { type: Boolean, default: false },
|
|
3363
|
+
collapseTagsTooltip: { type: Boolean, default: true },
|
|
3364
|
+
maxCollapseTags: { default: 5 },
|
|
3365
|
+
popperClass: { default: "" },
|
|
3366
|
+
nodeKey: { default: "value" },
|
|
3367
|
+
keyValue: { default: "value" },
|
|
3368
|
+
labelValue: { default: "label" },
|
|
3369
|
+
childrenValue: { default: "children" },
|
|
3370
|
+
disabledValue: { default: "disabled" },
|
|
3371
|
+
inputHeight: { default: 40 },
|
|
3372
|
+
isBorder: { type: Boolean, default: false },
|
|
3373
|
+
marginBottom: { default: 20 },
|
|
3374
|
+
paddingTop: { default: 20 }
|
|
3375
|
+
},
|
|
3376
|
+
emits: ["input", "update:value", "change", "focus", "blur", "visible-change", "clear"],
|
|
3377
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3378
|
+
const props = __props;
|
|
3379
|
+
const emit = __emit;
|
|
3380
|
+
const attrs = useAttrs();
|
|
3381
|
+
const treeSelectRef = ref(null);
|
|
3382
|
+
const treeSelectValue = ref(normalizeTreeSelectValue(props.value, isArrayMode()));
|
|
3383
|
+
const focused = ref(false);
|
|
3384
|
+
const blurred = ref(false);
|
|
3385
|
+
const visible = ref(false);
|
|
3386
|
+
watch(
|
|
3387
|
+
() => [props.value, props.multiple, props.showCheckbox],
|
|
3388
|
+
([value]) => {
|
|
3389
|
+
treeSelectValue.value = normalizeTreeSelectValue(value, isArrayMode());
|
|
3390
|
+
},
|
|
3391
|
+
{ immediate: true }
|
|
3392
|
+
);
|
|
3393
|
+
const rootClass = computed(() => attrs.class);
|
|
3394
|
+
const rootStyle = computed(() => attrs.style);
|
|
3395
|
+
const treeSelectAttrs = computed(() => {
|
|
3396
|
+
const { class: _class, style: _style, ...rest } = attrs;
|
|
3397
|
+
return rest;
|
|
3398
|
+
});
|
|
3399
|
+
const containerClasses = computed(() => ({
|
|
3400
|
+
"outlined-tree-select--bordered": props.isBorder
|
|
3401
|
+
}));
|
|
3402
|
+
const containerStyle = computed(() => ({
|
|
3403
|
+
marginBottom: toCssValue(props.marginBottom),
|
|
3404
|
+
paddingTop: toCssValue(props.paddingTop)
|
|
3405
|
+
}));
|
|
3406
|
+
const treeSelectStyle = computed(() => ({
|
|
3407
|
+
minHeight: `${props.inputHeight}px`,
|
|
3408
|
+
height: isArrayMode() ? "auto" : `${props.inputHeight}px`
|
|
3409
|
+
}));
|
|
3410
|
+
const resolvedTreeProps = computed(() => {
|
|
3411
|
+
if (props.propsValue) {
|
|
3412
|
+
return props.propsValue;
|
|
3413
|
+
}
|
|
3414
|
+
return {
|
|
3415
|
+
value: props.keyValue,
|
|
3416
|
+
label: props.labelValue,
|
|
3417
|
+
children: props.childrenValue,
|
|
3418
|
+
disabled: props.disabledValue
|
|
3419
|
+
};
|
|
3420
|
+
});
|
|
3421
|
+
const floatingLabel = computed(() => props.label || props.placeholder || "");
|
|
3422
|
+
const hasContent = computed(() => {
|
|
3423
|
+
if (isArrayMode()) {
|
|
3424
|
+
return Array.isArray(treeSelectValue.value) && treeSelectValue.value.length > 0;
|
|
3425
|
+
}
|
|
3426
|
+
return hasFilledValue(treeSelectValue.value);
|
|
3427
|
+
});
|
|
3428
|
+
const labelClasses = computed(() => ({
|
|
3429
|
+
"outlined-tree-select__label--floating": focused.value || hasContent.value,
|
|
3430
|
+
"outlined-tree-select__label--placeholder": !focused.value && !hasContent.value,
|
|
3431
|
+
"outlined-tree-select__label--filled": hasContent.value && !focused.value
|
|
3432
|
+
}));
|
|
3433
|
+
function isArrayMode() {
|
|
3434
|
+
return props.multiple || props.showCheckbox;
|
|
3435
|
+
}
|
|
3436
|
+
function handleModelValueUpdate(value) {
|
|
3437
|
+
const normalizedValue = normalizeTreeSelectValue(value, isArrayMode());
|
|
3438
|
+
treeSelectValue.value = normalizedValue;
|
|
3439
|
+
emitModelValue(normalizedValue);
|
|
3440
|
+
}
|
|
3441
|
+
function handleChange(value) {
|
|
3442
|
+
const normalizedValue = normalizeTreeSelectValue(value, isArrayMode());
|
|
3443
|
+
treeSelectValue.value = normalizedValue;
|
|
3444
|
+
emit("change", normalizedValue);
|
|
3445
|
+
}
|
|
3446
|
+
function handleFocus(event) {
|
|
3447
|
+
blurred.value = false;
|
|
3448
|
+
focused.value = true;
|
|
3449
|
+
emit("focus", event);
|
|
3450
|
+
}
|
|
3451
|
+
function handleBlur(event) {
|
|
3452
|
+
blurred.value = true;
|
|
3453
|
+
if (!visible.value) {
|
|
3454
|
+
focused.value = false;
|
|
3455
|
+
emitModelValue(treeSelectValue.value);
|
|
3456
|
+
}
|
|
3457
|
+
emit("blur", event);
|
|
3458
|
+
}
|
|
3459
|
+
function handleVisibleChange(nextVisible) {
|
|
3460
|
+
visible.value = nextVisible;
|
|
3461
|
+
if (!nextVisible && blurred.value) {
|
|
3462
|
+
focused.value = false;
|
|
3463
|
+
}
|
|
3464
|
+
emit("visible-change", nextVisible);
|
|
3465
|
+
}
|
|
3466
|
+
function handleClear() {
|
|
3467
|
+
emit("clear");
|
|
3468
|
+
}
|
|
3469
|
+
function emitModelValue(value) {
|
|
3470
|
+
emit("input", value);
|
|
3471
|
+
emit("update:value", value);
|
|
3472
|
+
}
|
|
3473
|
+
function normalizeTreeSelectValue(value, arrayMode) {
|
|
3474
|
+
if (arrayMode) {
|
|
3475
|
+
if (Array.isArray(value)) {
|
|
3476
|
+
return value;
|
|
3477
|
+
}
|
|
3478
|
+
if (value === void 0 || value === null || value === "") {
|
|
3479
|
+
return [];
|
|
3480
|
+
}
|
|
3481
|
+
return [value];
|
|
3482
|
+
}
|
|
3483
|
+
return value != null ? value : "";
|
|
3484
|
+
}
|
|
3485
|
+
function hasFilledValue(value) {
|
|
3486
|
+
return value !== void 0 && value !== null && String(value) !== "";
|
|
3487
|
+
}
|
|
3488
|
+
function toCssValue(value) {
|
|
3489
|
+
if (typeof value === "number") {
|
|
3490
|
+
return `${value}px`;
|
|
3491
|
+
}
|
|
3492
|
+
return value;
|
|
3493
|
+
}
|
|
3494
|
+
__expose({
|
|
3495
|
+
focus: () => {
|
|
3496
|
+
var _a, _b;
|
|
3497
|
+
(_b = (_a = treeSelectRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
3498
|
+
},
|
|
3499
|
+
blur: () => {
|
|
3500
|
+
var _a, _b;
|
|
3501
|
+
(_b = (_a = treeSelectRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
|
|
3502
|
+
},
|
|
3503
|
+
clear: () => {
|
|
3504
|
+
if (isArrayMode()) {
|
|
3505
|
+
treeSelectValue.value = [];
|
|
3506
|
+
emitModelValue([]);
|
|
3507
|
+
emit("change", []);
|
|
3508
|
+
emit("clear");
|
|
3509
|
+
return;
|
|
3510
|
+
}
|
|
3511
|
+
treeSelectValue.value = "";
|
|
3512
|
+
emitModelValue("");
|
|
3513
|
+
emit("change", "");
|
|
3514
|
+
emit("clear");
|
|
3515
|
+
},
|
|
3516
|
+
getTreeSelectRef: () => treeSelectRef.value
|
|
3517
|
+
});
|
|
3518
|
+
return (_ctx, _cache) => {
|
|
3519
|
+
const _component_el_tree_select = resolveComponent("el-tree-select");
|
|
3520
|
+
return openBlock(), createElementBlock("div", {
|
|
3521
|
+
class: normalizeClass(["outlined-tree-select", [containerClasses.value, rootClass.value]]),
|
|
3522
|
+
style: normalizeStyle([containerStyle.value, rootStyle.value])
|
|
3523
|
+
}, [
|
|
3524
|
+
createVNode(_component_el_tree_select, mergeProps({
|
|
3525
|
+
ref_key: "treeSelectRef",
|
|
3526
|
+
ref: treeSelectRef
|
|
3527
|
+
}, treeSelectAttrs.value, {
|
|
3528
|
+
class: "outlined-tree-select__control",
|
|
3529
|
+
"model-value": treeSelectValue.value,
|
|
3530
|
+
data: __props.data,
|
|
3531
|
+
props: resolvedTreeProps.value,
|
|
3532
|
+
placeholder: __props.placeholder,
|
|
3533
|
+
disabled: __props.disabled,
|
|
3534
|
+
clearable: __props.clearable,
|
|
3535
|
+
filterable: __props.filterable,
|
|
3536
|
+
multiple: __props.multiple,
|
|
3537
|
+
"show-checkbox": __props.showCheckbox,
|
|
3538
|
+
"check-strictly": __props.checkStrictly,
|
|
3539
|
+
"check-on-click-node": __props.checkOnClickNode,
|
|
3540
|
+
"default-expand-all": __props.defaultExpandAll,
|
|
3541
|
+
"expand-on-click-node": __props.expandOnClickNode,
|
|
3542
|
+
"render-after-expand": __props.renderAfterExpand,
|
|
3543
|
+
"collapse-tags": __props.collapseTags,
|
|
3544
|
+
"collapse-tags-tooltip": __props.collapseTagsTooltip,
|
|
3545
|
+
"max-collapse-tags": __props.maxCollapseTags,
|
|
3546
|
+
"popper-class": __props.popperClass,
|
|
3547
|
+
"node-key": __props.nodeKey,
|
|
3548
|
+
style: treeSelectStyle.value,
|
|
3549
|
+
"onUpdate:modelValue": handleModelValueUpdate,
|
|
3550
|
+
onFocus: handleFocus,
|
|
3551
|
+
onBlur: handleBlur,
|
|
3552
|
+
onChange: handleChange,
|
|
3553
|
+
onVisibleChange: handleVisibleChange,
|
|
3554
|
+
onClear: handleClear
|
|
3555
|
+
}), {
|
|
3556
|
+
empty: withCtx(() => [
|
|
3557
|
+
renderSlot(_ctx.$slots, "empty", {}, void 0, true)
|
|
3558
|
+
]),
|
|
3559
|
+
header: withCtx(() => [
|
|
3560
|
+
renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
3561
|
+
]),
|
|
3562
|
+
footer: withCtx(() => [
|
|
3563
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
3564
|
+
]),
|
|
3565
|
+
_: 3
|
|
3566
|
+
}, 16, ["model-value", "data", "props", "placeholder", "disabled", "clearable", "filterable", "multiple", "show-checkbox", "check-strictly", "check-on-click-node", "default-expand-all", "expand-on-click-node", "render-after-expand", "collapse-tags", "collapse-tags-tooltip", "max-collapse-tags", "popper-class", "node-key", "style"]),
|
|
3567
|
+
floatingLabel.value ? (openBlock(), createElementBlock("div", {
|
|
3568
|
+
key: 0,
|
|
3569
|
+
class: normalizeClass(["outlined-tree-select__label", labelClasses.value])
|
|
3570
|
+
}, toDisplayString(floatingLabel.value), 3)) : createCommentVNode("", true)
|
|
3571
|
+
], 6);
|
|
3572
|
+
};
|
|
3573
|
+
}
|
|
3574
|
+
});
|
|
3575
|
+
var OutlinedTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8403e6ea"]]);
|
|
3576
|
+
export { BaseCard, BaseEChart, _sfc_main$7 as BaseExportButton, BaseTable, OutlinedCascader, OutlinedDatePicker, OutlinedDateTimePicker, OutlinedInput, OutlinedSelect, OutlinedTimePicker, OutlinedTreeSelect, downloadExportResponse, exportExcel, extractFileNameFromDisposition, normalizeExportFileName };
|