@dative-gpi/foundation-shared-components 1.0.138 → 1.0.139
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.
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSSearchField
|
|
3
|
+
:modelValue="$props.modelValue"
|
|
4
|
+
:appendInnerIcon="$props.closable ? $props.appendInnerIcon : null"
|
|
5
|
+
:clearable="false"
|
|
6
|
+
@click:appendInner="onCloseClicked"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template
|
|
11
|
+
v-for="(_, name) in $slots"
|
|
12
|
+
v-slot:[name]="slotData"
|
|
13
|
+
>
|
|
14
|
+
<slot
|
|
15
|
+
:name="name"
|
|
16
|
+
v-bind="slotData"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
</FSSearchField>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import { defineComponent, type PropType } from "vue";
|
|
24
|
+
|
|
25
|
+
import FSSearchField from "./FSSearchField.vue";
|
|
26
|
+
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
name: "FSClosableSearchField",
|
|
29
|
+
components: {
|
|
30
|
+
FSSearchField
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
closable: {
|
|
34
|
+
type: Boolean as PropType<boolean>,
|
|
35
|
+
required: false,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
unfocusOnClose: {
|
|
39
|
+
type: Boolean as PropType<boolean>,
|
|
40
|
+
required: false,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
clearOnClose: {
|
|
44
|
+
type: Boolean as PropType<boolean>,
|
|
45
|
+
required: false,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
48
|
+
modelValue: {
|
|
49
|
+
type: String as PropType<string | null>,
|
|
50
|
+
required: false,
|
|
51
|
+
default: null
|
|
52
|
+
},
|
|
53
|
+
appendInnerIcon: {
|
|
54
|
+
type: String as PropType<string | undefined>,
|
|
55
|
+
required: false,
|
|
56
|
+
default: 'mdi-close'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
emits: ["update:modelValue", "close"],
|
|
60
|
+
setup(props, { emit }) {
|
|
61
|
+
const onCloseClicked = ($event: MouseEvent) => {
|
|
62
|
+
if(!props.closable) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (props.unfocusOnClose) {
|
|
67
|
+
$event.preventDefault();
|
|
68
|
+
$event.stopPropagation();
|
|
69
|
+
(document.activeElement as HTMLElement)?.blur();
|
|
70
|
+
}
|
|
71
|
+
if (props.clearOnClose) {
|
|
72
|
+
emit('update:modelValue', null);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
emit('close');
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
onCloseClicked
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
</script>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.139",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.139",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.139"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "e87dd93aeba0c018e180ab8d5764fe997011cea5"
|
|
39
39
|
}
|