@pequity/squirrel 1.0.20-beta.2 → 1.0.20-beta.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/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -1
- package/dist/cjs/chunks/p-action-bar.js +60 -1
- package/dist/cjs/chunks/p-card.js +28 -1
- package/dist/cjs/chunks/p-checkbox.js +24 -1
- package/dist/cjs/chunks/p-dropdown-select.js +414 -1
- package/dist/cjs/chunks/p-input-percent.js +53 -1
- package/dist/cjs/chunks/p-pagination-info.js +66 -1
- package/dist/cjs/chunks/p-pagination.js +122 -1
- package/dist/cjs/chunks/p-ring-loader.js +81 -1
- package/dist/cjs/chunks/p-select-btn.js +97 -1
- package/dist/cjs/chunks/p-select.js +123 -1
- package/dist/cjs/chunks/p-table-loader.js +70 -1
- package/dist/cjs/chunks/p-tabs.js +52 -1
- package/dist/cjs/config.js +105 -1
- package/dist/cjs/currency.js +9 -1
- package/dist/cjs/dom.js +27 -1
- package/dist/cjs/index.js +976 -1
- package/dist/cjs/inputClassesMixin.js +50 -1
- package/dist/cjs/inputClassesShared.js +76 -1
- package/dist/cjs/listKeyboardNavigation.js +110 -1
- package/dist/cjs/number.js +9 -1
- package/dist/cjs/object.js +4 -1
- package/dist/cjs/p-action-bar.js +3 -1
- package/dist/cjs/p-alert.js +65 -1
- package/dist/cjs/p-avatar.js +71 -1
- package/dist/cjs/p-btn.js +358 -2
- package/dist/cjs/p-card.js +3 -1
- package/dist/cjs/p-checkbox.js +3 -1
- package/dist/cjs/p-chips.js +110 -1
- package/dist/cjs/p-close-btn.js +36 -1
- package/dist/cjs/p-date-picker.js +139 -1
- package/dist/cjs/p-drawer.js +253 -1
- package/dist/cjs/p-dropdown-select.js +3 -1
- package/dist/cjs/p-dropdown.js +138 -1
- package/dist/cjs/p-file-upload.js +21 -1
- package/dist/cjs/p-info-icon.js +35 -1
- package/dist/cjs/p-inline-date-picker.js +142 -1
- package/dist/cjs/p-input-number.js +146 -1
- package/dist/cjs/p-input-percent.js +3 -1
- package/dist/cjs/p-input-search.js +110 -1
- package/dist/cjs/p-input.js +89 -1
- package/dist/cjs/p-loading.js +38 -1
- package/dist/cjs/p-modal.js +369 -1
- package/dist/cjs/p-pagination-info.js +3 -1
- package/dist/cjs/p-pagination.js +3 -1
- package/dist/cjs/p-progress-bar.js +41 -1
- package/dist/cjs/p-ring-loader.js +3 -1
- package/dist/cjs/p-select-btn.js +3 -1
- package/dist/cjs/p-select-list.js +4 -1
- package/dist/cjs/p-select-pill.js +111 -1
- package/dist/cjs/p-select.js +3 -1
- package/dist/cjs/p-skeleton-loader.js +73 -1
- package/dist/cjs/p-table-filter-icon.js +20 -1
- package/dist/cjs/p-table-header-cell.js +75 -1
- package/dist/cjs/p-table-loader.js +3 -1
- package/dist/cjs/p-table-sort.js +8 -1
- package/dist/cjs/p-table-td.js +88 -1
- package/dist/cjs/p-table.js +12 -1
- package/dist/cjs/p-tabs.js +3 -1
- package/dist/cjs/p-textarea.js +73 -1
- package/dist/cjs/p-toggle.js +114 -1
- package/dist/cjs/pagination.js +29 -1
- package/dist/cjs/string.js +12 -1
- package/dist/cjs/tailwind.js +4353 -1
- package/dist/cjs/text.js +16 -1
- package/dist/cjs/useInputClasses.js +44 -1
- package/dist/cjs/usePLoading.js +35 -1
- package/dist/cjs/usePModal.js +21 -1
- package/dist/cjs/usePTableColResize.js +81 -1
- package/dist/cjs/usePTableRowVirtualizer.js +31 -1
- package/dist/cjs/useSelectList.js +256 -1
- package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
- package/dist/es/chunks/p-action-bar.js +45 -36
- package/dist/es/chunks/p-card.js +18 -14
- package/dist/es/chunks/p-checkbox.js +14 -11
- package/dist/es/chunks/p-dropdown-select.js +232 -183
- package/dist/es/chunks/p-input-percent.js +34 -25
- package/dist/es/chunks/p-pagination-info.js +30 -24
- package/dist/es/chunks/p-pagination.js +78 -48
- package/dist/es/chunks/p-ring-loader.js +63 -40
- package/dist/es/chunks/p-select-btn.js +80 -59
- package/dist/es/chunks/p-select.js +81 -54
- package/dist/es/chunks/p-table-loader.js +46 -32
- package/dist/es/chunks/p-tabs.js +35 -29
- package/dist/es/config.js +2 -2
- package/dist/es/currency.js +3 -3
- package/dist/es/dom.js +24 -12
- package/dist/es/index.js +703 -561
- package/dist/es/inputClassesMixin.js +20 -14
- package/dist/es/inputClassesShared.js +60 -45
- package/dist/es/listKeyboardNavigation.js +86 -36
- package/dist/es/number.js +7 -2
- package/dist/es/object.js +2 -2
- package/dist/es/p-action-bar.js +2 -2
- package/dist/es/p-alert.js +35 -30
- package/dist/es/p-avatar.js +30 -27
- package/dist/es/p-btn.js +209 -164
- package/dist/es/p-card.js +2 -2
- package/dist/es/p-checkbox.js +2 -2
- package/dist/es/p-chips.js +60 -40
- package/dist/es/p-close-btn.js +20 -16
- package/dist/es/p-date-picker.js +66 -58
- package/dist/es/p-drawer.js +108 -89
- package/dist/es/p-dropdown-select.js +2 -2
- package/dist/es/p-dropdown.js +52 -33
- package/dist/es/p-file-upload.js +17 -9
- package/dist/es/p-info-icon.js +21 -16
- package/dist/es/p-inline-date-picker.js +64 -53
- package/dist/es/p-input-number.js +84 -66
- package/dist/es/p-input-percent.js +2 -2
- package/dist/es/p-input-search.js +43 -41
- package/dist/es/p-input.js +51 -45
- package/dist/es/p-loading.js +31 -22
- package/dist/es/p-modal.js +261 -174
- package/dist/es/p-pagination-info.js +2 -2
- package/dist/es/p-pagination.js +2 -2
- package/dist/es/p-progress-bar.js +26 -23
- package/dist/es/p-ring-loader.js +2 -2
- package/dist/es/p-select-btn.js +2 -2
- package/dist/es/p-select-list.js +2 -2
- package/dist/es/p-select-pill.js +58 -41
- package/dist/es/p-select.js +2 -2
- package/dist/es/p-skeleton-loader.js +34 -29
- package/dist/es/p-table-filter-icon.js +11 -11
- package/dist/es/p-table-header-cell.js +38 -33
- package/dist/es/p-table-loader.js +2 -2
- package/dist/es/p-table-sort.js +2 -2
- package/dist/es/p-table-td.js +76 -29
- package/dist/es/p-table.js +10 -6
- package/dist/es/p-tabs.js +2 -2
- package/dist/es/p-textarea.js +36 -34
- package/dist/es/p-toggle.js +53 -48
- package/dist/es/pagination.js +25 -8
- package/dist/es/string.js +10 -2
- package/dist/es/tailwind.js +1660 -1101
- package/dist/es/text.js +13 -8
- package/dist/es/useInputClasses.js +38 -22
- package/dist/es/usePLoading.js +31 -15
- package/dist/es/usePModal.js +15 -12
- package/dist/es/usePTableColResize.js +71 -39
- package/dist/es/usePTableRowVirtualizer.js +24 -15
- package/dist/es/useSelectList.js +234 -121
- package/dist/style.css +2124 -1
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -1,83 +1,102 @@
|
|
|
1
|
-
import { config
|
|
2
|
-
import { _
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { a
|
|
15
|
-
import { defineComponent
|
|
16
|
-
import { formatBytes
|
|
17
|
-
import { uniq
|
|
18
|
-
import { useInputClasses
|
|
19
|
-
import { useToast
|
|
20
|
-
import { _ as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { _ as
|
|
27
|
-
import
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { _ as
|
|
31
|
-
import { _ as
|
|
32
|
-
import { default as
|
|
33
|
-
import { _ as
|
|
34
|
-
import { _ as
|
|
35
|
-
import { _ as
|
|
36
|
-
import { SIZES
|
|
37
|
-
import { splitStringForHighlight
|
|
38
|
-
import { toString
|
|
39
|
-
import { useSelectList
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import
|
|
43
|
-
import { colsInjectionKey
|
|
44
|
-
import { MIN_WIDTH_COL_RESIZE
|
|
45
|
-
import { usePTableColResize
|
|
46
|
-
import { _ as
|
|
47
|
-
import { SORTING_TYPES
|
|
48
|
-
import { default as
|
|
49
|
-
import { _ as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { usePLoading
|
|
53
|
-
import { usePModal
|
|
54
|
-
import { usePTableRowVirtualizer
|
|
55
|
-
import { default as
|
|
56
|
-
import { CURRENCY_INPUT_DEFAULTS
|
|
57
|
-
import { getColor
|
|
58
|
-
import { ERROR_MSG
|
|
59
|
-
import { createPagingRange
|
|
60
|
-
import { getNextActiveElement
|
|
61
|
-
import { isObject
|
|
62
|
-
import { setupListKeyboardNavigation
|
|
63
|
-
import { toNumberOrNull
|
|
64
|
-
const
|
|
1
|
+
import { config } from "./config.js";
|
|
2
|
+
import { _ } from "./chunks/p-action-bar.js";
|
|
3
|
+
import { default as default2 } from "./p-alert.js";
|
|
4
|
+
import { default as default3 } from "./p-avatar.js";
|
|
5
|
+
import { default as default4 } from "./p-btn.js";
|
|
6
|
+
import { _ as _2 } from "./chunks/p-card.js";
|
|
7
|
+
import { _ as _3 } from "./chunks/p-checkbox.js";
|
|
8
|
+
import { default as default5 } from "./p-chips.js";
|
|
9
|
+
import { default as default6 } from "./p-close-btn.js";
|
|
10
|
+
import { default as default7 } from "./p-date-picker.js";
|
|
11
|
+
import { default as default8 } from "./p-drawer.js";
|
|
12
|
+
import { default as default9 } from "./p-dropdown.js";
|
|
13
|
+
import { _ as _imports_0$2 } from "./chunks/p-dropdown-select.js";
|
|
14
|
+
import { a } from "./chunks/p-dropdown-select.js";
|
|
15
|
+
import { defineComponent, shallowRef, ref, computed, onMounted, openBlock, createElementBlock, normalizeClass, unref, toDisplayString, createCommentVNode, createElementVNode, withModifiers, createTextVNode, Fragment, renderList, withDirectives, vShow, pushScopeId, popScopeId, useAttrs, resolveDirective, normalizeStyle, createVNode, isRef, renderSlot, provide, onBeforeUnmount, watch, mergeProps, toHandlers } from "vue";
|
|
16
|
+
import { formatBytes, getFileExtension } from "./p-file-upload.js";
|
|
17
|
+
import { uniq, kebabCase } from "lodash-es";
|
|
18
|
+
import { useInputClasses } from "./useInputClasses.js";
|
|
19
|
+
import { useToast } from "vue-toastification";
|
|
20
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
21
|
+
import { default as default10 } from "./p-table-filter-icon.js";
|
|
22
|
+
import { default as default11 } from "./p-info-icon.js";
|
|
23
|
+
import { default as default12 } from "./p-inline-date-picker.js";
|
|
24
|
+
import { default as default13 } from "./p-input.js";
|
|
25
|
+
import { default as default14 } from "./p-input-number.js";
|
|
26
|
+
import { _ as _4 } from "./chunks/p-input-percent.js";
|
|
27
|
+
import PInputSearch from "./p-input-search.js";
|
|
28
|
+
import { default as default15 } from "./p-loading.js";
|
|
29
|
+
import { default as default16 } from "./p-modal.js";
|
|
30
|
+
import { _ as _5 } from "./chunks/p-pagination.js";
|
|
31
|
+
import { _ as _6 } from "./chunks/p-pagination-info.js";
|
|
32
|
+
import { default as default17 } from "./p-progress-bar.js";
|
|
33
|
+
import { _ as _7 } from "./chunks/p-ring-loader.js";
|
|
34
|
+
import { _ as _8 } from "./chunks/p-select.js";
|
|
35
|
+
import { _ as _9 } from "./chunks/p-select-btn.js";
|
|
36
|
+
import { SIZES } from "./p-select-list.js";
|
|
37
|
+
import { splitStringForHighlight } from "./text.js";
|
|
38
|
+
import { toString } from "./string.js";
|
|
39
|
+
import { useSelectList } from "./useSelectList.js";
|
|
40
|
+
import { default as default18 } from "./p-select-pill.js";
|
|
41
|
+
import { default as default19 } from "./p-skeleton-loader.js";
|
|
42
|
+
import PTableHeaderCell from "./p-table-header-cell.js";
|
|
43
|
+
import { colsInjectionKey, isFirstColFixedInjectionKey, isLastColFixedInjectionKey, isColsResizableInjectionKey } from "./p-table.js";
|
|
44
|
+
import { MIN_WIDTH_COL_RESIZE } from "./p-table.js";
|
|
45
|
+
import { usePTableColResize } from "./usePTableColResize.js";
|
|
46
|
+
import { _ as _10 } from "./chunks/p-table-loader.js";
|
|
47
|
+
import { SORTING_TYPES } from "./p-table-sort.js";
|
|
48
|
+
import { default as default20 } from "./p-table-td.js";
|
|
49
|
+
import { _ as _11 } from "./chunks/p-tabs.js";
|
|
50
|
+
import { default as default21 } from "./p-textarea.js";
|
|
51
|
+
import { default as default22 } from "./p-toggle.js";
|
|
52
|
+
import { usePLoading } from "./usePLoading.js";
|
|
53
|
+
import { usePModal } from "./usePModal.js";
|
|
54
|
+
import { usePTableRowVirtualizer } from "./usePTableRowVirtualizer.js";
|
|
55
|
+
import { default as default23 } from "./inputClassesMixin.js";
|
|
56
|
+
import { CURRENCY_INPUT_DEFAULTS } from "./currency.js";
|
|
57
|
+
import { getColor, getColorDeep, getScreen } from "./tailwind.js";
|
|
58
|
+
import { ERROR_MSG, INPUT_BASE, INPUT_ERROR, INPUT_NORMAL, INPUT_SIZES, LABEL_BASE, LABEL_REQUIRED, LABEL_SIZES, SELECT_ARROW, SELECT_BASE, SELECT_SIZES, SPACING_LEFT, SPACING_PREFIX, SPACING_RIGHT, SPACING_SUFFIX, TEXTAREA_BASE } from "./inputClassesShared.js";
|
|
59
|
+
import { createPagingRange } from "./pagination.js";
|
|
60
|
+
import { getNextActiveElement, isElement, isVisible } from "./dom.js";
|
|
61
|
+
import { isObject } from "./object.js";
|
|
62
|
+
import { setupListKeyboardNavigation } from "./listKeyboardNavigation.js";
|
|
63
|
+
import { toNumberOrNull } from "./number.js";
|
|
64
|
+
const _imports_0$1 = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8335%206.25016L10.0002%202.0835L14.1668%206.25016'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M10%202.0835V13.7502'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M2.91675%2015V18.3333H17.0834V15'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3c/svg%3e";
|
|
65
|
+
const _imports_1$1 = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M33%2012H14V44H42V21L33%2012Z'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M9%2036H6V4H25L28%207'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M37%2030H19M28%2021V39'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3c/svg%3e";
|
|
66
|
+
const _withScopeId = (n) => (pushScopeId("data-v-d07a8f64"), n = n(), popScopeId(), n);
|
|
67
|
+
const _hoisted_1$3 = ["data-has-error"];
|
|
68
|
+
const _hoisted_2$3 = {
|
|
65
69
|
key: 0,
|
|
66
70
|
class: "flex h-28 flex-col items-center justify-center"
|
|
67
|
-
}
|
|
71
|
+
};
|
|
72
|
+
const _hoisted_3$3 = {
|
|
68
73
|
key: 0,
|
|
69
74
|
class: "flex flex-col items-center"
|
|
70
|
-
}
|
|
71
|
-
|
|
75
|
+
};
|
|
76
|
+
const _hoisted_4$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
|
|
77
|
+
src: _imports_0$1,
|
|
72
78
|
class: "h-8 w-8"
|
|
73
|
-
}, null, -1))
|
|
79
|
+
}, null, -1));
|
|
80
|
+
const _hoisted_5$3 = { class: "mt-2 text-p-gray-50" };
|
|
81
|
+
const _hoisted_6$3 = { class: "text-p-blue-60" };
|
|
82
|
+
const _hoisted_7$2 = {
|
|
74
83
|
key: 1,
|
|
75
84
|
class: "flex flex-col items-center"
|
|
76
|
-
}
|
|
77
|
-
|
|
85
|
+
};
|
|
86
|
+
const _hoisted_8 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
|
|
87
|
+
src: _imports_1$1,
|
|
78
88
|
class: "h-8 w-8"
|
|
79
|
-
}, null, -1))
|
|
80
|
-
|
|
89
|
+
}, null, -1));
|
|
90
|
+
const _hoisted_9 = { class: "mt-2 text-p-purple-60" };
|
|
91
|
+
const _hoisted_10 = ["accept", "multiple", "disabled"];
|
|
92
|
+
const _hoisted_11 = { class: "max-h-48 overflow-y-auto overflow-x-hidden" };
|
|
93
|
+
const _hoisted_12 = ["title"];
|
|
94
|
+
const _hoisted_13 = ["onClick"];
|
|
95
|
+
const _hoisted_14 = { class: "mt-1 text-xs text-p-gray-40" };
|
|
96
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
97
|
+
...{
|
|
98
|
+
name: "PFileUpload"
|
|
99
|
+
},
|
|
81
100
|
__name: "p-file-upload",
|
|
82
101
|
props: {
|
|
83
102
|
modelValue: {
|
|
@@ -86,7 +105,7 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
86
105
|
},
|
|
87
106
|
multiple: {
|
|
88
107
|
type: Boolean,
|
|
89
|
-
default:
|
|
108
|
+
default: false
|
|
90
109
|
},
|
|
91
110
|
/**
|
|
92
111
|
* Array of file extensions to accept. If empty, all file types are accepted.
|
|
@@ -98,11 +117,11 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
98
117
|
},
|
|
99
118
|
disabled: {
|
|
100
119
|
type: Boolean,
|
|
101
|
-
default:
|
|
120
|
+
default: false
|
|
102
121
|
},
|
|
103
122
|
required: {
|
|
104
123
|
type: Boolean,
|
|
105
|
-
default:
|
|
124
|
+
default: false
|
|
106
125
|
},
|
|
107
126
|
errorMsg: {
|
|
108
127
|
type: String,
|
|
@@ -123,146 +142,201 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
123
142
|
}
|
|
124
143
|
},
|
|
125
144
|
emits: ["update:modelValue", "file-removed", "file-added"],
|
|
126
|
-
setup(
|
|
127
|
-
const
|
|
145
|
+
setup(__props, { emit: __emit }) {
|
|
146
|
+
const props = __props;
|
|
147
|
+
const emit = __emit;
|
|
148
|
+
const fileInputRef = shallowRef();
|
|
149
|
+
const isDraggingOver = ref(false);
|
|
150
|
+
const toast = useToast();
|
|
151
|
+
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
152
|
+
const fileWord = computed(() => props.multiple ? "files" : "file");
|
|
153
|
+
const files = computed({
|
|
128
154
|
get() {
|
|
129
|
-
return Array.isArray(
|
|
155
|
+
return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
130
156
|
},
|
|
131
|
-
set(
|
|
132
|
-
|
|
157
|
+
set(files2) {
|
|
158
|
+
if (props.multiple) {
|
|
159
|
+
emit("update:modelValue", files2);
|
|
160
|
+
} else {
|
|
161
|
+
emit("update:modelValue", files2[0]);
|
|
162
|
+
}
|
|
133
163
|
}
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
164
|
+
});
|
|
165
|
+
const acceptFileTypes = computed(() => {
|
|
166
|
+
return props.fileTypes.length > 0 ? uniq(props.fileTypes).join(",") : void 0;
|
|
167
|
+
});
|
|
168
|
+
const maxFilesReached = computed(() => {
|
|
169
|
+
return props.multiple ? files.value.length >= props.maxNumberOfFiles : files.value.length >= 1;
|
|
170
|
+
});
|
|
171
|
+
const validateFiles = (filesToUpload) => {
|
|
172
|
+
const res = [];
|
|
173
|
+
for (let i = 0; i < filesToUpload.length; i++) {
|
|
174
|
+
const file = filesToUpload[i];
|
|
175
|
+
const fileName = file.name || file.url;
|
|
176
|
+
if (res.length + files.value.length >= props.maxNumberOfFiles) {
|
|
177
|
+
toast.error(`You can only upload a maximum of ${props.maxNumberOfFiles} ${fileWord.value}.`);
|
|
140
178
|
break;
|
|
141
179
|
}
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (
|
|
155
|
-
|
|
180
|
+
if (!fileName) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (file.url) {
|
|
184
|
+
res.push(file);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (props.fileTypes.length === 0)
|
|
188
|
+
;
|
|
189
|
+
else {
|
|
190
|
+
const extension = getFileExtension(fileName) ? `.${getFileExtension(fileName)}` : "";
|
|
191
|
+
const isValidExtension = extension ? props.fileTypes.includes(extension) : false;
|
|
192
|
+
if (!isValidExtension) {
|
|
193
|
+
toast.error(`${extension} files are not allowed.`);
|
|
156
194
|
continue;
|
|
157
195
|
}
|
|
158
|
-
o.push(d);
|
|
159
196
|
}
|
|
197
|
+
if ((file.size || 0) > props.maxSizeInBytes) {
|
|
198
|
+
toast.error(`File size of ${fileName} exceeds ${formatBytes(props.maxSizeInBytes)}.`);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
res.push(file);
|
|
160
202
|
}
|
|
161
|
-
return
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
203
|
+
return res;
|
|
204
|
+
};
|
|
205
|
+
const uploadFile = (e) => {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const f = ((_a = e.target) == null ? void 0 : _a.files) || ((_b = e.dataTransfer) == null ? void 0 : _b.files);
|
|
208
|
+
if (!f) {
|
|
166
209
|
return;
|
|
167
|
-
const a = u.fileTypes ? F(Array.from(o)) : o;
|
|
168
|
-
f.value = u.multiple ? [...f.value, ...a] : a, m("file-added", a);
|
|
169
|
-
}, T = (n) => {
|
|
170
|
-
z(n), g.value && (g.value.value = "");
|
|
171
|
-
}, s = (n) => {
|
|
172
|
-
if (n in f.value) {
|
|
173
|
-
const o = f.value[n];
|
|
174
|
-
f.value = f.value.filter((a, d) => d !== n), m("file-removed", o);
|
|
175
210
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
211
|
+
const validatedFiles = props.fileTypes ? validateFiles(Array.from(f)) : f;
|
|
212
|
+
files.value = props.multiple ? [...files.value, ...validatedFiles] : validatedFiles;
|
|
213
|
+
emit("file-added", validatedFiles);
|
|
214
|
+
};
|
|
215
|
+
const changeFieldValue = (e) => {
|
|
216
|
+
uploadFile(e);
|
|
217
|
+
if (fileInputRef.value) {
|
|
218
|
+
fileInputRef.value.value = "";
|
|
219
|
+
}
|
|
180
220
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
const removeFile = (index) => {
|
|
222
|
+
if (index in files.value) {
|
|
223
|
+
const removedFile = files.value[index];
|
|
224
|
+
files.value = files.value.filter((item, idx) => idx !== index);
|
|
225
|
+
emit("file-removed", removedFile);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const onDrop = (e) => {
|
|
229
|
+
isDraggingOver.value = false;
|
|
230
|
+
changeFieldValue(e);
|
|
231
|
+
};
|
|
232
|
+
const openFileDialog = () => {
|
|
233
|
+
if (fileInputRef.value) {
|
|
234
|
+
fileInputRef.value.click();
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
onMounted(() => {
|
|
238
|
+
if (Array.isArray(files.value) && files.value.length > 0) {
|
|
239
|
+
files.value = validateFiles(files.value);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return (_ctx, _cache) => {
|
|
243
|
+
return openBlock(), createElementBlock("div", {
|
|
244
|
+
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }]),
|
|
245
|
+
"data-has-error": !!__props.errorMsg
|
|
204
246
|
}, [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
247
|
+
__props.label ? (openBlock(), createElementBlock("label", {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: normalizeClass(unref(labelClasses))
|
|
250
|
+
}, toDisplayString(__props.label), 3)) : createCommentVNode("", true),
|
|
251
|
+
createElementVNode("div", {
|
|
252
|
+
class: normalizeClass(["flex w-full flex-col rounded border bg-surface p-4", [
|
|
253
|
+
{ "cursor-pointer": !maxFilesReached.value },
|
|
254
|
+
{ "border-dashed": !isDraggingOver.value },
|
|
255
|
+
{ "border-primary ring-1 ring-primary": isDraggingOver.value && !__props.errorMsg },
|
|
256
|
+
__props.errorMsg ? "border-on-error" : "border-p-gray-40 hover:border-primary",
|
|
257
|
+
{ "pointer-events-none opacity-50": __props.disabled }
|
|
258
|
+
]]),
|
|
259
|
+
"aria-label": "dropzone",
|
|
260
|
+
onDragover: _cache[1] || (_cache[1] = withModifiers(($event) => isDraggingOver.value = true, ["prevent", "stop"])),
|
|
261
|
+
onDragleave: _cache[2] || (_cache[2] = withModifiers(($event) => isDraggingOver.value = false, ["prevent", "stop"])),
|
|
262
|
+
onDrop: withModifiers(onDrop, ["prevent", "stop"]),
|
|
263
|
+
onClick: openFileDialog
|
|
264
|
+
}, [
|
|
265
|
+
!maxFilesReached.value ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
266
|
+
!isDraggingOver.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
267
|
+
_hoisted_4$3,
|
|
268
|
+
createElementVNode("div", _hoisted_5$3, [
|
|
269
|
+
createTextVNode(" Drag or "),
|
|
270
|
+
createElementVNode("span", _hoisted_6$3, "select " + toDisplayString(fileWord.value), 1)
|
|
271
|
+
])
|
|
272
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
273
|
+
_hoisted_8,
|
|
274
|
+
createElementVNode("div", _hoisted_9, "Drop " + toDisplayString(fileWord.value), 1)
|
|
275
|
+
])),
|
|
276
|
+
createElementVNode("input", {
|
|
277
|
+
ref_key: "fileInputRef",
|
|
278
|
+
ref: fileInputRef,
|
|
279
|
+
type: "file",
|
|
280
|
+
class: "hidden",
|
|
281
|
+
tabindex: -1,
|
|
282
|
+
accept: acceptFileTypes.value,
|
|
283
|
+
multiple: __props.multiple,
|
|
284
|
+
disabled: __props.disabled,
|
|
285
|
+
"aria-hidden": "true",
|
|
286
|
+
onChange: changeFieldValue
|
|
287
|
+
}, null, 40, _hoisted_10)
|
|
288
|
+
])) : createCommentVNode("", true),
|
|
289
|
+
createElementVNode("div", _hoisted_11, [
|
|
290
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(files.value, (file, index) => {
|
|
291
|
+
return openBlock(), createElementBlock("div", {
|
|
292
|
+
key: index,
|
|
293
|
+
class: normalizeClass([
|
|
294
|
+
"flex cursor-default items-center justify-between",
|
|
295
|
+
{ "border-b border-dashed border-p-gray-30 pb-4": index !== files.value.length - 1 },
|
|
296
|
+
{ "mt-4": index !== 0 }
|
|
297
|
+
]),
|
|
298
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
299
|
+
}, ["stop"]))
|
|
300
|
+
}, [
|
|
301
|
+
createElementVNode("div", {
|
|
302
|
+
class: "truncate",
|
|
303
|
+
title: file.name
|
|
304
|
+
}, toDisplayString(file.name), 9, _hoisted_12),
|
|
305
|
+
createElementVNode("button", {
|
|
306
|
+
class: "bg-file-upload-x-icon h-4 w-4 shrink-0 cursor-pointer",
|
|
307
|
+
onClick: withModifiers(($event) => removeFile(index), ["stop"])
|
|
308
|
+
}, null, 8, _hoisted_13)
|
|
309
|
+
], 2);
|
|
310
|
+
}), 128))
|
|
311
|
+
])
|
|
312
|
+
], 34),
|
|
313
|
+
withDirectives(createElementVNode("div", {
|
|
314
|
+
class: normalizeClass(unref(errorMsgClasses))
|
|
315
|
+
}, toDisplayString(__props.errorMsg), 3), [
|
|
316
|
+
[vShow, __props.errorMsg]
|
|
317
|
+
]),
|
|
318
|
+
createElementVNode("div", _hoisted_14, toDisplayString(__props.multiple ? `Max ${__props.maxNumberOfFiles}` : "One") + " " + toDisplayString(acceptFileTypes.value) + " " + toDisplayString(__props.multiple ? "files" : "file") + " with size less than " + toDisplayString(unref(formatBytes)(__props.maxSizeInBytes)) + " " + toDisplayString(__props.multiple ? "each" : ""), 1)
|
|
319
|
+
], 10, _hoisted_1$3);
|
|
320
|
+
};
|
|
258
321
|
}
|
|
259
|
-
})
|
|
322
|
+
});
|
|
323
|
+
const pFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-d07a8f64"]]);
|
|
324
|
+
const _hoisted_1$2 = ["data-has-error"];
|
|
325
|
+
const _hoisted_2$2 = { class: "text-p-purple-60" };
|
|
326
|
+
const _hoisted_3$2 = { class: "flex flex-row" };
|
|
327
|
+
const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("span", { class: "px-1 leading-none" }, ".", -1);
|
|
328
|
+
const _hoisted_5$2 = ["onClick"];
|
|
329
|
+
const _hoisted_6$2 = ["title"];
|
|
330
|
+
const _hoisted_7$1 = {
|
|
260
331
|
key: 0,
|
|
261
332
|
class: "ml-auto fill-p-purple-60 pl-2",
|
|
262
|
-
src:
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
333
|
+
src: _imports_0$2
|
|
334
|
+
};
|
|
335
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
336
|
+
...{
|
|
337
|
+
name: "PSelectList",
|
|
338
|
+
inheritAttrs: false
|
|
339
|
+
},
|
|
266
340
|
__name: "p-select-list",
|
|
267
341
|
props: {
|
|
268
342
|
modelValue: {
|
|
@@ -276,7 +350,7 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
276
350
|
*/
|
|
277
351
|
valueIsObject: {
|
|
278
352
|
type: Boolean,
|
|
279
|
-
default:
|
|
353
|
+
default: false
|
|
280
354
|
},
|
|
281
355
|
/**
|
|
282
356
|
* Can be an array of objects or array of strings. When using objects, will look for a text - value pair.
|
|
@@ -296,13 +370,13 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
296
370
|
},
|
|
297
371
|
required: {
|
|
298
372
|
type: Boolean,
|
|
299
|
-
default:
|
|
373
|
+
default: false
|
|
300
374
|
},
|
|
301
375
|
size: {
|
|
302
376
|
type: String,
|
|
303
377
|
default: "md",
|
|
304
|
-
validator(
|
|
305
|
-
return Object.keys(
|
|
378
|
+
validator(value) {
|
|
379
|
+
return Object.keys(SIZES).includes(value);
|
|
306
380
|
}
|
|
307
381
|
},
|
|
308
382
|
/**
|
|
@@ -336,14 +410,14 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
336
410
|
},
|
|
337
411
|
searchable: {
|
|
338
412
|
type: Boolean,
|
|
339
|
-
default:
|
|
413
|
+
default: false
|
|
340
414
|
},
|
|
341
415
|
/**
|
|
342
416
|
* Enables multiple selection
|
|
343
417
|
*/
|
|
344
418
|
multiple: {
|
|
345
419
|
type: Boolean,
|
|
346
|
-
default:
|
|
420
|
+
default: false
|
|
347
421
|
},
|
|
348
422
|
/**
|
|
349
423
|
* Dropdown button text
|
|
@@ -364,7 +438,7 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
364
438
|
*/
|
|
365
439
|
selectedTopShown: {
|
|
366
440
|
type: Boolean,
|
|
367
|
-
default:
|
|
441
|
+
default: false
|
|
368
442
|
},
|
|
369
443
|
topSectionClass: {
|
|
370
444
|
type: String,
|
|
@@ -372,465 +446,533 @@ const Be = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%20
|
|
|
372
446
|
},
|
|
373
447
|
closePopperOnSelect: {
|
|
374
448
|
type: Boolean,
|
|
375
|
-
default:
|
|
449
|
+
default: true
|
|
376
450
|
}
|
|
377
451
|
},
|
|
378
452
|
emits: ["update:modelValue", "select"],
|
|
379
|
-
setup(
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
453
|
+
setup(__props, { emit: __emit }) {
|
|
454
|
+
const emit = __emit;
|
|
455
|
+
const props = __props;
|
|
456
|
+
const listItemStyle = ref({ paddingTop: 0, paddingBottom: 0 });
|
|
457
|
+
const scrollerStyle = ref({ maxHeight: "none" });
|
|
458
|
+
const inputSearch = ref(null);
|
|
459
|
+
const actionsContainer = ref(null);
|
|
460
|
+
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
461
|
+
const $attrs = useAttrs();
|
|
462
|
+
const virtualizerRef = ref(null);
|
|
463
|
+
const {
|
|
464
|
+
LIST_ITEM_CLASS,
|
|
465
|
+
LIST_ITEM_ACTIVE_CLASS,
|
|
466
|
+
selectedItems,
|
|
467
|
+
computedItems,
|
|
468
|
+
computedItemSize,
|
|
469
|
+
computedInsideSelected,
|
|
470
|
+
internalItems,
|
|
471
|
+
search,
|
|
472
|
+
rowVirtualizer,
|
|
473
|
+
getValue,
|
|
474
|
+
getText,
|
|
475
|
+
isSelected,
|
|
476
|
+
setupNavigationSvc,
|
|
477
|
+
select,
|
|
478
|
+
onFocus,
|
|
479
|
+
onMousemove,
|
|
480
|
+
scrollToActiveItem,
|
|
481
|
+
putSelectedItemsOnTop,
|
|
482
|
+
selectAll,
|
|
483
|
+
clearAll
|
|
484
|
+
} = useSelectList(props, inputSearch, virtualizerRef, emit);
|
|
485
|
+
const style = computed(() => $attrs.style);
|
|
486
|
+
onMounted(async () => {
|
|
487
|
+
var _a, _b;
|
|
488
|
+
const actionsContainerHeight = ((_a = actionsContainer.value) == null ? void 0 : _a.clientHeight) || 0;
|
|
489
|
+
scrollerStyle.value = { maxHeight: `${computedItemSize.value * props.itemsVisible - actionsContainerHeight}px` };
|
|
490
|
+
putSelectedItemsOnTop();
|
|
491
|
+
if (props.searchable) {
|
|
492
|
+
(_b = inputSearch.value) == null ? void 0 : _b.$el.querySelector("input").focus();
|
|
493
|
+
} else {
|
|
494
|
+
setupNavigationSvc();
|
|
495
|
+
}
|
|
496
|
+
scrollToActiveItem({ wait: 200 });
|
|
497
|
+
});
|
|
498
|
+
return (_ctx, _cache) => {
|
|
499
|
+
const _directive_close_popper = resolveDirective("close-popper");
|
|
500
|
+
return openBlock(), createElementBlock("div", {
|
|
409
501
|
ref: "formControl",
|
|
410
|
-
class:
|
|
411
|
-
"data-has-error": !!
|
|
412
|
-
style:
|
|
502
|
+
class: normalizeClass([{ hidden: unref($attrs).hidden }, unref($attrs).class]),
|
|
503
|
+
"data-has-error": !!__props.errorMsg,
|
|
504
|
+
style: normalizeStyle(style.value),
|
|
413
505
|
"p-select-list": ""
|
|
414
506
|
}, [
|
|
415
|
-
|
|
507
|
+
__props.label ? (openBlock(), createElementBlock("label", {
|
|
416
508
|
key: 0,
|
|
417
|
-
class:
|
|
418
|
-
},
|
|
419
|
-
|
|
420
|
-
class:
|
|
421
|
-
{ "border border-on-error": !!
|
|
422
|
-
|
|
509
|
+
class: normalizeClass(unref(labelClasses))
|
|
510
|
+
}, toDisplayString(__props.label), 3)) : createCommentVNode("", true),
|
|
511
|
+
createElementVNode("div", {
|
|
512
|
+
class: normalizeClass([
|
|
513
|
+
{ "border border-on-error": !!__props.errorMsg },
|
|
514
|
+
unref($attrs).disabled ? "pointer-events-none bg-p-gray-10" : "bg-white"
|
|
423
515
|
])
|
|
424
516
|
}, [
|
|
425
|
-
|
|
517
|
+
__props.multiple || __props.searchable ? (openBlock(), createElementBlock("div", {
|
|
426
518
|
key: 0,
|
|
427
|
-
class:
|
|
519
|
+
class: normalizeClass(__props.topSectionClass)
|
|
428
520
|
}, [
|
|
429
|
-
|
|
521
|
+
__props.multiple ? (openBlock(), createElementBlock("div", {
|
|
430
522
|
key: 0,
|
|
431
523
|
ref_key: "actionsContainer",
|
|
432
|
-
ref:
|
|
524
|
+
ref: actionsContainer,
|
|
433
525
|
class: "flex flex-row justify-between text-xs font-semibold text-primary"
|
|
434
526
|
}, [
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
527
|
+
createElementVNode("p", _hoisted_2$2, toDisplayString(unref(computedItems).length) + " items", 1),
|
|
528
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
529
|
+
unref(computedItems).length === unref(internalItems).length ? (openBlock(), createElementBlock("a", {
|
|
438
530
|
key: 0,
|
|
439
|
-
class:
|
|
440
|
-
|
|
531
|
+
class: normalizeClass([
|
|
532
|
+
unref(selectedItems).length !== unref(internalItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"
|
|
441
533
|
]),
|
|
442
|
-
onClick:
|
|
443
|
-
(...
|
|
444
|
-
}, " Select all ", 2)) : (
|
|
534
|
+
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
535
|
+
(...args) => unref(selectAll) && unref(selectAll)(...args))
|
|
536
|
+
}, " Select all ", 2)) : (openBlock(), createElementBlock("a", {
|
|
445
537
|
key: 1,
|
|
446
|
-
class:
|
|
447
|
-
onClick:
|
|
448
|
-
(...
|
|
538
|
+
class: normalizeClass([unref(computedInsideSelected) ? "pointer-events-none opacity-50" : "cursor-pointer"]),
|
|
539
|
+
onClick: _cache[1] || (_cache[1] = //@ts-ignore
|
|
540
|
+
(...args) => unref(selectAll) && unref(selectAll)(...args))
|
|
449
541
|
}, " Select all filtered ", 2)),
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
class:
|
|
453
|
-
onClick:
|
|
454
|
-
(...
|
|
542
|
+
_hoisted_4$2,
|
|
543
|
+
createElementVNode("a", {
|
|
544
|
+
class: normalizeClass([unref(selectedItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
|
|
545
|
+
onClick: _cache[2] || (_cache[2] = //@ts-ignore
|
|
546
|
+
(...args) => unref(clearAll) && unref(clearAll)(...args))
|
|
455
547
|
}, " Clear all ", 2)
|
|
456
548
|
])
|
|
457
|
-
], 512)) :
|
|
458
|
-
|
|
549
|
+
], 512)) : createCommentVNode("", true),
|
|
550
|
+
__props.searchable ? (openBlock(), createElementBlock("div", {
|
|
459
551
|
key: 1,
|
|
460
|
-
class:
|
|
552
|
+
class: normalizeClass([{ "mt-3": __props.multiple }])
|
|
461
553
|
}, [
|
|
462
|
-
|
|
554
|
+
createVNode(PInputSearch, {
|
|
463
555
|
ref_key: "inputSearch",
|
|
464
|
-
ref:
|
|
465
|
-
modelValue:
|
|
466
|
-
"onUpdate:modelValue":
|
|
467
|
-
size:
|
|
468
|
-
placeholder:
|
|
469
|
-
onFocus:
|
|
556
|
+
ref: inputSearch,
|
|
557
|
+
modelValue: unref(search),
|
|
558
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(search) ? search.value = $event : null),
|
|
559
|
+
size: __props.size,
|
|
560
|
+
placeholder: __props.placeholderSearch,
|
|
561
|
+
onFocus: unref(onFocus)
|
|
470
562
|
}, null, 8, ["modelValue", "size", "placeholder", "onFocus"])
|
|
471
|
-
], 2)) :
|
|
472
|
-
], 2)) :
|
|
473
|
-
|
|
563
|
+
], 2)) : createCommentVNode("", true)
|
|
564
|
+
], 2)) : createCommentVNode("", true),
|
|
565
|
+
createElementVNode("div", {
|
|
474
566
|
ref_key: "virtualizerRef",
|
|
475
|
-
ref:
|
|
476
|
-
style:
|
|
477
|
-
class:
|
|
567
|
+
ref: virtualizerRef,
|
|
568
|
+
style: normalizeStyle(scrollerStyle.value),
|
|
569
|
+
class: normalizeClass(["overflow-y-auto", { "mt-3": __props.multiple || __props.searchable }])
|
|
478
570
|
}, [
|
|
479
|
-
|
|
571
|
+
createElementVNode("div", {
|
|
480
572
|
tabindex: "-1",
|
|
481
573
|
class: "relative w-full",
|
|
482
574
|
"p-select-list-options": "",
|
|
483
|
-
style:
|
|
484
|
-
onFocus:
|
|
485
|
-
(...
|
|
486
|
-
onMousemove:
|
|
487
|
-
(...
|
|
575
|
+
style: normalizeStyle({ height: `${unref(rowVirtualizer).getTotalSize()}px` }),
|
|
576
|
+
onFocus: _cache[4] || (_cache[4] = //@ts-ignore
|
|
577
|
+
(...args) => unref(onFocus) && unref(onFocus)(...args)),
|
|
578
|
+
onMousemove: _cache[5] || (_cache[5] = //@ts-ignore
|
|
579
|
+
(...args) => unref(onMousemove) && unref(onMousemove)(...args))
|
|
488
580
|
}, [
|
|
489
|
-
(
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
Q((i(), r("div", {
|
|
496
|
-
class: c([t(V), { [t(F)]: t(P)(t(a)(p.index)) }]),
|
|
497
|
-
"p-select-list-option-item": "",
|
|
498
|
-
style: I(g.value),
|
|
499
|
-
onClick: (Z) => t(te)(Z, t(a)(p.index))
|
|
581
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rowVirtualizer).getVirtualItems(), (row) => {
|
|
582
|
+
return openBlock(), createElementBlock("div", {
|
|
583
|
+
key: row.index,
|
|
584
|
+
class: "absolute left-0 top-0 w-full",
|
|
585
|
+
"p-select-list-option": "",
|
|
586
|
+
style: normalizeStyle({ height: `${row.size}px`, transform: `translateY(${row.start}px)` })
|
|
500
587
|
}, [
|
|
501
|
-
|
|
502
|
-
class:
|
|
588
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
589
|
+
class: normalizeClass([unref(LIST_ITEM_CLASS), { [unref(LIST_ITEM_ACTIVE_CLASS)]: unref(isSelected)(unref(getValue)(row.index)) }]),
|
|
590
|
+
"p-select-list-option-item": "",
|
|
591
|
+
style: normalizeStyle(listItemStyle.value),
|
|
592
|
+
onClick: ($event) => unref(select)($event, unref(getValue)(row.index))
|
|
503
593
|
}, [
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
594
|
+
createElementVNode("div", {
|
|
595
|
+
class: normalizeClass(["flex items-center", { [unref(SIZES)[__props.size]]: !__props.itemSize }])
|
|
596
|
+
}, [
|
|
597
|
+
renderSlot(_ctx.$slots, "item", {
|
|
598
|
+
item: unref(computedItems)[row.index],
|
|
599
|
+
isItemSelected: unref(isSelected)(unref(getValue)(row.index)),
|
|
600
|
+
itemTextSplit: unref(splitStringForHighlight)(unref(toString)(unref(getText)(row.index)), unref(search))
|
|
601
|
+
}, () => [
|
|
602
|
+
createElementVNode("div", {
|
|
603
|
+
class: "truncate text-p-purple-60",
|
|
604
|
+
title: unref(toString)(unref(getText)(row.index))
|
|
605
|
+
}, [
|
|
606
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(splitStringForHighlight)(unref(toString)(unref(getText)(row.index)), unref(search)), (str, index) => {
|
|
607
|
+
return openBlock(), createElementBlock("span", {
|
|
608
|
+
key: `${unref(getValue)(row.index)}_${index}`,
|
|
609
|
+
class: normalizeClass({ "bg-p-blue-20": index === 1 })
|
|
610
|
+
}, toDisplayString(str), 3);
|
|
611
|
+
}), 128))
|
|
612
|
+
], 8, _hoisted_6$2)
|
|
613
|
+
]),
|
|
614
|
+
unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_7$1)) : createCommentVNode("", true)
|
|
615
|
+
], 2)
|
|
616
|
+
], 14, _hoisted_5$2)), [
|
|
617
|
+
[_directive_close_popper, __props.closePopperOnSelect && !__props.multiple]
|
|
618
|
+
])
|
|
619
|
+
], 4);
|
|
620
|
+
}), 128))
|
|
525
621
|
], 36),
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
class:
|
|
622
|
+
!unref(computedItems).length ? renderSlot(_ctx.$slots, "no-items", { key: 0 }, () => [
|
|
623
|
+
createElementVNode("div", {
|
|
624
|
+
class: normalizeClass(["flex items-center justify-center", unref(SIZES)[__props.size]])
|
|
529
625
|
}, "No items found", 2)
|
|
530
|
-
])
|
|
626
|
+
]) : createCommentVNode("", true)
|
|
531
627
|
], 6)
|
|
532
628
|
], 2),
|
|
533
|
-
|
|
534
|
-
class:
|
|
535
|
-
},
|
|
536
|
-
[
|
|
629
|
+
withDirectives(createElementVNode("div", {
|
|
630
|
+
class: normalizeClass(unref(errorMsgClasses))
|
|
631
|
+
}, toDisplayString(__props.errorMsg), 3), [
|
|
632
|
+
[vShow, __props.errorMsg]
|
|
537
633
|
])
|
|
538
|
-
], 14,
|
|
634
|
+
], 14, _hoisted_1$2);
|
|
539
635
|
};
|
|
540
636
|
}
|
|
541
|
-
})
|
|
637
|
+
});
|
|
638
|
+
const _hoisted_1$1 = ["data-col-id"];
|
|
639
|
+
const _hoisted_2$1 = { class: "flex" };
|
|
640
|
+
const _hoisted_3$1 = ["onMousedown", "onDblclick"];
|
|
641
|
+
const _hoisted_4$1 = {
|
|
542
642
|
key: 0,
|
|
543
643
|
class: "min-w-[80px] bg-gradient-to-r from-white via-p-gray-10 to-p-gray-10"
|
|
544
|
-
}
|
|
545
|
-
|
|
644
|
+
};
|
|
645
|
+
const _hoisted_5$1 = { key: 0 };
|
|
646
|
+
const _hoisted_6$1 = { key: 1 };
|
|
647
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
648
|
+
...{ name: "PTable" },
|
|
546
649
|
__name: "p-table",
|
|
547
650
|
props: {
|
|
548
651
|
cols: {},
|
|
549
|
-
colsResizable: { type: Boolean, default:
|
|
550
|
-
isFirstColFixed: { type: Boolean, default:
|
|
551
|
-
isLastColFixed: { type: Boolean, default:
|
|
552
|
-
lockScroll: { type: Boolean, default:
|
|
652
|
+
colsResizable: { type: Boolean, default: false },
|
|
653
|
+
isFirstColFixed: { type: Boolean, default: false },
|
|
654
|
+
isLastColFixed: { type: Boolean, default: false },
|
|
655
|
+
lockScroll: { type: Boolean, default: false },
|
|
553
656
|
virtualizer: { default: () => ({
|
|
554
657
|
paddingTop: 0,
|
|
555
658
|
paddingBottom: 0
|
|
556
659
|
}) }
|
|
557
660
|
},
|
|
558
661
|
emits: ["scroll", "click-filter-icon", "col-resize"],
|
|
559
|
-
setup(
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
662
|
+
setup(__props, { emit: __emit }) {
|
|
663
|
+
const emit = __emit;
|
|
664
|
+
const props = __props;
|
|
665
|
+
provide(
|
|
666
|
+
colsInjectionKey,
|
|
667
|
+
computed(() => props.cols)
|
|
668
|
+
);
|
|
669
|
+
provide(
|
|
670
|
+
isFirstColFixedInjectionKey,
|
|
671
|
+
computed(() => props.isFirstColFixed)
|
|
672
|
+
);
|
|
673
|
+
provide(
|
|
674
|
+
isLastColFixedInjectionKey,
|
|
675
|
+
computed(() => props.isLastColFixed)
|
|
676
|
+
);
|
|
677
|
+
provide(
|
|
678
|
+
isColsResizableInjectionKey,
|
|
679
|
+
computed(() => props.colsResizable)
|
|
573
680
|
);
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
681
|
+
const scrollWrapper = ref(null);
|
|
682
|
+
const ths = ref([]);
|
|
683
|
+
const {
|
|
684
|
+
isColResizing,
|
|
685
|
+
colResizeHandleLeft,
|
|
686
|
+
colResizingIndex,
|
|
687
|
+
colResizingWidth,
|
|
688
|
+
colResize,
|
|
689
|
+
colResizeStart,
|
|
690
|
+
colResizeFitToData
|
|
691
|
+
} = usePTableColResize({
|
|
692
|
+
enabled: computed(() => props.colsResizable),
|
|
693
|
+
ths
|
|
694
|
+
});
|
|
695
|
+
const updateThsRefs = (el, index) => {
|
|
696
|
+
if (el instanceof Element) {
|
|
697
|
+
ths.value[index] = el;
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
const emitScroll = (e) => {
|
|
701
|
+
emit("scroll", e);
|
|
592
702
|
};
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
(
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
(
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
return
|
|
703
|
+
const thDivClasses = (i, col) => {
|
|
704
|
+
const res = ["relative", "py-2"];
|
|
705
|
+
if (!col.borderColor) {
|
|
706
|
+
res.push("border-b border-p-gray-30");
|
|
707
|
+
}
|
|
708
|
+
if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
|
|
709
|
+
res.push("th-shadow px-4");
|
|
710
|
+
} else {
|
|
711
|
+
!props.colsResizable ? res.push("px-2") : res.push("pl-2 pr-4");
|
|
712
|
+
}
|
|
713
|
+
return res;
|
|
714
|
+
};
|
|
715
|
+
onMounted(() => {
|
|
716
|
+
var _a;
|
|
717
|
+
(_a = scrollWrapper.value) == null ? void 0 : _a.addEventListener("scroll", emitScroll, true);
|
|
718
|
+
});
|
|
719
|
+
onBeforeUnmount(() => {
|
|
720
|
+
var _a;
|
|
721
|
+
(_a = scrollWrapper.value) == null ? void 0 : _a.removeEventListener("scroll", emitScroll, true);
|
|
722
|
+
});
|
|
723
|
+
watch(isColResizing, (nV) => {
|
|
724
|
+
if (nV === false && colResizingWidth.value > 0) {
|
|
725
|
+
emit("col-resize", colResizingIndex.value, colResizingWidth.value);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
return (_ctx, _cache) => {
|
|
729
|
+
var _a, _b;
|
|
730
|
+
return openBlock(), createElementBlock("div", {
|
|
604
731
|
ref_key: "scrollWrapper",
|
|
605
|
-
ref:
|
|
606
|
-
class:
|
|
732
|
+
ref: scrollWrapper,
|
|
733
|
+
class: normalizeClass(["block border border-p-gray-30", _ctx.lockScroll ? "overflow-hidden" : "overflow-x-auto"])
|
|
607
734
|
}, [
|
|
608
|
-
|
|
735
|
+
unref(isColResizing) ? (openBlock(), createElementBlock("div", {
|
|
609
736
|
key: 0,
|
|
610
737
|
class: "fixed z-[100] w-1 cursor-col-resize bg-p-gray-30",
|
|
611
|
-
style:
|
|
612
|
-
top: `${(
|
|
613
|
-
left:
|
|
614
|
-
height: `${(
|
|
738
|
+
style: normalizeStyle({
|
|
739
|
+
top: `${(_a = scrollWrapper.value) == null ? void 0 : _a.offsetTop}px`,
|
|
740
|
+
left: unref(colResizeHandleLeft),
|
|
741
|
+
height: `${(_b = scrollWrapper.value) == null ? void 0 : _b.offsetHeight}px`
|
|
615
742
|
}),
|
|
616
743
|
"data-resize-y-axis": ""
|
|
617
|
-
}, null, 4)) :
|
|
618
|
-
|
|
744
|
+
}, null, 4)) : createCommentVNode("", true),
|
|
745
|
+
createElementVNode("table", mergeProps({
|
|
619
746
|
class: [
|
|
620
747
|
"p-table mb-0 w-full bg-surface",
|
|
621
|
-
{ "last-col-fixed":
|
|
622
|
-
{ "first-col-fixed":
|
|
748
|
+
{ "last-col-fixed": _ctx.isLastColFixed },
|
|
749
|
+
{ "first-col-fixed": _ctx.isFirstColFixed }
|
|
623
750
|
]
|
|
624
|
-
},
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
(
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
751
|
+
}, toHandlers(_ctx.colsResizable ? { mousemove: unref(colResize) } : {}, true)), [
|
|
752
|
+
createElementVNode("thead", null, [
|
|
753
|
+
createElementVNode("tr", null, [
|
|
754
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.cols, (col, i) => {
|
|
755
|
+
return openBlock(), createElementBlock("th", mergeProps({
|
|
756
|
+
ref_for: true,
|
|
757
|
+
ref: (el) => updateThsRefs(el, i),
|
|
758
|
+
key: col.id,
|
|
759
|
+
"data-col-id": col.id
|
|
760
|
+
}, col.thAttrs, {
|
|
761
|
+
style: col.style,
|
|
762
|
+
class: "bg-surface"
|
|
763
|
+
}), [
|
|
764
|
+
createElementVNode("div", {
|
|
765
|
+
class: normalizeClass(thDivClasses(i, col))
|
|
766
|
+
}, [
|
|
767
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
768
|
+
renderSlot(_ctx.$slots, `prepend-header-cell-${unref(kebabCase)(col.name)}`, { col }, void 0, true),
|
|
769
|
+
createVNode(PTableHeaderCell, mergeProps({
|
|
770
|
+
text: col.title,
|
|
771
|
+
"filter-active": col.filterActive,
|
|
772
|
+
"show-filter-icon": col.filterable || col.sortable,
|
|
773
|
+
"tooltip-text": col.tooltip,
|
|
774
|
+
class: [{ "pl-2": i === 1 && _ctx.isFirstColFixed, "pr-2": i === _ctx.cols.length && _ctx.isLastColFixed }, "grow"]
|
|
775
|
+
}, col.headerCellAttrs, {
|
|
776
|
+
onClickFilterIcon: ($event) => _ctx.$emit("click-filter-icon", $event, col)
|
|
777
|
+
}), null, 16, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "onClickFilterIcon"])
|
|
778
|
+
]),
|
|
779
|
+
_ctx.colsResizable && i !== 0 && !(i === _ctx.cols.length - 1 && _ctx.isLastColFixed) ? (openBlock(), createElementBlock("div", {
|
|
780
|
+
key: 0,
|
|
781
|
+
class: normalizeClass(["absolute bottom-0 right-0 h-full w-2 cursor-col-resize after:absolute after:bottom-2 after:z-20 after:block after:h-5 after:w-px after:cursor-col-resize after:bg-p-gray-30", i === _ctx.cols.length - 1 ? " after:right-0" : " after:right-1"]),
|
|
782
|
+
"data-resize-handle": "",
|
|
783
|
+
onMousedown: ($event) => unref(colResizeStart)($event, i),
|
|
784
|
+
onDblclick: ($event) => unref(colResizeFitToData)(i)
|
|
785
|
+
}, null, 42, _hoisted_3$1)) : createCommentVNode("", true),
|
|
786
|
+
createElementVNode("div", {
|
|
787
|
+
class: normalizeClass(["absolute bottom-0 h-1 w-full", _ctx.colsResizable ? "-left-1" : "left-0"]),
|
|
788
|
+
style: normalizeStyle({ background: col.borderColor })
|
|
789
|
+
}, null, 6)
|
|
790
|
+
], 2)
|
|
791
|
+
], 16, _hoisted_1$1);
|
|
792
|
+
}), 128)),
|
|
793
|
+
_ctx.colsResizable && !_ctx.isLastColFixed ? (openBlock(), createElementBlock("th", _hoisted_4$1)) : createCommentVNode("", true)
|
|
665
794
|
])
|
|
666
795
|
]),
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
style:
|
|
796
|
+
createElementVNode("tbody", null, [
|
|
797
|
+
_ctx.virtualizer.paddingTop > 0 ? (openBlock(), createElementBlock("tr", _hoisted_5$1, [
|
|
798
|
+
createElementVNode("td", {
|
|
799
|
+
style: normalizeStyle({ height: `${_ctx.virtualizer.paddingTop}px` })
|
|
671
800
|
}, null, 4)
|
|
672
|
-
])) :
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
style:
|
|
801
|
+
])) : createCommentVNode("", true),
|
|
802
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
803
|
+
_ctx.virtualizer.paddingBottom > 0 ? (openBlock(), createElementBlock("tr", _hoisted_6$1, [
|
|
804
|
+
createElementVNode("td", {
|
|
805
|
+
style: normalizeStyle({ height: `${_ctx.virtualizer.paddingBottom}px` })
|
|
677
806
|
}, null, 4)
|
|
678
|
-
])) :
|
|
807
|
+
])) : createCommentVNode("", true)
|
|
679
808
|
])
|
|
680
809
|
], 16)
|
|
681
810
|
], 2);
|
|
682
811
|
};
|
|
683
812
|
}
|
|
684
|
-
})
|
|
813
|
+
});
|
|
814
|
+
const pTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-170d774b"]]);
|
|
815
|
+
const _sfc_main = defineComponent({
|
|
685
816
|
name: "PTableSort",
|
|
686
817
|
props: {
|
|
687
818
|
modelValue: {
|
|
688
819
|
type: String,
|
|
689
|
-
default:
|
|
690
|
-
validator(
|
|
691
|
-
return Object.values(
|
|
820
|
+
default: SORTING_TYPES.NO_SORTING,
|
|
821
|
+
validator(value) {
|
|
822
|
+
return Object.values(SORTING_TYPES).includes(value);
|
|
692
823
|
}
|
|
693
824
|
}
|
|
694
825
|
},
|
|
695
826
|
emits: ["update:modelValue"],
|
|
696
827
|
data() {
|
|
697
828
|
return {
|
|
698
|
-
SORTING_TYPES
|
|
829
|
+
SORTING_TYPES
|
|
699
830
|
};
|
|
700
831
|
}
|
|
701
|
-
})
|
|
832
|
+
});
|
|
833
|
+
const _imports_0 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75838)'%3e%3cpath%20d='M11.6533%203.37331L8.47329%200.18664C8.41131%200.124154%208.33758%200.074558%208.25634%200.0407122C8.1751%200.00686641%208.08796%20-0.0105591%207.99995%20-0.0105591C7.91194%20-0.0105591%207.82481%200.00686641%207.74357%200.0407122C7.66233%200.074558%207.58859%200.124154%207.52662%200.18664L4.34662%203.37331C4.253%203.46615%204.18902%203.58468%204.16277%203.71388C4.13651%203.84309%204.14916%203.97719%204.19911%204.09921C4.24906%204.22123%204.33407%204.3257%204.44339%204.39941C4.55271%204.47312%204.68144%204.51275%204.81329%204.51331H6.81329C6.83571%204.51054%206.85846%204.51235%206.88016%204.51865C6.90186%204.52494%206.92205%204.53559%206.93951%204.54993C6.95697%204.56427%206.97133%204.58201%206.98172%204.60207C6.99211%204.62214%206.99832%204.6441%206.99995%204.66664V14.9933C6.99995%2015.2585%207.10531%2015.5129%207.29285%2015.7004C7.48038%2015.888%207.73474%2015.9933%207.99995%2015.9933C8.26517%2015.9933%208.51952%2015.888%208.70706%2015.7004C8.8946%2015.5129%208.99995%2015.2585%208.99995%2014.9933V4.66664C8.99995%204.62244%209.01751%204.58004%209.04877%204.54879C9.08002%204.51753%209.12242%204.49997%209.16662%204.49997H11.1666C11.2985%204.49942%2011.4272%204.45978%2011.5365%204.38608C11.6458%204.31237%2011.7308%204.2079%2011.7808%204.08587C11.8307%203.96385%2011.8434%203.82976%2011.8171%203.70055C11.7909%203.57134%2011.7269%203.45282%2011.6333%203.35997L11.6533%203.37331Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75838'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
834
|
+
const _imports_1 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80096)'%3e%3cpath%20d='M11.6533%203.37331L8.47329%200.18664C8.41131%200.124154%208.33758%200.074558%208.25634%200.0407122C8.1751%200.00686641%208.08796%20-0.0105591%207.99995%20-0.0105591C7.91194%20-0.0105591%207.82481%200.00686641%207.74357%200.0407122C7.66233%200.074558%207.58859%200.124154%207.52662%200.18664L4.34662%203.37331C4.253%203.46615%204.18902%203.58468%204.16277%203.71388C4.13651%203.84309%204.14916%203.97719%204.19911%204.09921C4.24906%204.22123%204.33407%204.3257%204.44339%204.39941C4.55271%204.47312%204.68144%204.51275%204.81329%204.51331H6.81329C6.83571%204.51054%206.85846%204.51235%206.88016%204.51865C6.90186%204.52494%206.92205%204.53559%206.93951%204.54993C6.95697%204.56427%206.97133%204.58201%206.98172%204.60207C6.99211%204.62214%206.99832%204.6441%206.99995%204.66664V14.9933C6.99995%2015.2585%207.10531%2015.5129%207.29285%2015.7004C7.48038%2015.888%207.73474%2015.9933%207.99995%2015.9933C8.26517%2015.9933%208.51952%2015.888%208.70706%2015.7004C8.8946%2015.5129%208.99995%2015.2585%208.99995%2014.9933V4.66664C8.99995%204.62244%209.01751%204.58004%209.04877%204.54879C9.08002%204.51753%209.12242%204.49997%209.16662%204.49997H11.1666C11.2985%204.49942%2011.4272%204.45978%2011.5365%204.38608C11.6458%204.31237%2011.7308%204.2079%2011.7808%204.08587C11.8307%203.96385%2011.8434%203.82976%2011.8171%203.70055C11.7909%203.57134%2011.7269%203.45282%2011.6333%203.35997L11.6533%203.37331Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80096'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
835
|
+
const _imports_2 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75842)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75842'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
836
|
+
const _imports_3 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80100)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80100'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
837
|
+
const _hoisted_1 = { class: "flex items-center justify-between" };
|
|
838
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "px-4 text-xs font-semibold text-p-gray-40" }, "SORT", -1);
|
|
839
|
+
const _hoisted_3 = { class: "mt-2" };
|
|
840
|
+
const _hoisted_4 = {
|
|
702
841
|
key: 0,
|
|
703
|
-
src:
|
|
704
|
-
}
|
|
842
|
+
src: _imports_0
|
|
843
|
+
};
|
|
844
|
+
const _hoisted_5 = {
|
|
705
845
|
key: 1,
|
|
706
|
-
src:
|
|
707
|
-
}
|
|
846
|
+
src: _imports_1
|
|
847
|
+
};
|
|
848
|
+
const _hoisted_6 = {
|
|
708
849
|
key: 0,
|
|
709
|
-
src:
|
|
710
|
-
}
|
|
850
|
+
src: _imports_2
|
|
851
|
+
};
|
|
852
|
+
const _hoisted_7 = {
|
|
711
853
|
key: 1,
|
|
712
|
-
src:
|
|
854
|
+
src: _imports_3
|
|
713
855
|
};
|
|
714
|
-
function
|
|
715
|
-
return
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
class:
|
|
856
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
857
|
+
return openBlock(), createElementBlock("div", null, [
|
|
858
|
+
createElementVNode("div", _hoisted_1, [
|
|
859
|
+
_hoisted_2,
|
|
860
|
+
createElementVNode("div", {
|
|
861
|
+
class: normalizeClass([
|
|
720
862
|
"px-4 text-xs font-semibold text-primary",
|
|
721
|
-
[
|
|
863
|
+
[_ctx.SORTING_TYPES.ASC, _ctx.SORTING_TYPES.DESC].includes(_ctx.modelValue) ? "cursor-pointer opacity-100" : "opacity-50"
|
|
722
864
|
]),
|
|
723
|
-
onClick:
|
|
865
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", _ctx.SORTING_TYPES.NO_SORTING))
|
|
724
866
|
}, " Clear ", 2)
|
|
725
867
|
]),
|
|
726
|
-
|
|
727
|
-
|
|
868
|
+
createElementVNode("div", _hoisted_3, [
|
|
869
|
+
createElementVNode("div", {
|
|
728
870
|
class: "flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",
|
|
729
|
-
onClick:
|
|
871
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:modelValue", _ctx.SORTING_TYPES.ASC))
|
|
730
872
|
}, [
|
|
731
|
-
|
|
732
|
-
class:
|
|
873
|
+
createElementVNode("div", {
|
|
874
|
+
class: normalizeClass(["text-sm font-semibold text-p-purple-60", { "text-primary": _ctx.modelValue === _ctx.SORTING_TYPES.ASC }])
|
|
733
875
|
}, " Sort ascending ", 2),
|
|
734
|
-
|
|
735
|
-
|
|
876
|
+
createElementVNode("div", null, [
|
|
877
|
+
_ctx.modelValue === _ctx.SORTING_TYPES.NO_SORTING || _ctx.modelValue === _ctx.SORTING_TYPES.DESC ? (openBlock(), createElementBlock("img", _hoisted_4)) : (openBlock(), createElementBlock("img", _hoisted_5))
|
|
736
878
|
])
|
|
737
879
|
]),
|
|
738
|
-
|
|
880
|
+
createElementVNode("div", {
|
|
739
881
|
class: "flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",
|
|
740
|
-
onClick:
|
|
882
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:modelValue", _ctx.SORTING_TYPES.DESC))
|
|
741
883
|
}, [
|
|
742
|
-
|
|
743
|
-
class:
|
|
884
|
+
createElementVNode("div", {
|
|
885
|
+
class: normalizeClass(["text-sm font-semibold text-p-purple-60", { "text-primary": _ctx.modelValue === _ctx.SORTING_TYPES.DESC }])
|
|
744
886
|
}, " Sort descending ", 2),
|
|
745
|
-
|
|
746
|
-
|
|
887
|
+
createElementVNode("div", null, [
|
|
888
|
+
_ctx.modelValue === _ctx.SORTING_TYPES.NO_SORTING || _ctx.modelValue === _ctx.SORTING_TYPES.ASC ? (openBlock(), createElementBlock("img", _hoisted_6)) : (openBlock(), createElementBlock("img", _hoisted_7))
|
|
747
889
|
])
|
|
748
890
|
])
|
|
749
891
|
])
|
|
750
892
|
]);
|
|
751
893
|
}
|
|
752
|
-
const
|
|
894
|
+
const pTableSort = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
753
895
|
export {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
896
|
+
CURRENCY_INPUT_DEFAULTS,
|
|
897
|
+
ERROR_MSG,
|
|
898
|
+
INPUT_BASE,
|
|
899
|
+
INPUT_ERROR,
|
|
900
|
+
INPUT_NORMAL,
|
|
901
|
+
INPUT_SIZES,
|
|
902
|
+
LABEL_BASE,
|
|
903
|
+
LABEL_REQUIRED,
|
|
904
|
+
LABEL_SIZES,
|
|
905
|
+
MIN_WIDTH_COL_RESIZE,
|
|
906
|
+
_ as PActionBar,
|
|
907
|
+
default2 as PAlert,
|
|
908
|
+
default3 as PAvatar,
|
|
909
|
+
default4 as PBtn,
|
|
910
|
+
_2 as PCard,
|
|
911
|
+
_3 as PCheckbox,
|
|
912
|
+
default5 as PChips,
|
|
913
|
+
default6 as PCloseBtn,
|
|
914
|
+
default7 as PDatePicker,
|
|
915
|
+
default8 as PDrawer,
|
|
916
|
+
default9 as PDropdown,
|
|
917
|
+
a as PDropdownSelect,
|
|
918
|
+
pFileUpload as PFileUpload,
|
|
919
|
+
default10 as PFilterIcon,
|
|
920
|
+
default11 as PInfoIcon,
|
|
921
|
+
default12 as PInlineDatePicker,
|
|
922
|
+
default13 as PInput,
|
|
923
|
+
default14 as PInputNumber,
|
|
924
|
+
_4 as PInputPercent,
|
|
925
|
+
PInputSearch,
|
|
926
|
+
default15 as PLoading,
|
|
927
|
+
default16 as PModal,
|
|
928
|
+
_5 as PPagination,
|
|
929
|
+
_6 as PPaginationInfo,
|
|
930
|
+
default17 as PProgressBar,
|
|
931
|
+
_7 as PRingLoader,
|
|
932
|
+
_8 as PSelect,
|
|
933
|
+
_9 as PSelectBtn,
|
|
934
|
+
_sfc_main$2 as PSelectList,
|
|
935
|
+
default18 as PSelectPill,
|
|
936
|
+
default19 as PSkeletonLoader,
|
|
937
|
+
pTable as PTable,
|
|
938
|
+
PTableHeaderCell,
|
|
939
|
+
_10 as PTableLoader,
|
|
940
|
+
pTableSort as PTableSort,
|
|
941
|
+
default20 as PTableTd,
|
|
942
|
+
_11 as PTabs,
|
|
943
|
+
default21 as PTextarea,
|
|
944
|
+
default22 as PToggle,
|
|
945
|
+
SELECT_ARROW,
|
|
946
|
+
SELECT_BASE,
|
|
947
|
+
SELECT_SIZES,
|
|
948
|
+
SORTING_TYPES,
|
|
949
|
+
SPACING_LEFT,
|
|
950
|
+
SPACING_PREFIX,
|
|
951
|
+
SPACING_RIGHT,
|
|
952
|
+
SPACING_SUFFIX,
|
|
953
|
+
TEXTAREA_BASE,
|
|
954
|
+
colsInjectionKey,
|
|
955
|
+
config,
|
|
956
|
+
createPagingRange,
|
|
957
|
+
getColor,
|
|
958
|
+
getColorDeep,
|
|
959
|
+
getNextActiveElement,
|
|
960
|
+
getScreen,
|
|
961
|
+
default23 as inputClassesMixin,
|
|
962
|
+
isColsResizableInjectionKey,
|
|
963
|
+
isElement,
|
|
964
|
+
isFirstColFixedInjectionKey,
|
|
965
|
+
isLastColFixedInjectionKey,
|
|
966
|
+
isObject,
|
|
967
|
+
isVisible,
|
|
968
|
+
setupListKeyboardNavigation,
|
|
969
|
+
splitStringForHighlight,
|
|
970
|
+
toNumberOrNull,
|
|
971
|
+
toString,
|
|
972
|
+
useInputClasses,
|
|
973
|
+
usePLoading,
|
|
974
|
+
usePModal,
|
|
975
|
+
usePTableColResize,
|
|
976
|
+
usePTableRowVirtualizer,
|
|
977
|
+
useSelectList
|
|
836
978
|
};
|