@varlet/ui 3.6.3 → 3.6.4-alpha.1730207839062

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "3.6.3",
4
+ "version": "3.6.4-alpha.1730207839062",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "3.6.3",
4
+ "version": "3.6.4-alpha.1730207839062",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
package/lib/varlet.cjs.js CHANGED
@@ -14,7 +14,7 @@ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
14
14
  var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
15
15
  var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16
16
  var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
17
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
+ var __defNormalProp$z = (obj, key3, value) => key3 in obj ? __defProp$z(obj, key3, { enumerable: true, configurable: true, writable: true, value }) : obj[key3] = value;
18
18
  var __spreadValues$z = (a, b) => {
19
19
  for (var prop in b || (b = {}))
20
20
  if (__hasOwnProp$z.call(b, prop))
@@ -27,83 +27,121 @@ var __spreadValues$z = (a, b) => {
27
27
  return a;
28
28
  };
29
29
  var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
30
- var isString = (val) => typeof val === "string";
31
- var isBoolean = (val) => typeof val === "boolean";
32
- var isNumber = (val) => typeof val === "number";
33
- var isNumeric = (val) => isNumber(val) || isString(val) && /^[-+]?\d+$/.test(val);
34
- var isPlainObject = (val) => Object.prototype.toString.call(val) === "[object Object]";
35
- var isObject = (val) => typeof val === "object" && val !== null;
36
- var isFunction = (val) => typeof val === "function";
37
- var isArray = (val) => Array.isArray(val);
38
- var isURL = (val) => {
39
- if (!val) {
40
- return false;
41
- }
42
- return /^(http)|(\.*\/)/.test(val);
43
- };
44
- var isEmpty = (val) => val === void 0 || val === null || val === "" || isArray(val) && !val.length;
45
- var isWindow = (val) => val === window;
46
- var supportTouch = () => inBrowser() && "ontouchstart" in window;
47
- var inBrowser = () => typeof window !== "undefined";
48
- var inMobile = () => inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
30
+ function isString(val) {
31
+ return typeof val === "string";
32
+ }
33
+ function isBoolean(val) {
34
+ return typeof val === "boolean";
35
+ }
36
+ function isNumber(val) {
37
+ return typeof val === "number";
38
+ }
39
+ function isNumeric(val) {
40
+ return isNumber(val) || isString(val) && /^[-+]?\d+$/.test(val);
41
+ }
42
+ function isPlainObject(val) {
43
+ return Object.prototype.toString.call(val) === "[object Object]";
44
+ }
45
+ function isObject(val) {
46
+ return typeof val === "object" && val !== null;
47
+ }
48
+ function isFunction(val) {
49
+ return typeof val === "function";
50
+ }
51
+ function isArray(val) {
52
+ return Array.isArray(val);
53
+ }
54
+ function isEmpty(val) {
55
+ return val === void 0 || val === null || val === "" || isArray(val) && !val.length;
56
+ }
57
+ function isWindow(val) {
58
+ return val === window;
59
+ }
60
+ function supportTouch() {
61
+ return inBrowser() && "ontouchstart" in window;
62
+ }
63
+ function inBrowser() {
64
+ return typeof window !== "undefined";
65
+ }
66
+ function inMobile() {
67
+ return inBrowser() && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
68
+ }
49
69
  var { hasOwnProperty } = Object.prototype;
50
- var hasOwn = (val, key) => hasOwnProperty.call(val, key);
51
- var uniq = (arr) => [...new Set(arr)];
52
- var normalizeToArray = (value) => isArray(value) ? value : [value];
53
- var removeItem = (arr, item) => {
70
+ function hasOwn(val, key3) {
71
+ return hasOwnProperty.call(val, key3);
72
+ }
73
+ function getGlobalThis() {
74
+ if (typeof globalThis !== "undefined") {
75
+ return globalThis;
76
+ }
77
+ if (inBrowser()) {
78
+ return window;
79
+ }
80
+ return typeof global !== "undefined" ? global : self;
81
+ }
82
+ function uniq(arr) {
83
+ return [...new Set(arr)];
84
+ }
85
+ function normalizeToArray(value) {
86
+ return isArray(value) ? value : [value];
87
+ }
88
+ function removeItem(arr, item) {
54
89
  if (arr.length) {
55
90
  const index = arr.indexOf(item);
56
91
  if (index > -1) {
57
92
  return arr.splice(index, 1);
58
93
  }
59
94
  }
60
- };
61
- var removeArrayBlank = (arr) => arr.filter((item) => item != null);
62
- var find = (arr, callback, from = "start") => {
95
+ }
96
+ function removeArrayBlank(arr) {
97
+ return arr.filter((item) => item != null);
98
+ }
99
+ function find(arr, fn2, from = "start") {
63
100
  let i = from === "start" ? 0 : arr.length - 1;
64
101
  while (arr.length > 0 && i >= 0 && i <= arr.length - 1) {
65
- const flag = callback(arr[i], i, arr);
102
+ const flag = fn2(arr[i], i, arr);
66
103
  if (flag) {
67
104
  return [arr[i], i];
68
105
  }
69
106
  from === "start" ? i++ : i--;
70
107
  }
71
108
  return [null, -1];
72
- };
73
- var classes$1d = (...classes2) => classes2.map((className) => {
74
- if (isArray(className)) {
75
- const [condition, truthy, falsy = null] = className;
76
- return condition ? truthy : falsy;
77
- }
78
- return className;
79
- });
80
- var getGlobalThis = () => {
81
- if (typeof globalThis !== "undefined") {
82
- return globalThis;
83
- }
84
- if (inBrowser()) {
85
- return window;
86
- }
87
- return typeof global !== "undefined" ? global : self;
88
- };
89
- var requestAnimationFrame$1 = (fn2) => {
109
+ }
110
+ function pascalCase(s) {
111
+ return camelize(s).replace(s.charAt(0), s.charAt(0).toUpperCase());
112
+ }
113
+ function camelize(s) {
114
+ s = s.replace(/-(\w)/g, (_, p) => p.toUpperCase());
115
+ return s.replace(s.charAt(0), s.charAt(0).toLowerCase());
116
+ }
117
+ function kebabCase(s) {
118
+ const ret = s.replace(/([A-Z])/g, " $1").trim();
119
+ return ret.split(" ").join("-").toLowerCase();
120
+ }
121
+ function requestAnimationFrame$1(fn2) {
90
122
  const globalThis2 = getGlobalThis();
91
123
  return globalThis2.requestAnimationFrame ? globalThis2.requestAnimationFrame(fn2) : globalThis2.setTimeout(fn2);
92
- };
93
- var cancelAnimationFrame = (handle) => {
124
+ }
125
+ function cancelAnimationFrame(handle) {
94
126
  const globalThis2 = getGlobalThis();
95
127
  globalThis2.cancelAnimationFrame ? globalThis2.cancelAnimationFrame(handle) : globalThis2.clearTimeout(handle);
96
- };
97
- var raf = () => new Promise((resolve) => {
98
- requestAnimationFrame$1(resolve);
99
- });
100
- var doubleRaf = () => new Promise((resolve) => {
101
- requestAnimationFrame$1(() => {
128
+ }
129
+ function raf() {
130
+ return new Promise((resolve) => {
102
131
  requestAnimationFrame$1(resolve);
103
132
  });
104
- });
105
- var getStyle$1 = (element) => window.getComputedStyle(element);
106
- var getRect = (element) => {
133
+ }
134
+ function doubleRaf() {
135
+ return new Promise((resolve) => {
136
+ requestAnimationFrame$1(() => {
137
+ requestAnimationFrame$1(resolve);
138
+ });
139
+ });
140
+ }
141
+ function getStyle$1(element) {
142
+ return window.getComputedStyle(element);
143
+ }
144
+ function getRect(element) {
107
145
  if (isWindow(element)) {
108
146
  const width = element.innerWidth;
109
147
  const height = element.innerHeight;
@@ -122,40 +160,61 @@ var getRect = (element) => {
122
160
  });
123
161
  }
124
162
  return element.getBoundingClientRect();
125
- };
126
- var inViewport = (element) => {
163
+ }
164
+ function inViewport(element) {
127
165
  const { top: top2, bottom: bottom2, left: left2, right: right2 } = getRect(element);
128
166
  const { width, height } = getRect(window);
129
167
  const xInViewport = left2 <= width && right2 >= 0;
130
168
  const yInViewport = top2 <= height && bottom2 >= 0;
131
169
  return xInViewport && yInViewport;
132
- };
133
- var toDataURL = (file) => new Promise((resolve) => {
134
- const fileReader = new FileReader();
135
- fileReader.onload = () => {
136
- resolve(fileReader.result);
137
- };
138
- fileReader.readAsDataURL(file);
139
- });
140
- var preventDefault = (event) => {
170
+ }
171
+ function preventDefault(event) {
141
172
  if (event.cancelable === false) {
142
173
  return;
143
174
  }
144
175
  event.preventDefault();
145
- };
146
- var getScrollTop = (element) => {
176
+ }
177
+ function getScrollTop(element) {
147
178
  const top2 = "scrollTop" in element ? element.scrollTop : element.scrollY;
148
179
  return Math.max(top2, 0);
149
- };
150
- var getScrollLeft = (element) => {
180
+ }
181
+ function getScrollLeft(element) {
151
182
  const left2 = "scrollLeft" in element ? element.scrollLeft : element.scrollX;
152
183
  return Math.max(left2, 0);
153
- };
154
- var throttle = (fn2, delay = 200) => {
184
+ }
185
+ function classes$1d(...classes2) {
186
+ return classes2.map((className) => {
187
+ if (isArray(className)) {
188
+ const [condition, truthy, falsy = null] = className;
189
+ return condition ? truthy : falsy;
190
+ }
191
+ return className;
192
+ });
193
+ }
194
+ function createNamespaceFn(namespace) {
195
+ return (name2) => {
196
+ const componentName = `${namespace}-${name2}`;
197
+ const createBEM = (suffix) => {
198
+ if (!suffix) {
199
+ return componentName;
200
+ }
201
+ if (suffix[0] === "$") {
202
+ return suffix.replace("$", namespace);
203
+ }
204
+ return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
205
+ };
206
+ return {
207
+ name: pascalCase(componentName),
208
+ n: createBEM,
209
+ classes: classes$1d
210
+ };
211
+ };
212
+ }
213
+ function throttle(fn2, delay = 200) {
155
214
  let timer;
156
215
  let start2 = 0;
157
216
  return function loop(...args) {
158
- const now = Date.now();
217
+ const now = performance.now();
159
218
  const elapsed = now - start2;
160
219
  if (!start2) {
161
220
  start2 = now;
@@ -172,7 +231,7 @@ var throttle = (fn2, delay = 200) => {
172
231
  }, delay - elapsed);
173
232
  }
174
233
  };
175
- };
234
+ }
176
235
  function call(fn2, ...args) {
177
236
  if (isArray(fn2)) {
178
237
  return fn2.map((f) => f(...args));
@@ -181,45 +240,67 @@ function call(fn2, ...args) {
181
240
  return fn2(...args);
182
241
  }
183
242
  }
184
- var toNumber = (val) => {
185
- if (val == null)
243
+ function toNumber(val) {
244
+ if (val == null) {
186
245
  return 0;
246
+ }
187
247
  if (isString(val)) {
188
248
  val = parseFloat(val);
189
249
  val = Number.isNaN(val) ? 0 : val;
190
250
  return val;
191
251
  }
192
- if (isBoolean(val))
252
+ if (isBoolean(val)) {
193
253
  return Number(val);
254
+ }
194
255
  return val;
195
- };
196
- var clamp$1 = (num, min2, max2) => Math.min(max2, Math.max(min2, num));
197
- var clampArrayRange = (index, arr) => clamp$1(index, 0, arr.length - 1);
198
- var bigCamelize = (s) => camelize(s).replace(s.charAt(0), s.charAt(0).toUpperCase());
199
- var camelize = (s) => s.replace(/-(\w)/g, (_, p) => p.toUpperCase());
200
- var kebabCase = (s) => {
201
- const ret = s.replace(/([A-Z])/g, " $1").trim();
202
- return ret.split(" ").join("-").toLowerCase();
203
- };
204
- function createNamespaceFn(namespace) {
205
- return (name2) => {
206
- const componentName = `${namespace}-${name2}`;
207
- const createBEM = (suffix) => {
208
- if (!suffix) {
209
- return componentName;
256
+ }
257
+ function clamp$1(num, min2, max2) {
258
+ return Math.min(max2, Math.max(min2, num));
259
+ }
260
+ function clampArrayRange(index, arr) {
261
+ return clamp$1(index, 0, arr.length - 1);
262
+ }
263
+ function toDataURL(file) {
264
+ return new Promise((resolve) => {
265
+ const fileReader = new FileReader();
266
+ fileReader.onload = () => {
267
+ resolve(fileReader.result);
268
+ };
269
+ fileReader.readAsDataURL(file);
270
+ });
271
+ }
272
+ function createStorage(storage) {
273
+ return __spreadProps$d(__spreadValues$z({}, storage), {
274
+ set(key3, value) {
275
+ if (value == null) {
276
+ return;
210
277
  }
211
- if (suffix[0] === "$") {
212
- return suffix.replace("$", namespace);
278
+ if (!isString(value)) {
279
+ value = JSON.stringify(value);
213
280
  }
214
- return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
215
- };
216
- return {
217
- name: bigCamelize(componentName),
218
- n: createBEM,
219
- classes: classes$1d
220
- };
221
- };
281
+ storage.setItem(key3, value);
282
+ },
283
+ get(key3) {
284
+ const data = storage.getItem(key3);
285
+ try {
286
+ return JSON.parse(data);
287
+ } catch (err) {
288
+ return data;
289
+ }
290
+ },
291
+ remove(key3) {
292
+ storage.removeItem(key3);
293
+ }
294
+ });
222
295
  }
296
+ createStorage(globalThis.sessionStorage);
297
+ createStorage(globalThis.localStorage);
298
+ var isURL = (val) => {
299
+ if (!val) {
300
+ return false;
301
+ }
302
+ return /^(http)|(\.*\/)/.test(val);
303
+ };
223
304
  var __defProp$y = Object.defineProperty;
224
305
  var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
225
306
  var __hasOwnProp$y = Object.prototype.hasOwnProperty;
@@ -29702,7 +29783,7 @@ withInstall(stdin_default$1);
29702
29783
  withPropsDefaultsSetter(stdin_default$1, props);
29703
29784
  const _WatermarkComponent = stdin_default$1;
29704
29785
  var stdin_default = stdin_default$1;
29705
- const version = "3.6.3";
29786
+ const version = "3.6.4-alpha.1730207839062";
29706
29787
  function install(app) {
29707
29788
  stdin_default$5U.install && app.use(stdin_default$5U);
29708
29789
  stdin_default$5S.install && app.use(stdin_default$5S);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.6.3",
3
+ "version": "3.6.4-alpha.1730207839062",
4
4
  "description": "A material like components library",
5
5
  "main": "lib/varlet.cjs.js",
6
6
  "module": "es/index.mjs",
@@ -48,9 +48,9 @@
48
48
  "@popperjs/core": "^2.11.6",
49
49
  "dayjs": "^1.10.4",
50
50
  "decimal.js": "^10.2.1",
51
- "@varlet/shared": "3.6.3",
52
- "@varlet/icons": "3.6.3",
53
- "@varlet/use": "3.6.3"
51
+ "@varlet/icons": "3.6.4-alpha.1730207839062",
52
+ "@varlet/shared": "3.6.4-alpha.1730207839062",
53
+ "@varlet/use": "3.6.4-alpha.1730207839062"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^18.7.18",
@@ -66,9 +66,9 @@
66
66
  "vue": "3.4.21",
67
67
  "vue-router": "4.2.0",
68
68
  "zod": "^3.23.8",
69
- "@varlet/cli": "3.6.3",
70
- "@varlet/touch-emulator": "3.6.3",
71
- "@varlet/ui": "3.6.3"
69
+ "@varlet/cli": "3.6.4-alpha.1730207839062",
70
+ "@varlet/ui": "3.6.4-alpha.1730207839062",
71
+ "@varlet/touch-emulator": "3.6.4-alpha.1730207839062"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",