@enso-ui/auth 2.0.4 → 2.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/auth",
3
- "version": "2.0.4",
3
+ "version": "2.0.8",
4
4
  "description": "UI auth package",
5
5
  "main": "src/bulma/pages/auth/Index.vue",
6
6
  "scripts": {
@@ -39,7 +39,7 @@
39
39
  "autoprefixer": "^9.6.1",
40
40
  "babel-eslint": "^10.0.1",
41
41
  "cross-env": "^6.0.0",
42
- "eslint": "^7.0",
42
+ "eslint": "^7.0.0",
43
43
  "eslint-import-resolver-alias": "^1.1.2",
44
44
  "eslint-plugin-vue": "^8.0.3"
45
45
  }
@@ -1,13 +1,13 @@
1
1
  <template>
2
- <core-auth #default="{ guestState }">
3
- <section class="hero is-fullheight is-primary is-bold">
4
- <div class="hero-body">
5
- <div class="container">
2
+ <section class="hero is-fullheight is-primary is-bold">
3
+ <div class="hero-body">
4
+ <div class="container">
5
+ <core-auth v-slot="{ guestState }">
6
6
  <router v-if="guestState"/>
7
- </div>
7
+ </core-auth>
8
8
  </div>
9
- </section>
10
- </core-auth>
9
+ </div>
10
+ </section>
11
11
  </template>
12
12
 
13
13
  <script>
@@ -8,8 +8,7 @@
8
8
  :alt="meta.appName">
9
9
  </figure>
10
10
  </div>
11
- <form class="mb-2"
12
- @submit.prevent="submit()">
11
+ <form class="mb-2">
13
12
  <slot/>
14
13
  <submit v-bind="$attrs"/>
15
14
  <slot name="footer"/>
@@ -38,7 +38,7 @@ export default {
38
38
  : 6;
39
39
  },
40
40
  x(i) {
41
- const x = 2.5 + (i-1) * 15 + (i-1) * 5;
41
+ const x = 2.5 + (i - 1) * 15 + (i - 1) * 5;
42
42
  return `${x}%`;
43
43
  },
44
44
  },
@@ -21,10 +21,10 @@ library.add(faLock, faUser);
21
21
  export default {
22
22
  name: 'Submit',
23
23
 
24
- inject: ['errors', 'i18n', 'route', 'state', 'toastr'],
25
-
26
24
  components: { Fa },
27
25
 
26
+ inject: ['errors', 'i18n', 'route', 'state', 'toastr'],
27
+
28
28
  props: {
29
29
  action: {
30
30
  type: String,
@@ -44,6 +44,8 @@ export default {
44
44
  },
45
45
  },
46
46
 
47
+ emits: ['submitting', 'success'],
48
+
47
49
  data: () => ({
48
50
  loading: false,
49
51
  }),
@@ -1,18 +1,19 @@
1
1
  <template>
2
2
  <div class="field">
3
3
  <div class="control has-icons-left has-icons-right">
4
- <input :value="value"
4
+ <input :value="modelValue"
5
5
  class="input"
6
6
  :type="meta.content"
7
7
  :class="{ 'is-danger': errors.has('password'), 'is-success': successful }"
8
8
  :placeholder="i18n('Repeat Password')"
9
- @input="$emit('input', $event.target.value); errors.clear('password')">
9
+ @input="$emit('update:modelValue', $event.target.modelValue);
10
+ errors.clear('password')">
10
11
  <span class="icon is-small is-left">
11
12
  <fa icon="lock"/>
12
13
  </span>
13
14
  <reveal-password :meta="meta"
14
15
  :class="{ 'mr-5': match || successful || errors.has('password')}"
15
- v-if="value && !successful"/>
16
+ v-if="modelValue && !successful"/>
16
17
  <span v-if="errors.has('password')"
17
18
  class="icon is-small is-right has-text-danger">
18
19
  <fa icon="exclamation-triangle"/>
@@ -52,12 +53,14 @@ export default {
52
53
  type: Boolean,
53
54
  required: true,
54
55
  },
55
- value: {
56
+ modelValue: {
56
57
  type: String,
57
58
  required: true,
58
59
  },
59
60
  },
60
61
 
62
+ emits: ['update:modelValue'],
63
+
61
64
  data: () => ({
62
65
  meta: {
63
66
  content: 'password',
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <div class="field">
3
3
  <div class="control has-icons-left has-icons-right">
4
- <input :value="value"
4
+ <input :value="modelValue"
5
5
  v-focus
6
6
  class="input"
7
7
  type="email"
8
8
  :class="{ 'is-danger': errors.has('email'), 'is-success': successful }"
9
9
  :placeholder="i18n('Email')"
10
10
  autocomplete="email"
11
- @input="$emit('input', $event.target.value); errors.clear('email')">
11
+ @input="$emit('update:modelValue', $event.target.value); errors.clear('email')">
12
12
  <span class="icon is-small is-left">
13
13
  <fa icon="envelope"/>
14
14
  </span>
@@ -46,12 +46,14 @@ export default {
46
46
  inject: ['errors', 'i18n', 'state'],
47
47
 
48
48
  props: {
49
- value: {
49
+ modelValue: {
50
50
  type: String,
51
51
  required: true,
52
52
  },
53
53
  },
54
54
 
55
+ emits: ['change', 'update:modelValue'],
56
+
55
57
  computed: {
56
58
  successful() {
57
59
  return this.state.successful;
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <div class="field">
3
3
  <div class="control has-icons-left has-icons-right">
4
- <input :value="value"
4
+ <input :value="modelValue"
5
5
  class="input"
6
6
  :type="meta.content"
7
7
  :class="{ 'is-danger': errors.has('password'), 'is-success': successful }"
8
8
  :placeholder="i18n('Password')"
9
9
  :autocomplete="autocomplete"
10
- @input="$emit('input', $event.target.value); errors.clear('password')">
10
+ @input="$emit('update:modelValue', $event.target.value); errors.clear('password')">
11
11
  <span class="icon is-small is-left">
12
12
  <fa icon="lock"/>
13
13
  </span>
14
14
  <reveal-password :meta="meta"
15
15
  :class="{ 'is-spaced': successful || errors.has('password') }"
16
- v-if="value && !successful"/>
16
+ v-if="modelValue && !successful"/>
17
17
  <span v-if="successful"
18
18
  class="icon is-small is-right has-text-success">
19
19
  <fa icon="check"/>
@@ -23,8 +23,8 @@
23
23
  <fa icon="exclamation-triangle"/>
24
24
  </span>
25
25
  <slot name="password-strength"
26
- :password="value"
27
- :has-password="value.length > 0"/>
26
+ :password="modelValue"
27
+ :has-password="modelValue.length > 0"/>
28
28
  </div>
29
29
  <p class="has-text-danger is-size-7"
30
30
  v-if="errors.has('password')">
@@ -56,12 +56,14 @@ export default {
56
56
  type: String,
57
57
  default: 'current-password',
58
58
  },
59
- value: {
59
+ modelValue: {
60
60
  type: String,
61
61
  required: true,
62
62
  },
63
63
  },
64
64
 
65
+ emits: ['update:modelValue'],
66
+
65
67
  data: () => ({
66
68
  meta: {
67
69
  content: 'password',
@@ -2,9 +2,9 @@
2
2
  <div class="field">
3
3
  <div class="control">
4
4
  <label class="checkbox">
5
- <input :value="value"
6
- @change="$emit('input', !value)"
7
- :checked="value"
5
+ <input :value="modelValue"
6
+ @change="$emit('update:modelValue', !modelValue)"
7
+ :checked="modelValue"
8
8
  type="checkbox">
9
9
  {{ i18n('Remember me') }}
10
10
  </label>
@@ -19,10 +19,12 @@ export default {
19
19
  inject: ['i18n'],
20
20
 
21
21
  props: {
22
- value: {
22
+ modelValue: {
23
23
  type: Boolean,
24
24
  required: true,
25
25
  },
26
26
  },
27
+
28
+ emits: ['update:modelValue'],
27
29
  };
28
30
  </script>