@vueless/storybook 0.0.34 → 0.0.35
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.
|
@@ -79,18 +79,21 @@ function templateSourceCode(templateSource, args, argTypes) {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const slotTemplateCodeBefore =
|
|
83
83
|
// eslint-disable-next-line vue/max-len
|
|
84
|
-
`<template v-for="(slot, index) of slots" :key="index" v-slot:[slot]><template v-if="
|
|
85
|
-
|
|
84
|
+
`<template v-for="(slot, index) of slots" :key="index" v-slot:[slot]><template v-if="slot === 'default' && !args['defaultSlot']">`;
|
|
85
|
+
|
|
86
|
+
const slotTemplateCodeAfter =
|
|
87
|
+
// eslint-disable-next-line vue/max-len
|
|
88
|
+
`</template><template v-else-if="slot === 'default' && args['defaultSlot']">{{ args['defaultSlot'] }}</template><template v-else-if="args[slot + 'Slot']">{{ args[slot + 'Slot'] }}</template></template>`;
|
|
86
89
|
|
|
87
90
|
return templateSource
|
|
88
91
|
.replace(/>[\s]+</g, "><")
|
|
89
92
|
.trim()
|
|
90
|
-
.replace(
|
|
91
|
-
.replace(
|
|
93
|
+
.replace(slotTemplateCodeBefore, "")
|
|
94
|
+
.replace(slotTemplateCodeAfter, "")
|
|
92
95
|
.replace(
|
|
93
|
-
|
|
96
|
+
`v-model="args.${MODEL_VALUE_KEY}"`,
|
|
94
97
|
args[MODEL_VALUE_KEY] ? `v-model="${args[MODEL_VALUE_KEY]}"` : "",
|
|
95
98
|
)
|
|
96
99
|
.replace(
|
|
@@ -109,6 +112,8 @@ function propToSource(key, val) {
|
|
|
109
112
|
return val ? key : "";
|
|
110
113
|
case "string":
|
|
111
114
|
return `${key}="${val}"`;
|
|
115
|
+
case "object":
|
|
116
|
+
return `:${key}="${JSON.stringify(val)}"`;
|
|
112
117
|
default:
|
|
113
118
|
return `:${key}="${val}"`;
|
|
114
119
|
}
|
package/.storybook/main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @type { import('@storybook/vue3-vite').StorybookConfig } */
|
|
2
2
|
export default {
|
|
3
3
|
stories: [
|
|
4
|
-
"../node_modules/vueless
|
|
4
|
+
"../node_modules/vueless/**/*stories.@(js|jsx|ts|tsx)",
|
|
5
5
|
"../node_modules/vueless/**/*.@(mdx)",
|
|
6
|
-
"../src
|
|
6
|
+
"../src/**/*stories.@(js|jsx|ts|tsx)",
|
|
7
7
|
"../src/**/*.@(mdx)",
|
|
8
8
|
],
|
|
9
9
|
addons: [
|
package/.storybook/manager.js
CHANGED
package/.storybook/preview.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setup } from "@storybook/vue3";
|
|
2
2
|
|
|
3
|
-
import { backgrounds, docs, layout } from "./configs/main.config";
|
|
4
|
-
import { vue3SourceDecorator } from "./decorators/vue3SourceDecorator";
|
|
3
|
+
import { backgrounds, docs, layout } from "./configs/main.config.js";
|
|
4
|
+
import { vue3SourceDecorator } from "./decorators/vue3SourceDecorator.js";
|
|
5
5
|
|
|
6
6
|
// Vue plugins
|
|
7
7
|
import { createVueless } from "vueless";
|
|
@@ -9,7 +9,8 @@ export default create({
|
|
|
9
9
|
|
|
10
10
|
brandTitle: "Vueless UI",
|
|
11
11
|
brandUrl: "https://vueless.com",
|
|
12
|
-
brandImage:
|
|
12
|
+
brandImage:
|
|
13
|
+
"https://raw.githubusercontent.com/vuelessjs/vueless-storybook/main/public/images/logo.png",
|
|
13
14
|
brandTarget: "_blank",
|
|
14
15
|
|
|
15
16
|
// Main colors
|