@tak-ps/vue-tabler 3.43.0 → 3.44.1

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/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v3.44.1
14
+
15
+ - :bug: Allow alert to open
16
+
17
+ ### v3.44.0
18
+
19
+ - :tada: Add `Alert` Component and update `Err` to use `Alert` internally
20
+
13
21
  ### v3.43.0
14
22
 
15
23
  - :rocket: Reduce number of updates in `Input` and also declare all emits
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div class='card-body'>
3
+ <div class='d-flex justify-content-center' :class='{
4
+ "mt-4 mb-2": !compact
5
+ }'>
6
+ <IconAlertTriangle v-if='compact' size='32' />
7
+ <IconAlertTriangle v-else size='48'/>
8
+ </div>
9
+
10
+ <h3 class='pt-3 text-center' v-text='title'></h3>
11
+ <div class='text-center' :class='{
12
+ "mb-4 mt-2": !compact
13
+ }'>
14
+ <div><span v-text='err.message'/></div>
15
+ </div>
16
+
17
+ <template v-if='err.body || err.stack'>
18
+ <div class="py-2 px-3">
19
+ <div @click='open = !open' class='subheader d-flex align-items-center cursor-pointer'>
20
+ <IconChevronRight v-if='!open' size='24' class='cursor-pointer'/>
21
+ <IconChevronDown v-else size='24' class='cursor-pointer'/>
22
+ <span>Advanced</span>
23
+ </div>
24
+ <pre
25
+ v-if='open'
26
+ v-text='err.body || err.stack'
27
+ class='my-3'
28
+ />
29
+ </div>
30
+ </template>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import {
36
+ IconAlertTriangle,
37
+ IconChevronRight,
38
+ IconChevronDown,
39
+ } from '@tabler/icons-vue'
40
+
41
+ export default {
42
+ name: 'TablerAlert',
43
+ props: {
44
+ title: {
45
+ type: String,
46
+ default: 'Generic Error'
47
+ },
48
+ err: {
49
+ type: Error,
50
+ default: new Error('Something is amiss')
51
+ },
52
+ compact: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ },
57
+ data: function() {
58
+ return {
59
+ open: false
60
+ }
61
+ },
62
+ components: {
63
+ IconAlertTriangle,
64
+ IconChevronRight,
65
+ IconChevronDown,
66
+ }
67
+ }
68
+ </script>
@@ -2,26 +2,9 @@
2
2
  <Modal>
3
3
  <button type="button" class="btn-close" @click='close' aria-label="Close"></button>
4
4
  <div class="modal-status bg-yellow"></div>
5
- <div class="modal-body text-center py-4">
6
- <IconAlertCircle size='40'/>
7
- <h3>Website Error</h3>
8
- <div class="text-muted" v-text='err.message'></div>
9
- </div>
10
5
 
11
- <template v-if='err.body || err.stack'>
12
- <div class="py-2 px-3">
13
- <div @click='open = !open' class='subheader d-flex align-items-center cursor-pointer'>
14
- <IconChevronRight v-if='!open' size='24' class='cursor-pointer'/>
15
- <IconChevronDown v-else size='24' class='cursor-pointer'/>
16
- <span>Advanced</span>
17
- </div>
18
- <pre
19
- v-if='open'
20
- v-text='err.body || err.stack'
21
- class='my-3'
22
- />
23
- </div>
24
- </template>
6
+ <Alert :title='title' :err='err'/>
7
+
25
8
  <div class="modal-footer">
26
9
  <div class="w-100">
27
10
  <div class="row">
@@ -34,11 +17,7 @@
34
17
 
35
18
  <script>
36
19
  import Modal from './Modal.vue';
37
- import {
38
- IconAlertCircle,
39
- IconChevronRight,
40
- IconChevronDown
41
- } from '@tabler/icons-vue'
20
+ import Alert from './Alert.vue';
42
21
 
43
22
  export default {
44
23
  name: 'TablerErr',
@@ -47,6 +26,10 @@ export default {
47
26
  type: Error,
48
27
  required: true
49
28
  },
29
+ title: {
30
+ type: String,
31
+ default: 'Website Error'
32
+ },
50
33
  trace: {
51
34
  type: Boolean,
52
35
  default: true
@@ -63,10 +46,8 @@ export default {
63
46
  },
64
47
  },
65
48
  components: {
66
- Modal,
67
- IconChevronRight,
68
- IconChevronDown,
69
- IconAlertCircle
49
+ Alert,
50
+ Modal
70
51
  }
71
52
  }
72
53
  </script>
package/lib.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // Inputs
2
+ export { default as TablerAlert } from './components/Alert.vue'
2
3
  export { default as TablerTimeZone } from './components/input/TimeZone.vue'
3
4
  export { default as TablerRange } from './components/input/Range.vue'
4
5
  export { default as TablerColour } from './components/input/Colour.vue'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "3.43.0",
4
+ "version": "3.44.1",
5
5
  "lib": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",