@dejwcake/craftable 2.0.2 → 2.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/dist/index.cjs +1 -1
- package/dist/index.mjs +295 -250
- package/package.json +1 -1
- 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.0
|
|
3
|
+
"version": "2.1.0",
|
|
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",
|
|
@@ -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';
|