aloha-vue 1.0.10 → 1.0.11

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/docs/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "build-css": "node-sass --include-path scss styles/styles.scss public/styles.css"
12
12
  },
13
13
  "dependencies": {
14
- "aloha-css": "1.0.9",
14
+ "aloha-css": "1.0.10",
15
15
  "lodash-es": "^4.17.21",
16
16
  "vue": "3.2.31",
17
17
  "vue-router": "4.0.14",
@@ -41,8 +41,8 @@
41
41
  "sass-loader": "12.6.0",
42
42
  "source-map-loader": "3.0.1",
43
43
  "style-loader": "3.3.1",
44
- "vue-loader": "17.0.0",
45
44
  "vue-eslint-parser": "8.3.0",
45
+ "vue-loader": "17.0.0",
46
46
  "vue-pug-loader": "1.1.26",
47
47
  "webpack": "5.73.0",
48
48
  "webpack-cli": "4.10.0",
@@ -43,6 +43,11 @@ export default {
43
43
  name: "PageAccordion",
44
44
  label: "Accordion",
45
45
  },
46
+ {
47
+ id: "alert",
48
+ name: "PageAlert",
49
+ label: "Alert",
50
+ },
46
51
  ],
47
52
  };
48
53
  },
@@ -54,6 +54,11 @@ const ROUTES = [
54
54
  name: "PageAccordion",
55
55
  component: () => import(/* webpackChunkName: "PageAccordionBootstrap" */ "../views/PageAccordion/PageAccordion.vue"),
56
56
  },
57
+ {
58
+ path: "/alert",
59
+ name: "PageAlert",
60
+ component: () => import(/* webpackChunkName: "PageAlert" */ "../views/PageAlert/PageAlert.vue"),
61
+ },
57
62
  {
58
63
  // If the routing configuration '*' reports an error, replace it with '/: catchAll(. *)'
59
64
  // caught Error: Catch all routes ("*") must now be defined using a param with a custom regexp
@@ -0,0 +1,27 @@
1
+ import AAlert from "../../../../src/AAlert/AAlert";
2
+
3
+ export default {
4
+ name: "PageAlert",
5
+ components: {
6
+ AAlert,
7
+ },
8
+ data() {
9
+ return {
10
+ alerts: [
11
+ "primary",
12
+ "secondary",
13
+ "success",
14
+ "danger",
15
+ "warning",
16
+ "info",
17
+ "dark",
18
+ ],
19
+ isAlertsHidden: {},
20
+ };
21
+ },
22
+ methods: {
23
+ closeAlert(alert) {
24
+ this.isAlertsHidden[alert] = true;
25
+ },
26
+ },
27
+ };
@@ -0,0 +1,10 @@
1
+ div
2
+ a-alert(
3
+ v-for="alert in alerts"
4
+ :key="alert"
5
+ :type="alert"
6
+ :is-visible="!isAlertsHidden[alert]"
7
+ :is-dismissible="true"
8
+ @on-dismiss="closeAlert(alert)"
9
+ )
10
+ div Alert {{ alert }}
@@ -0,0 +1,2 @@
1
+ <template lang="pug" src="./PageAlert.pug"></template>
2
+ <script src="./PageAlert.js"></script>
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Ilia Brykin",
6
6
  "dependencies": {
7
7
  "@popperjs/core": "2.11.5",
8
- "aloha-css": "1.0.8",
8
+ "aloha-css": "1.0.10",
9
9
  "lodash-es": "^4.17.21",
10
10
  "vue": "3.2.37"
11
11
  }
@@ -0,0 +1,62 @@
1
+ import {
2
+ h,
3
+ } from "vue";
4
+
5
+ export default {
6
+ name: "AAlert",
7
+ props: {
8
+ isVisible: {
9
+ type: Boolean,
10
+ required: false,
11
+ },
12
+ type: {
13
+ type: String,
14
+ required: false,
15
+ default: "danger",
16
+ },
17
+ isDismissible: {
18
+ type: Boolean,
19
+ required: false,
20
+ default: false,
21
+ },
22
+ alertClass: {
23
+ type: [String, Object],
24
+ required: false,
25
+ default: undefined,
26
+ },
27
+ },
28
+ emits: [
29
+ "onDismiss",
30
+ ],
31
+ computed: {
32
+ alertClassLocal() {
33
+ let alertClass = `a_alert a_alert_${ this.type }`;
34
+ if (this.isDismissible) {
35
+ alertClass += " a_alert_dismissible";
36
+ }
37
+ return alertClass;
38
+ },
39
+ },
40
+ methods: {
41
+ onDismissLocal() {
42
+ this.$emit("onDismiss");
43
+ },
44
+ },
45
+ render() {
46
+ return h("div", {
47
+ role: "alert",
48
+ }, [
49
+ this.isVisible && h("div", {
50
+ class: [this.alertClass, this.alertClassLocal],
51
+ }, [
52
+ this.$slots.default && this.$slots.default(),
53
+ this.isDismissible && h("button", {
54
+ type: "button",
55
+ class: "a_btn_close",
56
+ ariaLabel: "Close",
57
+ onClick: this.onDismissLocal,
58
+ })
59
+ ]),
60
+ ]);
61
+ },
62
+ };