@weconstudio/nuxt 0.0.0-stage → 1.72.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/LICENSE +1 -0
- package/README.md +115 -2
- package/dist/module.d.mts +7 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +250 -0
- package/dist/runtime/components/We/Autocomplete.d.vue.ts +13 -0
- package/dist/runtime/components/We/Autocomplete.vue +91 -0
- package/dist/runtime/components/We/Autocomplete.vue.d.ts +13 -0
- package/dist/runtime/components/We/BoldText.d.vue.ts +17 -0
- package/dist/runtime/components/We/BoldText.vue +29 -0
- package/dist/runtime/components/We/BoldText.vue.d.ts +17 -0
- package/dist/runtime/components/We/ColorPicker.d.vue.ts +11 -0
- package/dist/runtime/components/We/ColorPicker.vue +199 -0
- package/dist/runtime/components/We/ColorPicker.vue.d.ts +11 -0
- package/dist/runtime/components/We/ConfirmDialog.d.vue.ts +104 -0
- package/dist/runtime/components/We/ConfirmDialog.vue +143 -0
- package/dist/runtime/components/We/ConfirmDialog.vue.d.ts +104 -0
- package/dist/runtime/components/We/Datatable.d.vue.ts +40 -0
- package/dist/runtime/components/We/Datatable.vue +87 -0
- package/dist/runtime/components/We/Datatable.vue.d.ts +40 -0
- package/dist/runtime/components/We/DatatableInternal.d.vue.ts +194 -0
- package/dist/runtime/components/We/DatatableInternal.vue +638 -0
- package/dist/runtime/components/We/DatatableInternal.vue.d.ts +194 -0
- package/dist/runtime/components/We/DatePicker.d.vue.ts +51 -0
- package/dist/runtime/components/We/DatePicker.vue +901 -0
- package/dist/runtime/components/We/DatePicker.vue.d.ts +51 -0
- package/dist/runtime/components/We/Dt/Actions.d.vue.ts +51 -0
- package/dist/runtime/components/We/Dt/Actions.vue +106 -0
- package/dist/runtime/components/We/Dt/Actions.vue.d.ts +51 -0
- package/dist/runtime/components/We/Dt/BooleanFormatter.d.vue.ts +8 -0
- package/dist/runtime/components/We/Dt/BooleanFormatter.vue +26 -0
- package/dist/runtime/components/We/Dt/BooleanFormatter.vue.d.ts +8 -0
- package/dist/runtime/components/We/Dt/CardFilterContainer.d.vue.ts +17 -0
- package/dist/runtime/components/We/Dt/CardFilterContainer.vue +60 -0
- package/dist/runtime/components/We/Dt/CardFilterContainer.vue.d.ts +17 -0
- package/dist/runtime/components/We/Dt/CheckboxFilter.d.vue.ts +16 -0
- package/dist/runtime/components/We/Dt/CheckboxFilter.vue +47 -0
- package/dist/runtime/components/We/Dt/CheckboxFilter.vue.d.ts +16 -0
- package/dist/runtime/components/We/Dt/ChipGroupSelect.d.vue.ts +7 -0
- package/dist/runtime/components/We/Dt/ChipGroupSelect.vue +35 -0
- package/dist/runtime/components/We/Dt/ChipGroupSelect.vue.d.ts +7 -0
- package/dist/runtime/components/We/Dt/ClusterFilter.d.vue.ts +18 -0
- package/dist/runtime/components/We/Dt/ClusterFilter.vue +68 -0
- package/dist/runtime/components/We/Dt/ClusterFilter.vue.d.ts +18 -0
- package/dist/runtime/components/We/Dt/DatasetFormatter.d.vue.ts +19 -0
- package/dist/runtime/components/We/Dt/DatasetFormatter.vue +65 -0
- package/dist/runtime/components/We/Dt/DatasetFormatter.vue.d.ts +19 -0
- package/dist/runtime/components/We/Dt/DaterangeFilter.d.vue.ts +28 -0
- package/dist/runtime/components/We/Dt/DaterangeFilter.vue +140 -0
- package/dist/runtime/components/We/Dt/DaterangeFilter.vue.d.ts +28 -0
- package/dist/runtime/components/We/Dt/Filter.d.vue.ts +7 -0
- package/dist/runtime/components/We/Dt/Filter.vue +234 -0
- package/dist/runtime/components/We/Dt/Filter.vue.d.ts +7 -0
- package/dist/runtime/components/We/Dt/Filters.d.vue.ts +6 -0
- package/dist/runtime/components/We/Dt/Filters.vue +24 -0
- package/dist/runtime/components/We/Dt/Filters.vue.d.ts +6 -0
- package/dist/runtime/components/We/Dt/LuxonFormatter.d.vue.ts +12 -0
- package/dist/runtime/components/We/Dt/LuxonFormatter.vue +23 -0
- package/dist/runtime/components/We/Dt/LuxonFormatter.vue.d.ts +12 -0
- package/dist/runtime/components/We/Dt/SelectFilter.d.vue.ts +60 -0
- package/dist/runtime/components/We/Dt/SelectFilter.vue +333 -0
- package/dist/runtime/components/We/Dt/SelectFilter.vue.d.ts +60 -0
- package/dist/runtime/components/We/Dt/SelectResourceFilter.d.vue.ts +43 -0
- package/dist/runtime/components/We/Dt/SelectResourceFilter.vue +127 -0
- package/dist/runtime/components/We/Dt/SelectResourceFilter.vue.d.ts +43 -0
- package/dist/runtime/components/We/Dt/dt.types.d.ts +8 -0
- package/dist/runtime/components/We/EndpointSwitcher.d.vue.ts +12 -0
- package/dist/runtime/components/We/EndpointSwitcher.vue +256 -0
- package/dist/runtime/components/We/EndpointSwitcher.vue.d.ts +12 -0
- package/dist/runtime/components/We/Import.d.vue.ts +118 -0
- package/dist/runtime/components/We/Import.vue +730 -0
- package/dist/runtime/components/We/Import.vue.d.ts +118 -0
- package/dist/runtime/components/We/ImportDefaultValues.d.vue.ts +3666 -0
- package/dist/runtime/components/We/ImportDefaultValues.vue +115 -0
- package/dist/runtime/components/We/ImportDefaultValues.vue.d.ts +3666 -0
- package/dist/runtime/components/We/ImportMatchColumns.d.vue.ts +66 -0
- package/dist/runtime/components/We/ImportMatchColumns.vue +172 -0
- package/dist/runtime/components/We/ImportMatchColumns.vue.d.ts +66 -0
- package/dist/runtime/components/We/ImportPreviewResults.d.vue.ts +38 -0
- package/dist/runtime/components/We/ImportPreviewResults.vue +165 -0
- package/dist/runtime/components/We/ImportPreviewResults.vue.d.ts +38 -0
- package/dist/runtime/components/We/ImportSelectStart.d.vue.ts +47 -0
- package/dist/runtime/components/We/ImportSelectStart.vue +106 -0
- package/dist/runtime/components/We/ImportSelectStart.vue.d.ts +47 -0
- package/dist/runtime/components/We/Notification.d.vue.ts +7 -0
- package/dist/runtime/components/We/Notification.vue +49 -0
- package/dist/runtime/components/We/Notification.vue.d.ts +7 -0
- package/dist/runtime/components/We/S3Dropzone.d.vue.ts +17 -0
- package/dist/runtime/components/We/S3Dropzone.vue +527 -0
- package/dist/runtime/components/We/S3Dropzone.vue.d.ts +17 -0
- package/dist/runtime/components/We/Select.d.vue.ts +39 -0
- package/dist/runtime/components/We/Select.vue +354 -0
- package/dist/runtime/components/We/Select.vue.d.ts +39 -0
- package/dist/runtime/components/We/TipTap.d.vue.ts +26 -0
- package/dist/runtime/components/We/TipTap.vue +362 -0
- package/dist/runtime/components/We/TipTap.vue.d.ts +26 -0
- package/dist/runtime/components/We/datatable.props.d.ts +57 -0
- package/dist/runtime/components/We/datatable.props.js +60 -0
- package/dist/runtime/composables/datatable/useAutoFillHeight.d.ts +31 -0
- package/dist/runtime/composables/datatable/useAutoFillHeight.js +57 -0
- package/dist/runtime/composables/datatable/useDataTable.d.ts +33 -0
- package/dist/runtime/composables/datatable/useDataTable.js +161 -0
- package/dist/runtime/composables/datatable/useDatatableColumns.d.ts +12 -0
- package/dist/runtime/composables/datatable/useDatatableColumns.js +96 -0
- package/dist/runtime/composables/useApi.d.ts +56 -0
- package/dist/runtime/composables/useApi.js +230 -0
- package/dist/runtime/composables/useApiFetch.d.ts +2 -0
- package/dist/runtime/composables/useApiFetch.js +9 -0
- package/dist/runtime/composables/useApiUrl.d.ts +10 -0
- package/dist/runtime/composables/useApiUrl.js +37 -0
- package/dist/runtime/composables/useAuth.d.ts +9 -0
- package/dist/runtime/composables/useAuth.js +22 -0
- package/dist/runtime/composables/useBus.d.ts +8 -0
- package/dist/runtime/composables/useBus.js +18 -0
- package/dist/runtime/composables/useDateRangePresets.d.ts +21 -0
- package/dist/runtime/composables/useDateRangePresets.js +90 -0
- package/dist/runtime/composables/useForm.d.ts +29 -0
- package/dist/runtime/composables/useForm.js +74 -0
- package/dist/runtime/composables/useFormLock.d.ts +11 -0
- package/dist/runtime/composables/useFormLock.js +8 -0
- package/dist/runtime/composables/useFormWrapper.d.ts +16 -0
- package/dist/runtime/composables/useFormWrapper.js +36 -0
- package/dist/runtime/composables/useImportJob.d.ts +55 -0
- package/dist/runtime/composables/useImportJob.js +94 -0
- package/dist/runtime/composables/useLux.d.ts +1 -0
- package/dist/runtime/composables/useLux.js +8 -0
- package/dist/runtime/composables/useNotify.d.ts +12 -0
- package/dist/runtime/composables/useNotify.js +24 -0
- package/dist/runtime/composables/usePaginatedFetch.d.ts +24 -0
- package/dist/runtime/composables/usePaginatedFetch.js +154 -0
- package/dist/runtime/composables/useServerErrors.d.ts +16 -0
- package/dist/runtime/composables/useServerErrors.js +60 -0
- package/dist/runtime/composables/useValidators.d.ts +18 -0
- package/dist/runtime/composables/useValidators.js +56 -0
- package/dist/runtime/generator/code/dt.d.ts +8 -0
- package/dist/runtime/generator/code/dt.js +97 -0
- package/dist/runtime/generator/code/edit.d.ts +4 -0
- package/dist/runtime/generator/code/edit.js +41 -0
- package/dist/runtime/generator/code/form.d.ts +6 -0
- package/dist/runtime/generator/code/form.js +229 -0
- package/dist/runtime/generator/code/i18n.d.ts +5 -0
- package/dist/runtime/generator/code/i18n.js +43 -0
- package/dist/runtime/generator/code/index.d.ts +11 -0
- package/dist/runtime/generator/code/index.js +90 -0
- package/dist/runtime/generator/components/CodeSnippet.d.vue.ts +14 -0
- package/dist/runtime/generator/components/CodeSnippet.vue +49 -0
- package/dist/runtime/generator/components/CodeSnippet.vue.d.ts +14 -0
- package/dist/runtime/generator/components/Configuration.d.vue.ts +16 -0
- package/dist/runtime/generator/components/Configuration.vue +154 -0
- package/dist/runtime/generator/components/Configuration.vue.d.ts +16 -0
- package/dist/runtime/generator/components/GeneratorPage.d.vue.ts +50 -0
- package/dist/runtime/generator/components/GeneratorPage.vue +226 -0
- package/dist/runtime/generator/components/GeneratorPage.vue.d.ts +50 -0
- package/dist/runtime/generator/fs.d.ts +16 -0
- package/dist/runtime/generator/fs.js +79 -0
- package/dist/runtime/generator/index.d.vue.ts +52 -0
- package/dist/runtime/generator/index.vue +17 -0
- package/dist/runtime/generator/index.vue.d.ts +52 -0
- package/dist/runtime/internals/api.d.ts +3 -0
- package/dist/runtime/internals/api.js +16 -0
- package/dist/runtime/internals/bus.d.ts +1 -0
- package/dist/runtime/internals/bus.js +2 -0
- package/dist/runtime/internals/dt.d.ts +24 -0
- package/dist/runtime/internals/dt.js +57 -0
- package/dist/runtime/lang/en.json +211 -0
- package/dist/runtime/lang/it.json +211 -0
- package/dist/runtime/mixins/formValidator.d.ts +38 -0
- package/dist/runtime/mixins/formValidator.js +118 -0
- package/dist/runtime/plugins/api-legacy.d.ts +76 -0
- package/dist/runtime/plugins/api-legacy.js +11 -0
- package/dist/runtime/plugins/auth-legacy.d.ts +22 -0
- package/dist/runtime/plugins/auth-legacy.js +14 -0
- package/dist/runtime/plugins/bus-legacy.d.ts +6 -0
- package/dist/runtime/plugins/bus-legacy.js +9 -0
- package/dist/runtime/plugins/notify-legacy.d.ts +25 -0
- package/dist/runtime/plugins/notify-legacy.js +35 -0
- package/dist/runtime/plugins/portal.d.ts +2 -0
- package/dist/runtime/plugins/portal.js +5 -0
- package/dist/runtime/plugins/update-sanctum-app-config.d.ts +2 -0
- package/dist/runtime/plugins/update-sanctum-app-config.js +44 -0
- package/dist/runtime/plugins/vuetify-nuxt-icon.d.ts +4 -0
- package/dist/runtime/plugins/vuetify-nuxt-icon.js +30 -0
- package/dist/runtime/types/app-config.d.ts +24 -0
- package/dist/runtime/types/app-config.js +1 -0
- package/dist/runtime/types/icons.d.ts +82 -0
- package/dist/runtime/types/icons.js +84 -0
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/module-options.d.ts +29 -0
- package/dist/runtime/types/module-options.js +0 -0
- package/dist/runtime/types/runtime-hooks.d.ts +17 -0
- package/dist/runtime/types/runtime-hooks.js +1 -0
- package/dist/runtime/utils/color.d.ts +10 -0
- package/dist/runtime/utils/color.js +38 -0
- package/dist/runtime/utils/file.d.ts +17 -0
- package/dist/runtime/utils/file.js +108 -0
- package/dist/runtime/utils/format.d.ts +1 -0
- package/dist/runtime/utils/format.js +14 -0
- package/dist/runtime/utils/make-enum.d.ts +15 -0
- package/dist/runtime/utils/make-enum.js +27 -0
- package/dist/runtime/utils/mergeDefaults.d.ts +1 -0
- package/dist/runtime/utils/mergeDefaults.js +18 -0
- package/dist/runtime/utils/object-to-formdata.d.ts +10 -0
- package/dist/runtime/utils/object-to-formdata.js +82 -0
- package/dist/runtime/utils/uuid.d.ts +1 -0
- package/dist/runtime/utils/uuid.js +9 -0
- package/dist/types.d.mts +9 -0
- package/package.json +92 -4
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { CharacterCount } from "@tiptap/extensions";
|
|
3
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
4
|
+
import { Editor, EditorContent } from "@tiptap/vue-3";
|
|
5
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
6
|
+
import { useDefaults, useDisplay } from "vuetify";
|
|
7
|
+
import { useFormLock } from "../../composables/useFormLock";
|
|
8
|
+
const _props = defineProps({
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: false
|
|
12
|
+
},
|
|
13
|
+
label: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
placeholder: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
errorMessages: {
|
|
26
|
+
type: [Array, String],
|
|
27
|
+
default: () => []
|
|
28
|
+
},
|
|
29
|
+
limit: Number,
|
|
30
|
+
// Da qui in giù: le stesse prop di `v-text-field`, inoltrate a VField/VInput.
|
|
31
|
+
variant: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "filled"
|
|
34
|
+
},
|
|
35
|
+
rounded: {
|
|
36
|
+
type: [String, Number, Boolean],
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
tile: Boolean,
|
|
40
|
+
flat: Boolean,
|
|
41
|
+
color: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "primary"
|
|
44
|
+
},
|
|
45
|
+
baseColor: String,
|
|
46
|
+
bgColor: String,
|
|
47
|
+
density: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "default"
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: null
|
|
54
|
+
},
|
|
55
|
+
readonly: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
hideDetails: {
|
|
60
|
+
type: [Boolean, String],
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
hint: String,
|
|
64
|
+
persistentHint: Boolean,
|
|
65
|
+
messages: {
|
|
66
|
+
type: [Array, String],
|
|
67
|
+
default: () => []
|
|
68
|
+
},
|
|
69
|
+
persistentCounter: Boolean
|
|
70
|
+
});
|
|
71
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
72
|
+
const props = useDefaults(_props, "WeTipTap");
|
|
73
|
+
const { isReadonly, isDisabled } = useFormLock(props);
|
|
74
|
+
const isLocked = computed(() => isReadonly.value || isDisabled.value);
|
|
75
|
+
const { xs } = useDisplay();
|
|
76
|
+
const toolbarClass = computed(() => {
|
|
77
|
+
return {
|
|
78
|
+
"we-tiptap__toolbar": true,
|
|
79
|
+
"pb-1": true,
|
|
80
|
+
"we-tiptap__toolbar--scroll": xs.value
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const editor = ref(null);
|
|
84
|
+
const isFocused = ref(false);
|
|
85
|
+
const heading = computed(() => {
|
|
86
|
+
if (editor.value?.isActive("heading", { level: 1 })) {
|
|
87
|
+
return "h1";
|
|
88
|
+
}
|
|
89
|
+
if (editor.value?.isActive("heading", { level: 2 })) {
|
|
90
|
+
return "h2";
|
|
91
|
+
}
|
|
92
|
+
if (editor.value?.isActive("heading", { level: 3 })) {
|
|
93
|
+
return "h3";
|
|
94
|
+
}
|
|
95
|
+
if (editor.value?.isActive("heading", { level: 4 })) {
|
|
96
|
+
return "h4";
|
|
97
|
+
}
|
|
98
|
+
if (editor.value?.isActive("heading", { level: 5 })) {
|
|
99
|
+
return "h5";
|
|
100
|
+
}
|
|
101
|
+
if (editor.value?.isActive("heading", { level: 6 })) {
|
|
102
|
+
return "h6";
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
});
|
|
106
|
+
const counter = computed(() => editor.value?.storage.characterCount.characters());
|
|
107
|
+
const inputProps = computed(() => ({
|
|
108
|
+
density: props.density,
|
|
109
|
+
disabled: isDisabled.value,
|
|
110
|
+
readonly: isReadonly.value,
|
|
111
|
+
hideDetails: props.hideDetails,
|
|
112
|
+
hint: props.hint,
|
|
113
|
+
persistentHint: props.persistentHint,
|
|
114
|
+
messages: props.messages,
|
|
115
|
+
color: props.color,
|
|
116
|
+
baseColor: props.baseColor,
|
|
117
|
+
errorMessages: props.errorMessages,
|
|
118
|
+
rules: props.rules
|
|
119
|
+
}));
|
|
120
|
+
const fieldProps = computed(() => ({
|
|
121
|
+
variant: props.variant,
|
|
122
|
+
rounded: props.rounded,
|
|
123
|
+
tile: props.tile,
|
|
124
|
+
flat: props.flat,
|
|
125
|
+
color: props.color,
|
|
126
|
+
baseColor: props.baseColor,
|
|
127
|
+
bgColor: props.bgColor,
|
|
128
|
+
label: props.label
|
|
129
|
+
}));
|
|
130
|
+
watch(() => props.modelValue, (newValue) => {
|
|
131
|
+
if (!editor.value) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const isSame = editor.value.getHTML() === newValue;
|
|
135
|
+
if (!isSame) {
|
|
136
|
+
editor.value.commands.setContent(newValue, { emitUpdate: false });
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
watch(isLocked, (locked) => {
|
|
140
|
+
editor.value?.setEditable(!locked);
|
|
141
|
+
});
|
|
142
|
+
onMounted(() => {
|
|
143
|
+
editor.value = new Editor({
|
|
144
|
+
content: props.modelValue,
|
|
145
|
+
editable: !isLocked.value,
|
|
146
|
+
editorProps: {
|
|
147
|
+
attributes: { "data-placeholder": props.placeholder }
|
|
148
|
+
},
|
|
149
|
+
extensions: [
|
|
150
|
+
// StarterKit v3 include già Link; trailingNode off: aggiungerebbe un <p></p> finale all'HTML salvato
|
|
151
|
+
StarterKit.configure({ trailingNode: false }),
|
|
152
|
+
CharacterCount.configure({
|
|
153
|
+
limit: props.limit
|
|
154
|
+
})
|
|
155
|
+
],
|
|
156
|
+
onUpdate: () => {
|
|
157
|
+
const htmlContent = editor.value.getHTML();
|
|
158
|
+
emit("update:modelValue", htmlContent === "<p></p>" ? null : htmlContent);
|
|
159
|
+
},
|
|
160
|
+
onFocus: () => {
|
|
161
|
+
isFocused.value = true;
|
|
162
|
+
},
|
|
163
|
+
onBlur: () => {
|
|
164
|
+
isFocused.value = false;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
const btnAttrs = computed(() => {
|
|
169
|
+
return {
|
|
170
|
+
rounded: "lg",
|
|
171
|
+
size: "small",
|
|
172
|
+
variant: "tonal"
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
const editorFocus = () => editor.value.chain().focus();
|
|
176
|
+
onBeforeUnmount(() => {
|
|
177
|
+
editor.value?.destroy();
|
|
178
|
+
});
|
|
179
|
+
function setLink() {
|
|
180
|
+
const url = window.prompt("Url:");
|
|
181
|
+
editor.value.chain().focus().setLink({ href: url }).run();
|
|
182
|
+
}
|
|
183
|
+
const toolbarGroups = computed(() => [
|
|
184
|
+
[
|
|
185
|
+
{
|
|
186
|
+
icon: "mdi-undo",
|
|
187
|
+
onClick: () => editorFocus().undo().run()
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
icon: "mdi-redo",
|
|
191
|
+
onClick: () => editorFocus().redo().run()
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
[
|
|
195
|
+
{ icon: "mdi-link-variant", onClick: setLink }
|
|
196
|
+
],
|
|
197
|
+
[
|
|
198
|
+
{
|
|
199
|
+
icon: "mdi-format-bold",
|
|
200
|
+
isActive: () => editor.value.isActive("bold"),
|
|
201
|
+
onClick: () => editorFocus().toggleBold().run()
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
icon: "mdi-format-italic",
|
|
205
|
+
isActive: () => editor.value.isActive("italic"),
|
|
206
|
+
onClick: () => editorFocus().toggleItalic().run()
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
[
|
|
210
|
+
{
|
|
211
|
+
icon: "mdi-format-paragraph",
|
|
212
|
+
isActive: () => editor.value.isActive("paragraph"),
|
|
213
|
+
onClick: () => editorFocus().setParagraph().run()
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
icon: "mdi-format-text",
|
|
217
|
+
isActive: () => !!heading.value,
|
|
218
|
+
menu: Array.from({ length: 6 }, (_, i) => ({
|
|
219
|
+
title: `h${i + 1}`,
|
|
220
|
+
isActive: () => heading.value === `h${i + 1}`,
|
|
221
|
+
onClick: () => editorFocus().toggleHeading({ level: i + 1 }).run()
|
|
222
|
+
}))
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
[
|
|
226
|
+
{
|
|
227
|
+
icon: "mdi-format-list-bulleted-square",
|
|
228
|
+
isActive: () => editor.value.isActive("bulletList"),
|
|
229
|
+
onClick: () => editorFocus().toggleBulletList().run()
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
icon: "mdi-format-list-numbered",
|
|
233
|
+
isActive: () => editor.value.isActive("orderedList"),
|
|
234
|
+
onClick: () => editorFocus().toggleOrderedList().run()
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
]);
|
|
238
|
+
function focusEditor() {
|
|
239
|
+
if (isLocked.value) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
editor.value?.commands.focus();
|
|
243
|
+
}
|
|
244
|
+
</script>
|
|
245
|
+
|
|
246
|
+
<template>
|
|
247
|
+
<v-input
|
|
248
|
+
v-bind="inputProps"
|
|
249
|
+
class="we-tiptap"
|
|
250
|
+
:model-value="modelValue"
|
|
251
|
+
:focused="isFocused"
|
|
252
|
+
>
|
|
253
|
+
<template #default="{ id, isValid }">
|
|
254
|
+
<v-field
|
|
255
|
+
v-bind="fieldProps"
|
|
256
|
+
:id="id.value"
|
|
257
|
+
active
|
|
258
|
+
:dirty="!!modelValue"
|
|
259
|
+
:focused="isFocused"
|
|
260
|
+
:error="isValid.value === false"
|
|
261
|
+
:disabled="isDisabled"
|
|
262
|
+
class="we-tiptap__field"
|
|
263
|
+
>
|
|
264
|
+
<template #default="{ props: controlProps }">
|
|
265
|
+
<div
|
|
266
|
+
v-bind="controlProps"
|
|
267
|
+
class="we-tiptap__control"
|
|
268
|
+
>
|
|
269
|
+
<v-toolbar
|
|
270
|
+
v-if="editor && !isLocked"
|
|
271
|
+
height="auto"
|
|
272
|
+
:class="toolbarClass"
|
|
273
|
+
elevation="0"
|
|
274
|
+
color="transparent"
|
|
275
|
+
@mousedown.prevent
|
|
276
|
+
>
|
|
277
|
+
<template
|
|
278
|
+
v-for="(group, groupIndex) in toolbarGroups"
|
|
279
|
+
:key="groupIndex"
|
|
280
|
+
>
|
|
281
|
+
<v-divider
|
|
282
|
+
v-if="groupIndex"
|
|
283
|
+
vertical
|
|
284
|
+
class="mx-1"
|
|
285
|
+
/>
|
|
286
|
+
<template
|
|
287
|
+
v-for="button in group"
|
|
288
|
+
:key="button.icon"
|
|
289
|
+
>
|
|
290
|
+
<v-menu
|
|
291
|
+
v-if="button.menu"
|
|
292
|
+
:offset="4"
|
|
293
|
+
>
|
|
294
|
+
<template #activator="{ props: menuProps }">
|
|
295
|
+
<v-btn
|
|
296
|
+
v-bind="{ ...btnAttrs, ...menuProps }"
|
|
297
|
+
:color="button.isActive?.() ? 'primary' : undefined"
|
|
298
|
+
>
|
|
299
|
+
<v-icon size="large">
|
|
300
|
+
{{ button.icon }}
|
|
301
|
+
</v-icon>
|
|
302
|
+
</v-btn>
|
|
303
|
+
</template>
|
|
304
|
+
<v-list
|
|
305
|
+
rounded="lg"
|
|
306
|
+
density="compact"
|
|
307
|
+
@mousedown.prevent
|
|
308
|
+
>
|
|
309
|
+
<v-list-item
|
|
310
|
+
v-for="item in button.menu"
|
|
311
|
+
:key="item.title"
|
|
312
|
+
class="py-0"
|
|
313
|
+
:active="item.isActive?.()"
|
|
314
|
+
@click="item.onClick()"
|
|
315
|
+
>
|
|
316
|
+
<v-list-item-title>{{ item.title }}</v-list-item-title>
|
|
317
|
+
</v-list-item>
|
|
318
|
+
</v-list>
|
|
319
|
+
</v-menu>
|
|
320
|
+
<v-btn
|
|
321
|
+
v-else
|
|
322
|
+
v-bind="btnAttrs"
|
|
323
|
+
:color="button.isActive?.() ? 'primary' : undefined"
|
|
324
|
+
@click="button.onClick()"
|
|
325
|
+
>
|
|
326
|
+
<v-icon :size="button.iconSize">
|
|
327
|
+
{{ button.icon }}
|
|
328
|
+
</v-icon>
|
|
329
|
+
</v-btn>
|
|
330
|
+
</template>
|
|
331
|
+
</template>
|
|
332
|
+
</v-toolbar>
|
|
333
|
+
<div
|
|
334
|
+
class="we-tiptap__content pt-2"
|
|
335
|
+
@click="focusEditor"
|
|
336
|
+
>
|
|
337
|
+
<editor-content
|
|
338
|
+
v-if="editor"
|
|
339
|
+
:editor="editor"
|
|
340
|
+
:class="{ 'we-tiptap__content--empty': editor.isEmpty }"
|
|
341
|
+
/>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
</template>
|
|
345
|
+
</v-field>
|
|
346
|
+
</template>
|
|
347
|
+
|
|
348
|
+
<template v-if="limit" #details>
|
|
349
|
+
<span />
|
|
350
|
+
<v-counter
|
|
351
|
+
:active="persistentCounter || isFocused"
|
|
352
|
+
:value="counter"
|
|
353
|
+
:max="limit"
|
|
354
|
+
:disabled="disabled"
|
|
355
|
+
/>
|
|
356
|
+
</template>
|
|
357
|
+
</v-input>
|
|
358
|
+
</template>
|
|
359
|
+
|
|
360
|
+
<style scoped>
|
|
361
|
+
.we-tiptap :deep(.v-field__input){display:block;padding-inline:0}.we-tiptap__toolbar :deep(.v-toolbar__content){flex-wrap:wrap;gap:1px;padding-top:4px;padding-inline:var(--v-field-padding-start) var(--v-field-padding-end)}.we-tiptap__toolbar--scroll :deep(.v-toolbar__content){align-self:stretch;flex-wrap:nowrap;margin-inline:var(--v-field-padding-start) var(--v-field-padding-end);overflow-x:auto;padding-inline:0;scrollbar-width:none;width:auto}.we-tiptap__toolbar :deep(.v-divider--vertical),.we-tiptap__toolbar :deep(.v-toolbar__content>.v-btn:first-child),.we-tiptap__toolbar :deep(.v-toolbar__content>.v-btn:last-child){margin-inline:0}.we-tiptap__content{padding-inline:var(--v-field-padding-start) var(--v-field-padding-end)}.we-tiptap__content :deep(.ProseMirror){min-height:200px;outline:none;position:relative}.we-tiptap__content--empty :deep(.ProseMirror):before{color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));content:attr(data-placeholder);inset-inline-start:0;pointer-events:none;position:absolute;top:0}.we-tiptap__content :deep(.ProseMirror ol),.we-tiptap__content :deep(.ProseMirror ul){padding-left:1.5rem}.we-tiptap__content :deep(.ProseMirror>:first-child){margin-top:0!important}.we-tiptap__content :deep(.ProseMirror>:last-child){margin-bottom:0!important}
|
|
362
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
$emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
3
|
+
flat: boolean;
|
|
4
|
+
messages: string | unknown[];
|
|
5
|
+
label: string;
|
|
6
|
+
rules: unknown[];
|
|
7
|
+
readonly: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
color: string;
|
|
10
|
+
density: string;
|
|
11
|
+
tile: boolean;
|
|
12
|
+
variant: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
errorMessages: string | unknown[];
|
|
15
|
+
persistentHint: boolean;
|
|
16
|
+
hideDetails: string | boolean;
|
|
17
|
+
persistentCounter: boolean;
|
|
18
|
+
limit?: number | undefined;
|
|
19
|
+
modelValue?: string | undefined;
|
|
20
|
+
bgColor?: string | undefined;
|
|
21
|
+
rounded?: string | number | boolean | undefined;
|
|
22
|
+
baseColor?: string | undefined;
|
|
23
|
+
hint?: string | undefined;
|
|
24
|
+
$props: any;
|
|
25
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Regular props forwarded 1:1 to the internal component. */
|
|
2
|
+
export declare const datatableProps: {
|
|
3
|
+
resource: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
required: boolean;
|
|
6
|
+
};
|
|
7
|
+
addButton: {
|
|
8
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
filters: {
|
|
12
|
+
type: ObjectConstructor;
|
|
13
|
+
default: () => {};
|
|
14
|
+
};
|
|
15
|
+
requestParams: {
|
|
16
|
+
type: ObjectConstructor;
|
|
17
|
+
required: boolean;
|
|
18
|
+
default: () => {};
|
|
19
|
+
};
|
|
20
|
+
actionsHeader: {
|
|
21
|
+
type: (ObjectConstructor | BooleanConstructor)[];
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
extraHeaders: {
|
|
25
|
+
type: ArrayConstructor;
|
|
26
|
+
required: boolean;
|
|
27
|
+
default: () => never[];
|
|
28
|
+
};
|
|
29
|
+
loadConfiguration: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
hideAggregates: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
extraActions: {
|
|
38
|
+
type: ArrayConstructor;
|
|
39
|
+
default: () => never[];
|
|
40
|
+
};
|
|
41
|
+
hideTopActions: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
height: {
|
|
46
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
fill: {
|
|
50
|
+
type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
multiSort: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const datatableProps = {
|
|
2
|
+
resource: {
|
|
3
|
+
type: String,
|
|
4
|
+
required: true
|
|
5
|
+
},
|
|
6
|
+
addButton: {
|
|
7
|
+
type: [Boolean, String],
|
|
8
|
+
default: true
|
|
9
|
+
},
|
|
10
|
+
filters: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
requestParams: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: false,
|
|
17
|
+
default: () => ({})
|
|
18
|
+
},
|
|
19
|
+
actionsHeader: {
|
|
20
|
+
type: [Object, Boolean],
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
extraHeaders: {
|
|
24
|
+
type: Array,
|
|
25
|
+
required: false,
|
|
26
|
+
default: () => []
|
|
27
|
+
},
|
|
28
|
+
loadConfiguration: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "default"
|
|
31
|
+
},
|
|
32
|
+
hideAggregates: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
extraActions: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default: () => []
|
|
39
|
+
},
|
|
40
|
+
hideTopActions: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
height: {
|
|
45
|
+
type: [String, Number],
|
|
46
|
+
default: void 0
|
|
47
|
+
},
|
|
48
|
+
// fill mode: the card sizes itself to reach the bottom of the viewport —
|
|
49
|
+
// sticky header, only the rows scroll, footer always visible. It measures
|
|
50
|
+
// its own top offset, so it works at any nesting depth with NO layout CSS
|
|
51
|
+
// on the consumer side. Pass a number to set the bottom gap in px.
|
|
52
|
+
fill: {
|
|
53
|
+
type: [Boolean, Number, String],
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
multiSort: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
type FillTarget = HTMLElement | {
|
|
3
|
+
$el?: HTMLElement;
|
|
4
|
+
} | null | undefined;
|
|
5
|
+
export interface UseAutoFillHeightReturn {
|
|
6
|
+
/** the height as a CSS `calc(...)` string, or `undefined` while disabled */
|
|
7
|
+
height: Ref<string | undefined>;
|
|
8
|
+
/** force a re-measure (e.g. after a layout change the observers can't see) */
|
|
9
|
+
recompute: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Sizes an element so it fills from its own top down to the bottom of the page —
|
|
13
|
+
* to the top of a fixed bottom bar if there is one. It measures only the
|
|
14
|
+
* element's top offset (which already accounts for everything above it) and lets
|
|
15
|
+
* CSS do the rest: `100dvh` for the viewport and `--v-layout-bottom` (set by
|
|
16
|
+
* Vuetify) for the bottom bar reserve. Works at any nesting depth.
|
|
17
|
+
*
|
|
18
|
+
* Keep the fill container free of bottom padding (e.g. `pb-0` on the
|
|
19
|
+
* `v-container`) so nothing below the element adds a second scrollbar.
|
|
20
|
+
*
|
|
21
|
+
* It recomputes when the viewport is resized or when an ancestor's HEIGHT
|
|
22
|
+
* changes (width-only churn — window drag, sidebar toggle, responsive column
|
|
23
|
+
* widths — can't move the top, so it's ignored to stay off the reflow path).
|
|
24
|
+
*
|
|
25
|
+
* @param target the element (or a component exposing `$el`) to size
|
|
26
|
+
* @param enabled `false` disables; `true` enables with a 0px bottom gap; a
|
|
27
|
+
* number (or numeric string) enables with that bottom gap in px
|
|
28
|
+
* @returns `{ height, recompute }` — bind `height` to the element's `height`
|
|
29
|
+
*/
|
|
30
|
+
export declare function useAutoFillHeight(target: MaybeRefOrGetter<FillTarget>, enabled?: MaybeRefOrGetter<boolean | number | string>): UseAutoFillHeightReturn;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useEventListener, useResizeObserver } from "@vueuse/core";
|
|
2
|
+
import { nextTick, onMounted, ref, toValue, watch } from "vue";
|
|
3
|
+
export function useAutoFillHeight(target, enabled = true) {
|
|
4
|
+
const height = ref();
|
|
5
|
+
function resolveEl() {
|
|
6
|
+
const value = toValue(target);
|
|
7
|
+
if (!value) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
return value instanceof HTMLElement ? value : value.$el;
|
|
11
|
+
}
|
|
12
|
+
function recompute() {
|
|
13
|
+
const on = toValue(enabled);
|
|
14
|
+
if (on === false) {
|
|
15
|
+
height.value = void 0;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const el = resolveEl();
|
|
19
|
+
if (!el) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const top = Math.round(el.getBoundingClientRect().top);
|
|
23
|
+
const parsed = Number.parseFloat(String(on));
|
|
24
|
+
const gap = Number.isFinite(parsed) ? parsed : 0;
|
|
25
|
+
height.value = `calc(100dvh - ${top}px - var(--v-layout-bottom, 0px) - ${gap}px)`;
|
|
26
|
+
}
|
|
27
|
+
const ancestors = ref([]);
|
|
28
|
+
const lastHeights = /* @__PURE__ */ new WeakMap();
|
|
29
|
+
useResizeObserver(ancestors, (entries) => {
|
|
30
|
+
let heightChanged = false;
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
const entryHeight = entry.borderBoxSize?.[0]?.blockSize ?? entry.contentRect.height;
|
|
33
|
+
if (lastHeights.get(entry.target) !== entryHeight) {
|
|
34
|
+
lastHeights.set(entry.target, entryHeight);
|
|
35
|
+
heightChanged = true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (heightChanged) {
|
|
39
|
+
recompute();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
onMounted(() => nextTick(() => {
|
|
43
|
+
recompute();
|
|
44
|
+
const el = resolveEl();
|
|
45
|
+
if (!el) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const list = [];
|
|
49
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
50
|
+
list.push(node);
|
|
51
|
+
}
|
|
52
|
+
ancestors.value = list;
|
|
53
|
+
}));
|
|
54
|
+
watch(() => toValue(enabled), () => nextTick(recompute));
|
|
55
|
+
useEventListener("resize", recompute);
|
|
56
|
+
return { height, recompute };
|
|
57
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
interface UseDataTableOptions {
|
|
3
|
+
resource: Ref<string>;
|
|
4
|
+
filters: Ref<any>;
|
|
5
|
+
requestParams: Ref<any>;
|
|
6
|
+
loadConfiguration: Ref<'always' | 'default'>;
|
|
7
|
+
columns?: Ref<string[] | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useDataTable<T>(dtOptions: UseDataTableOptions): {
|
|
10
|
+
error: Ref<any, any>;
|
|
11
|
+
totalItems: Ref<number, number>;
|
|
12
|
+
aggregates: Ref<any, any>;
|
|
13
|
+
items: Ref<import("@vue/reactivity").UnwrapRefSimple<T>[], T[] | import("@vue/reactivity").UnwrapRefSimple<T>[]>;
|
|
14
|
+
headers: import("vue").ComputedRef<Header[]>;
|
|
15
|
+
pagination: import("vue").ComputedRef<any>;
|
|
16
|
+
actions: import("vue").ComputedRef<any>;
|
|
17
|
+
selectedItems: Ref<unknown[], unknown[]>;
|
|
18
|
+
loadingExecuteAction: Ref<boolean, boolean>;
|
|
19
|
+
clearSelection: () => void;
|
|
20
|
+
selectionKey: import("vue").ComputedRef<any>;
|
|
21
|
+
load: (options: any, reloadConfig?: boolean, keepSelection?: boolean) => Promise<{
|
|
22
|
+
data: Dt<any>;
|
|
23
|
+
meta: Dt<any>;
|
|
24
|
+
} | undefined>;
|
|
25
|
+
loading: Ref<boolean, boolean>;
|
|
26
|
+
reloadData: (reloadConfig?: boolean, keepSelection?: boolean) => void;
|
|
27
|
+
executeAction: (action: string, extraParams?: object, reset?: boolean, keepSelection?: boolean) => Promise<Dt<any>>;
|
|
28
|
+
availableFilters: import("vue").ComputedRef<Header[]>;
|
|
29
|
+
optionalHeaders: import("vue").ComputedRef<Header[]>;
|
|
30
|
+
visibleColumns: import("vue").ComputedRef<any[]>;
|
|
31
|
+
defaultColumns: import("vue").ComputedRef<any[]>;
|
|
32
|
+
};
|
|
33
|
+
export {};
|