vueless 0.0.177 → 0.0.178
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/package.json +1 -1
- package/ui.button/index.stories.js +20 -10
- package/ui.button/index.vue +27 -6
- package/web-types.json +21 -3
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const DefaultTemplate = (args) => ({
|
|
24
|
-
components: { UButton },
|
|
24
|
+
components: { UButton, UIcon },
|
|
25
25
|
setup() {
|
|
26
26
|
const slots = getSlotNames(UButton.name);
|
|
27
27
|
|
|
@@ -43,7 +43,7 @@ const SlotTemplate = (args) => ({
|
|
|
43
43
|
},
|
|
44
44
|
template: `
|
|
45
45
|
<UButton v-bind="args">
|
|
46
|
-
${args.slotTemplate}
|
|
46
|
+
${args.slotTemplate || ""}
|
|
47
47
|
</UButton>
|
|
48
48
|
`,
|
|
49
49
|
});
|
|
@@ -133,6 +133,16 @@ disabled.args = { disabled: true };
|
|
|
133
133
|
export const colors = ColorTemplate.bind({});
|
|
134
134
|
colors.args = {};
|
|
135
135
|
|
|
136
|
+
export const iconLeft = DefaultTemplate.bind({});
|
|
137
|
+
iconLeft.args = {
|
|
138
|
+
iconLeft: "star",
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const iconRight = DefaultTemplate.bind({});
|
|
142
|
+
iconRight.args = {
|
|
143
|
+
iconRight: "star",
|
|
144
|
+
};
|
|
145
|
+
|
|
136
146
|
export const slotDefault = SlotTemplate.bind({});
|
|
137
147
|
slotDefault.args = {
|
|
138
148
|
slotTemplate: `
|
|
@@ -142,26 +152,26 @@ slotDefault.args = {
|
|
|
142
152
|
`,
|
|
143
153
|
};
|
|
144
154
|
|
|
145
|
-
export const
|
|
146
|
-
|
|
155
|
+
export const iconLeftSlot = SlotTemplate.bind({});
|
|
156
|
+
iconLeftSlot.args = {
|
|
147
157
|
slotTemplate: `
|
|
148
158
|
<template #left>
|
|
149
159
|
<UIcon
|
|
150
160
|
name="star"
|
|
151
|
-
color="
|
|
152
|
-
|
|
161
|
+
color="green"
|
|
162
|
+
/>
|
|
153
163
|
</template>
|
|
154
164
|
`,
|
|
155
165
|
};
|
|
156
166
|
|
|
157
|
-
export const
|
|
158
|
-
|
|
167
|
+
export const iconRightSlot = SlotTemplate.bind({});
|
|
168
|
+
iconRightSlot.args = {
|
|
159
169
|
slotTemplate: `
|
|
160
170
|
<template #right>
|
|
161
171
|
<UIcon
|
|
162
172
|
name="star"
|
|
163
|
-
color="
|
|
164
|
-
|
|
173
|
+
color="green"
|
|
174
|
+
/>
|
|
165
175
|
</template>
|
|
166
176
|
`,
|
|
167
177
|
};
|
package/ui.button/index.vue
CHANGED
|
@@ -11,19 +11,23 @@
|
|
|
11
11
|
<template v-if="loading">
|
|
12
12
|
<!-- Label is needed to prevent changing button height -->
|
|
13
13
|
<div v-bind="textAttrs" tabindex="-1" class="invisible w-0" v-text="label" />
|
|
14
|
-
<ULoader :size="loaderSize" :color="
|
|
14
|
+
<ULoader :size="loaderSize" :color="componentColor" v-bind="loaderAttrs" />
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<template v-else>
|
|
18
|
-
<!-- @slot Use it to add
|
|
19
|
-
<slot name="left"
|
|
18
|
+
<!-- @slot Use it to add icon before text. -->
|
|
19
|
+
<slot name="left">
|
|
20
|
+
<UIcon v-if="iconLeft" :name="iconLeft" :color="componentColor" />
|
|
21
|
+
</slot>
|
|
20
22
|
|
|
21
23
|
<!-- @slot Use it to add something instead of text. -->
|
|
22
24
|
<slot />
|
|
23
25
|
<div v-if="label" v-bind="textAttrs" tabindex="-1" v-text="label" />
|
|
24
26
|
|
|
25
|
-
<!-- @slot Use it to add
|
|
26
|
-
<slot name="right"
|
|
27
|
+
<!-- @slot Use it to add icon after text. -->
|
|
28
|
+
<slot name="right">
|
|
29
|
+
<UIcon v-if="iconRight" :name="iconRight" :color="componentColor" />
|
|
30
|
+
</slot>
|
|
27
31
|
</template>
|
|
28
32
|
</component>
|
|
29
33
|
</template>
|
|
@@ -33,6 +37,7 @@ import { computed, ref } from "vue";
|
|
|
33
37
|
|
|
34
38
|
import UIService, { getRandomId } from "../service.ui";
|
|
35
39
|
import ULoader from "../ui.loader";
|
|
40
|
+
import UIcon from "../ui.image-icon";
|
|
36
41
|
|
|
37
42
|
import defaultConfig from "./configs/default.config";
|
|
38
43
|
import { useAttrs } from "./composables/attrs.composable";
|
|
@@ -157,6 +162,22 @@ const props = defineProps({
|
|
|
157
162
|
type: String,
|
|
158
163
|
default: "",
|
|
159
164
|
},
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Left side icon name.
|
|
168
|
+
*/
|
|
169
|
+
iconLeft: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: "",
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Right side icon name.
|
|
176
|
+
*/
|
|
177
|
+
iconRight: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: "",
|
|
180
|
+
},
|
|
160
181
|
});
|
|
161
182
|
|
|
162
183
|
const emit = defineEmits(["click"]);
|
|
@@ -180,7 +201,7 @@ const loaderSize = computed(() => {
|
|
|
180
201
|
return sizes[props.size];
|
|
181
202
|
});
|
|
182
203
|
|
|
183
|
-
const
|
|
204
|
+
const componentColor = computed(() => {
|
|
184
205
|
return props.variant === "primary" ? "white" : props.color;
|
|
185
206
|
});
|
|
186
207
|
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.178",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -806,6 +806,24 @@
|
|
|
806
806
|
"type": "string"
|
|
807
807
|
},
|
|
808
808
|
"default": "\"\""
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"name": "iconLeft",
|
|
812
|
+
"description": "Left side icon name.",
|
|
813
|
+
"value": {
|
|
814
|
+
"kind": "expression",
|
|
815
|
+
"type": "string"
|
|
816
|
+
},
|
|
817
|
+
"default": "\"\""
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"name": "iconRight",
|
|
821
|
+
"description": "Right side icon name.",
|
|
822
|
+
"value": {
|
|
823
|
+
"kind": "expression",
|
|
824
|
+
"type": "string"
|
|
825
|
+
},
|
|
826
|
+
"default": "\"\""
|
|
809
827
|
}
|
|
810
828
|
],
|
|
811
829
|
"events": [
|
|
@@ -816,7 +834,7 @@
|
|
|
816
834
|
"slots": [
|
|
817
835
|
{
|
|
818
836
|
"name": "left",
|
|
819
|
-
"description": "Use it to add
|
|
837
|
+
"description": "Use it to add icon before text."
|
|
820
838
|
},
|
|
821
839
|
{
|
|
822
840
|
"name": "default",
|
|
@@ -824,7 +842,7 @@
|
|
|
824
842
|
},
|
|
825
843
|
{
|
|
826
844
|
"name": "right",
|
|
827
|
-
"description": "Use it to add
|
|
845
|
+
"description": "Use it to add icon after text."
|
|
828
846
|
}
|
|
829
847
|
],
|
|
830
848
|
"source": {
|