@varlet/ui 2.18.2-alpha.1698728560863 → 2.18.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/lib/varlet.cjs.js CHANGED
@@ -65,6 +65,13 @@ var find = (arr, callback, from = "start") => {
65
65
  }
66
66
  return [null, -1];
67
67
  };
68
+ var classes$1a = (...classes2) => classes2.map((className) => {
69
+ if (isArray(className)) {
70
+ const [condition, truthy, falsy = null] = className;
71
+ return condition ? truthy : falsy;
72
+ }
73
+ return className;
74
+ });
68
75
  var getGlobalThis = () => {
69
76
  if (typeof globalThis !== "undefined") {
70
77
  return globalThis;
@@ -161,6 +168,14 @@ var throttle = (fn2, delay = 200) => {
161
168
  }
162
169
  };
163
170
  };
171
+ function call$1(fn2, ...args) {
172
+ if (isArray(fn2)) {
173
+ return fn2.map((f) => f(...args));
174
+ }
175
+ if (fn2) {
176
+ return fn2(...args);
177
+ }
178
+ }
164
179
  var toNumber = (val) => {
165
180
  if (val == null)
166
181
  return 0;
@@ -181,6 +196,25 @@ var kebabCase = (s) => {
181
196
  const ret = s.replace(/([A-Z])/g, " $1").trim();
182
197
  return ret.split(" ").join("-").toLowerCase();
183
198
  };
199
+ function createNamespaceFn(namespace) {
200
+ return (name2) => {
201
+ const componentName = `${namespace}-${name2}`;
202
+ const createBEM = (suffix) => {
203
+ if (!suffix) {
204
+ return componentName;
205
+ }
206
+ if (suffix[0] === "$") {
207
+ return suffix.replace("$", namespace);
208
+ }
209
+ return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
210
+ };
211
+ return {
212
+ name: bigCamelize(componentName),
213
+ n: createBEM,
214
+ classes: classes$1a
215
+ };
216
+ };
217
+ }
184
218
  var __defProp$s = Object.defineProperty;
185
219
  var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
186
220
  var __hasOwnProp$s = Object.prototype.hasOwnProperty;
@@ -540,6 +574,35 @@ function useWindowSize(options = {}) {
540
574
  height
541
575
  };
542
576
  }
577
+ function useVModel$1(props2, key, options = {}) {
578
+ const { passive: passive2 = true, eventName, defaultValue, emit } = options;
579
+ const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
580
+ const getValue = () => props2[key] != null ? props2[key] : defaultValue;
581
+ if (!passive2) {
582
+ return vue.computed({
583
+ get() {
584
+ return getValue();
585
+ },
586
+ set(value) {
587
+ emit ? emit(event, value) : call$1(props2[event], value);
588
+ }
589
+ });
590
+ }
591
+ const proxy = vue.ref(getValue());
592
+ vue.watch(
593
+ () => props2[key],
594
+ () => {
595
+ proxy.value = getValue();
596
+ }
597
+ );
598
+ vue.watch(
599
+ () => proxy.value,
600
+ (newValue) => {
601
+ emit ? emit(event, newValue) : call$1(props2[event], newValue);
602
+ }
603
+ );
604
+ return proxy;
605
+ }
543
606
  var __defProp$r = Object.defineProperty;
544
607
  var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
545
608
  var __hasOwnProp$r = Object.prototype.hasOwnProperty;
@@ -675,39 +738,9 @@ function useTeleport() {
675
738
  disabled
676
739
  };
677
740
  }
678
- function createNamespace(name2) {
679
- const namespace = `var`;
680
- const componentName = `${namespace}-${name2}`;
681
- const createBEM = (suffix) => {
682
- if (!suffix) {
683
- return componentName;
684
- }
685
- if (suffix[0] === "$") {
686
- return suffix.replace("$", namespace);
687
- }
688
- return suffix.startsWith("--") ? `${componentName}${suffix}` : `${componentName}__${suffix}`;
689
- };
690
- const classes2 = (...classes22) => classes22.map((className) => {
691
- if (isArray(className)) {
692
- const [condition, truthy, falsy = null] = className;
693
- return condition ? truthy : falsy;
694
- }
695
- return className;
696
- });
697
- return {
698
- name: bigCamelize(componentName),
699
- n: createBEM,
700
- classes: classes2
701
- };
702
- }
703
- function call(fn2, ...args) {
704
- if (isArray(fn2)) {
705
- return fn2.map((f) => f(...args));
706
- }
707
- if (fn2) {
708
- return fn2(...args);
709
- }
710
- }
741
+ const createNamespace = createNamespaceFn("var");
742
+ const call = call$1;
743
+ const useVModel = useVModel$1;
711
744
  function defineListenerProp(fallback) {
712
745
  return {
713
746
  type: [Function, Array],
@@ -723,35 +756,6 @@ function formatElevation(elevation2, defaultLevel) {
723
756
  }
724
757
  return `var-elevation--${elevation2}`;
725
758
  }
726
- function useVModel(props2, key, options = {}) {
727
- const { passive: passive2 = true, eventName, defaultValue, emit } = options;
728
- const event = eventName != null ? eventName : `onUpdate:${key.toString()}`;
729
- const getValue = () => props2[key] != null ? props2[key] : defaultValue;
730
- if (!passive2) {
731
- return vue.computed({
732
- get() {
733
- return getValue();
734
- },
735
- set(value) {
736
- emit ? emit(event, value) : call(props2[event], value);
737
- }
738
- });
739
- }
740
- const proxy = vue.ref(getValue());
741
- vue.watch(
742
- () => props2[key],
743
- () => {
744
- proxy.value = getValue();
745
- }
746
- );
747
- vue.watch(
748
- () => proxy.value,
749
- (newValue) => {
750
- emit ? emit(event, newValue) : call(props2[event], newValue);
751
- }
752
- );
753
- return proxy;
754
- }
755
759
  var __defProp$q = Object.defineProperty;
756
760
  var __defProps$8 = Object.defineProperties;
757
761
  var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
@@ -24675,9 +24679,9 @@ const skeleton = "";
24675
24679
  const SkeletonSfc = "";
24676
24680
  const slider = "";
24677
24681
  const SliderSfc = "";
24682
+ const SnackbarSfc = "";
24678
24683
  const snackbar = "";
24679
24684
  const coreSfc = "";
24680
- const SnackbarSfc = "";
24681
24685
  const space = "";
24682
24686
  const step = "";
24683
24687
  const StepSfc = "";
@@ -24704,7 +24708,7 @@ const uploader = "";
24704
24708
  const UploaderSfc = "";
24705
24709
  const watermark = "";
24706
24710
  const WatermarkSfc = "";
24707
- const version = "2.18.2-alpha.1698728560863";
24711
+ const version = "2.18.2";
24708
24712
  function install(app) {
24709
24713
  stdin_default$3k.install && app.use(stdin_default$3k);
24710
24714
  stdin_default$3i.install && app.use(stdin_default$3i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "2.18.2-alpha.1698728560863",
3
+ "version": "2.18.2",
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/use": "2.18.2-alpha.1698728560863",
52
- "@varlet/shared": "2.18.2-alpha.1698728560863",
53
- "@varlet/icons": "2.18.2-alpha.1698728560863"
51
+ "@varlet/use": "2.18.2",
52
+ "@varlet/shared": "2.18.2",
53
+ "@varlet/icons": "2.18.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.3.4",
@@ -66,9 +66,9 @@
66
66
  "typescript": "^5.1.5",
67
67
  "vue": "3.3.4",
68
68
  "vue-router": "4.2.0",
69
- "@varlet/touch-emulator": "2.18.2-alpha.1698728560863",
70
- "@varlet/ui": "2.18.2-alpha.1698728560863",
71
- "@varlet/cli": "2.18.2-alpha.1698728560863"
69
+ "@varlet/cli": "2.18.2",
70
+ "@varlet/touch-emulator": "2.18.2",
71
+ "@varlet/ui": "2.18.2"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",