vueless 0.0.614 → 0.0.616
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/package.json
CHANGED
package/ui.data-table/config.ts
CHANGED
|
@@ -61,8 +61,8 @@ export default /*tw*/ {
|
|
|
61
61
|
bodyCellContent: "text-ellipsis overflow-hidden",
|
|
62
62
|
bodyCellCheckbox: "{>bodyCellBase} pr-2",
|
|
63
63
|
bodyCellDateDivider: "",
|
|
64
|
-
bodyCellNested: "mr-2 flex gap-
|
|
65
|
-
bodyCellNestedExpandIconWrapper: "",
|
|
64
|
+
bodyCellNested: "mr-2 flex items-center gap-2",
|
|
65
|
+
bodyCellNestedExpandIconWrapper: "bg-brand-200 rounded-sm",
|
|
66
66
|
bodyCellNestedExpandIcon: {
|
|
67
67
|
base: "{UIcon}",
|
|
68
68
|
wrapper: "rounded-sm",
|
|
@@ -20,15 +20,21 @@ import type { UnknownObject } from "../types.ts";
|
|
|
20
20
|
|
|
21
21
|
defineOptions({ inheritAttrs: false });
|
|
22
22
|
|
|
23
|
-
// TODO: Use props and regular modal value
|
|
24
|
-
const modelValue = defineModel<string | number | UnknownObject>({ default: "" });
|
|
25
|
-
|
|
26
23
|
const props = withDefaults(defineProps<Props>(), {
|
|
27
24
|
...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
|
|
25
|
+
modelValue: "",
|
|
28
26
|
options: () => [],
|
|
29
27
|
});
|
|
30
28
|
|
|
31
29
|
const emit = defineEmits([
|
|
30
|
+
/**
|
|
31
|
+
* Triggers when the selected value is changes.
|
|
32
|
+
* @property {string} modelValue
|
|
33
|
+
* @property {number} modelValue
|
|
34
|
+
* @property {object} modelValue
|
|
35
|
+
*/
|
|
36
|
+
"update:modelValue",
|
|
37
|
+
|
|
32
38
|
/**
|
|
33
39
|
* Triggers when option is added.
|
|
34
40
|
*/
|
|
@@ -56,6 +62,11 @@ const { tm } = useLocale();
|
|
|
56
62
|
const i18nGlobal = tm(COMPONENT_NAME);
|
|
57
63
|
const currentLocale = computed(() => merge({}, defaultConfig.i18n, i18nGlobal, props.config.i18n));
|
|
58
64
|
|
|
65
|
+
const selectedValue = computed({
|
|
66
|
+
get: () => props.modelValue,
|
|
67
|
+
set: (value) => emit("update:modelValue", value),
|
|
68
|
+
});
|
|
69
|
+
|
|
59
70
|
const addOptionKeyCombination = computed(() => {
|
|
60
71
|
return isMac ? "(⌘ + Enter)" : "(Ctrl + Enter)";
|
|
61
72
|
});
|
|
@@ -136,12 +147,12 @@ function select(option: Option, keyCode?: string) {
|
|
|
136
147
|
if (keyCode === "Tab" && !pointerDirty.value) return;
|
|
137
148
|
|
|
138
149
|
if (props.valueKey in option && !isMetaKey(props.valueKey)) {
|
|
139
|
-
|
|
150
|
+
selectedValue.value = option[props.valueKey] as string | number | UnknownObject;
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
|
|
143
154
|
function isSelectedOption(option: Option) {
|
|
144
|
-
return
|
|
155
|
+
return selectedValue.value === option[props.valueKey];
|
|
145
156
|
}
|
|
146
157
|
|
|
147
158
|
function getMarginForSubCategory(level: number = 0) {
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.616",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -4630,6 +4630,21 @@
|
|
|
4630
4630
|
"name": "UDropdownList",
|
|
4631
4631
|
"description": "",
|
|
4632
4632
|
"attributes": [
|
|
4633
|
+
{
|
|
4634
|
+
"name": "modelValue",
|
|
4635
|
+
"required": true,
|
|
4636
|
+
"description": "Selected item.",
|
|
4637
|
+
"enum": [
|
|
4638
|
+
"string",
|
|
4639
|
+
"number",
|
|
4640
|
+
"UnknownObject"
|
|
4641
|
+
],
|
|
4642
|
+
"value": {
|
|
4643
|
+
"kind": "expression",
|
|
4644
|
+
"type": "union"
|
|
4645
|
+
},
|
|
4646
|
+
"default": "\"\""
|
|
4647
|
+
},
|
|
4633
4648
|
{
|
|
4634
4649
|
"name": "options",
|
|
4635
4650
|
"required": false,
|
|
@@ -4743,6 +4758,30 @@
|
|
|
4743
4758
|
}
|
|
4744
4759
|
],
|
|
4745
4760
|
"events": [
|
|
4761
|
+
{
|
|
4762
|
+
"name": "update:modelValue",
|
|
4763
|
+
"description": "Triggers when the selected value is changes.",
|
|
4764
|
+
"properties": [
|
|
4765
|
+
{
|
|
4766
|
+
"type": [
|
|
4767
|
+
"string"
|
|
4768
|
+
],
|
|
4769
|
+
"name": "modelValue"
|
|
4770
|
+
},
|
|
4771
|
+
{
|
|
4772
|
+
"type": [
|
|
4773
|
+
"number"
|
|
4774
|
+
],
|
|
4775
|
+
"name": "modelValue"
|
|
4776
|
+
},
|
|
4777
|
+
{
|
|
4778
|
+
"type": [
|
|
4779
|
+
"object"
|
|
4780
|
+
],
|
|
4781
|
+
"name": "modelValue"
|
|
4782
|
+
}
|
|
4783
|
+
]
|
|
4784
|
+
},
|
|
4746
4785
|
{
|
|
4747
4786
|
"name": "add",
|
|
4748
4787
|
"description": "Triggers when option is added."
|