vueless 0.0.56 → 0.0.57

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,21 +1,30 @@
1
1
  import tippy from "tippy.js";
2
+ import merge from "lodash.merge";
2
3
 
3
- import vuelessConfig from "../../vueless.config";
4
+ import vuelessConfig from "../../../vueless.config.js";
4
5
 
5
6
  import "tippy.js/dist/tippy.css";
6
7
  import "tippy.js/themes/light.css";
7
8
  import "tippy.js/animations/shift-away.css";
8
9
 
9
- tippy.setDefaultProps(vuelessConfig.directive.tooltip);
10
+ const globalSettings = vuelessConfig?.directive?.tooltip || {};
11
+ const defaultSettings = {
12
+ arrow: true,
13
+ theme: "light",
14
+ animation: "shift-away",
15
+ };
16
+ const mergedSettings = merge(defaultSettings, globalSettings);
17
+
18
+ tippy.setDefaultProps(mergedSettings);
10
19
 
11
20
  export default {
12
21
  mounted(el, bindings) {
13
- tippy(el, bindings.value);
22
+ tippy(el, merge(mergedSettings, bindings.value || {}));
14
23
  },
15
24
  updated(el, bindings) {
16
25
  if (!el._tippy) return;
17
26
 
18
- el._tippy.setProps(bindings);
27
+ el._tippy.setProps(merge(mergedSettings, bindings.value || {}));
19
28
  },
20
29
  unmounted(el) {
21
30
  if (!el._tippy) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -21,6 +21,8 @@ import { UIcon } from "./constants";
21
21
  import defaultConfig from "./configs/default.config";
22
22
  import { useAttrs } from "./composables/attrs.composable";
23
23
 
24
+ import vTooltip from "../directive.tooltip";
25
+
24
26
  /* Should be a string for correct web-types gen */
25
27
  defineOptions({
26
28
  name: "UIcon",
@@ -31,9 +31,15 @@ export default /*tw*/ {
31
31
  long: 12000,
32
32
  },
33
33
  i18n: {
34
- success: "Operation successful.",
35
- warning: "Operation warning.",
36
- error: "Operation error.",
34
+ success: {
35
+ default: "Operation successful.",
36
+ },
37
+ warning: {
38
+ default: "Operation warning.",
39
+ },
40
+ error: {
41
+ default: "Operation error.",
42
+ },
37
43
  },
38
44
  positionClasses: {
39
45
  page: "UNotifyPage",
@@ -211,7 +211,7 @@ function setPosition() {
211
211
  }
212
212
 
213
213
  function getText(notificationText, type) {
214
- return notificationText || currentLocale.value[type];
214
+ return notificationText || currentLocale.value[type]?.default;
215
215
  }
216
216
 
217
217
  function getNotificationClasses(notification) {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.56",
4
+ "version": "0.0.57",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",