druware-components 0.1.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/LICENSE +674 -0
- package/README.md +9 -0
- package/animated-count/animated-count.vue +102 -0
- package/animated-count/index.js +5 -0
- package/api/base.js +133 -0
- package/api/index.js +5 -0
- package/article-view/article-view.vue +146 -0
- package/article-view/index.js +4 -0
- package/content/content.js +10 -0
- package/content/index.js +4 -0
- package/dist/druware-components.css +26 -0
- package/dist/druware-components.js +4164 -0
- package/dist/druware-components.mjs +4164 -0
- package/dist/druware-components.umd.js +4167 -0
- package/index.js +5 -0
- package/package.json +24 -0
- package/vite.config.js +25 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="cardClass">
|
|
3
|
+
<div v-if="icon != null" class="icon-badge">
|
|
4
|
+
<span :class="'icon is-large ' + iconStyle">
|
|
5
|
+
<i :class="iconFamily + ' ' + icon" aria-hidden="true"></i>
|
|
6
|
+
</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="count">{{ currentCount }}</div>
|
|
9
|
+
<div class="label">{{ label }}</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
data: function() {
|
|
16
|
+
return {
|
|
17
|
+
currentCount: 0,
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
icon: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
iconFamily: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "fa",
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
count: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 0,
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: null,
|
|
37
|
+
},
|
|
38
|
+
iconStyle: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "has-text-info",
|
|
41
|
+
},
|
|
42
|
+
card: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
cardClass() {
|
|
49
|
+
return (this.card ? 'card ' : '') + "animated-count";
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
async setCount(value) {
|
|
54
|
+
var increment = Math.round(value / 10);
|
|
55
|
+
while (this.currentCount < value) {
|
|
56
|
+
this.currentCount += increment;
|
|
57
|
+
await new Promise(resolve => setTimeout(resolve, 25));
|
|
58
|
+
}
|
|
59
|
+
this.currentCount = value;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
watch: {
|
|
63
|
+
count(to,from) {
|
|
64
|
+
if (to === from) return;
|
|
65
|
+
this.setCount(to);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
mounted() {
|
|
70
|
+
this.setCount(this.count);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
</script>
|
|
74
|
+
<style lang="scss" scoped>
|
|
75
|
+
.animated-count {
|
|
76
|
+
// border: 1px solid black;
|
|
77
|
+
text-align: center;
|
|
78
|
+
align-content: space-evenly;
|
|
79
|
+
vertical-align: middle;
|
|
80
|
+
max-width: 140px;
|
|
81
|
+
min-width: 140px;
|
|
82
|
+
min-height: 128px;
|
|
83
|
+
max-height:128px;
|
|
84
|
+
|
|
85
|
+
.icon-badge {
|
|
86
|
+
font-size: 2em;
|
|
87
|
+
margin-bottom: 0px;
|
|
88
|
+
padding-bottom: 0px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.count {
|
|
92
|
+
font-size: 1.25em;
|
|
93
|
+
font-weight: 800;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.label {
|
|
97
|
+
color: #999999;
|
|
98
|
+
font-size: 0.75em;
|
|
99
|
+
font-weight: 100;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</style>
|
package/api/base.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
const trusteeStats = {
|
|
4
|
+
activeCaseCount: 0,
|
|
5
|
+
opendLast30: 0,
|
|
6
|
+
closedLast30: 0,
|
|
7
|
+
docketNext30: 0,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: "api",
|
|
12
|
+
models: {
|
|
13
|
+
trustee: {
|
|
14
|
+
stats: trusteeStats,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
url: {
|
|
18
|
+
profile: "316F7A82-BC60-46A4-B584-019CD3608B87",
|
|
19
|
+
base: {
|
|
20
|
+
tag: "/api/tag/",
|
|
21
|
+
trustee: "/api/trustee/",
|
|
22
|
+
calendar: "/api/calendar/",
|
|
23
|
+
case: "/api/case/",
|
|
24
|
+
creditor: "/api/creditor/",
|
|
25
|
+
employer: "/api/employer/"
|
|
26
|
+
},
|
|
27
|
+
authentication: {
|
|
28
|
+
login: "/api/login/",
|
|
29
|
+
user: "/api/user/",
|
|
30
|
+
status: "/api/profile/",
|
|
31
|
+
register: "/api/register/",
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
list: function (url, obj, onComplete, onError, page = 0, count = 100) {
|
|
36
|
+
axios
|
|
37
|
+
.get(url + "?page=" + page + "&count=" + count)
|
|
38
|
+
.then((response) => {
|
|
39
|
+
if (response.status == 200) {
|
|
40
|
+
onComplete(obj, response.data);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
onError(obj, response.message);
|
|
44
|
+
})
|
|
45
|
+
.catch((error) => onError(obj, error));
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
getUrl: function(url, obj, onComplete, onError) {
|
|
49
|
+
axios
|
|
50
|
+
.get(url)
|
|
51
|
+
.then(response => {
|
|
52
|
+
if (response.status == 200) {
|
|
53
|
+
onComplete(obj, response.data);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
onError(obj, response.statusText);
|
|
57
|
+
})
|
|
58
|
+
.catch(error => onError(obj, error));
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
get: function(url, obj, id, onComplete, onError) {
|
|
62
|
+
axios
|
|
63
|
+
.get(url + id)
|
|
64
|
+
.then(response => {
|
|
65
|
+
if (response.status == 200) {
|
|
66
|
+
onComplete(obj, response.data);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
onError(obj, response.statusText);
|
|
70
|
+
})
|
|
71
|
+
.catch(error => onError(obj, error));
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
post: function(url, obj, model, onComplete, onError) {
|
|
75
|
+
axios
|
|
76
|
+
.post(url, model)
|
|
77
|
+
.then(response => {
|
|
78
|
+
if (response.status == 200) {
|
|
79
|
+
onComplete(obj, response.data);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (response.status == 400) {
|
|
83
|
+
onError(obj, response.response);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
onError(obj, response.statusText);
|
|
87
|
+
})
|
|
88
|
+
.catch(error => onError(obj, error));
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
put: function(url, obj, id, model, onComplete, onError) {
|
|
92
|
+
axios
|
|
93
|
+
.put(url + id, model)
|
|
94
|
+
.then(response => {
|
|
95
|
+
if (response.status == 200) {
|
|
96
|
+
onComplete(obj, response.data);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (response.status == 400) {
|
|
100
|
+
onError(obj, response);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
onError(obj, response.statusText);
|
|
104
|
+
})
|
|
105
|
+
.catch(error => onError(obj, error));
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
delete: function(url, obj, id, onComplete, onError) {
|
|
109
|
+
axios
|
|
110
|
+
.delete(url + id)
|
|
111
|
+
.then(response => {
|
|
112
|
+
if (response.status == 200) {
|
|
113
|
+
onComplete(obj, response.data);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
onError(obj, response.statusText);
|
|
117
|
+
})
|
|
118
|
+
.catch(error => onError(obj, error));
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
model: function(url, obj, onComplete, onError) {
|
|
122
|
+
axios
|
|
123
|
+
.get(url + "model")
|
|
124
|
+
.then(response => {
|
|
125
|
+
if (response.status == 200) {
|
|
126
|
+
onComplete(obj, response.data);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
onError(obj, response.statusText);
|
|
130
|
+
})
|
|
131
|
+
.catch(error => onError(obj, error));
|
|
132
|
+
}
|
|
133
|
+
};
|
package/api/index.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="new-article-view">
|
|
3
|
+
<article class="media mt-1 mb-3" v-if="article != null">
|
|
4
|
+
<figure class="media-left" v-if="showIcon">
|
|
5
|
+
<p class="image is-64x64">
|
|
6
|
+
<router-link :to="route">
|
|
7
|
+
<img v-if="article.iconImage != null" :src="article.iconImage" />
|
|
8
|
+
<img v-else-if="article.iconId != null" :src="'/api/asset/' + article.iconId" />
|
|
9
|
+
<img v-else src="https://bulma.io/assets/images/placeholders/128x128.png" /></router-link>
|
|
10
|
+
</p>
|
|
11
|
+
</figure>
|
|
12
|
+
<div class="media-content">
|
|
13
|
+
<div class="content">
|
|
14
|
+
<router-link :to="route">
|
|
15
|
+
<h3 :class="'title mb-2 ' + (small ? 'is-5' : 'is-4')">{{article.title}}</h3>
|
|
16
|
+
</router-link>
|
|
17
|
+
<span v-html="compileMarkdown((summary) ? article.summary : article.body)"></span>
|
|
18
|
+
<div class="level is-mobile mt-2">
|
|
19
|
+
<div class="level-left">
|
|
20
|
+
<strong v-if="!disableByLine">{{article.byLine}} @ <small v-if="!disableDates">{{formatDate(article.posted)}}</small></strong>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="level-right">
|
|
23
|
+
<span v-if="!disableTags">
|
|
24
|
+
<span v-for="tag in article.tags" :key="article.tags.indexOf(tag)">
|
|
25
|
+
<span class="tag m-1">{{tag}}</span>
|
|
26
|
+
</span>
|
|
27
|
+
</span>
|
|
28
|
+
<a :href="url" v-if="summary && url !== ''" class="level-item">
|
|
29
|
+
<span class="icon is-medium"><i class="fa fa-search"></i></span>
|
|
30
|
+
</a>
|
|
31
|
+
<router-link :to="route" v-else-if="summary && route !== ''" class="level-item">
|
|
32
|
+
<span class="icon is-medium"><i class="fa fa-search"></i></span>
|
|
33
|
+
</router-link>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<!-- nav v-if="enableComments || enableLikes" class="level is-mobile">
|
|
38
|
+
<div class="level-left">
|
|
39
|
+
<a v-if="enableLikes" class="level-item">
|
|
40
|
+
<span class="icon is-small"><i class="fa fa-heart"></i></span>
|
|
41
|
+
</a>
|
|
42
|
+
<a v-if="enableComments" class="level-item">
|
|
43
|
+
<span class="icon is-small"><i class="fa fa-comment"></i></span>
|
|
44
|
+
</a>
|
|
45
|
+
</div>
|
|
46
|
+
</nav -->
|
|
47
|
+
<div v-if="enableDisqus" id="disqus_thread"></div>
|
|
48
|
+
</div>
|
|
49
|
+
</article>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script>
|
|
54
|
+
import { RouterLink } from 'vue-router'
|
|
55
|
+
|
|
56
|
+
import {marked} from "marked";
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: "NewsArticleView",
|
|
60
|
+
props: {
|
|
61
|
+
article: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default: null,
|
|
64
|
+
},
|
|
65
|
+
summary: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
route: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "",
|
|
72
|
+
},
|
|
73
|
+
enableComments: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
77
|
+
enableDisqus: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
81
|
+
enableLikes: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false,
|
|
84
|
+
},
|
|
85
|
+
disableTags: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false,
|
|
88
|
+
},
|
|
89
|
+
disableByLine: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
93
|
+
disableDates: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false,
|
|
96
|
+
},
|
|
97
|
+
showIcon: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false,
|
|
100
|
+
},
|
|
101
|
+
url: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: "",
|
|
104
|
+
},
|
|
105
|
+
disqusShortname: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: null,
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
components: {
|
|
111
|
+
RouterLink
|
|
112
|
+
},
|
|
113
|
+
methods: {
|
|
114
|
+
showDisqusThread() {
|
|
115
|
+
let d = document, s = d.createElement('script');
|
|
116
|
+
s.src = 'https://' + this.disqusShortname + '.disqus.com/embed.js';
|
|
117
|
+
s.setAttribute('data-timestamp', +new Date());
|
|
118
|
+
(d.head || d.body).appendChild(s);
|
|
119
|
+
},
|
|
120
|
+
formatDate(str) {
|
|
121
|
+
let d = new Date(str);
|
|
122
|
+
return (
|
|
123
|
+
d.toLocaleDateString("en-US") + " " + d.toLocaleTimeString("en-US")
|
|
124
|
+
);
|
|
125
|
+
},
|
|
126
|
+
compileMarkdown(str) {
|
|
127
|
+
return marked(str);
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
mounted() {
|
|
131
|
+
let disqus_config = function () {
|
|
132
|
+
this.page.url = document.location.href;
|
|
133
|
+
this.page.identifier = this.article.permalink ?? document.location.href;
|
|
134
|
+
}
|
|
135
|
+
if (this.enableDisqus && this.disqusShortname !== null) {
|
|
136
|
+
this.showDisqusThread();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<style scoped>
|
|
143
|
+
.new-article-view {
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
}
|
|
146
|
+
</style>
|
package/content/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.animated-count[data-v-0827a913] {
|
|
2
|
+
text-align: center;
|
|
3
|
+
align-content: space-evenly;
|
|
4
|
+
vertical-align: middle;
|
|
5
|
+
max-width: 140px;
|
|
6
|
+
min-width: 140px;
|
|
7
|
+
min-height: 128px;
|
|
8
|
+
max-height: 128px;
|
|
9
|
+
}
|
|
10
|
+
.animated-count .icon-badge[data-v-0827a913] {
|
|
11
|
+
font-size: 2em;
|
|
12
|
+
margin-bottom: 0px;
|
|
13
|
+
padding-bottom: 0px;
|
|
14
|
+
}
|
|
15
|
+
.animated-count .count[data-v-0827a913] {
|
|
16
|
+
font-size: 1.25em;
|
|
17
|
+
font-weight: 800;
|
|
18
|
+
}
|
|
19
|
+
.animated-count .label[data-v-0827a913] {
|
|
20
|
+
color: #999999;
|
|
21
|
+
font-size: 0.75em;
|
|
22
|
+
font-weight: 100;
|
|
23
|
+
}
|
|
24
|
+
.new-article-view[data-v-b6905e0a] {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|