@dejwcake/craftable 2.0.2 → 2.1.1
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/dist/index.cjs +1 -1
- package/dist/index.mjs +295 -250
- package/package.json +1 -1
- package/scss/overrides/_checkboxes.scss +12 -0
- package/scss/overrides/_tables.scss +0 -6
- package/src/components/ReadOnlySwitch.vue +23 -0
- package/src/components/show/ShowRow.vue +17 -0
- package/src/index.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dejwcake/craftable",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "This is a frontend dependency for Craftable. Craftable is a Laravel-based open-source toolkit for building administration interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -79,3 +79,15 @@
|
|
|
79
79
|
label:hover::before {
|
|
80
80
|
border: 1px solid $primary !important;
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
/* Inline switch: no float or reserved gutter, so it sits where it is placed -- in a listing cell,
|
|
84
|
+
a detail row, or anywhere else. Bootstrap otherwise pulls the input back over the preceding
|
|
85
|
+
column. */
|
|
86
|
+
.form-switch.form-switch-inline {
|
|
87
|
+
padding-left: 0;
|
|
88
|
+
|
|
89
|
+
.form-check-input {
|
|
90
|
+
margin-left: 0;
|
|
91
|
+
float: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -39,15 +39,9 @@ td > .switch {
|
|
|
39
39
|
.table-listing td .form-switch.form-switch-inline {
|
|
40
40
|
display: flex;
|
|
41
41
|
justify-content: center;
|
|
42
|
-
padding-left: 0;
|
|
43
42
|
min-width: 2.5em;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
.table-listing td .form-switch.form-switch-inline .form-check-input {
|
|
47
|
-
margin-left: 0;
|
|
48
|
-
float: none;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
45
|
@media (width <= 991px) {
|
|
52
46
|
.table-listing {
|
|
53
47
|
th,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-check form-switch form-switch-inline">
|
|
3
|
+
<input
|
|
4
|
+
class="form-check-input"
|
|
5
|
+
:class="switchClass"
|
|
6
|
+
type="checkbox"
|
|
7
|
+
role="switch"
|
|
8
|
+
:checked="!!modelValue"
|
|
9
|
+
disabled
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { computed } from 'vue';
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
modelValue: { type: [Boolean, Number, String], default: false },
|
|
19
|
+
variant: { type: String, default: 'success' },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const switchClass = computed(() => `form-switch-${props.variant}`);
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mb-3 row align-items-center">
|
|
3
|
+
<label class="col-md-3 col-form-label text-md-end">{{ label }}</label>
|
|
4
|
+
<div class="col-md-9 col-xl-8">
|
|
5
|
+
<slot>
|
|
6
|
+
<span>{{ value }}</span>
|
|
7
|
+
</slot>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
defineProps({
|
|
14
|
+
label: { type: String, required: true },
|
|
15
|
+
value: { type: [String, Number, Boolean], default: '' },
|
|
16
|
+
});
|
|
17
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -26,6 +26,9 @@ export { default as EditButton } from './components/listing/EditButton.vue';
|
|
|
26
26
|
export { default as DeleteButton } from './components/listing/DeleteButton.vue';
|
|
27
27
|
export { default as ConfirmModal } from './components/ConfirmModal.vue';
|
|
28
28
|
export { default as ToggleSwitch } from './components/listing/ToggleSwitch.vue';
|
|
29
|
+
export { default as ReadOnlySwitch } from './components/ReadOnlySwitch.vue';
|
|
30
|
+
|
|
31
|
+
export { default as ShowRow } from './components/show/ShowRow.vue';
|
|
29
32
|
|
|
30
33
|
// Form components
|
|
31
34
|
export { default as FormInput } from './components/form/FormInput.vue';
|