@tak-ps/vue-tabler 4.2.0 → 4.3.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/CHANGELOG.md +8 -0
- package/components/BreadCrumb.vue +25 -8
- package/components/None.vue +12 -12
- package/components/SchemaBuilder.vue +6 -8
- package/components/SchemaBuilderEdit.vue +4 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<li class='breadcrumb-item'>
|
|
7
7
|
<a
|
|
8
8
|
class='cursor-pointer'
|
|
9
|
-
@click='
|
|
9
|
+
@click='navigate("/")'
|
|
10
10
|
>Home</a>
|
|
11
11
|
</li>
|
|
12
12
|
<li
|
|
@@ -21,16 +21,10 @@
|
|
|
21
21
|
v-if='crumb_it === crumbs.length - 1'
|
|
22
22
|
v-text='crumb'
|
|
23
23
|
/>
|
|
24
|
-
<a
|
|
25
|
-
v-else-if='normalize'
|
|
26
|
-
class='cursor-pointer'
|
|
27
|
-
@click='router.push("/" + crumbs.splice(0, crumb_it + 1).join("/").toLowerCase())'
|
|
28
|
-
v-text='crumb'
|
|
29
|
-
/>
|
|
30
24
|
<a
|
|
31
25
|
v-else
|
|
32
26
|
class='cursor-pointer'
|
|
33
|
-
@click='
|
|
27
|
+
@click='navigate(resolvePath(crumb_it))'
|
|
34
28
|
v-text='crumb'
|
|
35
29
|
/>
|
|
36
30
|
</li>
|
|
@@ -52,6 +46,29 @@ const props = withDefaults(defineProps<BreadCrumbProps>(), {
|
|
|
52
46
|
const router = useRouter()
|
|
53
47
|
const route = useRoute()
|
|
54
48
|
|
|
49
|
+
const navigate = (url: string) => {
|
|
50
|
+
try {
|
|
51
|
+
const resolved = router.resolve(url);
|
|
52
|
+
if (resolved.matched.length > 0) {
|
|
53
|
+
router.push(url);
|
|
54
|
+
} else {
|
|
55
|
+
window.location.href = url;
|
|
56
|
+
}
|
|
57
|
+
} catch (e) {
|
|
58
|
+
window.location.href = url;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const resolvePath = (index: number) => {
|
|
63
|
+
const rawCrumbs = route.path.split('/').filter((c) => c.length);
|
|
64
|
+
const subset = rawCrumbs.slice(0, index + 1);
|
|
65
|
+
let path = '/' + subset.join('/');
|
|
66
|
+
if (props.normalize) {
|
|
67
|
+
path = path.toLowerCase();
|
|
68
|
+
}
|
|
69
|
+
return path;
|
|
70
|
+
}
|
|
71
|
+
|
|
55
72
|
const crumbs = computed(() => {
|
|
56
73
|
return route.path.split('/').filter((crumb: string) => {
|
|
57
74
|
return crumb.length
|
package/components/None.vue
CHANGED
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
<div
|
|
28
28
|
class='user-select-none'
|
|
29
29
|
v-text='label'
|
|
30
|
-
|
|
31
|
-
</div>
|
|
30
|
+
/>
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
<div
|
|
33
|
+
v-if='create'
|
|
34
|
+
class='d-flex justify-content-center my-4'
|
|
35
|
+
:class='{
|
|
36
|
+
"my-4": !compact
|
|
37
|
+
}'
|
|
38
|
+
@click='emit("create")'
|
|
39
|
+
>
|
|
40
|
+
<div class='btn btn-primary'>
|
|
41
|
+
<span>Create <span v-text='label' /></span>
|
|
42
|
+
</div>
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
@@ -148,18 +148,16 @@ import {
|
|
|
148
148
|
IconPlus,
|
|
149
149
|
} from '@tabler/icons-vue';
|
|
150
150
|
import BuilderEdit from './SchemaBuilderEdit.vue';
|
|
151
|
-
import
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
TablerDelete
|
|
157
|
-
} from '@tak-ps/vue-tabler';
|
|
151
|
+
import TablerNone from './None.vue';
|
|
152
|
+
import TablerInput from './input/Input.vue';
|
|
153
|
+
import TablerEnum from './input/Enum.vue';
|
|
154
|
+
import TablerToggle from './input/Toggle.vue';
|
|
155
|
+
import TablerDelete from './Delete.vue';
|
|
158
156
|
|
|
159
157
|
interface SchemaProperty {
|
|
160
158
|
name: string;
|
|
161
159
|
type: string;
|
|
162
|
-
required
|
|
160
|
+
required: boolean;
|
|
163
161
|
description?: string;
|
|
164
162
|
enum?: string[];
|
|
165
163
|
_id?: string;
|
|
@@ -117,16 +117,14 @@ import {
|
|
|
117
117
|
IconPlus,
|
|
118
118
|
IconTrash
|
|
119
119
|
} from '@tabler/icons-vue';
|
|
120
|
-
import
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
TablerToggle
|
|
124
|
-
} from '@tak-ps/vue-tabler';
|
|
120
|
+
import TablerModal from './Modal.vue';
|
|
121
|
+
import TablerInput from './input/Input.vue';
|
|
122
|
+
import TablerToggle from './input/Toggle.vue';
|
|
125
123
|
|
|
126
124
|
interface SchemaProperty {
|
|
127
125
|
name: string;
|
|
128
126
|
type: string;
|
|
129
|
-
required
|
|
127
|
+
required: boolean;
|
|
130
128
|
description?: string;
|
|
131
129
|
enum?: string[];
|
|
132
130
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|