quasar-ui-danx 0.3.28 → 0.3.30
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/danx.es.js +579 -553
- package/dist/danx.es.js.map +1 -1
- package/dist/danx.umd.js +2 -2
- package/dist/danx.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +49 -49
- package/src/components/ActionTable/Form/Fields/TextField.vue +41 -36
- package/src/helpers/FileUpload.ts +299 -292
- package/src/helpers/files.ts +55 -42
package/package.json
CHANGED
@@ -69,74 +69,74 @@ import { ContentDrawer } from "../../../Utility";
|
|
69
69
|
|
70
70
|
const emit = defineEmits(["update:modelValue"]);
|
71
71
|
const props = defineProps({
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
72
|
+
modelValue: {
|
73
|
+
type: [Object, String, Array, null],
|
74
|
+
required: true
|
75
|
+
},
|
76
|
+
options: {
|
77
|
+
type: Array,
|
78
|
+
default: () => []
|
79
|
+
},
|
80
|
+
multiple: Boolean,
|
81
|
+
label: {
|
82
|
+
type: String,
|
83
|
+
default: "Select"
|
84
|
+
},
|
85
|
+
placeholder: {
|
86
|
+
type: String,
|
87
|
+
default: "All"
|
88
|
+
}
|
89
89
|
});
|
90
90
|
|
91
91
|
const showDrawer = ref(false);
|
92
92
|
const formattedOptions = computed(() =>
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
93
|
+
props.options.map((opt) =>
|
94
|
+
typeof opt === "string"
|
95
|
+
? {
|
96
|
+
label: opt,
|
97
|
+
value: opt
|
98
|
+
}
|
99
|
+
: opt
|
100
|
+
)
|
101
101
|
);
|
102
102
|
|
103
103
|
function getOptionValue(option) {
|
104
|
-
|
104
|
+
return option.value === undefined ? option : option.value;
|
105
105
|
}
|
106
106
|
|
107
107
|
function getOptionLabel(value) {
|
108
|
-
|
108
|
+
return formattedOptions.value.find((opt) => opt.value === value)?.label;
|
109
109
|
}
|
110
110
|
|
111
111
|
function isSelected(option) {
|
112
|
-
|
112
|
+
const optionValue = getOptionValue(option);
|
113
113
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
114
|
+
if (props.multiple) {
|
115
|
+
return props.modelValue.includes(optionValue);
|
116
|
+
} else {
|
117
|
+
return props.modelValue === optionValue;
|
118
|
+
}
|
119
119
|
}
|
120
120
|
|
121
121
|
function toggleSelect(option) {
|
122
|
-
|
122
|
+
let optionValue = getOptionValue(option);
|
123
123
|
|
124
|
-
|
124
|
+
let selection = optionValue;
|
125
125
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
126
|
+
if (props.multiple) {
|
127
|
+
selection = [...props.modelValue];
|
128
|
+
if (isSelected(optionValue)) {
|
129
|
+
selection = selection.filter((opt) => opt !== optionValue);
|
130
|
+
} else {
|
131
|
+
selection.push(optionValue);
|
132
|
+
}
|
133
|
+
} else {
|
134
|
+
// Allow deselection on single select
|
135
|
+
if (selection === props.modelValue) {
|
136
|
+
selection = null;
|
137
|
+
}
|
138
|
+
}
|
139
139
|
|
140
|
-
|
140
|
+
emit("update:modelValue", selection);
|
141
141
|
}
|
142
142
|
</script>
|
@@ -12,6 +12,7 @@
|
|
12
12
|
:input-class="inputClass"
|
13
13
|
:class="parentClass"
|
14
14
|
stack-label
|
15
|
+
:rows="rows"
|
15
16
|
:type="type"
|
16
17
|
:model-value="modelValue"
|
17
18
|
:debounce="debounce"
|
@@ -42,41 +43,45 @@ import LabelValueBlock from "./LabelValueBlock";
|
|
42
43
|
|
43
44
|
defineEmits(["update:model-value", "submit"]);
|
44
45
|
defineProps({
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
46
|
+
modelValue: {
|
47
|
+
type: [String, Number],
|
48
|
+
default: ""
|
49
|
+
},
|
50
|
+
field: {
|
51
|
+
type: Object,
|
52
|
+
default: null
|
53
|
+
},
|
54
|
+
type: {
|
55
|
+
type: String,
|
56
|
+
default: "text"
|
57
|
+
},
|
58
|
+
label: {
|
59
|
+
type: String,
|
60
|
+
default: null
|
61
|
+
},
|
62
|
+
labelClass: {
|
63
|
+
type: String,
|
64
|
+
default: "text-sm text-gray-700"
|
65
|
+
},
|
66
|
+
parentClass: {
|
67
|
+
type: String,
|
68
|
+
default: ""
|
69
|
+
},
|
70
|
+
inputClass: {
|
71
|
+
type: String,
|
72
|
+
default: ""
|
73
|
+
},
|
74
|
+
rows: {
|
75
|
+
type: Number,
|
76
|
+
default: 3
|
77
|
+
},
|
78
|
+
noLabel: Boolean,
|
79
|
+
showName: Boolean,
|
80
|
+
disabled: Boolean,
|
81
|
+
readonly: Boolean,
|
82
|
+
debounce: {
|
83
|
+
type: [String, Number],
|
84
|
+
default: 0
|
85
|
+
}
|
81
86
|
});
|
82
87
|
</script>
|