eco-vue-js 0.10.80 → 0.10.82
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/components/Button/WButton.vue.d.ts +2 -0
- package/dist/components/Button/WButton.vue.d.ts.map +1 -1
- package/dist/components/Button/WButton.vue.js +13 -11
- package/dist/components/Button/WButtonAction.vue.d.ts +2 -0
- package/dist/components/Button/WButtonAction.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonAction.vue.js +16 -13
- package/dist/components/Button/WButtonDropdown.vue.d.ts +1 -0
- package/dist/components/Button/WButtonDropdown.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonDropdown.vue.js +2 -1
- package/dist/components/Button/WButtonGroup.vue.d.ts +1 -1
- package/dist/components/Button/WButtonGroup.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonGroup.vue.js +7 -5
- package/dist/components/Chart/WChartLine.vue.d.ts.map +1 -1
- package/dist/components/Chart/WChartLine.vue.js +21 -18
- package/dist/components/Chart/WChartLinear.vue.d.ts +1 -0
- package/dist/components/Chart/WChartLinear.vue.d.ts.map +1 -1
- package/dist/components/Chart/WChartLinear.vue.js +8 -6
- package/dist/components/Checkbox/WCheckbox.vue.d.ts +5 -1
- package/dist/components/Checkbox/WCheckbox.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/WCheckbox.vue.js +21 -18
- package/dist/components/Checkbox/types.d.ts +1 -0
- package/dist/components/Checkbox/types.d.ts.map +1 -1
- package/dist/components/Chip/WChip.vue.d.ts +5 -1
- package/dist/components/Chip/WChip.vue.d.ts.map +1 -1
- package/dist/components/Chip/WChip.vue.js +9 -6
- package/dist/components/DatePicker/WDatePicker.vue.d.ts +9 -1
- package/dist/components/DatePicker/WDatePicker.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/WDatePicker.vue.js +8 -4
- package/dist/components/DatePicker/WDatePickerSingle.vue.d.ts +11 -1
- package/dist/components/DatePicker/WDatePickerSingle.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/WDatePickerSingle.vue.js +10 -4
- package/dist/components/DragContainer/use/useDragContainer.js +2 -1
- package/dist/components/Dropdown/WDropdown.vue.js +2 -2
- package/dist/components/Dropdown/types.d.ts +1 -0
- package/dist/components/Dropdown/types.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts +2 -0
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.js +1 -0
- package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts +5 -1
- package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts.map +1 -1
- package/dist/components/FieldWrapper/WFieldWrapper.vue.js +12 -10
- package/dist/components/FilePicker/WFilePicker.vue.d.ts +11 -1
- package/dist/components/FilePicker/WFilePicker.vue.d.ts.map +1 -1
- package/dist/components/FilePicker/WFilePicker.vue.js +20 -14
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.js +3 -3
- package/dist/components/FormAsync/WFormAsyncCheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncCheckboxGroup.vue.js +3 -3
- package/dist/components/FormAsync/WFormAsyncInput.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncInput.vue.js +3 -3
- package/dist/components/FormAsync/WFormAsyncSelect.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncSelect.vue.js +4 -3
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +4 -3
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +4 -3
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +4 -3
- package/dist/components/FormAsync/WFormAsyncToggle.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncToggle.vue.js +3 -2
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +1 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteList.vue.js +4 -2
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.d.ts +1 -0
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.js +3 -2
- package/dist/components/Input/WInput.vue.d.ts.map +1 -1
- package/dist/components/Input/WInput.vue.js +24 -22
- package/dist/components/Input/WInputAsync.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputAsync.vue.js +11 -9
- package/dist/components/Input/WInputDate.vue.d.ts +3 -0
- package/dist/components/Input/WInputDate.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputDate.vue.js +5 -4
- package/dist/components/Input/WInputOptions.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputOptions.vue.js +13 -10
- package/dist/components/Input/WInputSuggest.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputSuggest.vue.js +12 -9
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +27 -25
- package/dist/components/List/WListCard.vue.d.ts.map +1 -1
- package/dist/components/List/WListCard.vue.js +2 -1
- package/dist/components/List/WListHeader.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeader.vue.js +1 -0
- package/dist/components/MenuItem/WMenuItem.vue.js +1 -1
- package/dist/components/Nav/WNavItemTransition.vue.d.ts.map +1 -1
- package/dist/components/Progress/WProgressStriped.vue.d.ts.map +1 -1
- package/dist/components/Progress/WProgressStriped.vue.js +6 -4
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +23 -20
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +15 -12
- package/dist/components/Select/WSelectAsyncList.vue.d.ts +2 -0
- package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncList.vue.js +12 -6
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.js +6 -5
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +8 -7
- package/dist/components/Select/WSelectStringified.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectStringified.vue.js +8 -7
- package/dist/components/Toggle/WToggle.vue.d.ts.map +1 -1
- package/dist/components/Toggle/WToggle.vue.js +16 -12
- package/dist/components/Toggle/WToggleTheme.vue.js +2 -1
- package/dist/components/Toggle/types.d.ts +1 -0
- package/dist/components/Toggle/types.d.ts.map +1 -1
- package/dist/components/Tooltip/WTooltip.vue.d.ts +2 -0
- package/dist/components/Tooltip/WTooltip.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/WTooltip.vue.js +4 -0
- package/dist/components/Tooltip/WTooltipContainer.vue.d.ts +1 -0
- package/dist/components/Tooltip/WTooltipContainer.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/WTooltipContainer.vue.js +3 -1
- package/dist/components/Tooltip/models/tooltipMeta.d.ts +6 -0
- package/dist/components/Tooltip/models/tooltipMeta.d.ts.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/types/global.d.ts +1 -1
- package/dist/utils/api.d.ts +1 -0
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +4 -1
- package/dist/utils/provide.d.ts +5 -0
- package/dist/utils/provide.d.ts.map +1 -0
- package/dist/utils/provide.js +19 -0
- package/dist/utils/useComponentStates.d.ts +19 -0
- package/dist/utils/useComponentStates.d.ts.map +1 -0
- package/dist/utils/useComponentStates.js +36 -0
- package/package.json +4 -1
@@ -1,6 +1,7 @@
|
|
1
1
|
import { defineComponent, ref, useTemplateRef, computed, watch, toRef, nextTick, createBlock, openBlock, mergeProps, withModifiers, createSlots, withCtx, createElementBlock, createCommentVNode, createElementVNode, toDisplayString, Fragment, renderList, renderSlot, resolveDynamicComponent } from 'vue';
|
2
2
|
import _sfc_main$1 from './WInputSuggest.vue.js';
|
3
3
|
import _sfc_main$2 from '../Select/components/SelectOption.vue.js';
|
4
|
+
import { useComponentStates } from '../../utils/useComponentStates.js';
|
4
5
|
import { debounce } from '../../utils/utils.js';
|
5
6
|
|
6
7
|
const _hoisted_1 = {
|
@@ -12,7 +13,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
13
|
__name: "WInputOptions",
|
13
14
|
props: {
|
14
15
|
options: {},
|
15
|
-
valueGetter: {
|
16
|
+
valueGetter: {},
|
16
17
|
emptyStub: {},
|
17
18
|
optionComponent: {},
|
18
19
|
mobileTitle: {},
|
@@ -32,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
32
33
|
name: {},
|
33
34
|
autocomplete: {},
|
34
35
|
autofocus: { type: Boolean },
|
35
|
-
readonly: { type: Boolean },
|
36
|
+
readonly: { type: Boolean, default: void 0 },
|
36
37
|
disabledActions: { type: Boolean },
|
37
38
|
loading: { type: Boolean },
|
38
39
|
spellcheck: { type: Boolean },
|
@@ -50,8 +51,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
50
51
|
tooltipText: {},
|
51
52
|
mono: { type: Boolean },
|
52
53
|
hasChanges: { type: Boolean },
|
53
|
-
skeleton: { type: Boolean },
|
54
|
-
disabled: { type: Boolean },
|
54
|
+
skeleton: { type: Boolean, default: void 0 },
|
55
|
+
disabled: { type: Boolean, default: void 0 },
|
55
56
|
required: { type: Boolean },
|
56
57
|
mandatory: { type: Boolean },
|
57
58
|
noMargin: { type: Boolean },
|
@@ -66,12 +67,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
66
67
|
maxHeight: {},
|
67
68
|
maxWidth: {},
|
68
69
|
horizontalAlign: {},
|
69
|
-
top: { type: Boolean }
|
70
|
+
top: { type: Boolean },
|
71
|
+
bottom: { type: Boolean }
|
70
72
|
},
|
71
73
|
emits: ["update:model-value"],
|
72
74
|
setup(__props, { expose: __expose, emit: __emit }) {
|
73
75
|
const props = __props;
|
74
76
|
const emit = __emit;
|
77
|
+
const { isReadonly, isDisabled } = useComponentStates(props);
|
75
78
|
const isOpen = ref(false);
|
76
79
|
const inputRef = useTemplateRef("input");
|
77
80
|
const cursor = ref(-1);
|
@@ -79,13 +82,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
79
82
|
const lastIndex = computed(() => props.options.length);
|
80
83
|
const focused = ref(false);
|
81
84
|
const loadingOptionIndex = ref(null);
|
82
|
-
const
|
85
|
+
const isDisabledComputed = computed(() => props.loading || isReadonly.value || isDisabled.value);
|
83
86
|
const close = () => {
|
84
87
|
isOpen.value = false;
|
85
88
|
focused.value = false;
|
86
89
|
};
|
87
90
|
const setLoadingOptionIndex = (value) => {
|
88
|
-
if (
|
91
|
+
if (isDisabledComputed.value) return;
|
89
92
|
loadingOptionIndex.value = value;
|
90
93
|
};
|
91
94
|
const unlockCursor = debounce(() => {
|
@@ -100,17 +103,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
100
103
|
cursor.value = value;
|
101
104
|
};
|
102
105
|
const cursorUp = () => {
|
103
|
-
if (
|
106
|
+
if (isDisabledComputed.value) return;
|
104
107
|
lockCursor();
|
105
108
|
cursor.value = !props.options.length ? 0 : cursor.value < 1 ? lastIndex.value : cursor.value - 1;
|
106
109
|
};
|
107
110
|
const cursorDown = () => {
|
108
|
-
if (
|
111
|
+
if (isDisabledComputed.value) return;
|
109
112
|
lockCursor();
|
110
113
|
cursor.value = !props.options.length ? 0 : cursor.value >= lastIndex.value ? 0 : cursor.value + 1;
|
111
114
|
};
|
112
115
|
const selectCursor = () => {
|
113
|
-
if (
|
116
|
+
if (isDisabledComputed.value) return;
|
114
117
|
const value = cursor.value !== -1 ? props.options[cursor.value] : void 0;
|
115
118
|
if (value) select(value);
|
116
119
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"AA6GA;
|
1
|
+
{"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"AA6GA;AAsNA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAC,KAAK,KAAK,EAAgC,MAAM,KAAK,CAAA;yBAa5C,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA+YO,mBAAmB,CAAC,2CAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;;;;MAAsB,GAAG,IAAI;WACpE,GAAG;;gBAxTD,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE;YAAC,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;SAAC,KAAK,IAAI;gBAChD,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;kBACpC,CAAC,KAAK,CAAC,EAAE;YAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;SAAC,KAAK,KAAK,EAAE;;gBAJnD,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE;YAAC,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;SAAC,KAAK,IAAI;gBAChD,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;kBACpC,CAAC,KAAK,CAAC,EAAE;YAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;SAAC,KAAK,KAAK,EAAE;;;YA1EvD,mBAAmB,mDAAsB,IAAI;YAC7C,gBAAgB,SAAS,aAAa,GAAG,IAAI;YAC7C,aAAa,SAAS,aAAa,GAAG,IAAI;YAC1C,eAAe,SAAS,aAAa,GAAG,IAAI;YAC5C,iBAAiB,SAAS,aAAa,GAAG,IAAI;YAC9C,MAAM,GAAG,IAAI;YACb,OAAO,GAAG,IAAI;YACd,aAAa,GAAG,IAAI;YACpB,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,MAAM,SAAS,UAAU,GAAG,IAAI;;EAyXlC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA1ZzE,wBA0Z4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -6,6 +6,7 @@ import _sfc_main$4 from './WInput.vue.js';
|
|
6
6
|
import IconArrow from '../../assets/icons/default/IconArrow.svg.js';
|
7
7
|
import { HorizontalAlign } from '../../utils/HorizontalAlign.js';
|
8
8
|
import { useIsMobile } from '../../utils/mobile.js';
|
9
|
+
import { useComponentStates } from '../../utils/useComponentStates.js';
|
9
10
|
|
10
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
11
12
|
...{ inheritAttrs: false },
|
@@ -28,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
29
|
name: {},
|
29
30
|
autocomplete: {},
|
30
31
|
autofocus: { type: Boolean },
|
31
|
-
readonly: { type: Boolean },
|
32
|
+
readonly: { type: Boolean, default: void 0 },
|
32
33
|
disabledActions: { type: Boolean },
|
33
34
|
loading: { type: Boolean },
|
34
35
|
spellcheck: { type: Boolean },
|
@@ -46,8 +47,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
47
|
tooltipText: {},
|
47
48
|
mono: { type: Boolean },
|
48
49
|
hasChanges: { type: Boolean },
|
49
|
-
skeleton: { type: Boolean },
|
50
|
-
disabled: { type: Boolean },
|
50
|
+
skeleton: { type: Boolean, default: void 0 },
|
51
|
+
disabled: { type: Boolean, default: void 0 },
|
51
52
|
required: { type: Boolean },
|
52
53
|
mandatory: { type: Boolean },
|
53
54
|
noMargin: { type: Boolean },
|
@@ -62,19 +63,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
62
63
|
maxHeight: { default: 320 },
|
63
64
|
maxWidth: { default: 600 },
|
64
65
|
horizontalAlign: { default: HorizontalAlign.FILL },
|
65
|
-
top: { type: Boolean }
|
66
|
+
top: { type: Boolean },
|
67
|
+
bottom: { type: Boolean }
|
66
68
|
},
|
67
69
|
emits: ["update:modelValue", "keypress:enter", "keypress:up", "keypress:down", "keypress:delete", "open", "close", "click:clear", "focus", "blur"],
|
68
70
|
setup(__props, { expose: __expose, emit: __emit }) {
|
69
71
|
const props = __props;
|
70
72
|
const emit = __emit;
|
73
|
+
const { isReadonly, isDisabled } = useComponentStates(props);
|
71
74
|
const isOpen = ref(false);
|
72
75
|
const dropdownMenuRef = useTemplateRef("dropdownMenu");
|
73
76
|
const inputRef = useTemplateRef("input");
|
74
77
|
const { isMobile } = useIsMobile();
|
75
|
-
const
|
78
|
+
const isDisabledComputed = computed(() => isReadonly.value || isDisabled.value);
|
76
79
|
const open = () => {
|
77
|
-
if (
|
80
|
+
if (isDisabledComputed.value) return;
|
78
81
|
isOpen.value = true;
|
79
82
|
emit("open");
|
80
83
|
};
|
@@ -124,8 +127,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
124
127
|
seamless: toggleScope?.unclickable === false ? false : props.seamless
|
125
128
|
}, {
|
126
129
|
class: {
|
127
|
-
"cursor-pointer": !
|
128
|
-
"cursor-not-allowed":
|
130
|
+
"cursor-pointer": !unref(isDisabled) && !unref(isReadonly),
|
131
|
+
"cursor-not-allowed": unref(isDisabled) && !unref(isReadonly),
|
129
132
|
"mb-3": unref(isMobile) && !toggleScope?.unclickable
|
130
133
|
},
|
131
134
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => !_ctx.loading && _ctx.$emit("update:modelValue", $event)),
|
@@ -154,7 +157,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
154
157
|
})
|
155
158
|
]),
|
156
159
|
suffix: withCtx(() => [
|
157
|
-
!
|
160
|
+
!unref(isDisabled) ? (openBlock(), createBlock(unref(IconArrow), {
|
158
161
|
key: 0,
|
159
162
|
class: normalizeClass(["square-3 text-description transition-transform", { "rotate-180": isOpen.value }])
|
160
163
|
}, null, 8, ["class"])) : createCommentVNode("", true)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WList.vue"],"names":[],"mappings":"AAqTA;
|
1
|
+
{"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WList.vue"],"names":[],"mappings":"AAqTA;AA6fA,OAAO,KAAK,EAAC,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAChK,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAezC,OAAO,EAAuB,QAAQ,EAAC,MAAM,eAAe,CAAA;yBAW3C,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,WAAW,SAAS,SAAS,OAAO,EAAE,EAC3I,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAk7BO,mBAAmB,CAAC;;;;;;;;;gBA96BhB,MAAM;gBACN,MAAM;oBACF,kBAAkB,CAAC,IAAI,CAAC;oBACxB,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;uBACT,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;6BACxC,MAAM;wBACX,MAAM;eACf,aAAa,CAAC,WAAW,CAAC,EAAE;mBACxB,aAAa,CAAC,WAAW,CAAC,EAAE;iBAC9B,eAAe,CAAC,WAAW,CAAC,EAAE;eAChC,aAAa,CAAC,IAAI,CAAC,EAAE;yBACX,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO;oBAC5B,MAAM;2BACC,MAAM;6BACJ,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;oBACvD,OAAO;mBACR,MAAM;0BACC,cAAc,CAAC,MAAM,CAAC;sBAC1B,QAAQ;mBACX,OAAO;sBACJ,OAAO;mBACV,OAAO;qBACL,OAAO;yBACH,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAAG,SAAS;kBACzC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,OAAO;qBAC1B,WAAW;mBACb,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;iBAC1C,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS;oBACxC,OAAO;2BACA,OAAO;oBACd,OAAO;mBA+4BuE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;YA9EiB,GAAG;2BACC,GAAG;;;;;YACP,GAAG;uBACF,GAAG;;;YA7yB1B,cAAc,SAAS,QAAQ,GAAG,IAAI;YACtC,cAAc,SAAS,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;YACpD,qBAAqB,SAAS,WAAW,GAAG,IAAI;YAChD,cAAc,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;;EAy3BlD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA77BzE,wBA67B4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -5,9 +5,10 @@ import _sfc_main$1 from '../InfiniteList/WInfiniteList.vue.js';
|
|
5
5
|
import IconRefresh from '../../assets/icons/sax/IconRefresh.svg.js';
|
6
6
|
import { useIsMobile } from '../../utils/mobile.js';
|
7
7
|
import { parseOrdering, encodeOrdering } from '../../utils/order.js';
|
8
|
+
import { useComponentStates } from '../../utils/useComponentStates.js';
|
8
9
|
import { PAGE_LENGTH } from '../../utils/useDefaultQuery.js';
|
9
10
|
import { useSelected } from '../../utils/useSelected.js';
|
10
|
-
import { BASE_ZINDEX_DROPDOWN } from '../../utils/utils.js';
|
11
|
+
import { ListMode, BASE_ZINDEX_DROPDOWN } from '../../utils/utils.js';
|
11
12
|
import _sfc_main$2 from './WListCard.vue.js';
|
12
13
|
import _sfc_main$8 from './WListHeader.vue.js';
|
13
14
|
import _sfc_main$a from './WListHeaderItem.vue.js';
|
@@ -25,35 +26,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
25
26
|
...{ inheritAttrs: false },
|
26
27
|
__name: "WList",
|
27
28
|
props: {
|
28
|
-
count: {},
|
29
|
+
count: { default: void 0 },
|
29
30
|
fields: {},
|
30
|
-
expansion: {},
|
31
|
+
expansion: { default: void 0 },
|
31
32
|
useQueryFn: {},
|
32
33
|
queryParams: {},
|
33
|
-
queryOptions: {},
|
34
|
-
bulkDisableMessage: {},
|
34
|
+
queryOptions: { default: void 0 },
|
35
|
+
bulkDisableMessage: { default: void 0 },
|
35
36
|
selectionTitle: {},
|
36
|
-
bulk: {},
|
37
|
-
bulkMore: {},
|
38
|
-
action: {},
|
39
|
-
menu: {},
|
40
|
-
readonlyGetter: { type: Function },
|
41
|
-
cardClass: {},
|
42
|
-
cardWrapperClass: {},
|
43
|
-
selectAllTextGetter: {
|
37
|
+
bulk: { default: void 0 },
|
38
|
+
bulkMore: { default: void 0 },
|
39
|
+
action: { default: void 0 },
|
40
|
+
menu: { default: void 0 },
|
41
|
+
readonlyGetter: { type: Function, default: void 0 },
|
42
|
+
cardClass: { default: void 0 },
|
43
|
+
cardWrapperClass: { default: void 0 },
|
44
|
+
selectAllTextGetter: {},
|
44
45
|
hasBorder: { type: Boolean },
|
45
46
|
configKey: {},
|
46
47
|
defaultConfigMap: {},
|
47
|
-
defaultMode: {},
|
48
|
+
defaultMode: { default: ListMode.TABLE },
|
48
49
|
alignTop: { type: Boolean },
|
49
50
|
disableMore: { type: Boolean },
|
50
|
-
readonly: { type: Boolean },
|
51
|
+
readonly: { type: Boolean, default: void 0 },
|
51
52
|
noOrdering: { type: Boolean },
|
52
|
-
formNameGetter: { type: Function },
|
53
|
-
groupBy: { type: Function },
|
53
|
+
formNameGetter: { type: Function, default: void 0 },
|
54
|
+
groupBy: { type: Function, default: void 0 },
|
54
55
|
cardColumns: {},
|
55
56
|
cardAreas: {},
|
56
|
-
cardTo: { type: Function },
|
57
|
+
cardTo: { type: Function, default: void 0 },
|
57
58
|
hasAction: { type: Boolean },
|
58
59
|
noHeaderSettings: { type: Boolean },
|
59
60
|
noRefetch: { type: Boolean }
|
@@ -62,6 +63,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
62
63
|
setup(__props, { emit: __emit }) {
|
63
64
|
const props = __props;
|
64
65
|
const emit = __emit;
|
66
|
+
const { isDisabled, isReadonly } = useComponentStates(props);
|
65
67
|
const { isMobile } = useIsMobile();
|
66
68
|
const listCount = ref(void 0);
|
67
69
|
const countValue = computed(() => props.count ?? listCount.value);
|
@@ -221,7 +223,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
221
223
|
return openBlock(), createBlock(resolveDynamicComponent(item), {
|
222
224
|
key: index,
|
223
225
|
"query-params": _ctx.queryParams,
|
224
|
-
readonly:
|
226
|
+
readonly: unref(isReadonly) ?? unref(isDisabled) ?? false,
|
225
227
|
class: normalizeClass(cssClass)
|
226
228
|
}, null, 8, ["query-params", "readonly", "class"]);
|
227
229
|
}), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.bulk, (item, index) => {
|
@@ -230,7 +232,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
230
232
|
"selection-count": unref(selectionCount),
|
231
233
|
"query-params-getter": getQueryParamsBulk,
|
232
234
|
"disable-message": disableMessage,
|
233
|
-
readonly:
|
235
|
+
readonly: unref(isReadonly) ?? unref(isDisabled) ?? false,
|
234
236
|
class: normalizeClass(cssClass),
|
235
237
|
"onClear:selected": unref(resetSelection)
|
236
238
|
}, null, 40, ["selection-count", "disable-message", "readonly", "class", "onClear:selected"]);
|
@@ -247,7 +249,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
247
249
|
"selection-count": unref(selectionCount),
|
248
250
|
"query-params-getter": getQueryParamsBulk,
|
249
251
|
"disable-message": scope?.disableMessage,
|
250
|
-
readonly:
|
252
|
+
readonly: unref(isReadonly) ?? unref(isDisabled) ?? false,
|
251
253
|
class: normalizeClass(scope?.cssClass),
|
252
254
|
"onClear:selected": unref(resetSelection)
|
253
255
|
}, null, 40, ["selection-count", "disable-message", "readonly", "class", "onClear:selected"]);
|
@@ -340,12 +342,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
340
342
|
item,
|
341
343
|
skeleton,
|
342
344
|
card: unref(isGrid),
|
343
|
-
readonly:
|
345
|
+
readonly: (unref(isReadonly) ?? unref(isDisabled)) || (_ctx.readonlyGetter?.(item) ?? false)
|
344
346
|
}, {
|
345
347
|
default: withCtx((defaultScope) => [
|
346
348
|
(openBlock(), createBlock(resolveDynamicComponent(defaultScope.field.default), {
|
347
349
|
item: defaultScope.item,
|
348
|
-
readonly:
|
350
|
+
readonly: (unref(isReadonly) ?? unref(isDisabled)) || (_ctx.readonlyGetter?.(defaultScope.item) ?? false),
|
349
351
|
skeleton,
|
350
352
|
card: unref(isGrid),
|
351
353
|
config: unref(fieldConfigMap)[defaultScope.field.meta.label],
|
@@ -380,7 +382,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
380
382
|
fn: withCtx(() => [
|
381
383
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.expansion), {
|
382
384
|
item,
|
383
|
-
readonly:
|
385
|
+
readonly: (unref(isReadonly) ?? unref(isDisabled)) || (_ctx.readonlyGetter?.(item) ?? false),
|
384
386
|
skeleton,
|
385
387
|
card: unref(isGrid),
|
386
388
|
"onUpdate:item": setter,
|
@@ -401,7 +403,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
401
403
|
ref_for: true
|
402
404
|
}, Array.isArray(menuItem) ? menuItem[1] : void 0, {
|
403
405
|
item,
|
404
|
-
readonly:
|
406
|
+
readonly: (unref(isReadonly) ?? unref(isDisabled)) || (_ctx.readonlyGetter?.(item) ?? false),
|
405
407
|
"update-item": setter,
|
406
408
|
"delete-item": () => {
|
407
409
|
setter();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListCard.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListCard.vue"],"names":[],"mappings":"AAmMA;AAAA,OAwRO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAgB5C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;IAC/B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IAEjB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAC;AAmDF,iBAAS,cAAc,QA6YtB;AA4BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;mFAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -136,7 +136,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
136
136
|
_ctx.allowSelect && _ctx.card ? (openBlock(), createBlock(_sfc_main$1, {
|
137
137
|
key: 0,
|
138
138
|
"model-value": _ctx.selected,
|
139
|
-
disabled: _ctx.disabled,
|
139
|
+
disabled: _ctx.disabled ?? false,
|
140
|
+
readonly: false,
|
140
141
|
class: normalizeClass(["-p--inner-margin -my---inner-margin -mr---inner-margin justify-end self-start", {
|
141
142
|
"opacity-50": _ctx.allowSelectHover
|
142
143
|
}]),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListHeader.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListHeader.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListHeader.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListHeader.vue"],"names":[],"mappings":"AA2CA;AA4EA,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC1B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;AAmBF,iBAAS,cAAc;WAuFT,OAAO,IAA6B;;yBAXrB,GAAG;0BACF,GAAG;;;;EAehC;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;6FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -36,6 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
36
36
|
_ctx.allowSelect && _ctx.selection !== void 0 ? (openBlock(), createBlock(_sfc_main$1, {
|
37
37
|
key: 0,
|
38
38
|
disabled: _ctx.disabled || _ctx.count === 0 || _ctx.count === void 0,
|
39
|
+
readonly: false,
|
39
40
|
"model-value": _ctx.selection,
|
40
41
|
"tooltip-text": _ctx.tooltipText,
|
41
42
|
intermediate: "",
|
@@ -12,7 +12,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
12
|
emits: ["click"],
|
13
13
|
setup(__props) {
|
14
14
|
return (_ctx, _cache) => {
|
15
|
-
return openBlock(), createBlock(resolveDynamicComponent(_ctx.
|
15
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.disabled ? "div" : _ctx.to ? unref(RouterLink) : _ctx.href ? "a" : "button"), mergeProps(_ctx.disabled ? void 0 : _ctx.to ? { to: _ctx.to } : _ctx.href ? { href: _ctx.href, download: _ctx.download } : void 0, {
|
16
16
|
class: ["text-description w-ripple-trigger block w-full min-w-36 select-none items-center justify-start px-2 text-start outline-none first:pt-2 last:pb-2", {
|
17
17
|
"hover:text-primary dark:hover:text-primary-dark cursor-pointer": !_ctx.disabled,
|
18
18
|
"cursor-not-allowed opacity-50": _ctx.disabled
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WNavItemTransition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItemTransition.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WNavItemTransition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItemTransition.vue"],"names":[],"mappings":"AAYA;AAoBA,iBAAS,cAAc;WA0CT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,+QAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WProgressStriped.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Progress/WProgressStriped.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WProgressStriped.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Progress/WProgressStriped.vue"],"names":[],"mappings":"AAwBA;AA+BA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC;;AA2DF,wBAOG"}
|
@@ -8,8 +8,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
setup(__props) {
|
9
9
|
return (_ctx, _cache) => {
|
10
10
|
return openBlock(), createElementBlock("div", {
|
11
|
-
class: normalizeClass(["relative
|
12
|
-
"
|
11
|
+
class: normalizeClass(["relative w-full select-none overflow-clip rounded-full", {
|
12
|
+
"bg-primary dark:bg-primary-dark": _ctx.modelValue > 0,
|
13
13
|
"bg-gray-200 dark:bg-gray-800": _ctx.modelValue <= 0,
|
14
14
|
"w-progress-striped before:animate-move-horizontal cursor-progress": _ctx.modelValue > 0 && _ctx.modelValue < 100,
|
15
15
|
"before:absolute before:inset-0": _ctx.modelValue >= 100 || _ctx.modelValue <= 0,
|
@@ -19,11 +19,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
19
|
}, [
|
20
20
|
_ctx.modelValue < 100 && _ctx.modelValue > 0 ? (openBlock(), createElementBlock("div", {
|
21
21
|
key: 0,
|
22
|
-
class: "absolute right-0 h-full bg-gray-200 transition-[width] dark:bg-gray-800",
|
22
|
+
class: normalizeClass(["absolute right-0 h-full bg-gray-200 transition-[width] dark:bg-gray-800", {
|
23
|
+
"w-progress-striped before:animate-move-horizontal": _ctx.modelValue === 0
|
24
|
+
}]),
|
23
25
|
style: normalizeStyle({
|
24
26
|
width: 100 - _ctx.modelValue + "%"
|
25
27
|
})
|
26
|
-
}, null,
|
28
|
+
}, null, 6)) : createCommentVNode("", true)
|
27
29
|
], 2);
|
28
30
|
};
|
29
31
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AA8KA;
|
1
|
+
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AA8KA;AA0cA,OAAO,KAAK,EAAC,qBAAqB,EAA8B,iBAAiB,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA;yBAc7F,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAChJ,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAqrBO,mBAAmB,CAAC;;;;;;;sSAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BAzdrB,MAAM,KAAG,IAAI;MAyd8B,GAAG,IAAI;WACpE,GAAG;;gBA3aD,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;gBACrD,MAAM,IAAI;;gBAHV,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;gBACrD,MAAM,IAAI;;;YAjQd,QAAQ,QAAQ,KAAK,GAAG,IAAI;YAC5B,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,MAAM,SAAS,UAAU,GAAG,IAAI;YAChC,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;EAwqBrB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhsBzE,wBAgsB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -2,6 +2,7 @@ import { defineComponent, ref, useTemplateRef, computed, toRef, watch, nextTick,
|
|
2
2
|
import _sfc_main$1 from '../Input/WInputSuggest.vue.js';
|
3
3
|
import { ApiError } from '../../utils/api.js';
|
4
4
|
import { useIsMobile } from '../../utils/mobile.js';
|
5
|
+
import { useComponentStates } from '../../utils/useComponentStates.js';
|
5
6
|
import { debounce } from '../../utils/utils.js';
|
6
7
|
import _sfc_main$2 from './components/SelectOption.vue.js';
|
7
8
|
import _sfc_main$3 from './components/SelectOptionPrefix.vue.js';
|
@@ -20,14 +21,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
21
|
__name: "WSelect",
|
21
22
|
props: {
|
22
23
|
modelValue: {},
|
23
|
-
valueGetter: {
|
24
|
-
searchFn: {
|
24
|
+
valueGetter: {},
|
25
|
+
searchFn: {},
|
25
26
|
useQueryFnDefault: {},
|
26
27
|
emptyStub: {},
|
27
28
|
disableClear: { type: Boolean },
|
28
29
|
hidePrefix: { type: Boolean },
|
29
|
-
createOption: {
|
30
|
-
filterOptions: {
|
30
|
+
createOption: {},
|
31
|
+
filterOptions: {},
|
31
32
|
hideOptionIcon: { type: Boolean },
|
32
33
|
createdData: {},
|
33
34
|
selectOnClose: { type: Boolean },
|
@@ -47,7 +48,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
48
|
name: {},
|
48
49
|
autocomplete: {},
|
49
50
|
autofocus: { type: Boolean },
|
50
|
-
readonly: { type: Boolean },
|
51
|
+
readonly: { type: Boolean, default: void 0 },
|
51
52
|
disabledActions: { type: Boolean },
|
52
53
|
loading: { type: Boolean },
|
53
54
|
spellcheck: { type: Boolean },
|
@@ -63,8 +64,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
63
64
|
tooltipText: {},
|
64
65
|
mono: { type: Boolean },
|
65
66
|
hasChanges: { type: Boolean },
|
66
|
-
skeleton: { type: Boolean },
|
67
|
-
disabled: { type: Boolean },
|
67
|
+
skeleton: { type: Boolean, default: void 0 },
|
68
|
+
disabled: { type: Boolean, default: void 0 },
|
68
69
|
required: { type: Boolean },
|
69
70
|
mandatory: { type: Boolean },
|
70
71
|
noMargin: { type: Boolean },
|
@@ -80,6 +81,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
80
81
|
maxWidth: {},
|
81
82
|
horizontalAlign: {},
|
82
83
|
top: { type: Boolean },
|
84
|
+
bottom: { type: Boolean },
|
83
85
|
optionComponent: {},
|
84
86
|
optionComponentProps: {},
|
85
87
|
useQueryFnOptions: {},
|
@@ -90,6 +92,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
90
92
|
setup(__props, { expose: __expose, emit: __emit }) {
|
91
93
|
const props = __props;
|
92
94
|
const emit = __emit;
|
95
|
+
const { isReadonly, isDisabled } = useComponentStates(props);
|
93
96
|
const { isMobile } = useIsMobile();
|
94
97
|
const isOpen = ref(false);
|
95
98
|
const inputRef = useTemplateRef("input");
|
@@ -125,7 +128,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
125
128
|
const focused = ref(false);
|
126
129
|
const loadingOptionIndex = ref(null);
|
127
130
|
const loadingCreate = ref(false);
|
128
|
-
const
|
131
|
+
const isDisabledComputed = computed(() => props.loading || isReadonly.value || isDisabled.value);
|
129
132
|
const hasCreateOption = computed(() => props.createOption && (!optionsFiltered.value.some((option) => props.valueGetter(option) === search.value) || isModelValueSearch.value));
|
130
133
|
const close = () => {
|
131
134
|
if (props.selectOnClose && focused.value && !isModelValueSearch.value) {
|
@@ -139,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
139
142
|
search.value = "";
|
140
143
|
};
|
141
144
|
const setLoadingOptionIndex = (value) => {
|
142
|
-
if (
|
145
|
+
if (isDisabledComputed.value) return;
|
143
146
|
loadingOptionIndex.value = value;
|
144
147
|
};
|
145
148
|
const unlockCursor = debounce(() => {
|
@@ -154,17 +157,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
154
157
|
cursor.value = value;
|
155
158
|
};
|
156
159
|
const cursorUp = () => {
|
157
|
-
if (
|
160
|
+
if (isDisabledComputed.value) return;
|
158
161
|
lockCursor();
|
159
162
|
cursor.value = !optionsFiltered.value.length ? 0 : cursor.value < 1 ? lastIndex.value : cursor.value - 1;
|
160
163
|
};
|
161
164
|
const cursorDown = () => {
|
162
|
-
if (
|
165
|
+
if (isDisabledComputed.value) return;
|
163
166
|
lockCursor();
|
164
167
|
cursor.value = !optionsFiltered.value.length ? 0 : cursor.value >= lastIndex.value ? 0 : cursor.value + 1;
|
165
168
|
};
|
166
169
|
const selectCursor = () => {
|
167
|
-
if (
|
170
|
+
if (isDisabledComputed.value) return;
|
168
171
|
if (cursor.value === optionsFiltered.value.length) {
|
169
172
|
if (search.value && props.createOption) create(search.value);
|
170
173
|
return;
|
@@ -190,19 +193,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
190
193
|
}
|
191
194
|
};
|
192
195
|
const select = (item) => {
|
193
|
-
if (
|
196
|
+
if (isDisabledComputed.value) return;
|
194
197
|
emit("select", item);
|
195
198
|
search.value = "";
|
196
199
|
};
|
197
200
|
const unselect = (item) => {
|
198
|
-
if (
|
201
|
+
if (isDisabledComputed.value) return;
|
199
202
|
emit("unselect", item);
|
200
203
|
search.value = "";
|
201
204
|
const index = createdOptions.value.findIndex((option) => props.valueGetter(option) === item);
|
202
205
|
if (index !== -1) createdOptions.value.splice(index, 1);
|
203
206
|
};
|
204
207
|
const create = async (value) => {
|
205
|
-
if (
|
208
|
+
if (isDisabledComputed.value) return;
|
206
209
|
if (!props.createOption) return;
|
207
210
|
loadingCreate.value = true;
|
208
211
|
const option = await props.createOption(value);
|
@@ -288,13 +291,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
288
291
|
"option-component-props": _ctx.optionComponentProps,
|
289
292
|
index,
|
290
293
|
loading: _ctx.loading || unref(isLoading),
|
291
|
-
disabled:
|
292
|
-
readonly:
|
293
|
-
"disable-clear": _ctx.disableClear ||
|
294
|
+
disabled: unref(isDisabled),
|
295
|
+
readonly: unref(isReadonly),
|
296
|
+
"disable-clear": _ctx.disableClear || unref(isReadonly) || _ctx.seamless && !focused.value,
|
294
297
|
search: value,
|
295
298
|
class: normalizeClass({
|
296
|
-
"cursor-pointer": !
|
297
|
-
"cursor-not-allowed opacity-50":
|
299
|
+
"cursor-pointer": !unref(isDisabled) && !unref(isReadonly),
|
300
|
+
"cursor-not-allowed opacity-50": unref(isDisabled)
|
298
301
|
}),
|
299
302
|
onUnselect: ($event) => unselect(value)
|
300
303
|
}, createSlots({ _: 2 }, [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AA6HA;
|
1
|
+
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AA6HA;AAyTA,OAAO,KAAK,EAAC,gBAAgB,EAAE,qBAAqB,EAA8B,iBAAiB,EAAC,MAAM,SAAS,CAAA;yBAYlG,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EACzI,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAkhBO,mBAAmB,CAAC;;;;;;;2RAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;2BAxYrB,MAAM,KAAG,IAAI;MAwY8B,GAAG,IAAI;WACpE,GAAG;;gBAtWD,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;;gBAHrD,MAAM,IAAI;mBACP,MAAM,IAAI;gBACb,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;iBACrC,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;;;YAhKzD,QAAQ,QAAQ,KAAK,GAAG,IAAI;YAC5B,UAAU,QAAQ,KAAK,GAAG,IAAI;YAC9B,mBAAmB,SAAS,KAAK,EAAE,GAAG,IAAI;YAC1C,YAAY,GAAG,IAAI;YACnB,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,MAAM,SAAS,UAAU,GAAG,IAAI;;EAkgBlC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA7hBzE,wBA6hB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|