@katlux/preset-modern 0.1.0-beta.4 → 0.1.0-beta.40
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/module.json +1 -1
- package/dist/module.mjs +19 -6
- package/dist/runtime/components/KTextbox/KTextbox.d.vue.ts +1 -0
- package/dist/runtime/components/KTextbox/KTextbox.vue +4 -2
- package/dist/runtime/components/KTextbox/KTextbox.vue.d.ts +1 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +21 -0
- package/package.json +2 -2
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, installModule, addComponentsDir } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir } from '@nuxt/kit';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
3
4
|
|
|
4
5
|
const module$1 = defineNuxtModule({
|
|
5
6
|
meta: {
|
|
@@ -10,8 +11,10 @@ const module$1 = defineNuxtModule({
|
|
|
10
11
|
const { resolve } = createResolver(import.meta.url);
|
|
11
12
|
const _require = createRequire(import.meta.url);
|
|
12
13
|
await installModule("@katlux/toolkit");
|
|
14
|
+
addPlugin(resolve("./runtime/plugin"));
|
|
13
15
|
addComponentsDir({
|
|
14
16
|
path: resolve("./runtime/components"),
|
|
17
|
+
prefix: "PresetModern",
|
|
15
18
|
pathPrefix: false,
|
|
16
19
|
extensions: ["vue"],
|
|
17
20
|
global: true
|
|
@@ -22,12 +25,22 @@ const module$1 = defineNuxtModule({
|
|
|
22
25
|
const currentAdditionalData = nuxt.options.vite.css.preprocessorOptions.scss.additionalData || "";
|
|
23
26
|
const toolkitPkgJson = _require.resolve("@katlux/toolkit/package.json");
|
|
24
27
|
const toolkitPkgDir = toolkitPkgJson.replace(/[\\/]package\.json$/, "");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
28
|
+
const toolkitRuntimeDir = nuxt.options.dev && existsSync(toolkitPkgDir + "/src/runtime") ? toolkitPkgDir + "/src/runtime" : toolkitPkgDir + "/dist/runtime";
|
|
29
|
+
const mixinsScssPath = toolkitRuntimeDir + "/presets/default/assets/scss/mixins.scss";
|
|
30
|
+
const mixinsCssPath = toolkitRuntimeDir + "/presets/default/assets/scss/mixins.css";
|
|
31
|
+
const toolkitMixinsPath = existsSync(mixinsScssPath) ? mixinsScssPath : mixinsCssPath;
|
|
32
|
+
const toolkitScss = `@use "${toolkitMixinsPath}" as *;`;
|
|
33
|
+
nuxt.hook("vite:extendConfig", (config) => {
|
|
34
|
+
const server = config.server || (config.server = {});
|
|
35
|
+
const fs = server.fs || (server.fs = {});
|
|
36
|
+
const allow = fs.allow || (fs.allow = []);
|
|
37
|
+
if (!allow.includes(toolkitRuntimeDir)) {
|
|
38
|
+
allow.push(toolkitRuntimeDir);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const presetScssPath = resolve("./runtime/assets/scss/index.scss");
|
|
42
|
+
nuxt.options.css.push(presetScssPath);
|
|
29
43
|
nuxt.options.vite.css.preprocessorOptions.scss.additionalData = `${toolkitScss}
|
|
30
|
-
${presetScssImport}
|
|
31
44
|
${currentAdditionalData}`;
|
|
32
45
|
}
|
|
33
46
|
});
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
showClearIcon: boolean;
|
|
4
4
|
clear: () => void;
|
|
5
5
|
placeholder: string;
|
|
6
|
+
type: string;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
9
|
"update:text": (value: string) => any;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
2
|
.KTextbox.modern-textbox
|
|
3
|
-
input(type="
|
|
3
|
+
input(:type="props.type" v-model="text" :placeholder="placeholder")
|
|
4
4
|
.clear-button(v-if="showClearIcon" @click="clear")
|
|
5
5
|
KIcon(iconname="close" width="16" height="16")
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script setup>
|
|
9
|
+
import { computed } from "vue";
|
|
9
10
|
const props = defineProps({
|
|
10
11
|
text: { type: String, required: true },
|
|
11
12
|
showClearIcon: { type: Boolean, required: true },
|
|
12
13
|
clear: { type: Function, required: true },
|
|
13
|
-
placeholder: { type: String, required: true }
|
|
14
|
+
placeholder: { type: String, required: true },
|
|
15
|
+
type: { type: String, required: true }
|
|
14
16
|
});
|
|
15
17
|
const emit = defineEmits(["update:text"]);
|
|
16
18
|
const text = computed({
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
showClearIcon: boolean;
|
|
4
4
|
clear: () => void;
|
|
5
5
|
placeholder: string;
|
|
6
|
+
type: string;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
8
9
|
"update:text": (value: string) => any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#app";
|
|
2
|
+
import { registerPresetComponents } from "#imports";
|
|
3
|
+
export default defineNuxtPlugin(() => {
|
|
4
|
+
const loaders = {
|
|
5
|
+
"./components/KBulkActions/KBulkActions.vue": () => import("./components/KBulkActions/KBulkActions.vue"),
|
|
6
|
+
"./components/KButton/KButton.vue": () => import("./components/KButton/KButton.vue"),
|
|
7
|
+
"./components/KCheckbox/KCheckbox.vue": () => import("./components/KCheckbox/KCheckbox.vue"),
|
|
8
|
+
"./components/KDatatable/KDatatable.vue": () => import("./components/KDatatable/KDatatable.vue"),
|
|
9
|
+
"./components/KMaskTextbox/KMaskTextbox.vue": () => import("./components/KMaskTextbox/KMaskTextbox.vue"),
|
|
10
|
+
"./components/KPagination/KPagination.vue": () => import("./components/KPagination/KPagination.vue"),
|
|
11
|
+
"./components/KRangeSlider/KRangeSlider.vue": () => import("./components/KRangeSlider/KRangeSlider.vue"),
|
|
12
|
+
"./components/KSlider/KSlider.vue": () => import("./components/KSlider/KSlider.vue"),
|
|
13
|
+
"./components/KTextarea/KTextarea.vue": () => import("./components/KTextarea/KTextarea.vue"),
|
|
14
|
+
"./components/KTextbox/KTextbox.vue": () => import("./components/KTextbox/KTextbox.vue")
|
|
15
|
+
};
|
|
16
|
+
if (typeof registerPresetComponents === "function") {
|
|
17
|
+
registerPresetComponents("modern", loaders);
|
|
18
|
+
} else {
|
|
19
|
+
console.warn("Katlux preset-modern: registerPresetComponents not found in imports. Ensure @katlux/toolkit is installed and loaded.");
|
|
20
|
+
}
|
|
21
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@katlux/preset-modern",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.40",
|
|
4
4
|
"description": "Modern default design preset and styling variables for Katlux components",
|
|
5
5
|
"author": "Katlux",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@katlux/toolkit": "*",
|
|
24
|
-
"@nuxt/kit": "^3.
|
|
24
|
+
"@nuxt/kit": "^3.12.0"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|