@volverjs/ui-vue 0.0.1 → 0.0.2
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/README.md +17 -0
- package/dist/components/VvButton/VvButton.es.js +159 -147
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +0 -8
- package/dist/components/VvButton/index.d.ts +4 -4
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +36 -37
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +10 -10
- package/dist/components/VvButtonGroup/index.d.ts +5 -5
- package/dist/components/VvCombobox/VvCombobox.es.js +526 -345
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +22 -0
- package/dist/components/VvCombobox/index.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +118 -109
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +19 -0
- package/dist/components/VvDropdown/index.d.ts +12 -0
- package/dist/components/VvInputText/VvInputText.es.js +221 -213
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +13 -13
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvSelect/VvSelect.es.js +186 -167
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +23 -11
- package/dist/components/VvSelect/index.d.ts +10 -17
- package/dist/components/VvTextarea/VvTextarea.es.js +112 -104
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +12 -12
- package/dist/components/VvTextarea/index.d.ts +5 -5
- package/dist/components/index.es.js +1045 -975
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/types/IButtonGroupState.d.ts +1 -1
- package/dist/composables/group/types/IGroupState.d.ts +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1065 -995
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +35 -4
- package/dist/resolvers/unplugin.es.js +26 -24
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/Button/Button.settings.d.ts +9 -11
- package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +9 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +19 -0
- package/dist/stories/Dropdown/Dropdown.settings.d.ts +10 -0
- package/dist/stories/InputText/InputText.settings.d.ts +23 -23
- package/dist/stories/Select/Select.settings.d.ts +42 -23
- package/dist/stories/Textarea/Textarea.settings.d.ts +23 -23
- package/dist/stories/argTypes.d.ts +50 -1
- package/package.json +5 -4
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvButton/index.ts +28 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -1
- package/src/components/VvButtonGroup/index.ts +3 -6
- package/src/components/VvCombobox/VvCombobox.vue +45 -11
- package/src/components/VvCombobox/index.ts +6 -0
- package/src/components/VvDropdown/VvDropdown.vue +9 -6
- package/src/components/VvDropdown/index.ts +11 -1
- package/src/components/VvInputText/VvInputText.vue +10 -8
- package/src/components/VvSelect/VvSelect.vue +23 -1
- package/src/components/VvSelect/index.ts +8 -11
- package/src/components/VvTextarea/VvTextarea.vue +10 -8
- package/src/composables/group/types/IButtonGroupState.ts +1 -1
- package/src/composables/group/types/IGroupState.ts +1 -1
- package/src/composables/group/useInjectedGroupState.ts +3 -3
- package/src/composables/useTextCount.ts +1 -1
- package/src/props/index.ts +33 -15
- package/src/resolvers/unplugin.ts +22 -13
- package/src/stories/Button/Button.settings.ts +2 -7
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +6 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +37 -0
- package/src/stories/ButtonGroup/ButtonGroupToggle.stories.mdx +12 -1
- package/src/stories/Combobox/Combobox.settings.ts +5 -0
- package/src/stories/Combobox/Combobox.stories.mdx +51 -0
- package/src/stories/Combobox/Combobox.test.ts +7 -0
- package/src/stories/Dropdown/Dropdown.settings.ts +10 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +17 -0
- package/src/stories/Select/Select.settings.ts +9 -23
- package/src/stories/Select/Select.stories.mdx +60 -0
- package/src/stories/argTypes.ts +46 -22
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isRef as y, provide as b, computed as d, unref as
|
|
1
|
+
import { isRef as y, provide as b, computed as d, unref as p, defineComponent as v, toRefs as A, watchEffect as V, openBlock as g, createElementBlock as B, normalizeClass as _, renderSlot as C } from "vue";
|
|
2
2
|
const k = "VV_BUTTON_GROUP";
|
|
3
3
|
function G(e) {
|
|
4
4
|
if (Object.keys(e).some(
|
|
5
|
-
(
|
|
5
|
+
(r) => r !== "key" && !y(e[r])
|
|
6
6
|
))
|
|
7
7
|
throw Error("One or more groupState props aren't ref.");
|
|
8
8
|
b(
|
|
@@ -11,26 +11,26 @@ function G(e) {
|
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
13
|
function c(e) {
|
|
14
|
-
var
|
|
14
|
+
var r, t;
|
|
15
15
|
if (e)
|
|
16
|
-
return (
|
|
16
|
+
return (t = (r = e.match(
|
|
17
17
|
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
|
|
18
|
-
)) == null ? void 0 :
|
|
18
|
+
)) == null ? void 0 : r.join("-")) == null ? void 0 : t.toLowerCase();
|
|
19
19
|
}
|
|
20
|
-
function O(e,
|
|
21
|
-
const
|
|
20
|
+
function O(e, r) {
|
|
21
|
+
const t = { [`${e}`]: !0 };
|
|
22
22
|
return {
|
|
23
|
-
bemCssClasses: d(() => Object.keys(
|
|
24
|
-
const o =
|
|
23
|
+
bemCssClasses: d(() => Object.keys(r).reduce((l, a) => {
|
|
24
|
+
const o = p(r[a]) || !1;
|
|
25
25
|
if (!o)
|
|
26
26
|
return l;
|
|
27
27
|
if (a === "modifiers") {
|
|
28
|
-
const
|
|
28
|
+
const n = Array.isArray(o) ? o : o.split(" ");
|
|
29
29
|
return {
|
|
30
30
|
...l,
|
|
31
|
-
...
|
|
32
|
-
(
|
|
33
|
-
...
|
|
31
|
+
...n.reduce(
|
|
32
|
+
(u, i) => ({
|
|
33
|
+
...u,
|
|
34
34
|
[`${e}--${c(i)}`]: !0
|
|
35
35
|
}),
|
|
36
36
|
{}
|
|
@@ -41,7 +41,7 @@ function O(e, t) {
|
|
|
41
41
|
...l,
|
|
42
42
|
[`${e}--${c(a)}`]: o
|
|
43
43
|
};
|
|
44
|
-
},
|
|
44
|
+
}, t) || {})
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const P = {
|
|
@@ -49,39 +49,38 @@ const P = {
|
|
|
49
49
|
}, $ = {
|
|
50
50
|
modifiers: [String, Array]
|
|
51
51
|
}, M = {
|
|
52
|
+
unselectable: { type: Boolean, default: !0 }
|
|
53
|
+
}, S = {
|
|
52
54
|
...$,
|
|
53
55
|
...P,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
default: ""
|
|
57
|
-
},
|
|
56
|
+
...M,
|
|
57
|
+
itemModifiers: { type: [String, Array], default: void 0 },
|
|
58
58
|
toggle: { type: Boolean, default: !1 },
|
|
59
59
|
multiple: { type: Boolean, default: !1 },
|
|
60
|
-
unselectable: { type: Boolean, default: !0 },
|
|
61
60
|
modelValue: { type: [String, Array], default: void 0 }
|
|
62
|
-
},
|
|
61
|
+
}, U = ["update:modelValue"], h = {
|
|
63
62
|
name: "VvButtonGroup"
|
|
64
|
-
},
|
|
63
|
+
}, Z = /* @__PURE__ */ v({
|
|
65
64
|
...h,
|
|
66
|
-
props:
|
|
67
|
-
emits:
|
|
68
|
-
setup(e, { emit:
|
|
69
|
-
const
|
|
65
|
+
props: S,
|
|
66
|
+
emits: U,
|
|
67
|
+
setup(e, { emit: r }) {
|
|
68
|
+
const t = e, {
|
|
70
69
|
disabled: f,
|
|
71
70
|
toggle: l,
|
|
72
71
|
modifiers: a,
|
|
73
72
|
multiple: o,
|
|
74
|
-
unselectable:
|
|
75
|
-
itemModifiers:
|
|
76
|
-
} =
|
|
77
|
-
|
|
78
|
-
typeof
|
|
73
|
+
unselectable: n,
|
|
74
|
+
itemModifiers: u
|
|
75
|
+
} = A(t);
|
|
76
|
+
V(() => {
|
|
77
|
+
typeof t.modelValue == "string" && o.value && console.warn(
|
|
79
78
|
"[VvButtonGroup]: modelValue is a string but multiple is true."
|
|
80
79
|
);
|
|
81
80
|
});
|
|
82
81
|
const i = d({
|
|
83
|
-
get: () => o.value ?
|
|
84
|
-
set: (s) => (s !== void 0 && (Array.isArray(
|
|
82
|
+
get: () => o.value ? t.modelValue : Array.isArray(t.modelValue) ? t.modelValue[0] : t.modelValue,
|
|
83
|
+
set: (s) => (s !== void 0 && (Array.isArray(t.modelValue) || o.value) && !Array.isArray(s) && (s = [s]), r("update:modelValue", s))
|
|
85
84
|
});
|
|
86
85
|
G({
|
|
87
86
|
key: k,
|
|
@@ -89,14 +88,14 @@ const P = {
|
|
|
89
88
|
disabled: f,
|
|
90
89
|
toggle: l,
|
|
91
90
|
multiple: o,
|
|
92
|
-
unselectable:
|
|
93
|
-
|
|
91
|
+
unselectable: n,
|
|
92
|
+
itemModifiers: u
|
|
94
93
|
});
|
|
95
|
-
const { bemCssClasses:
|
|
94
|
+
const { bemCssClasses: m } = O("vv-button-group", {
|
|
96
95
|
modifiers: a
|
|
97
96
|
});
|
|
98
97
|
return (s, R) => (g(), B("div", {
|
|
99
|
-
class: _(m
|
|
98
|
+
class: _(p(m)),
|
|
100
99
|
role: "group"
|
|
101
100
|
}, [
|
|
102
101
|
C(s.$slots, "default")
|
|
@@ -104,5 +103,5 @@ const P = {
|
|
|
104
103
|
}
|
|
105
104
|
});
|
|
106
105
|
export {
|
|
107
|
-
|
|
106
|
+
Z as default
|
|
108
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButtonGroup=i(e.vue))})(this,function(e){"use strict";const i="VV_BUTTON_GROUP";function m(t){if(Object.keys(t).some(r=>r!=="key"&&!e.isRef(t[r])))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed(()=>t))}function p(t){var r,o;if(t)return(o=(r=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:r.join("-"))==null?void 0:o.toLowerCase()}function y(t,r){const o={[`${t}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((u
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.VvButtonGroup=i(e.vue))})(this,function(e){"use strict";const i="VV_BUTTON_GROUP";function m(t){if(Object.keys(t).some(r=>r!=="key"&&!e.isRef(t[r])))throw Error("One or more groupState props aren't ref.");e.provide(t.key,e.computed(()=>t))}function p(t){var r,o;if(t)return(o=(r=t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:r.join("-"))==null?void 0:o.toLowerCase()}function y(t,r){const o={[`${t}`]:!0};return{bemCssClasses:e.computed(()=>Object.keys(r).reduce((l,u)=>{const s=e.unref(r[u])||!1;if(!s)return l;if(u==="modifiers"){const a=Array.isArray(s)?s:s.split(" ");return{...l,...a.reduce((d,f)=>({...d,[`${t}--${p(f)}`]:!0}),{})}}else return{...l,[`${t}--${p(u)}`]:s}},o)||{})}}const b={...{modifiers:[String,Array]},...{disabled:Boolean},...{unselectable:{type:Boolean,default:!0}},itemModifiers:{type:[String,Array],default:void 0},toggle:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},modelValue:{type:[String,Array],default:void 0}},V=["update:modelValue"],A={name:"VvButtonGroup"};return e.defineComponent({...A,props:b,emits:V,setup(t,{emit:r}){const o=t,{disabled:c,toggle:l,modifiers:u,multiple:s,unselectable:a,itemModifiers:d}=e.toRefs(o);e.watchEffect(()=>{typeof o.modelValue=="string"&&s.value&&console.warn("[VvButtonGroup]: modelValue is a string but multiple is true.")});const f=e.computed({get:()=>s.value?o.modelValue:Array.isArray(o.modelValue)?o.modelValue[0]:o.modelValue,set:n=>(n!==void 0&&(Array.isArray(o.modelValue)||s.value)&&!Array.isArray(n)&&(n=[n]),r("update:modelValue",n))});m({key:i,modelValue:f,disabled:c,toggle:l,multiple:s,unselectable:a,itemModifiers:d});const{bemCssClasses:_}=y("vv-button-group",{modifiers:u});return(n,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_)),role:"group"},[e.renderSlot(n.$slots,"default")],2))}})});
|
|
@@ -14,7 +14,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
of<T_4>(...items: T_4[]): T_4[];
|
|
15
15
|
readonly [Symbol.species]: ArrayConstructor;
|
|
16
16
|
})[];
|
|
17
|
-
default:
|
|
17
|
+
default: undefined;
|
|
18
18
|
};
|
|
19
19
|
toggle: {
|
|
20
20
|
type: BooleanConstructor;
|
|
@@ -24,10 +24,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
24
24
|
type: BooleanConstructor;
|
|
25
25
|
default: boolean;
|
|
26
26
|
};
|
|
27
|
-
unselectable: {
|
|
28
|
-
type: BooleanConstructor;
|
|
29
|
-
default: boolean;
|
|
30
|
-
};
|
|
31
27
|
modelValue: {
|
|
32
28
|
type: (StringConstructor | {
|
|
33
29
|
(arrayLength: number): string[];
|
|
@@ -45,6 +41,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
45
41
|
})[];
|
|
46
42
|
default: undefined;
|
|
47
43
|
};
|
|
44
|
+
unselectable: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
48
|
disabled: BooleanConstructor;
|
|
49
49
|
modifiers: import("vue").PropType<string | string[]>;
|
|
50
50
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -63,7 +63,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
63
63
|
of<T_4>(...items: T_4[]): T_4[];
|
|
64
64
|
readonly [Symbol.species]: ArrayConstructor;
|
|
65
65
|
})[];
|
|
66
|
-
default:
|
|
66
|
+
default: undefined;
|
|
67
67
|
};
|
|
68
68
|
toggle: {
|
|
69
69
|
type: BooleanConstructor;
|
|
@@ -73,10 +73,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
73
73
|
type: BooleanConstructor;
|
|
74
74
|
default: boolean;
|
|
75
75
|
};
|
|
76
|
-
unselectable: {
|
|
77
|
-
type: BooleanConstructor;
|
|
78
|
-
default: boolean;
|
|
79
|
-
};
|
|
80
76
|
modelValue: {
|
|
81
77
|
type: (StringConstructor | {
|
|
82
78
|
(arrayLength: number): string[];
|
|
@@ -94,6 +90,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
94
90
|
})[];
|
|
95
91
|
default: undefined;
|
|
96
92
|
};
|
|
93
|
+
unselectable: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
97
97
|
disabled: BooleanConstructor;
|
|
98
98
|
modifiers: import("vue").PropType<string | string[]>;
|
|
99
99
|
}>> & {
|
|
@@ -17,7 +17,7 @@ export declare const VvButtonGroupProps: {
|
|
|
17
17
|
of<T_4>(...items: T_4[]): T_4[];
|
|
18
18
|
readonly [Symbol.species]: ArrayConstructor;
|
|
19
19
|
})[];
|
|
20
|
-
default:
|
|
20
|
+
default: undefined;
|
|
21
21
|
};
|
|
22
22
|
toggle: {
|
|
23
23
|
type: BooleanConstructor;
|
|
@@ -27,10 +27,6 @@ export declare const VvButtonGroupProps: {
|
|
|
27
27
|
type: BooleanConstructor;
|
|
28
28
|
default: boolean;
|
|
29
29
|
};
|
|
30
|
-
unselectable: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
default: boolean;
|
|
33
|
-
};
|
|
34
30
|
modelValue: {
|
|
35
31
|
type: (StringConstructor | {
|
|
36
32
|
(arrayLength: number): string[];
|
|
@@ -48,6 +44,10 @@ export declare const VvButtonGroupProps: {
|
|
|
48
44
|
})[];
|
|
49
45
|
default: undefined;
|
|
50
46
|
};
|
|
47
|
+
unselectable: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
51
|
disabled: BooleanConstructor;
|
|
52
52
|
modifiers: import("vue").PropType<string | string[]>;
|
|
53
53
|
};
|