wave-ui 1.68.1 → 1.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wave-ui.cjs.js +1 -1
- package/dist/wave-ui.css +1 -1
- package/dist/wave-ui.es.js +508 -114
- package/dist/wave-ui.umd.js +1 -1
- package/package.json +14 -14
- package/src/wave-ui/components/index.js +1 -0
- package/src/wave-ui/components/transitions/w-transition-expand.vue +2 -4
- package/src/wave-ui/components/w-accordion.vue +1 -4
- package/src/wave-ui/components/w-alert.vue +1 -4
- package/src/wave-ui/components/w-autocomplete.vue +404 -0
- package/src/wave-ui/components/w-badge.vue +1 -0
- package/src/wave-ui/components/w-button/button.vue +7 -9
- package/src/wave-ui/components/w-card.vue +2 -0
- package/src/wave-ui/components/w-checkbox.vue +3 -2
- package/src/wave-ui/components/w-checkboxes.vue +4 -1
- package/src/wave-ui/components/w-drawer.vue +2 -8
- package/src/wave-ui/components/w-icon.vue +1 -1
- package/src/wave-ui/components/w-image.vue +2 -8
- package/src/wave-ui/components/w-input.vue +19 -16
- package/src/wave-ui/components/w-list.vue +8 -11
- package/src/wave-ui/components/w-menu.vue +12 -1
- package/src/wave-ui/components/w-notification-manager.vue +3 -3
- package/src/wave-ui/components/w-progress.vue +2 -8
- package/src/wave-ui/components/w-rating.vue +1 -4
- package/src/wave-ui/components/w-select.vue +94 -48
- package/src/wave-ui/components/w-slider.vue +6 -5
- package/src/wave-ui/components/w-spinner.vue +2 -0
- package/src/wave-ui/components/w-switch.vue +1 -1
- package/src/wave-ui/components/w-table.vue +221 -211
- package/src/wave-ui/components/w-tabs/index.vue +1 -4
- package/src/wave-ui/components/w-tag.vue +1 -4
- package/src/wave-ui/components/w-textarea.vue +1 -1
- package/src/wave-ui/components/w-timeline.vue +1 -0
- package/src/wave-ui/components/w-toolbar.vue +1 -2
- package/src/wave-ui/components/w-tooltip.vue +44 -10
- package/src/wave-ui/components/w-tree.vue +7 -7
- package/src/wave-ui/core.js +36 -2
- package/src/wave-ui/mixins/detachable.js +27 -6
- package/src/wave-ui/scss/_base.scss +18 -0
- package/src/wave-ui/scss/_variables.scss +103 -9
- package/src/wave-ui/scss/index.scss +0 -1
- package/src/wave-ui/utils/dynamic-css.js +19 -8
package/dist/wave-ui.es.js
CHANGED
|
@@ -34,6 +34,8 @@ var __privateWrapper = (obj, member, setter, getter) => {
|
|
|
34
34
|
};
|
|
35
35
|
var _instance, _uid, _notificationDefaults;
|
|
36
36
|
import Vue from "vue";
|
|
37
|
+
const consoleWarn = (message) => console.warn(`Wave UI: ${message}`);
|
|
38
|
+
const consoleError = (message) => console.error(`Wave UI: ${message}`);
|
|
37
39
|
const config = Vue.observable({
|
|
38
40
|
breakpoints: {
|
|
39
41
|
xs: 600,
|
|
@@ -506,8 +508,24 @@ const colorPalette = [
|
|
|
506
508
|
{ label: "inherit", color: "inherit" }
|
|
507
509
|
];
|
|
508
510
|
const injectPresets = (component, presets) => {
|
|
511
|
+
var _a, _b;
|
|
509
512
|
for (const preset in presets) {
|
|
510
|
-
component.props
|
|
513
|
+
if (!((_a = component.props) == null ? void 0 : _a[preset])) {
|
|
514
|
+
let foundProp = false;
|
|
515
|
+
if (Array.isArray(component.mixins) && component.mixins.length) {
|
|
516
|
+
for (const mixin of component.mixins) {
|
|
517
|
+
if ((_b = mixin == null ? void 0 : mixin.props) == null ? void 0 : _b[preset]) {
|
|
518
|
+
mixin.props[preset].default = presets[preset];
|
|
519
|
+
foundProp = true;
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
if (!foundProp)
|
|
524
|
+
consoleWarn(`Attempting to set a preset on a prop that doesn't exist: \`${component.name}.${preset}\`.`);
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
} else
|
|
528
|
+
component.props[preset].default = presets[preset];
|
|
511
529
|
}
|
|
512
530
|
};
|
|
513
531
|
const _WaveUI = class {
|
|
@@ -568,7 +586,7 @@ const _WaveUI = class {
|
|
|
568
586
|
let WaveUI = _WaveUI;
|
|
569
587
|
__publicField(WaveUI, "instance", null);
|
|
570
588
|
__publicField(WaveUI, "vueInstance", null);
|
|
571
|
-
var render$
|
|
589
|
+
var render$T = function() {
|
|
572
590
|
var _vm = this;
|
|
573
591
|
var _h = _vm.$createElement;
|
|
574
592
|
var _c = _vm._self._c || _h;
|
|
@@ -601,7 +619,7 @@ var render$S = function() {
|
|
|
601
619
|
}, { "item": _vm.getOriginalItem(item), "expanded": item._expanded, "index": i + 1 })], 2) : _vm._e()])], 1);
|
|
602
620
|
}), 0);
|
|
603
621
|
};
|
|
604
|
-
var staticRenderFns$
|
|
622
|
+
var staticRenderFns$T = [];
|
|
605
623
|
var wAccordion_vue_vue_type_style_index_0_lang = "";
|
|
606
624
|
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
607
625
|
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
@@ -657,7 +675,7 @@ function normalizeComponent(scriptExports, render2, staticRenderFns2, functional
|
|
|
657
675
|
options
|
|
658
676
|
};
|
|
659
677
|
}
|
|
660
|
-
const __vue2_script$
|
|
678
|
+
const __vue2_script$T = {
|
|
661
679
|
name: "w-accordion",
|
|
662
680
|
props: {
|
|
663
681
|
value: { type: Array },
|
|
@@ -746,26 +764,26 @@ const __vue2_script$S = {
|
|
|
746
764
|
}
|
|
747
765
|
}
|
|
748
766
|
};
|
|
749
|
-
const __cssModules$
|
|
750
|
-
var __component__$
|
|
751
|
-
__vue2_script$
|
|
752
|
-
render$
|
|
753
|
-
staticRenderFns$
|
|
767
|
+
const __cssModules$T = {};
|
|
768
|
+
var __component__$T = /* @__PURE__ */ normalizeComponent(
|
|
769
|
+
__vue2_script$T,
|
|
770
|
+
render$T,
|
|
771
|
+
staticRenderFns$T,
|
|
754
772
|
false,
|
|
755
|
-
__vue2_injectStyles$
|
|
773
|
+
__vue2_injectStyles$T,
|
|
756
774
|
null,
|
|
757
775
|
null,
|
|
758
776
|
null
|
|
759
777
|
);
|
|
760
|
-
function __vue2_injectStyles$
|
|
761
|
-
for (let o in __cssModules$
|
|
762
|
-
this[o] = __cssModules$
|
|
778
|
+
function __vue2_injectStyles$T(context) {
|
|
779
|
+
for (let o in __cssModules$T) {
|
|
780
|
+
this[o] = __cssModules$T[o];
|
|
763
781
|
}
|
|
764
782
|
}
|
|
765
783
|
var wAccordion = /* @__PURE__ */ function() {
|
|
766
|
-
return __component__$
|
|
784
|
+
return __component__$T.exports;
|
|
767
785
|
}();
|
|
768
|
-
var render$
|
|
786
|
+
var render$S = function() {
|
|
769
787
|
var _vm = this;
|
|
770
788
|
var _h = _vm.$createElement;
|
|
771
789
|
var _c = _vm._self._c || _h;
|
|
@@ -775,9 +793,9 @@ var render$R = function() {
|
|
|
775
793
|
_vm.$emit("close", false);
|
|
776
794
|
} } }) : _vm._e()] : _vm._t("default")], 2) : _vm._e();
|
|
777
795
|
};
|
|
778
|
-
var staticRenderFns$
|
|
796
|
+
var staticRenderFns$S = [];
|
|
779
797
|
var wAlert_vue_vue_type_style_index_0_lang = "";
|
|
780
|
-
const __vue2_script$
|
|
798
|
+
const __vue2_script$S = {
|
|
781
799
|
name: "w-alert",
|
|
782
800
|
props: {
|
|
783
801
|
value: { default: true },
|
|
@@ -853,6 +871,282 @@ const __vue2_script$R = {
|
|
|
853
871
|
}
|
|
854
872
|
}
|
|
855
873
|
};
|
|
874
|
+
const __cssModules$S = {};
|
|
875
|
+
var __component__$S = /* @__PURE__ */ normalizeComponent(
|
|
876
|
+
__vue2_script$S,
|
|
877
|
+
render$S,
|
|
878
|
+
staticRenderFns$S,
|
|
879
|
+
false,
|
|
880
|
+
__vue2_injectStyles$S,
|
|
881
|
+
null,
|
|
882
|
+
null,
|
|
883
|
+
null
|
|
884
|
+
);
|
|
885
|
+
function __vue2_injectStyles$S(context) {
|
|
886
|
+
for (let o in __cssModules$S) {
|
|
887
|
+
this[o] = __cssModules$S[o];
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
var wAlert = /* @__PURE__ */ function() {
|
|
891
|
+
return __component__$S.exports;
|
|
892
|
+
}();
|
|
893
|
+
var render$R = function() {
|
|
894
|
+
var _vm = this;
|
|
895
|
+
var _h = _vm.$createElement;
|
|
896
|
+
var _c = _vm._self._c || _h;
|
|
897
|
+
return _c("div", { staticClass: "w-autocomplete", class: _vm.classes, on: { "click": _vm.onClick } }, [_vm.selection.length ? _vm._l(_vm.selection, function(item, i) {
|
|
898
|
+
return _c("div", { staticClass: "w-autocomplete__selection" }, [_vm._t("selection", function() {
|
|
899
|
+
return [_c("span", { domProps: { "innerHTML": _vm._s(item[_vm.itemLabelKey]) } }), _c("w-button", { attrs: { "icon": "wi-cross", "xs": "", "text": "", "color": "currentColor" }, on: { "click": function($event) {
|
|
900
|
+
$event.stopPropagation();
|
|
901
|
+
return _vm.unselectItem(i);
|
|
902
|
+
} } })];
|
|
903
|
+
}, { "item": item, "unselect": function(i2) {
|
|
904
|
+
return _vm.unselectItem(i2);
|
|
905
|
+
} })], 2);
|
|
906
|
+
}) : _vm._e(), !_vm.selection.length && !_vm.keywords && _vm.placeholder ? _c("div", { staticClass: "w-autocomplete__placeholder", domProps: { "innerHTML": _vm._s(_vm.placeholder) } }) : _vm._e(), _c("input", _vm._g({ ref: "input", staticClass: "w-autocomplete__input", domProps: { "value": _vm.keywords } }, _vm.inputEventListeners)), _c("w-transition-slide-fade", [_vm.menuOpen ? _c("ul", { ref: "menu", staticClass: "w-autocomplete__menu", on: { "mousedown": function($event) {
|
|
907
|
+
_vm.menuIsBeingClicked = true;
|
|
908
|
+
}, "mouseup": _vm.setEndOfMenuClick, "touchstart": function($event) {
|
|
909
|
+
_vm.menuIsBeingClicked = true;
|
|
910
|
+
}, "touchend": _vm.setEndOfMenuClick } }, [_vm._l(_vm.filteredItems, function(item, i) {
|
|
911
|
+
return _c("li", { key: i, class: { highlighted: _vm.highlightedItem === item.uid }, on: { "click": function($event) {
|
|
912
|
+
$event.stopPropagation();
|
|
913
|
+
_vm.selectItem(item), _vm.$emit("item-click", item);
|
|
914
|
+
} } }, [_vm._t("item", function() {
|
|
915
|
+
return [_c("span", { domProps: { "innerHTML": _vm._s(item[_vm.itemLabelKey]) } })];
|
|
916
|
+
}, { "item": item, "highlighted": _vm.highlightedItem === item.uid })], 2);
|
|
917
|
+
}), !_vm.filteredItems.length ? _c("li", { staticClass: "w-autocomplete__no-match", class: { "w-autocomplete__no-match--default": !_vm.$slots.noMatch } }, [_vm._t("no-match", function() {
|
|
918
|
+
return [_c("div", { staticClass: "caption", domProps: { "innerHTML": _vm._s(_vm.noMatch !== void 0 ? _vm.noMatch : "No match.") } })];
|
|
919
|
+
})], 2) : _vm._e(), _vm.$slots["extra-item"] ? _c("li", { staticClass: "w-autocomplete__extra-item", class: { highlighted: _vm.highlightedItem === "extra-item" }, on: { "click": _vm.selectExtraItem } }, [_vm._t("extra-item")], 2) : _vm._e()], 2) : _vm._e()])], 2);
|
|
920
|
+
};
|
|
921
|
+
var staticRenderFns$R = [];
|
|
922
|
+
var wAutocomplete_vue_vue_type_style_index_0_lang = "";
|
|
923
|
+
const __vue2_script$R = {
|
|
924
|
+
name: "w-autocomplete",
|
|
925
|
+
props: {
|
|
926
|
+
items: { type: Array, required: true },
|
|
927
|
+
value: { type: [String, Number, Array] },
|
|
928
|
+
placeholder: { type: String },
|
|
929
|
+
openOnKeydown: { type: Boolean },
|
|
930
|
+
multiple: { type: Boolean },
|
|
931
|
+
allowDuplicates: { type: Boolean },
|
|
932
|
+
noMatch: { type: String },
|
|
933
|
+
itemValueKey: { type: String, default: "value" },
|
|
934
|
+
itemLabelKey: { type: String, default: "label" },
|
|
935
|
+
itemSearchableKey: { type: String, default: "searchable" }
|
|
936
|
+
},
|
|
937
|
+
emits: ["update:modelValue", "input", "focus", "blur", "keydown", "item-click", "item-select", "extra-item-select"],
|
|
938
|
+
data: () => ({
|
|
939
|
+
keywords: "",
|
|
940
|
+
selection: [],
|
|
941
|
+
menuOpen: false,
|
|
942
|
+
highlightedItem: null,
|
|
943
|
+
menuIsBeingClicked: false
|
|
944
|
+
}),
|
|
945
|
+
computed: {
|
|
946
|
+
normalizedKeywords() {
|
|
947
|
+
return this.normalize(this.keywords);
|
|
948
|
+
},
|
|
949
|
+
normalizedSelection() {
|
|
950
|
+
return this.selection.map((item) => this.normalize(item == null ? void 0 : item.searchable));
|
|
951
|
+
},
|
|
952
|
+
optimizedItemsForSearch() {
|
|
953
|
+
return this.items.map((item, i) => ({
|
|
954
|
+
...item,
|
|
955
|
+
uid: i,
|
|
956
|
+
searchable: this.normalize(item[this.itemSearchableKey] || "")
|
|
957
|
+
}));
|
|
958
|
+
},
|
|
959
|
+
filteredItems() {
|
|
960
|
+
let items = this.optimizedItemsForSearch;
|
|
961
|
+
const selection = this.normalizedSelection.join(",");
|
|
962
|
+
const isItemNotSelected = (item) => !selection.includes(item.searchable);
|
|
963
|
+
if (this.keywords) {
|
|
964
|
+
items = items.filter((item) => {
|
|
965
|
+
if (!item.searchable.includes(this.normalizedKeywords))
|
|
966
|
+
return false;
|
|
967
|
+
else if (this.multiple && !this.allowDuplicates)
|
|
968
|
+
return isItemNotSelected(item);
|
|
969
|
+
else
|
|
970
|
+
return true;
|
|
971
|
+
});
|
|
972
|
+
} else if (this.multiple && !this.allowDuplicates)
|
|
973
|
+
items = items.filter(isItemNotSelected);
|
|
974
|
+
return items;
|
|
975
|
+
},
|
|
976
|
+
highlightedItemIndex() {
|
|
977
|
+
if (this.highlightedItem === null)
|
|
978
|
+
return -1;
|
|
979
|
+
else if (this.highlightedItem === "extra-item")
|
|
980
|
+
return this.filteredItems.length;
|
|
981
|
+
return this.filteredItems.findIndex((item) => item.uid === this.highlightedItem);
|
|
982
|
+
},
|
|
983
|
+
inputEventListeners() {
|
|
984
|
+
return {
|
|
985
|
+
...this.$attrs,
|
|
986
|
+
input: (e) => {
|
|
987
|
+
this.keywords = e.target.value;
|
|
988
|
+
},
|
|
989
|
+
focus: (e) => {
|
|
990
|
+
if (this.menuIsBeingClicked)
|
|
991
|
+
return;
|
|
992
|
+
this.onFocus(e);
|
|
993
|
+
this.$emit("focus", e);
|
|
994
|
+
},
|
|
995
|
+
blur: (e) => {
|
|
996
|
+
if (!this.menuIsBeingClicked)
|
|
997
|
+
this.$emit("blur", e);
|
|
998
|
+
},
|
|
999
|
+
keydown: (e) => {
|
|
1000
|
+
this.onKeydown(e);
|
|
1001
|
+
this.$emit("keydown", e);
|
|
1002
|
+
},
|
|
1003
|
+
drop: this.onDrop,
|
|
1004
|
+
compositionstart: this.onCompositionStart,
|
|
1005
|
+
compositionupdate: this.onCompositionUpdate
|
|
1006
|
+
};
|
|
1007
|
+
},
|
|
1008
|
+
classes() {
|
|
1009
|
+
return {
|
|
1010
|
+
"w-autocomplete--open": this.menuOpen,
|
|
1011
|
+
"w-autocomplete--filled": this.selection.length,
|
|
1012
|
+
"w-autocomplete--has-keywords": this.keywords,
|
|
1013
|
+
"w-autocomplete--empty": !this.selection.length && !this.keywords
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
methods: {
|
|
1018
|
+
normalize(string) {
|
|
1019
|
+
return string.toLowerCase().normalize("NFKD").replace(/\p{Diacritic}/gu, "").replace(/œ/g, "oe");
|
|
1020
|
+
},
|
|
1021
|
+
selectItem(item) {
|
|
1022
|
+
if (!this.multiple)
|
|
1023
|
+
this.selection = [];
|
|
1024
|
+
this.selection.push(item);
|
|
1025
|
+
this.highlightedItem = item.uid;
|
|
1026
|
+
this.keywords = "";
|
|
1027
|
+
const emitPayload = this.multiple ? this.selection.map((item2) => item2[this.itemValueKey]) : item[this.itemValueKey];
|
|
1028
|
+
this.$emit("item-select", item);
|
|
1029
|
+
this.$emit("update:modelValue", emitPayload);
|
|
1030
|
+
this.$emit("input", emitPayload);
|
|
1031
|
+
this.$refs.input.focus();
|
|
1032
|
+
if (!this.multiple)
|
|
1033
|
+
this.closeMenu();
|
|
1034
|
+
},
|
|
1035
|
+
unselectItem(i) {
|
|
1036
|
+
this.selection.splice(i != null ? i : this.selection.length - 1, 1);
|
|
1037
|
+
this.highlightedItem = null;
|
|
1038
|
+
this.$emit("update:modelValue", null);
|
|
1039
|
+
this.$emit("input", null);
|
|
1040
|
+
this.$refs.input.focus();
|
|
1041
|
+
},
|
|
1042
|
+
selectExtraItem() {
|
|
1043
|
+
this.keywords = "";
|
|
1044
|
+
this.$emit("extra-item-select");
|
|
1045
|
+
this.closeMenu();
|
|
1046
|
+
},
|
|
1047
|
+
setEndOfMenuClick() {
|
|
1048
|
+
setTimeout(() => this.menuIsBeingClicked = false, 100);
|
|
1049
|
+
},
|
|
1050
|
+
onClick() {
|
|
1051
|
+
if (!this.openOnKeydown)
|
|
1052
|
+
this.openMenu();
|
|
1053
|
+
this.$refs.input.focus();
|
|
1054
|
+
},
|
|
1055
|
+
onFocus() {
|
|
1056
|
+
if (!this.openOnKeydown)
|
|
1057
|
+
this.openMenu();
|
|
1058
|
+
},
|
|
1059
|
+
onKeydown(e) {
|
|
1060
|
+
var _a;
|
|
1061
|
+
const itemsCount = this.filteredItems.length + (this.$slots["extra-item"] ? 1 : 0);
|
|
1062
|
+
if (!this.openOnKeydown || (this.keywords || e.key.length === 1) && !this.menuOpen)
|
|
1063
|
+
this.openMenu();
|
|
1064
|
+
if (e.keyCode === 9)
|
|
1065
|
+
this.closeMenu();
|
|
1066
|
+
else if (e.keyCode === 8 && (!this.keywords || !e.target.selectionStart && !e.target.selectionEnd)) {
|
|
1067
|
+
this.unselectItem();
|
|
1068
|
+
} else if (e.keyCode === 13) {
|
|
1069
|
+
e.preventDefault();
|
|
1070
|
+
if (this.highlightedItem === "extra-item")
|
|
1071
|
+
this.selectExtraItem();
|
|
1072
|
+
else if (this.highlightedItemIndex >= 0)
|
|
1073
|
+
this.selectItem(this.filteredItems[this.highlightedItemIndex]);
|
|
1074
|
+
} else if ([38, 40].includes(e.keyCode)) {
|
|
1075
|
+
e.preventDefault();
|
|
1076
|
+
let index2 = this.highlightedItemIndex;
|
|
1077
|
+
if (index2 === -1)
|
|
1078
|
+
index2 = e.keyCode === 38 ? itemsCount - 1 : 0;
|
|
1079
|
+
else
|
|
1080
|
+
index2 = (index2 + (e.keyCode === 38 ? -1 : 1) + itemsCount) % itemsCount;
|
|
1081
|
+
if (this.$slots["extra-item"] && index2 === itemsCount - 1)
|
|
1082
|
+
this.highlightedItem = "extra-item";
|
|
1083
|
+
else
|
|
1084
|
+
this.highlightedItem = ((_a = this.filteredItems[index2]) == null ? void 0 : _a.uid) || 0;
|
|
1085
|
+
const menuEl = this.$refs.menu;
|
|
1086
|
+
if (menuEl) {
|
|
1087
|
+
if (this.$slots["extra-item"] && index2 === itemsCount - 1)
|
|
1088
|
+
menuEl.scrollTop = menuEl.scrollHeight;
|
|
1089
|
+
else {
|
|
1090
|
+
const { offsetHeight: itemElHeight, offsetTop: itemElTop } = menuEl.childNodes[index2] || {};
|
|
1091
|
+
if (menuEl.scrollTop + menuEl.offsetHeight - itemElHeight < itemElTop) {
|
|
1092
|
+
menuEl.scrollTop = itemElTop - menuEl.offsetHeight + itemElHeight;
|
|
1093
|
+
} else if (menuEl.scrollTop > itemElTop)
|
|
1094
|
+
menuEl.scrollTop = itemElTop;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
} else if (!this.multiple && this.selection.length && e.key.length === 1)
|
|
1098
|
+
e.preventDefault();
|
|
1099
|
+
},
|
|
1100
|
+
onDrop(e) {
|
|
1101
|
+
if (!this.multiple && this.selection.length)
|
|
1102
|
+
e.preventDefault();
|
|
1103
|
+
},
|
|
1104
|
+
onCompositionStart(e) {
|
|
1105
|
+
if (!this.multiple && this.selection.length)
|
|
1106
|
+
e.target.setAttribute("readonly", true);
|
|
1107
|
+
},
|
|
1108
|
+
onCompositionUpdate(e) {
|
|
1109
|
+
if (!this.multiple && this.selection.length)
|
|
1110
|
+
setTimeout(() => e.target.removeAttribute("readonly"), 200);
|
|
1111
|
+
},
|
|
1112
|
+
openMenu() {
|
|
1113
|
+
if (this.menuOpen)
|
|
1114
|
+
return;
|
|
1115
|
+
this.menuOpen = true;
|
|
1116
|
+
document.addEventListener("click", this.onDocumentClick);
|
|
1117
|
+
},
|
|
1118
|
+
closeMenu() {
|
|
1119
|
+
this.menuOpen = false;
|
|
1120
|
+
document.removeEventListener("click", this.onDocumentClick);
|
|
1121
|
+
},
|
|
1122
|
+
onDocumentClick(e) {
|
|
1123
|
+
if (!this.$el.contains(e.target) && !this.$el.isSameNode(e.target))
|
|
1124
|
+
this.closeMenu();
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
created() {
|
|
1128
|
+
if (this.value) {
|
|
1129
|
+
const arrayOfValues = Array.isArray(this.value) ? this.value : [this.value];
|
|
1130
|
+
arrayOfValues.forEach((value) => {
|
|
1131
|
+
this.selection.push(this.optimizedItemsForSearch.find((item) => item[this.itemValueKey] === +value));
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
beforeDestroy() {
|
|
1136
|
+
document.removeEventListener("click", this.onDocumentClick);
|
|
1137
|
+
},
|
|
1138
|
+
watch: {
|
|
1139
|
+
value(value) {
|
|
1140
|
+
this.selection = [];
|
|
1141
|
+
if (value) {
|
|
1142
|
+
const arrayOfValues = Array.isArray(value) ? value : [value];
|
|
1143
|
+
arrayOfValues.forEach((value2) => {
|
|
1144
|
+
this.selection.push(this.optimizedItemsForSearch.find((item) => item[this.itemValueKey] === +value2));
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
856
1150
|
const __cssModules$R = {};
|
|
857
1151
|
var __component__$R = /* @__PURE__ */ normalizeComponent(
|
|
858
1152
|
__vue2_script$R,
|
|
@@ -869,7 +1163,7 @@ function __vue2_injectStyles$R(context) {
|
|
|
869
1163
|
this[o] = __cssModules$R[o];
|
|
870
1164
|
}
|
|
871
1165
|
}
|
|
872
|
-
var
|
|
1166
|
+
var wAutocomplete = /* @__PURE__ */ function() {
|
|
873
1167
|
return __component__$R.exports;
|
|
874
1168
|
}();
|
|
875
1169
|
var render$Q = function() {
|
|
@@ -931,10 +1225,11 @@ const cssVars = {
|
|
|
931
1225
|
};
|
|
932
1226
|
const generateColors = (config2) => {
|
|
933
1227
|
let styles = "";
|
|
1228
|
+
const cssVariables = {};
|
|
934
1229
|
const { cssScope } = cssVars;
|
|
935
1230
|
const { info, warning, success, error, ...colors } = config2.colors;
|
|
936
|
-
for (const
|
|
937
|
-
styles += `${cssScope} .${
|
|
1231
|
+
for (const colorName in colors) {
|
|
1232
|
+
styles += `${cssScope} .${colorName}--bg{background-color:${config2.colors[colorName]}}${cssScope} .${colorName}{color:${config2.colors[colorName]}}`;
|
|
938
1233
|
}
|
|
939
1234
|
if (config2.css.colorShades && config2.shades) {
|
|
940
1235
|
Object.entries(config2.shades).forEach(([label, color]) => {
|
|
@@ -945,10 +1240,14 @@ const generateColors = (config2) => {
|
|
|
945
1240
|
for (const color in statusColors) {
|
|
946
1241
|
styles += `${cssScope} .${color}--bg{background-color:${config2.colors[color]}}${cssScope} .${color}{color:${config2.colors[color]}}`;
|
|
947
1242
|
}
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1243
|
+
const allColors = { ...colors, info, warning, success, error };
|
|
1244
|
+
for (const colorName in allColors)
|
|
1245
|
+
cssVariables[colorName] = allColors[colorName];
|
|
1246
|
+
let cssVariablesString = "";
|
|
1247
|
+
Object.entries(cssVariables).forEach(([colorName, colorHex]) => {
|
|
1248
|
+
cssVariablesString += `--w-${colorName}-color: ${colorHex};`;
|
|
1249
|
+
});
|
|
1250
|
+
return `:root{${cssVariablesString}}${styles}`;
|
|
952
1251
|
};
|
|
953
1252
|
const generateBreakpoints = (breakpoints, grid) => {
|
|
954
1253
|
let styles = "";
|
|
@@ -984,6 +1283,7 @@ const genBreakpointLayoutClasses = (breakpoints) => {
|
|
|
984
1283
|
"text-nowrap{white-space:nowrap}",
|
|
985
1284
|
"row{flex-direction:row}",
|
|
986
1285
|
"column{flex-direction:column}",
|
|
1286
|
+
"column-reverse{flex-direction:column-reverse}",
|
|
987
1287
|
"grow{flex-grow:1;flex-basis:auto}",
|
|
988
1288
|
"no-grow{flex-grow:0}",
|
|
989
1289
|
"shrink{flex-shrink:1;margin-left:auto;margin-right:auto}",
|
|
@@ -1699,8 +1999,9 @@ const __vue2_script$J = {
|
|
|
1699
1999
|
methods: {
|
|
1700
2000
|
onInput() {
|
|
1701
2001
|
this.isChecked = !this.isChecked;
|
|
1702
|
-
this
|
|
1703
|
-
this.$emit("
|
|
2002
|
+
const returnValue = this.isChecked && this.returnValue !== void 0 ? this.returnValue : this.isChecked;
|
|
2003
|
+
this.$emit("update:modelValue", returnValue);
|
|
2004
|
+
this.$emit("input", returnValue);
|
|
1704
2005
|
if (!this.noRipple) {
|
|
1705
2006
|
if (this.isChecked) {
|
|
1706
2007
|
this.ripple.start = true;
|
|
@@ -1765,6 +2066,7 @@ const __vue2_script$I = {
|
|
|
1765
2066
|
props: {
|
|
1766
2067
|
items: { type: Array, required: true },
|
|
1767
2068
|
value: { type: Array },
|
|
2069
|
+
returnValues: { type: Boolean },
|
|
1768
2070
|
labelOnLeft: { type: Boolean },
|
|
1769
2071
|
itemLabelKey: { type: String, default: "label" },
|
|
1770
2072
|
itemValueKey: { type: String, default: "value" },
|
|
@@ -1807,7 +2109,7 @@ const __vue2_script$I = {
|
|
|
1807
2109
|
},
|
|
1808
2110
|
toggleCheck(checkbox, isChecked) {
|
|
1809
2111
|
checkbox._isChecked = isChecked;
|
|
1810
|
-
const selection = this.checkboxItems.filter((item) => item._isChecked).map((item) => item.value);
|
|
2112
|
+
const selection = this.checkboxItems.filter((item) => item._isChecked).map((item) => this.returnValues ? item.returnValue : item.value);
|
|
1811
2113
|
this.$emit("update:modelValue", selection);
|
|
1812
2114
|
this.$emit("input", selection);
|
|
1813
2115
|
},
|
|
@@ -2839,8 +3141,6 @@ function __vue2_injectStyles$y(context) {
|
|
|
2839
3141
|
var wIcon = /* @__PURE__ */ function() {
|
|
2840
3142
|
return __component__$y.exports;
|
|
2841
3143
|
}();
|
|
2842
|
-
const consoleWarn = (message) => console.warn(`Wave UI: ${message}`);
|
|
2843
|
-
const consoleError = (message) => console.error(`Wave UI: ${message}`);
|
|
2844
3144
|
var render$x = function() {
|
|
2845
3145
|
var _vm = this;
|
|
2846
3146
|
var _h = _vm.$createElement;
|
|
@@ -3008,9 +3308,11 @@ var render$w = function() {
|
|
|
3008
3308
|
_vm.inputValue = $event.target.value;
|
|
3009
3309
|
} } }) : [_vm.labelPosition === "left" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-input__label w-input__label--left w-form-el-shakable", class: _vm.labelClasses, attrs: { "for": "w-input--" + _vm._uid } }, [_vm._t("default", function() {
|
|
3010
3310
|
return [_vm._v(_vm._s(_vm.label))];
|
|
3011
|
-
})], 2) : _vm._e()] : _vm._e(), _c("div", { staticClass: "w-input__input-wrap", class: _vm.inputWrapClasses }, [_vm.
|
|
3012
|
-
return _vm
|
|
3013
|
-
|
|
3311
|
+
})], 2) : _vm._e()] : _vm._e(), _c("div", { staticClass: "w-input__input-wrap", class: _vm.inputWrapClasses }, [_vm._t("icon-left", function() {
|
|
3312
|
+
return [_vm.innerIconLeft ? _c("w-icon", { staticClass: "w-input__icon w-input__icon--inner-left", attrs: { "tag": "label", "for": "w-input--" + _vm._uid }, on: { "click": function($event) {
|
|
3313
|
+
return _vm.$emit("click:inner-icon-left", $event);
|
|
3314
|
+
} } }, [_vm._v(_vm._s(_vm.innerIconLeft))]) : _vm._e()];
|
|
3315
|
+
}, { "inputId": "w-input--" + _vm._uid }), _vm.type === "checkbox" && _vm.type !== "file" ? _c("input", _vm._g(_vm._b({ directives: [{ name: "model", rawName: "v-model", value: _vm.inputValue, expression: "inputValue" }], ref: "input", staticClass: "w-input__input", attrs: { "id": "w-input--" + _vm._uid, "name": _vm.inputName, "placeholder": _vm.placeholder || null, "step": _vm.step || null, "min": _vm.min || null, "max": _vm.max || null, "minlength": _vm.minlength || null, "maxlength": _vm.maxlength || null, "readonly": _vm.isReadonly || null, "aria-readonly": _vm.isReadonly ? "true" : "false", "disabled": _vm.isDisabled || null, "required": _vm.required || null, "tabindex": _vm.tabindex || null, "type": "checkbox" }, domProps: { "checked": Array.isArray(_vm.inputValue) ? _vm._i(_vm.inputValue, null) > -1 : _vm.inputValue }, on: { "input": _vm.onInput, "focus": _vm.onFocus, "blur": _vm.onBlur, "change": function($event) {
|
|
3014
3316
|
var $$a = _vm.inputValue, $$el = $event.target, $$c = $$el.checked ? true : false;
|
|
3015
3317
|
if (Array.isArray($$a)) {
|
|
3016
3318
|
var $$v = null, $$i = _vm._i($$a, $$v);
|
|
@@ -3029,15 +3331,17 @@ var render$w = function() {
|
|
|
3029
3331
|
return;
|
|
3030
3332
|
}
|
|
3031
3333
|
_vm.inputValue = $event.target.value;
|
|
3032
|
-
}, _vm.onInput], "focus": _vm.onFocus, "blur": _vm.onBlur } }, "input", _vm.attrs, false), _vm.listeners)) : [_c("input", _vm._b({ ref: "input", attrs: { "id": "w-input--" + _vm._uid, "type": "file", "name": _vm.name || null, "multiple": _vm.multiple || null, "data-progress": _vm.overallFilesProgress }, on: { "focus": _vm.onFocus, "blur": _vm.onBlur, "change": _vm.onFileChange } }, "input", _vm.attrs, false)), _c("transition-group", { staticClass: "w-input__input w-input__input--file", attrs: { "tag": "label", "name": "fade", "for": "w-input--" + _vm._uid } }, [!_vm.inputFiles.length && _vm.isFocused ? _c("span", { key: "no-file", staticClass: "w-input__no-file" }, [_vm._t("no-file", function() {
|
|
3334
|
+
}, _vm.onInput], "focus": _vm.onFocus, "blur": _vm.onBlur } }, "input", _vm.attrs, false), _vm.listeners)) : [_c("input", _vm._b({ ref: "input", attrs: { "id": "w-input--" + _vm._uid, "type": "file", "name": _vm.name || null, "multiple": _vm.multiple || null, "disabled": _vm.isDisabled || null, "data-progress": _vm.overallFilesProgress }, on: { "focus": _vm.onFocus, "blur": _vm.onBlur, "change": _vm.onFileChange } }, "input", _vm.attrs, false)), _c("transition-group", { staticClass: "w-input__input w-input__input--file", attrs: { "tag": "label", "name": "fade", "for": "w-input--" + _vm._uid } }, [!_vm.inputFiles.length && _vm.isFocused ? _c("span", { key: "no-file", staticClass: "w-input__no-file" }, [_vm._t("no-file", function() {
|
|
3033
3335
|
return [_vm.$slots["no-file"] === void 0 ? [_vm._v("No file")] : _vm._e()];
|
|
3034
3336
|
})], 2) : _vm._e(), _vm._l(_vm.inputFiles, function(file, i) {
|
|
3035
3337
|
return _c("span", { key: file.lastModified }, [_vm._v(_vm._s(i ? ", " : "")), _c("span", { key: i + "b", staticClass: "filename" }, [_vm._v(_vm._s(file.base))]), _vm._v(_vm._s(file.extension ? "." + file.extension : ""))]);
|
|
3036
|
-
})], 2)], _vm.labelPosition === "inside" && _vm.showLabelInside
|
|
3338
|
+
})], 2)], _vm.labelPosition === "inside" && _vm.showLabelInside && (_vm.$slots.default || _vm.label) ? _c("label", { staticClass: "w-input__label w-input__label--inside w-form-el-shakable", class: _vm.labelClasses }, [_vm._t("default", function() {
|
|
3037
3339
|
return [_vm._v(_vm._s(_vm.label))];
|
|
3038
|
-
})], 2) : _vm._e()
|
|
3039
|
-
return _vm
|
|
3040
|
-
|
|
3340
|
+
})], 2) : _vm._e(), _vm._t("icon-right", function() {
|
|
3341
|
+
return [_vm.innerIconRight ? _c("w-icon", { staticClass: "w-input__icon w-input__icon--inner-right", attrs: { "tag": "label", "for": "w-input--" + _vm._uid }, on: { "click": function($event) {
|
|
3342
|
+
return _vm.$emit("click:inner-icon-right", $event);
|
|
3343
|
+
} } }, [_vm._v(_vm._s(_vm.innerIconRight))]) : _vm._e()];
|
|
3344
|
+
}, { "inputId": "w-input--" + _vm._uid }), _vm.hasLoading || _vm.showProgress && (_vm.uploadInProgress || _vm.uploadComplete) ? _c("w-progress", { staticClass: "fill-width", attrs: { "size": "2", "color": _vm.progressColor || _vm.color, "value": _vm.showProgress ? (_vm.uploadInProgress || _vm.uploadComplete) && _vm.overallFilesProgress : _vm.loadingValue } }) : _vm._e()], 2), _vm.type === "file" && _vm.preview && _vm.inputFiles.length ? _c("label", { staticClass: "d-flex", attrs: { "for": "w-input--" + _vm._uid } }, [_vm._l(_vm.inputFiles, function(file, i) {
|
|
3041
3345
|
return [file.progress < 100 ? _c("i", { key: i, staticClass: "w-icon wi-spinner w-icon--spin size--sm w-input__file-preview primary" }) : file.preview ? _c("img", { key: i, staticClass: "w-input__file-preview", attrs: { "src": file.preview, "alt": "" } }) : _c("i", { key: i, staticClass: "w-icon w-input__file-preview primary size--md", class: _vm.preview && typeof _vm.preview === "string" ? _vm.preview : "wi-file" })];
|
|
3042
3346
|
})], 2) : _vm._e(), _vm.labelPosition === "right" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-input__label w-input__label--right w-form-el-shakable", class: _vm.labelClasses, attrs: { "for": "w-input--" + _vm._uid } }, [_vm._t("default", function() {
|
|
3043
3347
|
return [_vm._v(_vm._s(_vm.label))];
|
|
@@ -3133,7 +3437,7 @@ const __vue2_script$w = {
|
|
|
3133
3437
|
overallFilesProgress() {
|
|
3134
3438
|
const progress = +this.inputFiles.reduce((total2, file) => total2 + file.progress, 0);
|
|
3135
3439
|
const total = progress / this.inputFiles.length;
|
|
3136
|
-
this.$emit("update:overallProgress", this.inputFiles.length ? total :
|
|
3440
|
+
this.$emit("update:overallProgress", this.inputFiles.length ? total : 0);
|
|
3137
3441
|
return total;
|
|
3138
3442
|
},
|
|
3139
3443
|
uploadInProgress() {
|
|
@@ -3394,8 +3698,8 @@ const __vue2_script$v = {
|
|
|
3394
3698
|
"w-list__item-label--focused": item._focused,
|
|
3395
3699
|
"w-list__item-label--hoverable": this.hover,
|
|
3396
3700
|
"w-list__item-label--selectable": this.isSelectable,
|
|
3397
|
-
[item.
|
|
3398
|
-
[this.SelectionColor]: item._selected && !item.
|
|
3701
|
+
[item[this.itemColorKey]]: !!item[this.itemColorKey],
|
|
3702
|
+
[this.SelectionColor]: item._selected && !item[this.itemColorKey] && this.SelectionColor,
|
|
3399
3703
|
[item[this.itemClassKey] || this.itemClass]: item[this.itemClassKey] || this.itemClass
|
|
3400
3704
|
};
|
|
3401
3705
|
},
|
|
@@ -3519,10 +3823,9 @@ const __vue2_script$v = {
|
|
|
3519
3823
|
applySelectionOnItems(selection) {
|
|
3520
3824
|
if (!this.isMultipleSelect)
|
|
3521
3825
|
this.listItems.forEach((item) => item._selected = false);
|
|
3522
|
-
this.checkSelection(selection)
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
foundItem._selected = true;
|
|
3826
|
+
const selectedItems = this.checkSelection(selection);
|
|
3827
|
+
this.listItems.forEach((item) => {
|
|
3828
|
+
item._selected = selectedItems.find((val) => item._value === val) !== void 0;
|
|
3526
3829
|
});
|
|
3527
3830
|
}
|
|
3528
3831
|
},
|
|
@@ -3591,7 +3894,8 @@ var DetachableMixin = {
|
|
|
3591
3894
|
detachableDefaultRoot: { default: null }
|
|
3592
3895
|
},
|
|
3593
3896
|
data: () => ({
|
|
3594
|
-
docEventListenersHandlers: []
|
|
3897
|
+
docEventListenersHandlers: [],
|
|
3898
|
+
openTimeout: null
|
|
3595
3899
|
}),
|
|
3596
3900
|
computed: {
|
|
3597
3901
|
appendToTarget() {
|
|
@@ -3648,12 +3952,17 @@ var DetachableMixin = {
|
|
|
3648
3952
|
},
|
|
3649
3953
|
alignment() {
|
|
3650
3954
|
return ["top", "bottom"].includes(this.position) && this.alignLeft && "left" || ["top", "bottom"].includes(this.position) && this.alignRight && "right" || ["left", "right"].includes(this.position) && this.alignTop && "top" || ["left", "right"].includes(this.position) && this.alignBottom && "bottom" || "";
|
|
3955
|
+
},
|
|
3956
|
+
shouldShowOnClick() {
|
|
3957
|
+
return this.$options.props.showOnHover && !this.showOnHover || this.$options.props.showOnClick && this.showOnClick;
|
|
3651
3958
|
}
|
|
3652
3959
|
},
|
|
3653
3960
|
methods: {
|
|
3654
3961
|
async open(e) {
|
|
3655
3962
|
if (this.delay)
|
|
3656
|
-
await new Promise((resolve) => setTimeout(resolve, this.delay));
|
|
3963
|
+
await new Promise((resolve) => this.openTimeout = setTimeout(resolve, this.delay));
|
|
3964
|
+
if (this.delay && !this.openTimeout)
|
|
3965
|
+
return;
|
|
3657
3966
|
this.detachableVisible = true;
|
|
3658
3967
|
if (this.activator)
|
|
3659
3968
|
this.activatorEl = e.target;
|
|
@@ -3795,15 +4104,17 @@ var DetachableMixin = {
|
|
|
3795
4104
|
if (this.activator)
|
|
3796
4105
|
this.bindActivatorEvents();
|
|
3797
4106
|
if (this.value)
|
|
3798
|
-
this.
|
|
4107
|
+
this.open({ target: this.activatorEl });
|
|
3799
4108
|
});
|
|
3800
4109
|
}
|
|
3801
4110
|
if (this.overlay) {
|
|
3802
4111
|
this.overlayEl = (_a = this.$refs.overlay) == null ? void 0 : _a.$el;
|
|
3803
4112
|
wrapper.parentNode.insertBefore(this.overlayEl, wrapper);
|
|
3804
4113
|
}
|
|
3805
|
-
if (this.value && this.activator)
|
|
3806
|
-
this.toggle({ type: "click", target: this.activatorEl });
|
|
4114
|
+
if (this.value && this.activator) {
|
|
4115
|
+
this.toggle({ type: this.shouldShowOnClick ? "click" : "mouseenter", target: this.activatorEl });
|
|
4116
|
+
} else if (this.value)
|
|
4117
|
+
this.open({ target: this.activatorEl });
|
|
3807
4118
|
},
|
|
3808
4119
|
beforeDestroy() {
|
|
3809
4120
|
var _a;
|
|
@@ -3821,8 +4132,12 @@ var DetachableMixin = {
|
|
|
3821
4132
|
},
|
|
3822
4133
|
watch: {
|
|
3823
4134
|
value(bool) {
|
|
3824
|
-
if (!!bool !== this.detachableVisible)
|
|
3825
|
-
|
|
4135
|
+
if (!!bool !== this.detachableVisible) {
|
|
4136
|
+
if (bool)
|
|
4137
|
+
this.open({ target: this.activatorEl });
|
|
4138
|
+
else
|
|
4139
|
+
this.close();
|
|
4140
|
+
}
|
|
3826
4141
|
},
|
|
3827
4142
|
appendTo() {
|
|
3828
4143
|
this.removeFromDOM();
|
|
@@ -3877,6 +4192,7 @@ const __vue2_script$u = {
|
|
|
3877
4192
|
contentClass: { type: [String, Object, Array] },
|
|
3878
4193
|
arrow: { type: Boolean },
|
|
3879
4194
|
minWidth: { type: [Number, String] },
|
|
4195
|
+
maxWidth: { type: [Number, String] },
|
|
3880
4196
|
overlay: { type: Boolean },
|
|
3881
4197
|
overlayClass: { type: [String, Object, Array] },
|
|
3882
4198
|
overlayProps: { type: Object },
|
|
@@ -3914,6 +4230,12 @@ const __vue2_script$u = {
|
|
|
3914
4230
|
else
|
|
3915
4231
|
return isNaN(this.minWidth) ? this.minWidth : this.minWidth ? `${this.minWidth}px` : 0;
|
|
3916
4232
|
},
|
|
4233
|
+
menuMaxWidth() {
|
|
4234
|
+
if (this.maxWidth === "activator")
|
|
4235
|
+
return this.activatorWidth ? `${this.activatorWidth}px` : 0;
|
|
4236
|
+
else
|
|
4237
|
+
return isNaN(this.maxWidth) ? this.maxWidth : this.maxWidth ? `${this.maxWidth}px` : 0;
|
|
4238
|
+
},
|
|
3917
4239
|
menuClasses() {
|
|
3918
4240
|
return objectifyClasses(this.menuClass);
|
|
3919
4241
|
},
|
|
@@ -3950,7 +4272,8 @@ const __vue2_script$u = {
|
|
|
3950
4272
|
top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
|
|
3951
4273
|
left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
|
|
3952
4274
|
minWidth: this.minWidth && this.menuMinWidth || null,
|
|
3953
|
-
|
|
4275
|
+
maxWidth: this.maxWidth && this.menuMaxWidth || null,
|
|
4276
|
+
"--w-menu-bg-color": this.arrow && (this.$waveui.colors[this.bgColor] || "rgb(var(--w-base-bg-color-rgb))")
|
|
3954
4277
|
};
|
|
3955
4278
|
},
|
|
3956
4279
|
activatorEventHandlers() {
|
|
@@ -4000,6 +4323,7 @@ const __vue2_script$u = {
|
|
|
4000
4323
|
this.close();
|
|
4001
4324
|
},
|
|
4002
4325
|
async close(force = false) {
|
|
4326
|
+
this.openTimeout = clearTimeout(this.openTimeout);
|
|
4003
4327
|
if (!this.detachableVisible)
|
|
4004
4328
|
return;
|
|
4005
4329
|
if (this.showOnHover && !force) {
|
|
@@ -4967,35 +5291,36 @@ var render$l = function() {
|
|
|
4967
5291
|
var _c = _vm._self._c || _h;
|
|
4968
5292
|
return _c(_vm.formRegister ? "w-form-element" : "div", _vm._b({ ref: "formEl", tag: "component", class: _vm.classes, attrs: { "valid": _vm.valid, "wrap": _vm.hasLabel && _vm.labelPosition !== "inside" }, on: { "update:valid": function($event) {
|
|
4969
5293
|
_vm.valid = $event;
|
|
4970
|
-
}, "reset": _vm.onReset } }, "component", _vm.formRegister && { validators: _vm.validators, inputValue: _vm.selectionString, disabled: _vm.isDisabled, readonly: _vm.isReadonly, isFocused: _vm.isFocused }, false), [_vm.labelPosition === "left" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--left w-form-el-shakable", class: _vm.labelClasses,
|
|
5294
|
+
}, "reset": _vm.onReset } }, "component", _vm.formRegister && { validators: _vm.validators, inputValue: _vm.selectionString, disabled: _vm.isDisabled, readonly: _vm.isReadonly, isFocused: _vm.isFocused }, false), [_vm.labelPosition === "left" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--left w-form-el-shakable", class: _vm.labelClasses, on: { "click": function($event) {
|
|
5295
|
+
return _vm.$refs["selection-input"].click();
|
|
5296
|
+
} } }, [_vm._t("default", function() {
|
|
4971
5297
|
return [_vm._v(_vm._s(_vm.label))];
|
|
4972
|
-
})], 2) : _vm._e()] : _vm._e(), _c("w-menu", _vm._b({ attrs: { "menu-class": "w-select__menu " + (_vm.menuClass || ""), "transition": "slide-fade-down", "append-to": (_vm.menuProps || {}).appendTo !== void 0 ? (_vm.menuProps || {}).appendTo : void 0, "align-left": "", "custom": "", "min-width": "activator" }, on: { "close": function(
|
|
4973
|
-
!$event && _vm.closeMenu();
|
|
4974
|
-
} }, scopedSlots: _vm._u([{ key: "activator", fn: function(ref) {
|
|
4975
|
-
ref.on;
|
|
5298
|
+
})], 2) : _vm._e()] : _vm._e(), _c("w-menu", _vm._b({ attrs: { "menu-class": "w-select__menu " + (_vm.menuClass || ""), "transition": "slide-fade-down", "append-to": (_vm.menuProps || {}).appendTo !== void 0 ? (_vm.menuProps || {}).appendTo : void 0, "align-left": "", "custom": "", "min-width": "activator" }, on: { "close": _vm.closeMenu }, scopedSlots: _vm._u([{ key: "activator", fn: function() {
|
|
4976
5299
|
return [_c("div", { staticClass: "w-select__selection-wrap", class: _vm.inputWrapClasses, attrs: { "role": "button", "aria-haspopup": "listbox", "aria-expanded": _vm.showMenu ? "true" : "false", "aria-owns": "w-select-menu--" + _vm._uid, "aria-activedescendant": "w-select-menu--" + _vm._uid + "_item-1" }, on: { "click": function($event) {
|
|
4977
5300
|
!_vm.isDisabled && !_vm.isReadonly && _vm.onInputFieldClick();
|
|
4978
5301
|
} } }, [_vm.innerIconLeft ? _c("w-icon", { staticClass: "w-select__icon w-select__icon--inner-left", attrs: { "tag": "label" }, on: { "click": function($event) {
|
|
4979
5302
|
return _vm.$emit("click:inner-icon-left", $event);
|
|
4980
|
-
} } }, [_vm._v(_vm._s(_vm.innerIconLeft))]) : _vm._e(), _vm.$scopedSlots.selection ? _c("div", { staticClass: "w-select__selection-slot" }, [_vm._t("selection", null, { "item": _vm.multiple ? _vm.inputValue : _vm.inputValue[0] })], 2) : _vm._e(), _c("div", { ref: "selection-input", staticClass: "w-select__selection",
|
|
5303
|
+
} } }, [_vm._v(_vm._s(_vm.innerIconLeft))]) : _vm._e(), _vm.$scopedSlots.selection ? _c("div", { staticClass: "w-select__selection-slot" }, [_vm._t("selection", null, { "item": _vm.multiple ? _vm.inputValue : _vm.inputValue[0] })], 2) : _vm._e(), _c("div", _vm._b({ ref: "selection-input", staticClass: "w-select__selection", domProps: { "innerHTML": _vm._s(_vm.selectionHtml) }, on: { "focus": function($event) {
|
|
4981
5304
|
!_vm.isDisabled && !_vm.isReadonly && _vm.onFocus($event);
|
|
4982
5305
|
}, "blur": _vm.onBlur, "keydown": function($event) {
|
|
4983
5306
|
!_vm.isDisabled && !_vm.isReadonly && _vm.onKeydown($event);
|
|
4984
|
-
} } }), _vm._l(_vm.inputValue.length ? _vm.inputValue : [{}], function(val, i) {
|
|
5307
|
+
} } }, "div", _vm.selectionAttributes, false)), _vm._l(_vm.inputValue.length ? _vm.inputValue : [{}], function(val, i) {
|
|
4985
5308
|
return _c("input", { key: i, attrs: { "type": "hidden", "name": _vm.inputName + (_vm.multiple ? "[]" : "") }, domProps: { "value": val.value === void 0 ? "" : val.value.toString() } });
|
|
4986
|
-
}), _vm.labelPosition === "inside" && _vm.showLabelInside ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--inside w-form-el-shakable", class: _vm.labelClasses
|
|
5309
|
+
}), _vm.labelPosition === "inside" && _vm.showLabelInside ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--inside w-form-el-shakable", class: _vm.labelClasses }, [_vm._t("default", function() {
|
|
4987
5310
|
return [_vm._v(_vm._s(_vm.label))];
|
|
4988
5311
|
})], 2) : _vm._e()] : _vm._e(), _vm.innerIconRight ? _c("w-icon", { staticClass: "w-select__icon w-select__icon--inner-right", attrs: { "tag": "label" }, on: { "click": function($event) {
|
|
4989
5312
|
return _vm.$emit("click:inner-icon-right", $event);
|
|
4990
5313
|
} } }, [_vm._v(_vm._s(_vm.innerIconRight))]) : _vm._e()], 2)];
|
|
4991
|
-
} }], null, true), model: { value: _vm.showMenu, callback: function($$v) {
|
|
5314
|
+
}, proxy: true }], null, true), model: { value: _vm.showMenu, callback: function($$v) {
|
|
4992
5315
|
_vm.showMenu = $$v;
|
|
4993
5316
|
}, expression: "showMenu" } }, "w-menu", _vm.menuProps || {}, false), [_c("w-list", { ref: "w-list", attrs: { "value": _vm.inputValue, "items": _vm.selectItems, "multiple": _vm.multiple, "arrows-navigation": "", "return-object": "", "no-unselect": _vm.noUnselect, "selection-color": _vm.selectionColor, "add-ids": "w-select-menu--" + _vm._uid, "item-color-key": _vm.itemColorKey, "role": "listbox", "tabindex": "-1" }, on: { "input": _vm.onInput, "item-click": function($event) {
|
|
4994
5317
|
return _vm.$emit("item-click", $event);
|
|
4995
5318
|
}, "item-select": _vm.onListItemSelect, "keydown:enter": function($event) {
|
|
4996
5319
|
_vm.noUnselect && !_vm.multiple && _vm.closeMenu();
|
|
4997
5320
|
}, "keydown:escape": function($event) {
|
|
4998
|
-
_vm.showMenu && (
|
|
5321
|
+
_vm.showMenu && (_vm.showMenu = false);
|
|
5322
|
+
} }, nativeOn: { "keydown": function($event) {
|
|
5323
|
+
return _vm.onWListKeydown.apply(null, arguments);
|
|
4999
5324
|
} }, scopedSlots: _vm._u([_vm._l(_vm.items.length, function(i) {
|
|
5000
5325
|
return { key: "item." + i, fn: function(ref) {
|
|
5001
5326
|
var item = ref.item;
|
|
@@ -5012,7 +5337,9 @@ var render$l = function() {
|
|
|
5012
5337
|
return [_vm._t("item", function() {
|
|
5013
5338
|
return [_vm._v(_vm._s(item[_vm.itemLabelKey]))];
|
|
5014
5339
|
}, { "item": item, "selected": selected, "index": index2 })];
|
|
5015
|
-
} }], null, true) })], 1), _vm.labelPosition === "right" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--right w-form-el-shakable", class: _vm.labelClasses,
|
|
5340
|
+
} }], null, true) })], 1), _vm.labelPosition === "right" ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-select__label w-select__label--right w-form-el-shakable", class: _vm.labelClasses, on: { "click": function($event) {
|
|
5341
|
+
return _vm.$refs["selection-input"].click();
|
|
5342
|
+
} } }, [_vm._t("default", function() {
|
|
5016
5343
|
return [_vm._v(_vm._s(_vm.label))];
|
|
5017
5344
|
})], 2) : _vm._e()] : _vm._e()], 2);
|
|
5018
5345
|
};
|
|
@@ -5056,7 +5383,8 @@ const __vue2_script$l = {
|
|
|
5056
5383
|
showMenu: false,
|
|
5057
5384
|
menuMinWidth: 0,
|
|
5058
5385
|
isFocused: false,
|
|
5059
|
-
selectionWrapRef: void 0
|
|
5386
|
+
selectionWrapRef: void 0,
|
|
5387
|
+
quickLookup: { string: "", timeout: null }
|
|
5060
5388
|
}),
|
|
5061
5389
|
computed: {
|
|
5062
5390
|
selectItems() {
|
|
@@ -5067,30 +5395,45 @@ const __vue2_script$l = {
|
|
|
5067
5395
|
return obj;
|
|
5068
5396
|
});
|
|
5069
5397
|
},
|
|
5070
|
-
hasValue() {
|
|
5071
|
-
return Array.isArray(this.inputValue) ? this.inputValue.length : this.inputValue !== null;
|
|
5072
|
-
},
|
|
5073
5398
|
hasLabel() {
|
|
5074
5399
|
return this.label || this.$slots.default;
|
|
5075
5400
|
},
|
|
5076
5401
|
showLabelInside() {
|
|
5077
|
-
return !this.staticLabel || !this.
|
|
5402
|
+
return !this.staticLabel || !this.inputValue.length && !this.placeholder;
|
|
5403
|
+
},
|
|
5404
|
+
selectionAttributes() {
|
|
5405
|
+
var _a;
|
|
5406
|
+
return {
|
|
5407
|
+
class: { "w-select__selection--placeholder": !this.$scopedSlots.selection && !this.selectionString && this.placeholder },
|
|
5408
|
+
disabled: this.isDisabled || null,
|
|
5409
|
+
readonly: true,
|
|
5410
|
+
ariareadonly: "true",
|
|
5411
|
+
tabindex: (_a = this.tabindex) != null ? _a : null,
|
|
5412
|
+
contenteditable: this.isDisabled || this.isReadonly ? "false" : "true"
|
|
5413
|
+
};
|
|
5078
5414
|
},
|
|
5079
5415
|
selectionString() {
|
|
5080
|
-
return this.inputValue
|
|
5416
|
+
return this.inputValue.map(
|
|
5081
5417
|
(item) => {
|
|
5082
5418
|
var _a;
|
|
5083
5419
|
return item[this.itemValueKey] !== void 0 ? item[this.itemLabelKey] : (_a = item[this.itemLabelKey]) != null ? _a : item;
|
|
5084
5420
|
}
|
|
5085
5421
|
).join(", ");
|
|
5086
5422
|
},
|
|
5423
|
+
selectionHtml() {
|
|
5424
|
+
if (!this.inputValue.length)
|
|
5425
|
+
return this.placeholder || "";
|
|
5426
|
+
if (this.$scopedSlots.selection)
|
|
5427
|
+
return "";
|
|
5428
|
+
return this.selectionString;
|
|
5429
|
+
},
|
|
5087
5430
|
classes() {
|
|
5088
5431
|
return {
|
|
5089
5432
|
"w-select": true,
|
|
5090
5433
|
"w-select--disabled": this.isDisabled,
|
|
5091
5434
|
"w-select--fit-to-content": this.fitToContent,
|
|
5092
5435
|
"w-select--readonly": this.isReadonly,
|
|
5093
|
-
[`w-select--${this.
|
|
5436
|
+
[`w-select--${this.inputValue.length ? "filled" : "empty"}`]: true,
|
|
5094
5437
|
"w-select--focused": (this.isFocused || this.showMenu) && !this.isReadonly,
|
|
5095
5438
|
"w-select--dark": this.dark,
|
|
5096
5439
|
"w-select--floating-label": this.hasLabel && this.labelPosition === "inside" && !this.staticLabel,
|
|
@@ -5147,8 +5490,43 @@ const __vue2_script$l = {
|
|
|
5147
5490
|
const direction = e.keyCode === 38 ? -1 : 1;
|
|
5148
5491
|
index2 = (index2 + items.length + direction) % items.length;
|
|
5149
5492
|
}
|
|
5150
|
-
|
|
5493
|
+
let allItemsAreDisabled = false;
|
|
5494
|
+
if (items[index2].disabled) {
|
|
5495
|
+
const direction = e.keyCode === 38 ? -1 : 1;
|
|
5496
|
+
let newIndex = (index2 + direction + items.length) % items.length;
|
|
5497
|
+
const itemsCount = items.length;
|
|
5498
|
+
let loop = 0;
|
|
5499
|
+
while (loop < itemsCount && items[newIndex].disabled) {
|
|
5500
|
+
newIndex = (newIndex + items.length + direction) % items.length;
|
|
5501
|
+
loop++;
|
|
5502
|
+
}
|
|
5503
|
+
if (loop >= itemsCount)
|
|
5504
|
+
allItemsAreDisabled = true;
|
|
5505
|
+
index2 = newIndex;
|
|
5506
|
+
}
|
|
5507
|
+
if (!allItemsAreDisabled)
|
|
5508
|
+
this.onInput(items[index2]);
|
|
5151
5509
|
}
|
|
5510
|
+
} else if (e.key.length === 1)
|
|
5511
|
+
this.focusItemOnQuickLookup(e);
|
|
5512
|
+
},
|
|
5513
|
+
onWListKeydown(e) {
|
|
5514
|
+
if (e.key.length === 1)
|
|
5515
|
+
this.focusItemOnQuickLookup(e);
|
|
5516
|
+
},
|
|
5517
|
+
focusItemOnQuickLookup(e) {
|
|
5518
|
+
var _a, _b, _c;
|
|
5519
|
+
if (this.quickLookup.timeout)
|
|
5520
|
+
clearTimeout(this.quickLookup.timeout);
|
|
5521
|
+
this.quickLookup.timeout = setTimeout(() => this.quickLookup.string = "", 1e3);
|
|
5522
|
+
this.quickLookup.string += e.key;
|
|
5523
|
+
const re = new RegExp(`^${this.quickLookup.string}`, "i");
|
|
5524
|
+
const itemIndexToFocus = this.selectItems.findIndex(
|
|
5525
|
+
(item) => !item.disabled && item[this.itemLabelKey].match(re)
|
|
5526
|
+
) + 1;
|
|
5527
|
+
if (itemIndexToFocus) {
|
|
5528
|
+
const selector = `.w-list__item:nth-child(${itemIndexToFocus}) .w-list__item-label`;
|
|
5529
|
+
(_c = (_b = (_a = this.$refs["w-list"]) == null ? void 0 : _a.$el) == null ? void 0 : _b.querySelector(selector)) == null ? void 0 : _c.focus();
|
|
5152
5530
|
}
|
|
5153
5531
|
},
|
|
5154
5532
|
onInput(items) {
|
|
@@ -5179,9 +5557,10 @@ const __vue2_script$l = {
|
|
|
5179
5557
|
items = Array.isArray(items) ? items : items !== void 0 ? [items] : [];
|
|
5180
5558
|
const allValues = this.selectItems.map((item) => item.value);
|
|
5181
5559
|
return items.map((item) => {
|
|
5560
|
+
var _a, _b;
|
|
5182
5561
|
let value = item;
|
|
5183
5562
|
if (item && typeof item === "object") {
|
|
5184
|
-
value = item[this.itemValueKey]
|
|
5563
|
+
value = (_b = (_a = item[this.itemValueKey]) != null ? _a : item[this.itemLabelKey]) != null ? _b : item;
|
|
5185
5564
|
}
|
|
5186
5565
|
return this.selectItems[allValues.indexOf(value)];
|
|
5187
5566
|
}).filter((item) => item !== void 0);
|
|
@@ -5199,7 +5578,10 @@ const __vue2_script$l = {
|
|
|
5199
5578
|
if (((_a = this.menuProps) == null ? void 0 : _a.hideOnMenuClick) === false)
|
|
5200
5579
|
return;
|
|
5201
5580
|
this.showMenu = false;
|
|
5202
|
-
setTimeout(() =>
|
|
5581
|
+
setTimeout(() => {
|
|
5582
|
+
var _a2;
|
|
5583
|
+
return (_a2 = this.$refs["selection-input"]) == null ? void 0 : _a2.focus();
|
|
5584
|
+
}, 50);
|
|
5203
5585
|
}
|
|
5204
5586
|
},
|
|
5205
5587
|
created() {
|
|
@@ -5979,7 +6361,7 @@ var render$e = function() {
|
|
|
5979
6361
|
var _vm = this;
|
|
5980
6362
|
var _h = _vm.$createElement;
|
|
5981
6363
|
var _c = _vm._self._c || _h;
|
|
5982
|
-
return _c("div", { staticClass: "w-table-wrap", class: _vm.
|
|
6364
|
+
return _c("div", { staticClass: "w-table w-table--wrap", class: _vm.classes }, [_c("div", { staticClass: "w-table__scroll-wrap" }, [_c("table", { staticClass: "w-table__table", on: { "mousedown": _vm.onMouseDown, "mouseover": _vm.onMouseOver, "mouseout": _vm.onMouseOut } }, [_c("colgroup", { ref: "colgroup" }, _vm._l(_vm.headers, function(header, i) {
|
|
5983
6365
|
return _c("col", { key: i, staticClass: "w-table__col", class: _vm.colClasses[i], attrs: { "width": header.width || null } });
|
|
5984
6366
|
}), 0), !_vm.noHeaders ? _c("thead", [_c("tr", _vm._l(_vm.headers, function(header, i) {
|
|
5985
6367
|
return _c("th", { key: i, staticClass: "w-table__header", class: _vm.headerClasses(header), on: { "click": function($event) {
|
|
@@ -5994,7 +6376,7 @@ var render$e = function() {
|
|
|
5994
6376
|
})], 2)], 1)]) : !_vm.tableItems.length ? _c("tr", { staticClass: "no-data" }, [_c("td", { staticClass: "w-table__cell text-center", attrs: { "colspan": _vm.headers.length } }, [_vm._t("no-data", function() {
|
|
5995
6377
|
return [_vm._v("No data to show.")];
|
|
5996
6378
|
})], 2)]) : _vm._e(), _vm.tableItems.length && _vm.loading !== true ? [_vm._l(_vm.paginatedItems, function(item, i) {
|
|
5997
|
-
return [_vm.$scopedSlots
|
|
6379
|
+
return [_vm.$scopedSlots.item ? _vm._t("item", null, { "item": item, "index": i + 1, "select": function() {
|
|
5998
6380
|
return _vm.doSelectRow(item, i);
|
|
5999
6381
|
}, "classes": { "w-table__row": true, "w-table__row--selected": _vm.selectedRowsByUid[item._uid] !== void 0, "w-table__row--expanded": _vm.expandedRowsByUid[item._uid] !== void 0 } }) : _c("tr", { key: i, staticClass: "w-table__row", class: { "w-table__row--selected": _vm.selectedRowsByUid[item._uid] !== void 0, "w-table__row--expanded": _vm.expandedRowsByUid[item._uid] !== void 0 }, on: { "click": function($event) {
|
|
6000
6382
|
return _vm.doSelectRow(item, i);
|
|
@@ -6002,21 +6384,27 @@ var render$e = function() {
|
|
|
6002
6384
|
var _obj, _obj$1;
|
|
6003
6385
|
return [_vm.$scopedSlots["item-cell." + header.key] || _vm.$scopedSlots["item-cell." + (j + 1)] || _vm.$scopedSlots["item-cell"] ? _c("td", { key: j + "-a", staticClass: "w-table__cell", class: (_obj = {}, _obj["text-" + (header.align || "left")] = true, _obj["w-table__cell--sticky"] = header.sticky, _obj), attrs: { "data-label": header.label } }, [_vm.$scopedSlots["item-cell." + header.key] ? _vm._t("item-cell." + header.key, null, { "header": header, "item": item, "label": item[header.key] || "", "index": i + 1 }) : _vm.$scopedSlots["item-cell." + (j + 1)] ? _vm._t("item-cell." + (j + 1), null, { "header": header, "item": item, "label": item[header.key] || "", "index": i + 1 }) : _vm.$scopedSlots["item-cell"] ? _vm._t("item-cell", null, { "header": header, "item": item, "label": item[header.key] || "", "index": i + 1 }) : _vm._e(), j < _vm.headers.length - 1 && _vm.resizableColumns ? _c("span", { staticClass: "w-table__col-resizer", class: { "w-table__col-resizer--hover": _vm.colResizing.hover === j, "w-table__col-resizer--active": _vm.colResizing.columnIndex === j } }) : _vm._e()], 2) : _c("td", { key: j + "-b", staticClass: "w-table__cell", class: (_obj$1 = {}, _obj$1["text-" + (header.align || "left")] = true, _obj$1["w-table__cell--sticky"] = header.sticky, _obj$1), attrs: { "data-label": header.label } }, [_c("div", { domProps: { "innerHTML": _vm._s(item[header.key] || "") } }), j < _vm.headers.length - 1 && _vm.resizableColumns ? _c("span", { staticClass: "w-table__col-resizer", class: { "w-table__col-resizer--hover": _vm.colResizing.hover === j, "w-table__col-resizer--active": _vm.colResizing.columnIndex === j } }) : _vm._e()])];
|
|
6004
6386
|
})], 2), _vm.expandedRowsByUid[item._uid] ? _c("tr", { staticClass: "w-table__row w-table__row--expansion" }, [_c("td", { staticClass: "w-table__cell", attrs: { "colspan": _vm.headers.length } }, [_c("w-transition-expand", { attrs: { "y": "" } }, [_vm.expandedRowsByUid[item._uid] ? _c("div", [_vm._t("row-expansion", null, { "item": item, "index": i + 1 })], 2) : _vm._e(), i < _vm.headers.length - 1 && _vm.resizableColumns ? _c("span", { staticClass: "w-table__col-resizer", class: { "w-table__col-resizer--hover": _vm.colResizing.hover === i, "w-table__col-resizer--active": _vm.colResizing.columnIndex === _vm.j } }) : _vm._e()])], 1)]) : _vm._e()];
|
|
6005
|
-
})] : _vm._e(), _vm.$slots["extra-row"] ? _c("div", { staticClass: "w-table__extra-row" }, [_vm._t("extra-row")], 2) : _vm._e()], 2), _vm.$slots.footer || _vm.$slots["footer-row"]
|
|
6387
|
+
})] : _vm._e(), _vm.$slots["extra-row"] ? _c("div", { staticClass: "w-table__extra-row" }, [_vm._t("extra-row")], 2) : _vm._e()], 2), _vm.$slots.footer || _vm.$slots["footer-row"] ? _c("tfoot", { staticClass: "w-table__footer" }, [_vm.$slots["footer-row"] ? _vm._t("footer-row") : _vm.$slots.footer ? _c("tr", { staticClass: "w-table__row" }, [_c("td", { staticClass: "w-table__cell", attrs: { "colspan": _vm.headers.length } }, [_vm._t("footer")], 2)]) : _vm._e()], 2) : _vm._e()])]), _vm.pagination && _vm.paginationConfig ? _c("div", { staticClass: "w-table__pagination w-pagination" }, [_vm._t("pagination", function() {
|
|
6006
6388
|
return [_vm.paginationConfig.itemsPerPageOptions ? _c("w-select", { staticClass: "w-pagination__items-per-page", attrs: { "items": _vm.paginationConfig.itemsPerPageOptions, "label-position": "left", "label": "Items per page", "label-color": "inherit" }, on: { "input": function($event) {
|
|
6007
6389
|
return _vm.updatePaginationConfig({ itemsPerPage: _vm.paginationConfig.itemsPerPage });
|
|
6008
6390
|
} }, model: { value: _vm.paginationConfig.itemsPerPage, callback: function($$v) {
|
|
6009
6391
|
_vm.$set(_vm.paginationConfig, "itemsPerPage", $$v);
|
|
6010
6392
|
}, expression: "paginationConfig.itemsPerPage" } }) : _vm._e(), _c("div", { staticClass: "pages-wrap" }, [_c("w-button", { staticClass: "w-pagination__arrow w-pagination__arrow--prev", attrs: { "disabled": _vm.paginationConfig.page <= 1, "icon": "wi-chevron-left", "text": "", "lg": "" }, on: { "click": function($event) {
|
|
6011
6393
|
return _vm.goToPage("-1");
|
|
6012
|
-
} } }), _vm._l(_vm.paginationConfig.pagesCount, function(i) {
|
|
6394
|
+
} } }), _vm.paginationConfig.pagesCount > 7 ? [_vm._l(_vm.paginationConfig.pagesCount, function(i) {
|
|
6395
|
+
return [[1, _vm.paginationConfig.pagesCount, _vm.paginationConfig.page - 1, _vm.paginationConfig.page, _vm.paginationConfig.page + 1].includes(i) ? _c("w-button", { key: i, staticClass: "w-pagination__page", class: { "w-pagination__page--active": i === _vm.paginationConfig.page }, attrs: { "round": "", "lg": "" }, on: { "click": function($event) {
|
|
6396
|
+
i !== _vm.paginationConfig.page && _vm.goToPage(i);
|
|
6397
|
+
} } }, [_vm._v(_vm._s(i))]) : [1, _vm.paginationConfig.pagesCount, _vm.paginationConfig.page - 1, _vm.paginationConfig.page, _vm.paginationConfig.page + 1].includes(i - 1) ? _c("w-button", { key: i, staticClass: "w-pagination__page", class: { "w-pagination__page--active": i === _vm.paginationConfig.page }, attrs: { "round": "", "lg": "" }, on: { "click": function($event) {
|
|
6398
|
+
i !== _vm.paginationConfig.page && _vm.goToPage(i);
|
|
6399
|
+
} } }, [_vm._v("...")]) : _vm._e()];
|
|
6400
|
+
})] : _vm._l(_vm.paginationConfig.pagesCount, function(i) {
|
|
6013
6401
|
return _c("w-button", { key: i, staticClass: "w-pagination__page", class: { "w-pagination__page--active": i === _vm.paginationConfig.page }, attrs: { "round": "", "lg": "" }, on: { "click": function($event) {
|
|
6014
6402
|
i !== _vm.paginationConfig.page && _vm.goToPage(i);
|
|
6015
6403
|
} } }, [_vm._v(_vm._s(i))]);
|
|
6016
6404
|
}), _c("w-button", { staticClass: "w-pagination__arrow w-pagination__arrow--next", attrs: { "disabled": _vm.paginationConfig.page >= _vm.paginationConfig.pagesCount, "icon": "wi-chevron-right", "text": "", "lg": "" }, on: { "click": function($event) {
|
|
6017
6405
|
return _vm.goToPage("+1");
|
|
6018
6406
|
} } })], 2), _c("span", { staticClass: "w-pagination__results" }, [_vm._v(_vm._s(_vm.paginationConfig.start) + "-" + _vm._s(_vm.paginationConfig.end || _vm.paginationConfig.total) + " of " + _vm._s(_vm.paginationConfig.total))])];
|
|
6019
|
-
}, { "range": _vm.paginationConfig.start + "-" + _vm.paginationConfig.end, "total": _vm.paginationConfig.total
|
|
6407
|
+
}, { "range": _vm.paginationConfig.start + "-" + _vm.paginationConfig.end, "total": _vm.paginationConfig.total, "pagesCount": _vm.paginationConfig.pagesCount, "page": _vm.paginationConfig.page, "goToPage": _vm.goToPage })], 2) : _vm._e()]);
|
|
6020
6408
|
};
|
|
6021
6409
|
var staticRenderFns$e = [];
|
|
6022
6410
|
var wTable_vue_vue_type_style_index_0_lang = "";
|
|
@@ -6143,16 +6531,6 @@ const __vue2_script$e = {
|
|
|
6143
6531
|
return obj;
|
|
6144
6532
|
}, {});
|
|
6145
6533
|
},
|
|
6146
|
-
wrapClasses() {
|
|
6147
|
-
return {
|
|
6148
|
-
"w-table-wrap--loading": this.loading
|
|
6149
|
-
};
|
|
6150
|
-
},
|
|
6151
|
-
colClasses() {
|
|
6152
|
-
return this.headers.map((header) => {
|
|
6153
|
-
return { "w-table__col--highlighted": this.activeSortingKeys[header.key] };
|
|
6154
|
-
}) || [];
|
|
6155
|
-
},
|
|
6156
6534
|
classes() {
|
|
6157
6535
|
return {
|
|
6158
6536
|
"w-table--loading": this.loading,
|
|
@@ -6166,6 +6544,11 @@ const __vue2_script$e = {
|
|
|
6166
6544
|
"w-table--sticky-column": this.hasStickyColumn
|
|
6167
6545
|
};
|
|
6168
6546
|
},
|
|
6547
|
+
colClasses() {
|
|
6548
|
+
return this.headers.map((header) => {
|
|
6549
|
+
return { "w-table__col--highlighted": this.activeSortingKeys[header.key] };
|
|
6550
|
+
}) || [];
|
|
6551
|
+
},
|
|
6169
6552
|
isMobile() {
|
|
6170
6553
|
return ~~this.mobileBreakpoint && this.$waveui.breakpoint.width <= ~~this.mobileBreakpoint;
|
|
6171
6554
|
},
|
|
@@ -6303,7 +6686,7 @@ const __vue2_script$e = {
|
|
|
6303
6686
|
document.removeEventListener("mousemove", this.onResizerMouseMove);
|
|
6304
6687
|
document.removeEventListener("mouseup", this.onResizerMouseUp);
|
|
6305
6688
|
setTimeout(() => {
|
|
6306
|
-
const widths = [...this.$refs.colgroup.
|
|
6689
|
+
const widths = [...this.$refs.colgroup.children].map((column) => {
|
|
6307
6690
|
var _a;
|
|
6308
6691
|
return ((_a = column.style) == null ? void 0 : _a.width) || column.offsetWidth;
|
|
6309
6692
|
});
|
|
@@ -6349,8 +6732,8 @@ const __vue2_script$e = {
|
|
|
6349
6732
|
if (itemsPerPage !== void 0) {
|
|
6350
6733
|
this.paginationConfig.itemsPerPage = itemsPerPage;
|
|
6351
6734
|
itemsPerPage = itemsPerPage || this.paginationConfig.total;
|
|
6352
|
-
this.paginationConfig.page = 1;
|
|
6353
|
-
|
|
6735
|
+
this.paginationConfig.page = page || this.paginationConfig.page || 1;
|
|
6736
|
+
page = this.paginationConfig.page;
|
|
6354
6737
|
total = this.paginationConfig.total;
|
|
6355
6738
|
this.paginationConfig.start = 1;
|
|
6356
6739
|
this.paginationConfig.end = total >= itemsPerPage * page ? itemsPerPage * page : total % (itemsPerPage * page);
|
|
@@ -6556,7 +6939,7 @@ var render$c = function() {
|
|
|
6556
6939
|
return;
|
|
6557
6940
|
}
|
|
6558
6941
|
_vm.inputValue = $event.target.value;
|
|
6559
|
-
}, _vm.onInput], "focus": _vm.onFocus, "blur": _vm.onBlur } }, _vm.listeners)), _vm.labelPosition === "inside" && _vm.showLabelInside ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-textarea__label w-textarea__label--inside w-form-el-shakable", class: _vm.labelClasses
|
|
6942
|
+
}, _vm.onInput], "focus": _vm.onFocus, "blur": _vm.onBlur } }, _vm.listeners)), _vm.labelPosition === "inside" && _vm.showLabelInside ? [_vm.$slots.default || _vm.label ? _c("label", { staticClass: "w-textarea__label w-textarea__label--inside w-form-el-shakable", class: _vm.labelClasses }, [_vm._t("default", function() {
|
|
6560
6943
|
return [_vm._v(_vm._s(_vm.label))];
|
|
6561
6944
|
})], 2) : _vm._e()] : _vm._e(), _vm.innerIconRight ? _c("w-icon", { staticClass: "w-textarea__icon w-textarea__icon--inner-right", attrs: { "tag": "label", "for": "w-textarea--" + _vm._uid }, on: { "click": function($event) {
|
|
6562
6945
|
return _vm.$emit("click:inner-icon-right", $event);
|
|
@@ -6862,7 +7245,14 @@ const __vue2_script$9 = {
|
|
|
6862
7245
|
transition: { type: String },
|
|
6863
7246
|
tooltipClass: { type: [String, Object, Array] },
|
|
6864
7247
|
persistent: { type: Boolean },
|
|
6865
|
-
delay: { type: Number }
|
|
7248
|
+
delay: { type: Number },
|
|
7249
|
+
caption: { type: Boolean },
|
|
7250
|
+
xs: { type: Boolean },
|
|
7251
|
+
sm: { type: Boolean },
|
|
7252
|
+
md: { type: Boolean },
|
|
7253
|
+
lg: { type: Boolean },
|
|
7254
|
+
xl: { type: Boolean },
|
|
7255
|
+
enableTouch: { type: Boolean }
|
|
6866
7256
|
},
|
|
6867
7257
|
emits: ["input", "update:modelValue", "open", "close"],
|
|
6868
7258
|
data: () => ({
|
|
@@ -6883,6 +7273,9 @@ const __vue2_script$9 = {
|
|
|
6883
7273
|
const direction = this.position.replace(/top|bottom/, (m) => ({ top: "up", bottom: "down" })[m]);
|
|
6884
7274
|
return this.transition || `w-tooltip-slide-fade-${direction}`;
|
|
6885
7275
|
},
|
|
7276
|
+
size() {
|
|
7277
|
+
return this.xs && "xs" || this.sm && "sm" || this.sm && "md" || this.lg && "lg" || this.xl && "xl" || (this.caption ? "sm" : "md");
|
|
7278
|
+
},
|
|
6886
7279
|
classes() {
|
|
6887
7280
|
return {
|
|
6888
7281
|
[this.color]: this.color,
|
|
@@ -6892,6 +7285,8 @@ const __vue2_script$9 = {
|
|
|
6892
7285
|
[`w-tooltip--align-${this.alignment}`]: !this.noPosition && this.alignment,
|
|
6893
7286
|
"w-tooltip--tile": this.tile,
|
|
6894
7287
|
"w-tooltip--round": this.round,
|
|
7288
|
+
caption: this.caption,
|
|
7289
|
+
[`size--${this.size}`]: true,
|
|
6895
7290
|
"w-tooltip--shadow": this.shadow,
|
|
6896
7291
|
"w-tooltip--fixed": this.fixed,
|
|
6897
7292
|
"w-tooltip--no-border": this.noBorder || this.bgColor,
|
|
@@ -6903,17 +7298,16 @@ const __vue2_script$9 = {
|
|
|
6903
7298
|
zIndex: this.zIndex || this.zIndex === 0 || null,
|
|
6904
7299
|
top: this.detachableCoords.top && `${~~this.detachableCoords.top}px` || null,
|
|
6905
7300
|
left: this.detachableCoords.left && `${~~this.detachableCoords.left}px` || null,
|
|
6906
|
-
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor || "
|
|
7301
|
+
"--w-tooltip-bg-color": this.$waveui.colors[this.bgColor] || "rgb(var(--w-base-bg-color-rgb))"
|
|
6907
7302
|
};
|
|
6908
7303
|
},
|
|
6909
7304
|
activatorEventHandlers() {
|
|
6910
7305
|
let handlers = {};
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
else {
|
|
7306
|
+
const isTouchDevice = typeof window !== "undefined" && "ontouchstart" in window;
|
|
7307
|
+
if (!this.showOnClick && !isTouchDevice) {
|
|
6914
7308
|
handlers = {
|
|
6915
|
-
focus: this.
|
|
6916
|
-
blur: this.
|
|
7309
|
+
focus: this.open,
|
|
7310
|
+
blur: this.close,
|
|
6917
7311
|
mouseenter: (e) => {
|
|
6918
7312
|
this.hoveringActivator = true;
|
|
6919
7313
|
this.open(e);
|
|
@@ -6923,9 +7317,8 @@ const __vue2_script$9 = {
|
|
|
6923
7317
|
this.close();
|
|
6924
7318
|
}
|
|
6925
7319
|
};
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
}
|
|
7320
|
+
} else if (this.enableTouch || this.showOnClick)
|
|
7321
|
+
handlers = { click: this.toggle };
|
|
6929
7322
|
return handlers;
|
|
6930
7323
|
}
|
|
6931
7324
|
},
|
|
@@ -6933,7 +7326,9 @@ const __vue2_script$9 = {
|
|
|
6933
7326
|
toggle(e) {
|
|
6934
7327
|
let shouldShowTooltip = this.detachableVisible;
|
|
6935
7328
|
if (typeof window !== "undefined" && "ontouchstart" in window) {
|
|
6936
|
-
if (
|
|
7329
|
+
if (!this.enableTouch && !this.showOnClick)
|
|
7330
|
+
shouldShowTooltip = false;
|
|
7331
|
+
else
|
|
6937
7332
|
shouldShowTooltip = !shouldShowTooltip;
|
|
6938
7333
|
} else if (e.type === "click" && this.showOnClick)
|
|
6939
7334
|
shouldShowTooltip = !shouldShowTooltip;
|
|
@@ -7153,18 +7548,16 @@ const __vue2_script$7 = {
|
|
|
7153
7548
|
saveOriginalInlineStyles(el) {
|
|
7154
7549
|
this.el.originalStyles = el.style.cssText;
|
|
7155
7550
|
},
|
|
7156
|
-
show(el
|
|
7551
|
+
show(el) {
|
|
7157
7552
|
this.saveComputedStyles(el);
|
|
7158
7553
|
this.applyHideStyles(el);
|
|
7159
7554
|
setTimeout(() => this.applyShowStyles(el), 20);
|
|
7160
|
-
setTimeout(done, this.duration);
|
|
7161
7555
|
},
|
|
7162
7556
|
beforeHide(el) {
|
|
7163
7557
|
this.applyShowStyles(el);
|
|
7164
7558
|
},
|
|
7165
|
-
hide(el
|
|
7559
|
+
hide(el) {
|
|
7166
7560
|
setTimeout(() => this.applyHideStyles(el), 20);
|
|
7167
|
-
setTimeout(done, this.duration);
|
|
7168
7561
|
},
|
|
7169
7562
|
saveComputedStyles(el) {
|
|
7170
7563
|
const computedStyles = window.getComputedStyle(el, null);
|
|
@@ -7592,20 +7985,20 @@ const __vue2_script = {
|
|
|
7592
7985
|
this.emitItemSelection(item, e);
|
|
7593
7986
|
},
|
|
7594
7987
|
onLabelKeydown(item, e) {
|
|
7595
|
-
if (!(e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) && [13, 32, 37, 38, 39, 40].includes(e.
|
|
7988
|
+
if (!(e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) && [13, 32, 37, 38, 39, 40].includes(e.keyCode)) {
|
|
7596
7989
|
if (item.children || item.branch) {
|
|
7597
|
-
if ([13, 32].includes(e.
|
|
7990
|
+
if ([13, 32].includes(e.keyCode))
|
|
7598
7991
|
this.expandDepth(item) && e.preventDefault();
|
|
7599
|
-
else if (e.
|
|
7992
|
+
else if (e.keyCode === 37)
|
|
7600
7993
|
this.expandDepth(item, false) && e.preventDefault();
|
|
7601
|
-
else if (e.
|
|
7994
|
+
else if (e.keyCode === 39)
|
|
7602
7995
|
this.expandDepth(item, true) && e.preventDefault();
|
|
7603
7996
|
}
|
|
7604
|
-
if ([38, 40].includes(e.
|
|
7997
|
+
if ([38, 40].includes(e.keyCode)) {
|
|
7605
7998
|
const treeRoot = this.$el.closest(".w-tree--depth0");
|
|
7606
7999
|
const treeTabbableItems = treeRoot.querySelectorAll('.w-tree__item-label[tabindex="0"]');
|
|
7607
8000
|
const currLabel = e.target.closest(".w-tree__item-label");
|
|
7608
|
-
const indexModifier = e.
|
|
8001
|
+
const indexModifier = e.keyCode === 38 ? -1 : 1;
|
|
7609
8002
|
[...treeTabbableItems].some((item2, i) => {
|
|
7610
8003
|
if (item2.isSameNode(currLabel)) {
|
|
7611
8004
|
treeTabbableItems[i + indexModifier] && treeTabbableItems[i + indexModifier].focus();
|
|
@@ -7615,7 +8008,7 @@ const __vue2_script = {
|
|
|
7615
8008
|
});
|
|
7616
8009
|
}
|
|
7617
8010
|
}
|
|
7618
|
-
if (e.
|
|
8011
|
+
if (e.keyCode === 13) {
|
|
7619
8012
|
if (this.selectable)
|
|
7620
8013
|
item.selected = !item.selected;
|
|
7621
8014
|
this.emitItemSelection(item, e);
|
|
@@ -7709,6 +8102,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
7709
8102
|
__proto__: null,
|
|
7710
8103
|
WAccordion: wAccordion,
|
|
7711
8104
|
WAlert: wAlert,
|
|
8105
|
+
WAutocomplete: wAutocomplete,
|
|
7712
8106
|
WApp: wApp,
|
|
7713
8107
|
WBadge: wBadge,
|
|
7714
8108
|
WBreadcrumbs: wBreadcrumbs,
|