@volverjs/ui-vue 0.0.11 → 0.0.13-beta.1
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/bin/icons.js +1 -93
- package/dist/components/VvAccordion/VvAccordion.es.js +1 -366
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +7 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +5 -2
- package/dist/components/VvAction/VvAction.es.js +1 -302
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +3 -2
- package/dist/components/VvAlert/VvAlert.es.js +1 -527
- package/dist/components/VvAlert/VvAlert.vue.d.ts +3 -2
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +2 -2
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +1 -131
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +2 -2
- package/dist/components/VvButton/VvButton.es.js +1 -882
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +3 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvCard/VvCard.es.js +1 -152
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
- package/dist/components/VvCombobox/VvCombobox.es.js +1 -3463
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +16 -7
- package/dist/components/VvDialog/VvDialog.es.js +1 -317
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -2
- package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +14 -2
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +11 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +1 -149
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +1 -104
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -281
- package/dist/components/VvIcon/VvIcon.es.js +1 -143
- package/dist/components/VvIcon/VvIcon.vue.d.ts +2 -2
- package/dist/components/VvInputFile/VvInputFile.es.js +1 -1704
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +34 -4
- package/dist/components/VvInputFile/index.d.ts +7 -0
- package/dist/components/VvInputText/VvInputText.es.js +4 -2790
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +8 -3
- package/dist/components/VvNav/VvNav.es.js +1 -438
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +2 -2
- package/dist/components/VvNav/VvNavItem.vue.d.ts +2 -2
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +1 -24
- package/dist/components/VvProgress/VvProgress.es.js +1 -163
- package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
- package/dist/components/VvRadio/VvRadio.es.js +1 -661
- package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
- package/dist/components/VvSelect/VvSelect.es.js +1 -1103
- package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -7
- package/dist/components/VvTab/VvTab.es.js +1 -558
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +2 -2
- package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
- package/dist/components/index.es.js +6 -8558
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +2 -247
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.es.js +2 -311
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +2 -142
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -172
- package/dist/icons.es.js +1 -39
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1 -219
- package/dist/props/index.d.ts +7 -0
- package/dist/resolvers/unplugin.es.js +1 -187
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +2 -2
- package/dist/stories/Avatar/Avatar.settings.d.ts +1 -1
- package/package.json +47 -40
package/dist/index.es.js
CHANGED
|
@@ -1,219 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref } from "vue";
|
|
3
|
-
const SPLIT_LOWER_UPPER_RE = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu");
|
|
4
|
-
const SPLIT_UPPER_UPPER_RE = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
|
|
5
|
-
const SPLIT_SEPARATE_NUMBER_RE = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u");
|
|
6
|
-
const DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
7
|
-
const SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
8
|
-
const DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
|
|
9
|
-
function split(value) {
|
|
10
|
-
let result = value.trim();
|
|
11
|
-
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
12
|
-
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
13
|
-
let start = 0;
|
|
14
|
-
let end = result.length;
|
|
15
|
-
while (result.charAt(start) === "\0")
|
|
16
|
-
start++;
|
|
17
|
-
if (start === end)
|
|
18
|
-
return [];
|
|
19
|
-
while (result.charAt(end - 1) === "\0")
|
|
20
|
-
end--;
|
|
21
|
-
return result.slice(start, end).split(/\0/g);
|
|
22
|
-
}
|
|
23
|
-
function splitSeparateNumbers(value) {
|
|
24
|
-
const words = split(value);
|
|
25
|
-
for (let i = 0; i < words.length; i++) {
|
|
26
|
-
const word = words[i];
|
|
27
|
-
const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
|
|
28
|
-
if (match) {
|
|
29
|
-
const offset = match.index + (match[1] ?? match[2]).length;
|
|
30
|
-
words.splice(i, 1, word.slice(0, offset), word.slice(offset));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return words;
|
|
34
|
-
}
|
|
35
|
-
function noCase(input, options) {
|
|
36
|
-
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
|
|
37
|
-
return prefix + words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? " ") + suffix;
|
|
38
|
-
}
|
|
39
|
-
function kebabCase(input, options) {
|
|
40
|
-
return noCase(input, { delimiter: "-", ...options });
|
|
41
|
-
}
|
|
42
|
-
function lowerFactory(locale) {
|
|
43
|
-
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
|
|
44
|
-
}
|
|
45
|
-
function splitPrefixSuffix(input, options = {}) {
|
|
46
|
-
const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);
|
|
47
|
-
const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
48
|
-
const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
49
|
-
let prefixIndex = 0;
|
|
50
|
-
let suffixIndex = input.length;
|
|
51
|
-
while (prefixIndex < input.length) {
|
|
52
|
-
const char = input.charAt(prefixIndex);
|
|
53
|
-
if (!prefixCharacters.includes(char))
|
|
54
|
-
break;
|
|
55
|
-
prefixIndex++;
|
|
56
|
-
}
|
|
57
|
-
while (suffixIndex > prefixIndex) {
|
|
58
|
-
const index = suffixIndex - 1;
|
|
59
|
-
const char = input.charAt(index);
|
|
60
|
-
if (!suffixCharacters.includes(char))
|
|
61
|
-
break;
|
|
62
|
-
suffixIndex = index;
|
|
63
|
-
}
|
|
64
|
-
return [
|
|
65
|
-
input.slice(0, prefixIndex),
|
|
66
|
-
splitFn(input.slice(prefixIndex, suffixIndex)),
|
|
67
|
-
input.slice(suffixIndex)
|
|
68
|
-
];
|
|
69
|
-
}
|
|
70
|
-
const DEFAULT_ICONIFY_PROVIDER = "vv";
|
|
71
|
-
const INJECTION_KEY_VOLVER = Symbol.for("volver");
|
|
72
|
-
function useDefaultProps(component, defaults, name) {
|
|
73
|
-
const componentName = name || component.name;
|
|
74
|
-
if (!componentName) {
|
|
75
|
-
return component;
|
|
76
|
-
}
|
|
77
|
-
const componentDefaults = defaults?.[componentName];
|
|
78
|
-
const props = component.props;
|
|
79
|
-
if (!componentDefaults || !props) {
|
|
80
|
-
return { ...component, name: componentName };
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
...component,
|
|
84
|
-
name: componentName,
|
|
85
|
-
props: Object.keys(props).reduce(
|
|
86
|
-
(acc, key) => {
|
|
87
|
-
if (!(key in componentDefaults)) {
|
|
88
|
-
acc[key] = props[key];
|
|
89
|
-
return acc;
|
|
90
|
-
}
|
|
91
|
-
const customDefault = componentDefaults[key];
|
|
92
|
-
if (typeof props[key] === "function" || Array.isArray(props[key])) {
|
|
93
|
-
acc[key] = {
|
|
94
|
-
type: props[key],
|
|
95
|
-
default: customDefault
|
|
96
|
-
};
|
|
97
|
-
return acc;
|
|
98
|
-
}
|
|
99
|
-
acc[key] = {
|
|
100
|
-
...props[key],
|
|
101
|
-
default: customDefault
|
|
102
|
-
};
|
|
103
|
-
return acc;
|
|
104
|
-
},
|
|
105
|
-
{}
|
|
106
|
-
)
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
class Volver {
|
|
110
|
-
_fetchOptions = {};
|
|
111
|
-
_iconsCollections = [];
|
|
112
|
-
_iconsProvider = DEFAULT_ICONIFY_PROVIDER;
|
|
113
|
-
_nuxt = false;
|
|
114
|
-
_experimentalFeatures = {};
|
|
115
|
-
defaults = ref({});
|
|
116
|
-
constructor({
|
|
117
|
-
fetchWithCredentials,
|
|
118
|
-
fetchOptions,
|
|
119
|
-
iconsProvider,
|
|
120
|
-
nuxt,
|
|
121
|
-
iconsCollections,
|
|
122
|
-
defaults,
|
|
123
|
-
experimentalFeatures
|
|
124
|
-
} = {}) {
|
|
125
|
-
if (fetchOptions) {
|
|
126
|
-
this._fetchOptions = fetchOptions;
|
|
127
|
-
}
|
|
128
|
-
if (fetchWithCredentials) {
|
|
129
|
-
this._fetchOptions = {
|
|
130
|
-
...this._fetchOptions,
|
|
131
|
-
credentials: "include"
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
if (iconsProvider) {
|
|
135
|
-
this._iconsProvider = iconsProvider;
|
|
136
|
-
}
|
|
137
|
-
if (nuxt) {
|
|
138
|
-
this._nuxt = nuxt;
|
|
139
|
-
}
|
|
140
|
-
if (iconsCollections && Array.isArray(iconsCollections)) {
|
|
141
|
-
iconsCollections.forEach((iconsCollection) => {
|
|
142
|
-
this.addCollection(iconsCollection, this._iconsProvider);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
if (defaults) {
|
|
146
|
-
this.defaults.value = defaults;
|
|
147
|
-
}
|
|
148
|
-
if (experimentalFeatures) {
|
|
149
|
-
this._experimentalFeatures = experimentalFeatures;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
get nuxt() {
|
|
153
|
-
return this._nuxt;
|
|
154
|
-
}
|
|
155
|
-
get iconsProvider() {
|
|
156
|
-
return this._iconsProvider;
|
|
157
|
-
}
|
|
158
|
-
get iconsCollections() {
|
|
159
|
-
return this._iconsCollections;
|
|
160
|
-
}
|
|
161
|
-
get experimentalFeatures() {
|
|
162
|
-
return this._experimentalFeatures;
|
|
163
|
-
}
|
|
164
|
-
addCollection(collection, providerName = this._iconsProvider) {
|
|
165
|
-
this._iconsCollections.push(collection);
|
|
166
|
-
return addCollection(collection, providerName);
|
|
167
|
-
}
|
|
168
|
-
addIcon(name, data) {
|
|
169
|
-
return addIcon(name, data);
|
|
170
|
-
}
|
|
171
|
-
addIconsAPIProvider(provider, customConfig) {
|
|
172
|
-
return addAPIProvider(provider, customConfig);
|
|
173
|
-
}
|
|
174
|
-
fetchIcon(src, options = { cache: "force-cache" }) {
|
|
175
|
-
return new Promise((resolve, reject) => {
|
|
176
|
-
fetch(src, { ...this._fetchOptions, ...options }).catch((e) => reject(e)).then((response) => response?.text()).then((svg) => resolve(svg));
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
const VolverPlugin = {
|
|
181
|
-
/**
|
|
182
|
-
* Vue.use() hook
|
|
183
|
-
* @param {App} app
|
|
184
|
-
* @param {object} options
|
|
185
|
-
*/
|
|
186
|
-
install(app, options = {}) {
|
|
187
|
-
const volver = new Volver(options);
|
|
188
|
-
app.config.globalProperties.$vv = volver;
|
|
189
|
-
if (options.components) {
|
|
190
|
-
Object.entries(options.components).forEach(([name, component]) => {
|
|
191
|
-
app.component(
|
|
192
|
-
name,
|
|
193
|
-
useDefaultProps(component, options.defaults)
|
|
194
|
-
);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
if (options.aliases) {
|
|
198
|
-
Object.entries(options.aliases).forEach(([name, component]) => {
|
|
199
|
-
app.component(
|
|
200
|
-
name,
|
|
201
|
-
useDefaultProps(component, options.defaults, name)
|
|
202
|
-
);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
if (options.directives) {
|
|
206
|
-
Object.entries(options.directives).forEach(([name, directive]) => {
|
|
207
|
-
const kebabName = kebabCase(name);
|
|
208
|
-
if (kebabName.startsWith("v-")) {
|
|
209
|
-
name = kebabName.substring(2).toLocaleLowerCase();
|
|
210
|
-
}
|
|
211
|
-
app.directive(name, directive);
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
app.provide(INJECTION_KEY_VOLVER, volver);
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
export {
|
|
218
|
-
VolverPlugin
|
|
219
|
-
};
|
|
1
|
+
import{addCollection as e,addIcon as t,addAPIProvider as r}from"@iconify/vue";import{ref as n}from"vue";const i=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),s=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),o=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),c=/[^\p{L}\d]+/giu,l="$1\0$2";function a(e){let t=e.trim();t=t.replace(i,l).replace(s,l),t=t.replace(c,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function u(e){const t=a(e);for(let r=0;r<t.length;r++){const e=t[r],n=o.exec(e);if(n){const i=n.index+(n[1]??n[2]).length;t.splice(r,1,e.slice(0,i),e.slice(i))}}return t}function f(e,t){const[r,n,i]=function(e,t={}){const r=t.split??(t.separateNumbers?u:a),n=t.prefixCharacters??"",i=t.suffixCharacters??"";let s=0,o=e.length;for(;s<e.length;){const t=e.charAt(s);if(!n.includes(t))break;s++}for(;o>s;){const t=o-1,r=e.charAt(t);if(!i.includes(r))break;o=t}return[e.slice(0,s),r(e.slice(s,o)),e.slice(o)]}(e,t);return r+n.map((s=t?.locale,!1===s?e=>e.toLowerCase():e=>e.toLocaleLowerCase(s))).join(t?.delimiter??" ")+i;var s}const h=/* @__PURE__ */Symbol.for("volver");function p(e,t,r){const n=r||e.name;if(!n)return e;const i=t?.[n],s=e.props;return i&&s?{...e,name:n,props:Object.keys(s).reduce((e,t)=>{if(!(t in i))return e[t]=s[t],e;const r=i[t];return"function"==typeof s[t]||Array.isArray(s[t])?(e[t]={type:s[t],default:r},e):(e[t]={...s[t],default:r},e)},{})}:{...e,name:n}}class d{_fetchOptions={};_iconsCollections=[];_iconsProvider="vv";_nuxt=!1;_experimentalFeatures={};defaults=n({});constructor({fetchWithCredentials:e,fetchOptions:t,iconsProvider:r,nuxt:n,iconsCollections:i,defaults:s,experimentalFeatures:o}={}){t&&(this._fetchOptions=t),e&&(this._fetchOptions={...this._fetchOptions,credentials:"include"}),r&&(this._iconsProvider=r),n&&(this._nuxt=n),i&&Array.isArray(i)&&i.forEach(e=>{this.addCollection(e,this._iconsProvider)}),s&&(this.defaults.value=s),o&&(this._experimentalFeatures=o)}get nuxt(){return this._nuxt}get iconsProvider(){return this._iconsProvider}get iconsCollections(){return this._iconsCollections}get experimentalFeatures(){return this._experimentalFeatures}addCollection(t,r=this._iconsProvider){return this._iconsCollections.push(t),e(t,r)}addIcon(e,r){return t(e,r)}addIconsAPIProvider(e,t){return r(e,t)}fetchIcon(e,t={cache:"force-cache"}){return new Promise((r,n)=>{fetch(e,{...this._fetchOptions,...t}).catch(e=>n(e)).then(e=>e?.text()).then(e=>r(e))})}}const m={install(e,t={}){const r=new d(t);e.config.globalProperties.$vv=r,t.components&&Object.entries(t.components).forEach(([r,n])=>{e.component(r,p(n,t.defaults))}),t.aliases&&Object.entries(t.aliases).forEach(([r,n])=>{e.component(r,p(n,t.defaults,r))}),t.directives&&Object.entries(t.directives).forEach(([t,r])=>{const n=function(e,t){return f(e,{delimiter:"-",...t})}(t);n.startsWith("v-")&&(t=n.substring(2).toLocaleLowerCase()),e.directive(t,r)}),e.provide(h,r)}};export{m as VolverPlugin};
|
package/dist/props/index.d.ts
CHANGED
|
@@ -943,10 +943,17 @@ export declare const NavProps: {
|
|
|
943
943
|
};
|
|
944
944
|
};
|
|
945
945
|
export declare const StorageProps: {
|
|
946
|
+
/**
|
|
947
|
+
* Storage type
|
|
948
|
+
* @default StorageType.local
|
|
949
|
+
*/
|
|
946
950
|
storageType: {
|
|
947
951
|
type: PropType<`${StorageType}`>;
|
|
948
952
|
default: StorageType;
|
|
949
953
|
validator: (value: StorageType) => boolean;
|
|
950
954
|
};
|
|
955
|
+
/**
|
|
956
|
+
* Storage key
|
|
957
|
+
*/
|
|
951
958
|
storageKey: StringConstructor;
|
|
952
959
|
};
|
|
@@ -1,187 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const SPLIT_UPPER_UPPER_RE = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
|
|
3
|
-
const SPLIT_SEPARATE_NUMBER_RE = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u");
|
|
4
|
-
const DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
|
|
5
|
-
const SPLIT_REPLACE_VALUE = "$1\0$2";
|
|
6
|
-
const DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
|
|
7
|
-
function split(value) {
|
|
8
|
-
let result = value.trim();
|
|
9
|
-
result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
|
|
10
|
-
result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
|
|
11
|
-
let start = 0;
|
|
12
|
-
let end = result.length;
|
|
13
|
-
while (result.charAt(start) === "\0")
|
|
14
|
-
start++;
|
|
15
|
-
if (start === end)
|
|
16
|
-
return [];
|
|
17
|
-
while (result.charAt(end - 1) === "\0")
|
|
18
|
-
end--;
|
|
19
|
-
return result.slice(start, end).split(/\0/g);
|
|
20
|
-
}
|
|
21
|
-
function splitSeparateNumbers(value) {
|
|
22
|
-
const words = split(value);
|
|
23
|
-
for (let i = 0; i < words.length; i++) {
|
|
24
|
-
const word = words[i];
|
|
25
|
-
const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
|
|
26
|
-
if (match) {
|
|
27
|
-
const offset = match.index + (match[1] ?? match[2]).length;
|
|
28
|
-
words.splice(i, 1, word.slice(0, offset), word.slice(offset));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return words;
|
|
32
|
-
}
|
|
33
|
-
function noCase(input, options) {
|
|
34
|
-
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
|
|
35
|
-
return prefix + words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? " ") + suffix;
|
|
36
|
-
}
|
|
37
|
-
function kebabCase(input, options) {
|
|
38
|
-
return noCase(input, { delimiter: "-", ...options });
|
|
39
|
-
}
|
|
40
|
-
function lowerFactory(locale) {
|
|
41
|
-
return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
|
|
42
|
-
}
|
|
43
|
-
function splitPrefixSuffix(input, options = {}) {
|
|
44
|
-
const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);
|
|
45
|
-
const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
46
|
-
const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
47
|
-
let prefixIndex = 0;
|
|
48
|
-
let suffixIndex = input.length;
|
|
49
|
-
while (prefixIndex < input.length) {
|
|
50
|
-
const char = input.charAt(prefixIndex);
|
|
51
|
-
if (!prefixCharacters.includes(char))
|
|
52
|
-
break;
|
|
53
|
-
prefixIndex++;
|
|
54
|
-
}
|
|
55
|
-
while (suffixIndex > prefixIndex) {
|
|
56
|
-
const index = suffixIndex - 1;
|
|
57
|
-
const char = input.charAt(index);
|
|
58
|
-
if (!suffixCharacters.includes(char))
|
|
59
|
-
break;
|
|
60
|
-
suffixIndex = index;
|
|
61
|
-
}
|
|
62
|
-
return [
|
|
63
|
-
input.slice(0, prefixIndex),
|
|
64
|
-
splitFn(input.slice(prefixIndex, suffixIndex)),
|
|
65
|
-
input.slice(suffixIndex)
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
const STYLE_EXCLUDE = ["vv-icon", "vv-action"];
|
|
69
|
-
const VOLVER_PREFIX = "vv";
|
|
70
|
-
const DIRECTIVES = ["v-tooltip", "v-contextmenu"];
|
|
71
|
-
function getStyleNames(kebabName) {
|
|
72
|
-
if (STYLE_EXCLUDE.includes(kebabName)) {
|
|
73
|
-
return void 0;
|
|
74
|
-
}
|
|
75
|
-
if (kebabName === "vv-dropdown") {
|
|
76
|
-
return ["vv-dropdown", "vv-dropdown-option", "vv-dropdown-action"];
|
|
77
|
-
}
|
|
78
|
-
if (kebabName === "vv-combobox") {
|
|
79
|
-
return [
|
|
80
|
-
"vv-select",
|
|
81
|
-
"vv-dropdown-option",
|
|
82
|
-
"vv-dropdown-optgroup",
|
|
83
|
-
"vv-dropdown",
|
|
84
|
-
"vv-dropdown-action"
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
|
-
if (kebabName === "vv-button-group") {
|
|
88
|
-
return ["vv-button", "vv-button-group"];
|
|
89
|
-
}
|
|
90
|
-
if (kebabName === "vv-accordion-group") {
|
|
91
|
-
return ["vv-accordion", "vv-accordion-group"];
|
|
92
|
-
}
|
|
93
|
-
if (kebabName === "vv-checkbox-group") {
|
|
94
|
-
return ["vv-checkbox", "vv-checkbox-group"];
|
|
95
|
-
}
|
|
96
|
-
if (kebabName === "vv-radio-group") {
|
|
97
|
-
return ["vv-radio", "vv-radio-group"];
|
|
98
|
-
}
|
|
99
|
-
if (kebabName === "vv-alert-group") {
|
|
100
|
-
return ["vv-alert", "vv-alert-group"];
|
|
101
|
-
}
|
|
102
|
-
if (kebabName === "v-tooltip") {
|
|
103
|
-
return ["vv-tooltip"];
|
|
104
|
-
}
|
|
105
|
-
return [kebabName];
|
|
106
|
-
}
|
|
107
|
-
function getSideEffects(kebabName, importStyle) {
|
|
108
|
-
const sideEffects = [];
|
|
109
|
-
if (!importStyle) {
|
|
110
|
-
return sideEffects;
|
|
111
|
-
}
|
|
112
|
-
const styleNames = getStyleNames(kebabName);
|
|
113
|
-
if (styleNames) {
|
|
114
|
-
styleNames.forEach((name) => {
|
|
115
|
-
sideEffects.push(
|
|
116
|
-
`@volverjs/style/${importStyle === "scss" ? "scss/" : ""}components/${name}`
|
|
117
|
-
);
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
return sideEffects;
|
|
121
|
-
}
|
|
122
|
-
function VolverResolver({
|
|
123
|
-
prefix = VOLVER_PREFIX,
|
|
124
|
-
importStyle,
|
|
125
|
-
directives,
|
|
126
|
-
ignore,
|
|
127
|
-
cherryPick
|
|
128
|
-
} = {}) {
|
|
129
|
-
return [
|
|
130
|
-
{
|
|
131
|
-
type: "component",
|
|
132
|
-
resolve: (name) => {
|
|
133
|
-
if (!prefix || !name.toLowerCase().startsWith(prefix.toLowerCase())) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const kebabName = kebabCase(name).replace(
|
|
137
|
-
`${prefix}-`,
|
|
138
|
-
`${VOLVER_PREFIX}-`
|
|
139
|
-
);
|
|
140
|
-
if (ignore && ignore.includes(kebabName)) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (cherryPick) {
|
|
144
|
-
return {
|
|
145
|
-
from: `@volverjs/ui-vue/${kebabName}`,
|
|
146
|
-
sideEffects: getSideEffects(kebabName, importStyle)
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
from: "@volverjs/ui-vue/components",
|
|
151
|
-
sideEffects: getSideEffects(kebabName, importStyle),
|
|
152
|
-
name
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
type: "directive",
|
|
158
|
-
resolve: (name) => {
|
|
159
|
-
if (!directives) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const kebabName = `v-${kebabCase(name)}`;
|
|
163
|
-
if (!DIRECTIVES.includes(kebabName)) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (ignore && ignore.includes(kebabName)) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
if (cherryPick) {
|
|
170
|
-
return {
|
|
171
|
-
from: `@volverjs/ui-vue/${kebabName}`,
|
|
172
|
-
sideEffects: getSideEffects(kebabName, importStyle)
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
return {
|
|
176
|
-
from: "@volverjs/ui-vue/directives",
|
|
177
|
-
sideEffects: getSideEffects(kebabName, importStyle),
|
|
178
|
-
name: `v${name}`
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
];
|
|
183
|
-
}
|
|
184
|
-
export {
|
|
185
|
-
VolverResolver,
|
|
186
|
-
getStyleNames
|
|
187
|
-
};
|
|
1
|
+
const e=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),o=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),r=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),t=/[^\p{L}\d]+/giu,n="$1\0$2";function v(r){let v=r.trim();v=v.replace(e,n).replace(o,n),v=v.replace(t,"\0");let c=0,i=v.length;for(;"\0"===v.charAt(c);)c++;if(c===i)return[];for(;"\0"===v.charAt(i-1);)i--;return v.slice(c,i).split(/\0/g)}function c(e){const o=v(e);for(let t=0;t<o.length;t++){const e=o[t],n=r.exec(e);if(n){const r=n.index+(n[1]??n[2]).length;o.splice(t,1,e.slice(0,r),e.slice(r))}}return o}function i(e,o){const[r,t,n]=function(e,o={}){const r=o.split??(o.separateNumbers?c:v),t=o.prefixCharacters??"",n=o.suffixCharacters??"";let i=0,s=e.length;for(;i<e.length;){const o=e.charAt(i);if(!t.includes(o))break;i++}for(;s>i;){const o=s-1,r=e.charAt(o);if(!n.includes(r))break;s=o}return[e.slice(0,i),r(e.slice(i,s)),e.slice(s)]}(e,o);return r+t.map((i=o?.locale,!1===i?e=>e.toLowerCase():e=>e.toLocaleLowerCase(i))).join(o?.delimiter??" ")+n;var i}function s(e,o){return i(e,{delimiter:"-",...o})}const u=["vv-icon","vv-action"],p=["v-tooltip","v-contextmenu"];function l(e){if(!u.includes(e))return"vv-dropdown"===e?["vv-dropdown","vv-dropdown-option","vv-dropdown-action"]:"vv-combobox"===e?["vv-select","vv-dropdown-option","vv-dropdown-optgroup","vv-dropdown","vv-dropdown-action"]:"vv-button-group"===e?["vv-button","vv-button-group"]:"vv-accordion-group"===e?["vv-accordion","vv-accordion-group"]:"vv-checkbox-group"===e?["vv-checkbox","vv-checkbox-group"]:"vv-radio-group"===e?["vv-radio","vv-radio-group"]:"vv-alert-group"===e?["vv-alert","vv-alert-group"]:"v-tooltip"===e?["vv-tooltip"]:[e]}function d(e,o){const r=[];if(!o)return r;const t=l(e);return t&&t.forEach(e=>{r.push(`@volverjs/style/${"scss"===o?"scss/":""}components/${e}`)}),r}function a({prefix:e="vv",importStyle:o,directives:r,ignore:t,cherryPick:n}={}){return[{type:"component",resolve:r=>{if(!e||!r.toLowerCase().startsWith(e.toLowerCase()))return;const v=s(r).replace(`${e}-`,"vv-");return t&&t.includes(v)?void 0:n?{from:`@volverjs/ui-vue/${v}`,sideEffects:d(v,o)}:{from:"@volverjs/ui-vue/components",sideEffects:d(v,o),name:r}}},{type:"directive",resolve:e=>{if(!r)return;const v=`v-${s(e)}`;return!p.includes(v)||t&&t.includes(v)?void 0:n?{from:`@volverjs/ui-vue/${v}`,sideEffects:d(v,o)}:{from:"@volverjs/ui-vue/directives",sideEffects:d(v,o),name:`v${e}`}}}]}export{a as VolverResolver,l as getStyleNames};
|
|
@@ -196,10 +196,10 @@ declare const _default: {
|
|
|
196
196
|
itemModifiers?: string | string[] | undefined;
|
|
197
197
|
storageType?: "local" | "session" | undefined;
|
|
198
198
|
style?: unknown;
|
|
199
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
200
199
|
class?: unknown;
|
|
201
200
|
readonly storageKey?: string | undefined;
|
|
202
201
|
key?: PropertyKey | undefined;
|
|
202
|
+
ref?: import("vue").VNodeRef | undefined;
|
|
203
203
|
ref_for?: boolean | undefined;
|
|
204
204
|
ref_key?: string | undefined;
|
|
205
205
|
onVnodeBeforeMount?: (((vnode: VNode) => void) | ((vnode: VNode) => void)[]) | undefined;
|
|
@@ -223,10 +223,10 @@ declare const _default: {
|
|
|
223
223
|
itemModifiers?: string | string[] | undefined;
|
|
224
224
|
storageType?: "local" | "session" | undefined;
|
|
225
225
|
style?: unknown;
|
|
226
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
227
226
|
class?: unknown;
|
|
228
227
|
readonly storageKey?: string | undefined;
|
|
229
228
|
key?: PropertyKey | undefined;
|
|
229
|
+
ref?: import("vue").VNodeRef | undefined;
|
|
230
230
|
ref_for?: boolean | undefined;
|
|
231
231
|
ref_key?: string | undefined;
|
|
232
232
|
onVnodeBeforeMount?: (((vnode: VNode) => void) | ((vnode: VNode) => void)[]) | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volverjs/ui-vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13-beta.1",
|
|
5
5
|
"description": "@volverjs/ui-vue is a lightweight Vue 3 component library to accompany @volverjs/style.",
|
|
6
6
|
"author": "8 wave S.r.l.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -377,18 +377,18 @@
|
|
|
377
377
|
],
|
|
378
378
|
"peerDependencies": {
|
|
379
379
|
"@volverjs/style": "0.x",
|
|
380
|
-
"@vueuse/core": "^
|
|
380
|
+
"@vueuse/core": "^14.x",
|
|
381
381
|
"vue": "^3.5.x"
|
|
382
382
|
},
|
|
383
383
|
"dependencies": {
|
|
384
384
|
"@floating-ui/vue": "^1.1.9",
|
|
385
|
-
"@iconify/tools": "^
|
|
385
|
+
"@iconify/tools": "^5.0.2",
|
|
386
386
|
"@iconify/vue": "^5.0.0",
|
|
387
387
|
"blurhash": "^2.0.5",
|
|
388
|
-
"chokidar": "^
|
|
388
|
+
"chokidar": "^5.0.0",
|
|
389
389
|
"comlink": "^4.4.2",
|
|
390
|
-
"dot-prop": "^10.
|
|
391
|
-
"jsdom": "^27.
|
|
390
|
+
"dot-prop": "^10.1.0",
|
|
391
|
+
"jsdom": "^27.4.0",
|
|
392
392
|
"mitt": "^3.0.1",
|
|
393
393
|
"pica": "^9.0.1",
|
|
394
394
|
"vue-imask": "^7.6.1",
|
|
@@ -396,53 +396,60 @@
|
|
|
396
396
|
"yargs": "^18.0.0"
|
|
397
397
|
},
|
|
398
398
|
"devDependencies": {
|
|
399
|
-
"@antfu/eslint-config": "
|
|
400
|
-
"@babel/core": "^7.28.
|
|
401
|
-
"@babel/preset-env": "^7.28.
|
|
402
|
-
"@babel/preset-typescript": "^7.
|
|
399
|
+
"@antfu/eslint-config": "6.7.3",
|
|
400
|
+
"@babel/core": "^7.28.5",
|
|
401
|
+
"@babel/preset-env": "^7.28.5",
|
|
402
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
403
403
|
"@iconify/types": "^2.0.0",
|
|
404
|
-
"@iconify/utils": "^3.0
|
|
404
|
+
"@iconify/utils": "^3.1.0",
|
|
405
405
|
"@nabla/vite-plugin-eslint": "^2.0.6",
|
|
406
|
-
"@storybook/addon-a11y": "^
|
|
407
|
-
"@storybook/addon-docs": "^
|
|
408
|
-
"@storybook/addon-links": "^
|
|
409
|
-
"@storybook/
|
|
410
|
-
"@storybook/
|
|
411
|
-
"@storybook/
|
|
412
|
-
"@
|
|
406
|
+
"@storybook/addon-a11y": "^10.1.11",
|
|
407
|
+
"@storybook/addon-docs": "^10.1.11",
|
|
408
|
+
"@storybook/addon-links": "^10.1.11",
|
|
409
|
+
"@storybook/addon-themes": "^10.1.11",
|
|
410
|
+
"@storybook/addon-vitest": "^10.1.11",
|
|
411
|
+
"@storybook/cli": "^10.1.11",
|
|
412
|
+
"@storybook/vue3-vite": "^10.1.11",
|
|
413
|
+
"@tsconfig/node18": "^18.2.6",
|
|
413
414
|
"@types/jest-axe": "^3.5.9",
|
|
414
415
|
"@types/jsdom": "^27.0.0",
|
|
415
|
-
"@types/node": "^
|
|
416
|
+
"@types/node": "^25.0.3",
|
|
416
417
|
"@types/pica": "^9.0.5",
|
|
417
|
-
"@types/yargs": "^17.0.
|
|
418
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
419
|
-
"@
|
|
420
|
-
"@
|
|
418
|
+
"@types/yargs": "^17.0.35",
|
|
419
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
420
|
+
"@vitest/browser": "^4.0.16",
|
|
421
|
+
"@vitest/browser-playwright": "^4.0.16",
|
|
422
|
+
"@volverjs/style": "^0.1.23",
|
|
423
|
+
"@vue/compiler-sfc": "^3.5.26",
|
|
421
424
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
422
425
|
"@vue/test-utils": "^2.4.6",
|
|
423
426
|
"@vue/tsconfig": "^0.8.1",
|
|
424
|
-
"@vueless/storybook-dark-mode": "^
|
|
425
|
-
"@vueuse/core": "^
|
|
427
|
+
"@vueless/storybook-dark-mode": "^10.0.4",
|
|
428
|
+
"@vueuse/core": "^14.1.0",
|
|
426
429
|
"change-case": "^5.4.4",
|
|
427
|
-
"eslint": "^9.
|
|
428
|
-
"glob": "^
|
|
430
|
+
"eslint": "^9.39.2",
|
|
431
|
+
"glob": "^13.0.0",
|
|
429
432
|
"jest-axe": "^10.0.0",
|
|
430
|
-
"jsdom": "^27.
|
|
433
|
+
"jsdom": "^27.4.0",
|
|
431
434
|
"npm-run-all": "^4.1.5",
|
|
432
|
-
"
|
|
435
|
+
"playwright": "^1.57.0",
|
|
436
|
+
"prettier": "^3.7.4",
|
|
437
|
+
"react": "^19.2.3",
|
|
438
|
+
"react-dom": "^19.2.3",
|
|
433
439
|
"remark": "^15.0.1",
|
|
434
|
-
"sass-embedded": "1.
|
|
435
|
-
"storybook": "^
|
|
440
|
+
"sass-embedded": "1.97.2",
|
|
441
|
+
"storybook": "^10.1.11",
|
|
436
442
|
"storybook-addon-markdown-docs": "^2.0.0",
|
|
437
|
-
"terser": "^5.44.
|
|
443
|
+
"terser": "^5.44.1",
|
|
438
444
|
"ts-node": "^10.9.2",
|
|
439
445
|
"typescript": "~5.9.3",
|
|
440
|
-
"unplugin-auto-import": "^20.
|
|
441
|
-
"unplugin-vue-components": "^
|
|
442
|
-
"vite": "^7.1
|
|
443
|
-
"vite-plugin-externalize-deps": "^0.
|
|
444
|
-
"
|
|
445
|
-
"vue
|
|
446
|
+
"unplugin-auto-import": "^20.3.0",
|
|
447
|
+
"unplugin-vue-components": "^30.0.0",
|
|
448
|
+
"vite": "^7.3.1",
|
|
449
|
+
"vite-plugin-externalize-deps": "^0.10.0",
|
|
450
|
+
"vitest": "^4.0.16",
|
|
451
|
+
"vue": "^3.5.26",
|
|
452
|
+
"vue-tsc": "^3.2.2"
|
|
446
453
|
},
|
|
447
454
|
"scripts": {
|
|
448
455
|
"dev": "storybook dev -p 6006",
|
|
@@ -454,8 +461,8 @@
|
|
|
454
461
|
"lint:fix": "eslint . --fix",
|
|
455
462
|
"generate-icons": "node --loader ts-node/esm ./scripts/icons.ts --srcPath=src/assets/icons",
|
|
456
463
|
"generate-tsd": "vue-tsc --declaration --emitDeclarationOnly",
|
|
457
|
-
"test-
|
|
458
|
-
"test-
|
|
464
|
+
"test-storybook": "vitest --run",
|
|
465
|
+
"test-storybook:watch": "vitest",
|
|
459
466
|
"credits": "npx @opengovsg/credits-generator"
|
|
460
467
|
}
|
|
461
468
|
}
|