@tekkare/auriga 0.1.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/README.md +89 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.d.ts +7 -0
- package/dist/module.json +8 -0
- package/dist/module.mjs +23 -0
- package/dist/runtime/components/argAdvancedSearchBar.vue +866 -0
- package/dist/runtime/components/argAdvancedSearchBar.vue.d.ts +4 -0
- package/dist/runtime/components/argBtn.vue +108 -0
- package/dist/runtime/components/argBtn.vue.d.ts +4 -0
- package/dist/runtime/components/argComplexSelect.vue +558 -0
- package/dist/runtime/components/argComplexSelect.vue.d.ts +4 -0
- package/dist/runtime/components/argDataLoader.vue +337 -0
- package/dist/runtime/components/argDataLoader.vue.d.ts +4 -0
- package/dist/runtime/components/argDropdownSelect.vue +321 -0
- package/dist/runtime/components/argDropdownSelect.vue.d.ts +4 -0
- package/dist/runtime/components/argFileBtn.vue +136 -0
- package/dist/runtime/components/argFileBtn.vue.d.ts +4 -0
- package/dist/runtime/components/argHeaderTabs.vue +216 -0
- package/dist/runtime/components/argHeaderTabs.vue.d.ts +4 -0
- package/dist/runtime/components/argIcon.vue +3135 -0
- package/dist/runtime/components/argIcon.vue.d.ts +4 -0
- package/dist/runtime/components/argMultipleChoice.vue +149 -0
- package/dist/runtime/components/argMultipleChoice.vue.d.ts +4 -0
- package/dist/runtime/components/argNoData.vue +83 -0
- package/dist/runtime/components/argNoData.vue.d.ts +4 -0
- package/dist/runtime/components/argSearchInput.vue +123 -0
- package/dist/runtime/components/argSearchInput.vue.d.ts +4 -0
- package/dist/runtime/components/argSimpleLabel.vue +214 -0
- package/dist/runtime/components/argSimpleLabel.vue.d.ts +4 -0
- package/dist/runtime/components/argStyle.vue +975 -0
- package/dist/runtime/components/argStyle.vue.d.ts +4 -0
- package/dist/runtime/components/argTable.vue +863 -0
- package/dist/runtime/components/argTable.vue.d.ts +4 -0
- package/dist/runtime/components/argTags.vue +26 -0
- package/dist/runtime/components/argTags.vue.d.ts +4 -0
- package/dist/runtime/components/argTekkareLoader.vue +72 -0
- package/dist/runtime/components/argTekkareLoader.vue.d.ts +4 -0
- package/dist/runtime/components/argTooltip.vue +141 -0
- package/dist/runtime/components/argTooltip.vue.d.ts +4 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.mjs +4 -0
- package/dist/types.d.mts +15 -0
- package/dist/types.d.ts +15 -0
- package/package.json +45 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div
|
|
4
|
+
v-if="onlyIcon === false"
|
|
5
|
+
:class="
|
|
6
|
+
`oip_${btnStyle}_button oip_btn ` +
|
|
7
|
+
[becomeSmall === true ? 'prmt_button_big' : '']
|
|
8
|
+
"
|
|
9
|
+
>
|
|
10
|
+
<span :class="{ oip_button_is_loading: loading }" class="oip_button_flex">
|
|
11
|
+
<span v-if="prefixIcon">
|
|
12
|
+
<arg-icon :name="prefixIcon" size="20" :color="getIconColor" />
|
|
13
|
+
</span>
|
|
14
|
+
<slot></slot>
|
|
15
|
+
<span v-if="suffixIcon">
|
|
16
|
+
<arg-icon :name="suffixIcon" size="20" :color="getIconColor" />
|
|
17
|
+
</span>
|
|
18
|
+
</span>
|
|
19
|
+
<span class="oip_button_loading" v-if="loading">
|
|
20
|
+
<div class="oip_button_spinner">
|
|
21
|
+
<div></div>
|
|
22
|
+
<div></div>
|
|
23
|
+
<div></div>
|
|
24
|
+
<div></div>
|
|
25
|
+
</div>
|
|
26
|
+
</span>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
v-if="becomeSmall === true || onlyIcon === true"
|
|
31
|
+
:class="
|
|
32
|
+
`oip_${btnStyle}_icon_button oip_btn ` +
|
|
33
|
+
[onlyIcon === false ? 'prmt_button_small' : '']
|
|
34
|
+
"
|
|
35
|
+
>
|
|
36
|
+
<span class="oip_button_loading" v-if="loading">
|
|
37
|
+
<div class="oip_button_spinner">
|
|
38
|
+
<div></div>
|
|
39
|
+
<div></div>
|
|
40
|
+
<div></div>
|
|
41
|
+
<div></div>
|
|
42
|
+
</div>
|
|
43
|
+
</span>
|
|
44
|
+
<arg-icon
|
|
45
|
+
:name="icon"
|
|
46
|
+
:color="btnStyle == 'primary' ? 'var(--pure-white)' : ''"
|
|
47
|
+
size="20px"
|
|
48
|
+
:class="{ oip_button_is_loading: loading }"
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
<script>
|
|
54
|
+
export default {
|
|
55
|
+
name: "argBtn"
|
|
56
|
+
};
|
|
57
|
+
</script>
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import argIcon from "./argIcon.vue";
|
|
60
|
+
import { onMounted, ref, computed, defineProps, defineEmits } from "vue";
|
|
61
|
+
|
|
62
|
+
const btnProps = defineProps({
|
|
63
|
+
btnStyle: { type: String, default: "primary" },
|
|
64
|
+
becomeSmall: { type: Boolean, default: true },
|
|
65
|
+
icon: { type: String, default: "Spinner" },
|
|
66
|
+
onlyIcon: { type: Boolean, default: false },
|
|
67
|
+
prefixIcon: { type: String, default: null },
|
|
68
|
+
suffixIcon: { type: String, default: null },
|
|
69
|
+
loading: { type: Boolean, default: false },
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const getIconColor = computed(() => {
|
|
73
|
+
const finalColor = ref("");
|
|
74
|
+
if (
|
|
75
|
+
["primary", "tertiary", "terciary", "dark", "green", "red"].includes(
|
|
76
|
+
btnProps.btnStyle
|
|
77
|
+
)
|
|
78
|
+
) {
|
|
79
|
+
finalColor.value = "var(--pure-white)";
|
|
80
|
+
} else if (btnProps.btnStyle === "secondary") {
|
|
81
|
+
finalColor.value = "var(--wild-blue-yonder)";
|
|
82
|
+
} else if (btnProps.btnStyle === "outlined") {
|
|
83
|
+
finalColor.value = "var(--primary)";
|
|
84
|
+
} else if (btnProps.btnStyle === "skeleton") {
|
|
85
|
+
finalColor.value = "var(--independence)";
|
|
86
|
+
} else if (btnProps.btnStyle === "disable") {
|
|
87
|
+
finalColor.value = "var(--cool-grey)";
|
|
88
|
+
} else if (btnProps.btnStyle === "success") {
|
|
89
|
+
finalColor.value = "var(--system-success)";
|
|
90
|
+
} else if (btnProps.btnStyle === "warning") {
|
|
91
|
+
finalColor.value = "var(--system-alert)";
|
|
92
|
+
}
|
|
93
|
+
return finalColor.value;
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style scoped>
|
|
98
|
+
@media screen and (min-width: 1001px) {
|
|
99
|
+
.prmt_button_small {
|
|
100
|
+
display: none !important;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
@media screen and (max-width: 1000px) {
|
|
104
|
+
.prmt_button_big {
|
|
105
|
+
display: none !important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- Simple select -->
|
|
4
|
+
<arg-simple-label
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
id="simple-select-complex"
|
|
7
|
+
@click="changeDisplay()"
|
|
8
|
+
:class="isDisplay ? 'open' : ''"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</arg-simple-label>
|
|
12
|
+
<!-- Complex select -->
|
|
13
|
+
<div
|
|
14
|
+
:style="isDisplay === false ? 'display : none' : ''"
|
|
15
|
+
id="select-complex"
|
|
16
|
+
class="oip_select_complex_block"
|
|
17
|
+
@click.stop
|
|
18
|
+
>
|
|
19
|
+
<div class="oip_select_complex_header">
|
|
20
|
+
<h1 class="oip_select_complex_header_title">
|
|
21
|
+
{{
|
|
22
|
+
!!select_placeholder ? `${select_placeholder} select` : "Select "
|
|
23
|
+
}}
|
|
24
|
+
</h1>
|
|
25
|
+
</div>
|
|
26
|
+
<div v-if="!!smart_selection_table" class="oip_select_complex_smart">
|
|
27
|
+
<h2 class="oip_select_complex_smart_title">Smart Selection</h2>
|
|
28
|
+
<div class="oip_select_complex_smart_selection">
|
|
29
|
+
<!-- Tags -->
|
|
30
|
+
<!-- List here -->
|
|
31
|
+
<div
|
|
32
|
+
v-for="(item, index) of smart_selection_table"
|
|
33
|
+
:key="index"
|
|
34
|
+
:class="[
|
|
35
|
+
'oip_tag',
|
|
36
|
+
!!smart_selection_selected &&
|
|
37
|
+
smart_selection_selected.name === item.name
|
|
38
|
+
? 'is_primary'
|
|
39
|
+
: 'is_disabled',
|
|
40
|
+
]"
|
|
41
|
+
@click="smart_selection_select_item(item)"
|
|
42
|
+
>
|
|
43
|
+
{{ item.name }}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="oip_select_complex_all_selection">
|
|
48
|
+
<div class="oip_select_complex_add_selection">
|
|
49
|
+
<div class="oip_select_complex_all_title">
|
|
50
|
+
<div class="oip_select_complex_all_tittle_left">Available</div>
|
|
51
|
+
<div
|
|
52
|
+
v-if="show_select_all"
|
|
53
|
+
class="oip_select_complex_all_tittle_right add"
|
|
54
|
+
@click="add_all_element"
|
|
55
|
+
>
|
|
56
|
+
Select all
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="oip_search_container">
|
|
60
|
+
<arg-icon size="20" name="MagnifyingGlass"></arg-icon>
|
|
61
|
+
<input
|
|
62
|
+
class="oip_search_name"
|
|
63
|
+
:placeholder="search_placeholder"
|
|
64
|
+
v-model="searchNameAdd"
|
|
65
|
+
@input="changeInput"
|
|
66
|
+
/>
|
|
67
|
+
<arg-icon
|
|
68
|
+
v-if="searchNameAdd && searchNameAdd.length > 0"
|
|
69
|
+
size="20"
|
|
70
|
+
name="XCircle"
|
|
71
|
+
@click="
|
|
72
|
+
searchNameAdd = '';
|
|
73
|
+
changeInput();
|
|
74
|
+
"
|
|
75
|
+
></arg-icon>
|
|
76
|
+
</div>
|
|
77
|
+
<!-- List -->
|
|
78
|
+
<div class="oip_select_complex_selection_container">
|
|
79
|
+
<div
|
|
80
|
+
class="oip_select_complex_selection_loop add"
|
|
81
|
+
v-for="(element, index) of filterNameAdd"
|
|
82
|
+
:key="index"
|
|
83
|
+
@mouseover="hoverAdd = index"
|
|
84
|
+
@mouseleave="hoverAdd = null"
|
|
85
|
+
@click="add_element(element)"
|
|
86
|
+
>
|
|
87
|
+
<arg-icon
|
|
88
|
+
size="16"
|
|
89
|
+
:name="hoverAdd === index ? 'PlusCircleFill' : 'PlusCircle'"
|
|
90
|
+
></arg-icon>
|
|
91
|
+
<div class="oip_select_complex_selection_loop_name">
|
|
92
|
+
{{ element }}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="oip_select_complex_del_selection">
|
|
98
|
+
<div class="oip_select_complex_all_title">
|
|
99
|
+
<div class="oip_select_complex_all_tittle_left">Selected</div>
|
|
100
|
+
<div
|
|
101
|
+
class="oip_select_complex_all_tittle_right del"
|
|
102
|
+
@click="del_all_element"
|
|
103
|
+
>
|
|
104
|
+
Clear all
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="oip_search_container">
|
|
108
|
+
<arg-icon size="20" name="MagnifyingGlass"></arg-icon>
|
|
109
|
+
<input
|
|
110
|
+
class="oip_search_name"
|
|
111
|
+
:placeholder="search_placeholder"
|
|
112
|
+
v-model="searchNameDel"
|
|
113
|
+
/>
|
|
114
|
+
<arg-icon
|
|
115
|
+
v-if="searchNameDel && searchNameDel.length > 0"
|
|
116
|
+
size="20"
|
|
117
|
+
name="XCircle"
|
|
118
|
+
@click="searchNameDel = ''"
|
|
119
|
+
></arg-icon>
|
|
120
|
+
</div>
|
|
121
|
+
<!-- List -->
|
|
122
|
+
<div class="oip_select_complex_selection_container">
|
|
123
|
+
<div
|
|
124
|
+
class="oip_select_complex_selection_loop del"
|
|
125
|
+
v-for="(element, index) of filterNameDel"
|
|
126
|
+
:key="index"
|
|
127
|
+
@mouseover="hoverRemove = index"
|
|
128
|
+
@mouseleave="hoverRemove = null"
|
|
129
|
+
@click="del_element(element)"
|
|
130
|
+
>
|
|
131
|
+
<arg-icon
|
|
132
|
+
size="16"
|
|
133
|
+
:name="
|
|
134
|
+
hoverRemove === index ? 'MinusCircleFill' : 'MinusCircle'
|
|
135
|
+
"
|
|
136
|
+
></arg-icon>
|
|
137
|
+
<div class="oip_select_complex_selection_loop_name">
|
|
138
|
+
{{ element }}
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div v-if="need_apply" class="oip_select_complex_footer">
|
|
145
|
+
<arg-btn @click="cancel_function()" btnStyle="secondary"
|
|
146
|
+
>Cancel</arg-btn
|
|
147
|
+
>
|
|
148
|
+
<arg-btn @click="apply_function()" btnStyle="primary">Apply</arg-btn>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</template>
|
|
153
|
+
<script>
|
|
154
|
+
export default {
|
|
155
|
+
name: "argComplexSelect"
|
|
156
|
+
};
|
|
157
|
+
</script>
|
|
158
|
+
<script setup lang="ts">
|
|
159
|
+
import { ref, computed, defineProps, defineEmits, watch } from "vue";
|
|
160
|
+
import argIcon from "./argIcon.vue";
|
|
161
|
+
import argSimpleLabel from "./argSimpleLabel.vue";
|
|
162
|
+
import argBtn from "./argBtn.vue";
|
|
163
|
+
|
|
164
|
+
const props = defineProps({
|
|
165
|
+
element_table: { type: Array<string>, required: true },
|
|
166
|
+
search_placeholder: { type: String, default: "Search" },
|
|
167
|
+
need_apply: { type: Boolean, default: false },
|
|
168
|
+
select_placeholder: { type: String, required: false },
|
|
169
|
+
smart_selection_table: { type: Array, required: false },
|
|
170
|
+
return_value: { type: Boolean, default: false },
|
|
171
|
+
disabled: { type: Boolean, default: false },
|
|
172
|
+
already_selected: {
|
|
173
|
+
type: Array<string>,
|
|
174
|
+
default: () => [],
|
|
175
|
+
},
|
|
176
|
+
show_select_all: { type: Boolean, default: false },
|
|
177
|
+
max_result: { type: Number, default: 500 },
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const add_table = ref([""]);
|
|
181
|
+
const del_table = ref([""]);
|
|
182
|
+
const isDisplay = ref(false);
|
|
183
|
+
const save_table = ref({ add: [""], del: [""] });
|
|
184
|
+
const smart_selection_selected = ref();
|
|
185
|
+
const searchNameAdd = ref("");
|
|
186
|
+
const searchNameDel = ref("");
|
|
187
|
+
const uid = ref(0);
|
|
188
|
+
const hoverAdd = ref(null);
|
|
189
|
+
const hoverRemove = ref(null);
|
|
190
|
+
|
|
191
|
+
const emit = defineEmits([
|
|
192
|
+
"changeElement",
|
|
193
|
+
"changeAddInputValue",
|
|
194
|
+
"update:Value",
|
|
195
|
+
]);
|
|
196
|
+
|
|
197
|
+
del_table.value = Object.assign([], [...new Set(props.already_selected)]);
|
|
198
|
+
add_table.value = Object.assign(
|
|
199
|
+
[],
|
|
200
|
+
[...new Set(props.element_table)].filter(
|
|
201
|
+
(item: string) => !del_table.value.includes(item)
|
|
202
|
+
)
|
|
203
|
+
);
|
|
204
|
+
save_table.value.add = Object.assign(
|
|
205
|
+
[],
|
|
206
|
+
[...new Set(props.element_table)].filter(
|
|
207
|
+
(item) => !del_table.value.includes(item)
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
uid.value = Math.floor(Math.random() * (100 - 1) + 1);
|
|
211
|
+
|
|
212
|
+
if (props.already_selected.length > 0) {
|
|
213
|
+
if (!props.need_apply) {
|
|
214
|
+
apply_function();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
watch(
|
|
219
|
+
() => props.element_table,
|
|
220
|
+
(new_element_table: string[]) => {
|
|
221
|
+
del_table.value = Object.assign([], [...new Set(props.already_selected)]);
|
|
222
|
+
add_table.value = Object.assign(
|
|
223
|
+
[],
|
|
224
|
+
[...new Set(new_element_table)].filter(
|
|
225
|
+
(item: string) => !del_table.value.includes(item)
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
save_table.value.add = Object.assign(
|
|
229
|
+
[],
|
|
230
|
+
[...new Set(new_element_table)].filter(
|
|
231
|
+
(item) => !del_table.value.includes(item)
|
|
232
|
+
)
|
|
233
|
+
);
|
|
234
|
+
if (!props.need_apply) {
|
|
235
|
+
apply_function();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
watch(
|
|
241
|
+
() => props.already_selected,
|
|
242
|
+
(new_selected: string[]) => {
|
|
243
|
+
del_table.value = Object.assign([], [...new Set(new_selected)]);
|
|
244
|
+
add_table.value = Object.assign(
|
|
245
|
+
[],
|
|
246
|
+
[...new Set(props.element_table)].filter(
|
|
247
|
+
(item: string) => !del_table.value.includes(item)
|
|
248
|
+
)
|
|
249
|
+
);
|
|
250
|
+
save_table.value.add = Object.assign(
|
|
251
|
+
[],
|
|
252
|
+
[...new Set(props.element_table)].filter(
|
|
253
|
+
(item) => !del_table.value.includes(item)
|
|
254
|
+
)
|
|
255
|
+
);
|
|
256
|
+
if (!props.need_apply) {
|
|
257
|
+
apply_function();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
const filterNameAdd = computed(() => {
|
|
263
|
+
if (searchNameAdd.value !== null) {
|
|
264
|
+
return add_table.value
|
|
265
|
+
.filter((element) =>
|
|
266
|
+
element.toLowerCase().includes(searchNameAdd.value.toLowerCase())
|
|
267
|
+
)
|
|
268
|
+
.slice(0, props.max_result);
|
|
269
|
+
} else return add_table.value.slice(0, props.max_result);
|
|
270
|
+
});
|
|
271
|
+
const filterNameDel = computed(() => {
|
|
272
|
+
if (searchNameDel.value !== null) {
|
|
273
|
+
return del_table.value.filter((element) =>
|
|
274
|
+
element.toLowerCase().includes(searchNameAdd.value.toLowerCase())
|
|
275
|
+
);
|
|
276
|
+
} else return del_table.value;
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
function changeInput() {
|
|
280
|
+
emit("changeAddInputValue", searchNameAdd);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function isInViewport(el: HTMLElement) {
|
|
284
|
+
const rect = el.getBoundingClientRect();
|
|
285
|
+
return (
|
|
286
|
+
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function changeDisplay() {
|
|
291
|
+
if (props.disabled === false) {
|
|
292
|
+
if (isDisplay.value === true) {
|
|
293
|
+
isDisplay.value = !isDisplay.value;
|
|
294
|
+
} else {
|
|
295
|
+
isDisplay.value = !isDisplay.value;
|
|
296
|
+
setTimeout(() => {
|
|
297
|
+
document?.addEventListener("click", close);
|
|
298
|
+
}, 100);
|
|
299
|
+
}
|
|
300
|
+
const elem = document?.getElementById("select_complex");
|
|
301
|
+
const simpleElem = document?.getElementById("simple_select_complex");
|
|
302
|
+
if (elem !== null && simpleElem !== null) {
|
|
303
|
+
elem.style.display = "";
|
|
304
|
+
elem.style.left = "";
|
|
305
|
+
const bounding = elem.getBoundingClientRect();
|
|
306
|
+
elem.style.left = !isInViewport(elem)
|
|
307
|
+
? `${
|
|
308
|
+
simpleElem.getBoundingClientRect().right +
|
|
309
|
+
window.scrollX -
|
|
310
|
+
bounding.width
|
|
311
|
+
}px`
|
|
312
|
+
: "";
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
function close() {
|
|
317
|
+
if (isDisplay.value === true) {
|
|
318
|
+
isDisplay.value = false;
|
|
319
|
+
document.removeEventListener("click", close);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function add_element(element: string) {
|
|
324
|
+
smart_selection_selected.value = undefined;
|
|
325
|
+
del_table.value.push(element);
|
|
326
|
+
add_table.value.splice(add_table.value.indexOf(element), 1);
|
|
327
|
+
if (!props.need_apply) {
|
|
328
|
+
apply_function();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function del_element(element: string) {
|
|
333
|
+
smart_selection_selected.value = undefined;
|
|
334
|
+
add_table.value.push(element);
|
|
335
|
+
del_table.value.splice(del_table.value.indexOf(element, 1));
|
|
336
|
+
if (!props.need_apply) {
|
|
337
|
+
apply_function();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function add_all_element() {
|
|
342
|
+
smart_selection_selected.value = undefined;
|
|
343
|
+
del_table.value = Object.assign([], [...new Set(props.element_table)]);
|
|
344
|
+
add_table.value = [];
|
|
345
|
+
if (!props.need_apply) {
|
|
346
|
+
apply_function();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function del_all_element() {
|
|
351
|
+
smart_selection_selected.value = undefined;
|
|
352
|
+
add_table.value = Object.assign([], [...new Set(props.element_table)]);
|
|
353
|
+
del_table.value = [];
|
|
354
|
+
if (!props.need_apply) {
|
|
355
|
+
apply_function();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function apply_function() {
|
|
360
|
+
change_save_table();
|
|
361
|
+
if (!props.return_value) {
|
|
362
|
+
emit(
|
|
363
|
+
"changeElement",
|
|
364
|
+
del_table.value.map((elem) => props.element_table.indexOf(elem))
|
|
365
|
+
);
|
|
366
|
+
emit(
|
|
367
|
+
"update:Value",
|
|
368
|
+
del_table.value.map((elem) => props.element_table.indexOf(elem))
|
|
369
|
+
);
|
|
370
|
+
} else {
|
|
371
|
+
emit(
|
|
372
|
+
"changeElement",
|
|
373
|
+
del_table.value.map((elem) => elem)
|
|
374
|
+
);
|
|
375
|
+
emit(
|
|
376
|
+
"update:Value",
|
|
377
|
+
del_table.value.map((elem) => elem)
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
if (props.need_apply) {
|
|
381
|
+
close();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function smart_selection_select_item(selected: any) {
|
|
386
|
+
if (props.smart_selection_table !== selected) {
|
|
387
|
+
del_all_element();
|
|
388
|
+
selected.item.forEach((index: string | number) => {
|
|
389
|
+
if (typeof index == "string") {
|
|
390
|
+
if (
|
|
391
|
+
typeof props.element_table[props.element_table.indexOf(index)] !==
|
|
392
|
+
"undefined"
|
|
393
|
+
) {
|
|
394
|
+
del_table.value.push(
|
|
395
|
+
props.element_table[props.element_table.indexOf(index)]
|
|
396
|
+
);
|
|
397
|
+
add_table.value.splice(
|
|
398
|
+
add_table.value.indexOf(
|
|
399
|
+
props.element_table[props.element_table.indexOf(index)]
|
|
400
|
+
),
|
|
401
|
+
1
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
} else if (typeof index === "number") {
|
|
405
|
+
if (typeof props.element_table[index] !== "undefined") {
|
|
406
|
+
del_table.value.push(props.element_table[index]);
|
|
407
|
+
add_table.value.splice(
|
|
408
|
+
add_table.value.indexOf(props.element_table[index]),
|
|
409
|
+
1
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
smart_selection_selected.value = selected;
|
|
415
|
+
}
|
|
416
|
+
if (!props.need_apply) {
|
|
417
|
+
apply_function();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function cancel_function() {
|
|
422
|
+
add_table.value = save_table.value.add;
|
|
423
|
+
del_table.value = save_table.value.del;
|
|
424
|
+
close();
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function change_save_table() {
|
|
428
|
+
save_table.value = { add: [], del: [] };
|
|
429
|
+
save_table.value.add = add_table.value;
|
|
430
|
+
save_table.value.del = del_table.value;
|
|
431
|
+
}
|
|
432
|
+
</script>
|
|
433
|
+
|
|
434
|
+
<style scoped>
|
|
435
|
+
.oip_select_complex_del_selection {
|
|
436
|
+
padding: 16px;
|
|
437
|
+
flex: 1;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.oip_select_complex_add_selection {
|
|
441
|
+
padding: 16px;
|
|
442
|
+
width: auto;
|
|
443
|
+
flex: 1;
|
|
444
|
+
border-right: 1px solid var(--dividers);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.oip_select_complex_all_tittle_right.add {
|
|
448
|
+
font-weight: 500;
|
|
449
|
+
font-size: 12px;
|
|
450
|
+
line-height: 22px;
|
|
451
|
+
vertical-align: bottom;
|
|
452
|
+
color: var(--primary);
|
|
453
|
+
cursor: pointer;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.oip_select_complex_all_tittle_right.del {
|
|
457
|
+
font-weight: 500;
|
|
458
|
+
font-size: 12px;
|
|
459
|
+
line-height: 22px;
|
|
460
|
+
vertical-align: bottom;
|
|
461
|
+
color: var(--alert);
|
|
462
|
+
cursor: pointer;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.oip_select_complex_all_title {
|
|
466
|
+
display: flex;
|
|
467
|
+
gap: 12px;
|
|
468
|
+
margin-bottom: 8px;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.oip_select_complex_all_tittle_left {
|
|
472
|
+
font-weight: 500;
|
|
473
|
+
font-size: 14px;
|
|
474
|
+
line-height: 22px;
|
|
475
|
+
color: var(--independence);
|
|
476
|
+
padding-right: 12px;
|
|
477
|
+
border-right: 1px solid var(--more);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.oip_select_complex_all_selection {
|
|
481
|
+
display: flex;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.oip_select_complex_footer {
|
|
485
|
+
border-top: 1px solid var(--more);
|
|
486
|
+
display: flex;
|
|
487
|
+
gap: 16px;
|
|
488
|
+
justify-content: flex-end;
|
|
489
|
+
padding: 28px 36px;
|
|
490
|
+
background-color: var(--pure-white);
|
|
491
|
+
border-radius: 0 0 12px 12px;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.oip_select_complex_smart_title {
|
|
495
|
+
margin-bottom: 12px;
|
|
496
|
+
font-weight: 500;
|
|
497
|
+
font-size: 14px;
|
|
498
|
+
line-height: 22px;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.oip_select_complex_smart_selection {
|
|
502
|
+
display: flex;
|
|
503
|
+
flex-wrap: wrap;
|
|
504
|
+
gap: 10px;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.oip_select_complex_smart_selection > .oip_tag {
|
|
508
|
+
cursor: pointer;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.oip_select_complex_smart {
|
|
512
|
+
padding: 16px;
|
|
513
|
+
margin-bottom: 0px;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.oip_select_complex_block {
|
|
517
|
+
z-index: 12;
|
|
518
|
+
margin-top: 15px;
|
|
519
|
+
position: absolute;
|
|
520
|
+
width: 780px;
|
|
521
|
+
border: 1px solid var(--more);
|
|
522
|
+
background: var(--demi-fond);
|
|
523
|
+
border-radius: 12px;
|
|
524
|
+
box-shadow: var(--overlay-shadow);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.oip_select_complex_header {
|
|
528
|
+
border-bottom: 1px solid var(--more);
|
|
529
|
+
background-color: var(--pure-white);
|
|
530
|
+
padding: 16px;
|
|
531
|
+
border-radius: 12px 12px 0 0;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.oip_select_complex_header_title {
|
|
535
|
+
font-weight: 700;
|
|
536
|
+
font-size: 16px;
|
|
537
|
+
line-height: 19px;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.oip_select_complex_selection_loop > svg.add {
|
|
541
|
+
fill: var(--accent) !important;
|
|
542
|
+
color: var(--pure-white) !important;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.oip_tag.is_disable {
|
|
546
|
+
cursor: pointer !important;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.oip_select_complex_selection_loop > svg.add {
|
|
550
|
+
width: 19px;
|
|
551
|
+
height: 19px;
|
|
552
|
+
margin: -2px;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
h1 {
|
|
556
|
+
margin: 0px !important;
|
|
557
|
+
}
|
|
558
|
+
</style>
|