@community-release/nx-ui 0.0.4 → 0.0.7
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/dist/module.d.mts +7 -0
- package/dist/module.d.ts +7 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +230 -9
- package/dist/runtime/components/accordion.vue +221 -0
- package/dist/runtime/components/animated-number/animateValue.d.ts +13 -0
- package/dist/runtime/components/animated-number/animateValue.mjs +56 -0
- package/dist/runtime/components/animated-number/index.vue +43 -0
- package/dist/runtime/components/button/index.vue +360 -0
- package/dist/runtime/components/button/index.vue.d.ts +81 -0
- package/dist/runtime/components/button/props.json +6 -0
- package/dist/runtime/components/card.vue +138 -0
- package/dist/runtime/components/checkbox.vue +227 -0
- package/dist/runtime/components/countdown/index.vue +64 -0
- package/dist/runtime/components/countdown/props.json +6 -0
- package/dist/runtime/components/filter/index.vue +140 -0
- package/dist/runtime/components/filter/props.json +4 -0
- package/dist/runtime/components/grid.vue +169 -0
- package/dist/runtime/components/grid.vue.d.ts +56 -0
- package/dist/runtime/components/helpers/Countdown.d.ts +0 -0
- package/dist/runtime/components/helpers/Countdown.mjs +143 -0
- package/dist/runtime/components/helpers/getEventCoord.d.ts +7 -0
- package/dist/runtime/components/helpers/getEventCoord.mjs +16 -0
- package/dist/runtime/components/helpers/isImageExist.d.ts +6 -0
- package/dist/runtime/components/helpers/isImageExist.mjs +20 -0
- package/dist/runtime/components/helpers/isMobileDevice.d.ts +5 -0
- package/dist/runtime/components/helpers/isMobileDevice.mjs +12 -0
- package/dist/runtime/components/helpers/isWebKit.d.ts +5 -0
- package/dist/runtime/components/helpers/isWebKit.mjs +12 -0
- package/dist/runtime/components/helpers/uniq.d.ts +2 -0
- package/dist/runtime/components/helpers/uniq.mjs +1 -0
- package/dist/runtime/components/icons/check.svg +1 -0
- package/dist/runtime/components/icons/check.white.svg +1 -0
- package/dist/runtime/components/impulse-indicator.vue +139 -0
- package/dist/runtime/components/impulse-indicator.vue.d.ts +21 -0
- package/dist/runtime/components/input/index.vue +241 -0
- package/dist/runtime/components/input/props.json +5 -0
- package/dist/runtime/components/label.vue +33 -0
- package/dist/runtime/components/loading.vue +91 -0
- package/dist/runtime/components/map/device-zoom-switch.vue +160 -0
- package/dist/runtime/components/map/index.vue +135 -0
- package/dist/runtime/components/map/location/index.vue +109 -0
- package/dist/runtime/components/map/location/list.vue +54 -0
- package/dist/runtime/components/map/location/nearest.vue +88 -0
- package/dist/runtime/components/map/openlayers/index.vue +355 -0
- package/dist/runtime/components/map/props.json +5 -0
- package/dist/runtime/components/map/store.d.ts +114 -0
- package/dist/runtime/components/map/store.mjs +166 -0
- package/dist/runtime/components/map/zoom.vue +61 -0
- package/dist/runtime/components/notice/index.vue +63 -0
- package/dist/runtime/components/notice/item.vue +118 -0
- package/dist/runtime/components/notice/store.d.ts +27 -0
- package/dist/runtime/components/notice/store.mjs +46 -0
- package/dist/runtime/components/radio.vue +215 -0
- package/dist/runtime/components/select.vue +303 -0
- package/dist/runtime/components/static-map.vue +345 -0
- package/dist/runtime/components/styles/components.less +3 -0
- package/dist/runtime/components/styles/mixins.less +6 -0
- package/dist/runtime/components/textarea/index.vue +166 -0
- package/dist/runtime/components/textarea/props.json +4 -0
- package/dist/runtime/components/tooltip.vue +137 -0
- package/dist/runtime/plugins/methods.d.ts +2 -0
- package/dist/runtime/plugins/methods.mjs +20 -0
- package/dist/runtime/plugins/variables.d.ts +2 -0
- package/dist/runtime/plugins/variables.mjs +17 -0
- package/dist/types.d.mts +2 -11
- package/dist/types.d.ts +2 -11
- package/package.json +2 -2
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
class="component-ui component-ui-button"
|
|
4
|
+
:is="computedType"
|
|
5
|
+
:href="href"
|
|
6
|
+
:to="href"
|
|
7
|
+
:class="classes"
|
|
8
|
+
:style="styles"
|
|
9
|
+
@click="handleClick"
|
|
10
|
+
>
|
|
11
|
+
<div class="button-bg" :style="buttonBgStyle"></div>
|
|
12
|
+
|
|
13
|
+
<ui-impulse-indicator :impulse="impulse" />
|
|
14
|
+
|
|
15
|
+
<span class="button-content">
|
|
16
|
+
<span><slot name="prepend"></slot></span>
|
|
17
|
+
<span class="slot-default"><slot></slot></span>
|
|
18
|
+
<span><slot name="append"></slot></span>
|
|
19
|
+
</span>
|
|
20
|
+
|
|
21
|
+
<ui-loading class="loading-indicator" :active="loading"></ui-loading>
|
|
22
|
+
</component>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import UiImpulseIndicator from '../impulse-indicator.vue';
|
|
27
|
+
import UiLoading from '../loading.vue';
|
|
28
|
+
import comProps from '#build/ui.button.mjs';
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
components: {
|
|
32
|
+
UiImpulseIndicator,
|
|
33
|
+
UiLoading,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Data
|
|
37
|
+
props: {
|
|
38
|
+
color: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: comProps.color,
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: comProps.size,
|
|
45
|
+
},
|
|
46
|
+
variant: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: comProps.variant,
|
|
49
|
+
},
|
|
50
|
+
shape: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: comProps.shape,
|
|
53
|
+
},
|
|
54
|
+
href: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: '',
|
|
57
|
+
},
|
|
58
|
+
type: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: '',
|
|
61
|
+
},
|
|
62
|
+
block: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
loading: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
disabled: {
|
|
71
|
+
type: [Boolean, Number],
|
|
72
|
+
default: false,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
data: function() {
|
|
76
|
+
return {
|
|
77
|
+
impulse: false,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
computedType() {
|
|
82
|
+
return this.type !== '' ? this.type : (this.href !== '' ? 'a' : 'span');
|
|
83
|
+
},
|
|
84
|
+
classes() {
|
|
85
|
+
let ar = [];
|
|
86
|
+
|
|
87
|
+
if (this.size) ar.push(`tag-size-${this.size}`);
|
|
88
|
+
if (this.shape) ar.push(`tag-shape-${this.shape}`);
|
|
89
|
+
if (this.variant) ar.push(`tag-variant-${this.variant}`);
|
|
90
|
+
if (this.block) ar.push('tag-block');
|
|
91
|
+
if (this.loading) ar.push('tag-loading');
|
|
92
|
+
if (this.disabled) ar.push('tag-disabled');
|
|
93
|
+
|
|
94
|
+
return ar;
|
|
95
|
+
},
|
|
96
|
+
stylesHoverColor() {
|
|
97
|
+
return `var(--ui-color-text-on-${this.color})`;
|
|
98
|
+
},
|
|
99
|
+
styles() {
|
|
100
|
+
let background = `var(--ui-color-${this.color})`;
|
|
101
|
+
let color = `var(--ui-color-text-on-${this.color})`;
|
|
102
|
+
|
|
103
|
+
if (this.variant === 'flat' || this.variant === 'outline')
|
|
104
|
+
background = 'transparent';
|
|
105
|
+
|
|
106
|
+
if (this.variant === 'flat' || this.variant === 'outline')
|
|
107
|
+
color = `var(--ui-color-${this.color}-text)`;
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
background,
|
|
111
|
+
color
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
buttonBgStyle() {
|
|
115
|
+
return {
|
|
116
|
+
'background': (this.variant === 'flat' || this.variant === 'outline') ? `var(--ui-color-${this.color})` : 'rgba(66,88,120, 0.075)'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
// Methods
|
|
122
|
+
methods: {
|
|
123
|
+
handleClick(e) {
|
|
124
|
+
if (this.disabled || this.loading) return;
|
|
125
|
+
|
|
126
|
+
let rect = this.$el.getBoundingClientRect();
|
|
127
|
+
|
|
128
|
+
this.impulse = {
|
|
129
|
+
left : e.clientX - rect.left,
|
|
130
|
+
top : e.clientY - rect.top,
|
|
131
|
+
width : this.$el.offsetWidth,
|
|
132
|
+
height : this.$el.offsetHeight
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<style lang="less">
|
|
140
|
+
.component-ui-button {
|
|
141
|
+
--button-hover-color: v-bind(stylesHoverColor);
|
|
142
|
+
--button-text-color: v-bind(styles.color);
|
|
143
|
+
--button-background: v-bind(styles.background);
|
|
144
|
+
|
|
145
|
+
// Input height
|
|
146
|
+
@com-input-height-large: var(--ui-input-height-large);
|
|
147
|
+
@com-input-height-big: var(--ui-input-height-big);
|
|
148
|
+
@com-input-height-medium: var(--ui-input-height-medium);
|
|
149
|
+
@com-input-height-default: var(--ui-input-height-default);
|
|
150
|
+
@com-input-height-small: var(--ui-input-height-small);
|
|
151
|
+
@com-input-height-mini: var(--ui-input-height-mini);
|
|
152
|
+
|
|
153
|
+
// Animation
|
|
154
|
+
@com-ani-time: var(--ui-ani-time);
|
|
155
|
+
@com-ani-ease: var(--ui-ani-ease);
|
|
156
|
+
|
|
157
|
+
// Colors
|
|
158
|
+
@com-color-header-text: var(--ui-color-header-text);
|
|
159
|
+
@com-color-primary: var(--ui-color-primary);
|
|
160
|
+
@com-color-primary-text: var(--ui-color-primary-text);
|
|
161
|
+
@com-color-secondary: var(--ui-color-secondary);
|
|
162
|
+
@com-color-border-bolder: var(--ui-color-border-bolder);
|
|
163
|
+
|
|
164
|
+
// Border radius
|
|
165
|
+
@com-border-radius-default: var(--ui-border-radius-default);
|
|
166
|
+
@com-border-radius-small: var(--ui-border-radius-small);
|
|
167
|
+
@com-border-radius-round: var(--ui-input-height-large);
|
|
168
|
+
|
|
169
|
+
// Padding
|
|
170
|
+
@com-space-default: var(--ui-space-default);
|
|
171
|
+
@com-space-small: var(--ui-space-small);
|
|
172
|
+
@com-space-mini: var(--ui-space-mini);
|
|
173
|
+
|
|
174
|
+
// Text
|
|
175
|
+
@com-text-default: var(--ui-text-default);
|
|
176
|
+
@com-text-small: var(--ui-text-small);
|
|
177
|
+
@com-text-mini: var(--ui-text-mini);
|
|
178
|
+
|
|
179
|
+
// Font
|
|
180
|
+
@com-font-header: var(--ui-font-header);
|
|
181
|
+
|
|
182
|
+
// Box shadow
|
|
183
|
+
@com-bs-1: var(--ui-bs-1);
|
|
184
|
+
|
|
185
|
+
transition: opacity @com-ani-time @com-ani-ease, visibility @com-ani-time @com-ani-ease;
|
|
186
|
+
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
position: relative;
|
|
189
|
+
display: inline-block;
|
|
190
|
+
vertical-align: top;
|
|
191
|
+
|
|
192
|
+
padding: 0 @com-space-default;
|
|
193
|
+
height: @com-input-height-default;
|
|
194
|
+
line-height: 1.1;
|
|
195
|
+
|
|
196
|
+
text-align: center;
|
|
197
|
+
font-size: @com-text-default;
|
|
198
|
+
font-weight: normal;
|
|
199
|
+
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
border: 1px solid transparent;
|
|
202
|
+
border-radius: @com-input-height-large;
|
|
203
|
+
|
|
204
|
+
-webkit-user-select: none;
|
|
205
|
+
-moz-user-select: none;
|
|
206
|
+
user-select: none;
|
|
207
|
+
|
|
208
|
+
img {
|
|
209
|
+
width: 35px;
|
|
210
|
+
max-width: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.button-bg {
|
|
214
|
+
transition: opacity @com-ani-time @com-ani-ease;
|
|
215
|
+
|
|
216
|
+
opacity: 0;
|
|
217
|
+
position: absolute;
|
|
218
|
+
inset: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.button-content {
|
|
222
|
+
transition: opacity @com-ani-time @com-ani-ease, visibility @com-ani-time @com-ani-ease, color @com-ani-time @com-ani-ease;
|
|
223
|
+
|
|
224
|
+
display: flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
|
|
228
|
+
position: relative;
|
|
229
|
+
height: 100%;
|
|
230
|
+
font-weight: 600;
|
|
231
|
+
font-family: @com-font-header;
|
|
232
|
+
letter-spacing: -0.015em;
|
|
233
|
+
|
|
234
|
+
.slot-default {
|
|
235
|
+
padding: 0 @com-space-mini;
|
|
236
|
+
line-height: 1;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.ic {
|
|
240
|
+
font-weight: normal;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.loading-indicator {
|
|
245
|
+
transform: translate3d(-50%, -50%, 0);
|
|
246
|
+
position: absolute;
|
|
247
|
+
top: 50%;
|
|
248
|
+
left: 50%;
|
|
249
|
+
|
|
250
|
+
svg circle {
|
|
251
|
+
stroke: var(--button-text-color);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Loading state
|
|
256
|
+
&.tag-loading {
|
|
257
|
+
cursor: default;
|
|
258
|
+
|
|
259
|
+
.button-content {
|
|
260
|
+
opacity: 0;
|
|
261
|
+
visibility: hidden;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Flat
|
|
266
|
+
&.tag-variant-flat {
|
|
267
|
+
border: none;
|
|
268
|
+
box-shadow: none;
|
|
269
|
+
background: transparent;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Outline
|
|
273
|
+
&.tag-variant-outline {
|
|
274
|
+
background: transparent;
|
|
275
|
+
border: 1px solid var(--button-text-color);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Shapes
|
|
279
|
+
&.tag-shape-circle {
|
|
280
|
+
padding: 0 !important;
|
|
281
|
+
width: @com-input-height-default;
|
|
282
|
+
border-radius: 50%;
|
|
283
|
+
|
|
284
|
+
&.tag-size-large { width: @com-input-height-large; }
|
|
285
|
+
&.tag-size-big { width: @com-input-height-big; }
|
|
286
|
+
&.tag-size-medium { width: @com-input-height-big; }
|
|
287
|
+
&.tag-size-small { width: @com-input-height-small; }
|
|
288
|
+
&.tag-size-mini { width: @com-input-height-mini; }
|
|
289
|
+
}
|
|
290
|
+
&.tag-shape-round {
|
|
291
|
+
border-radius: @com-border-radius-round;
|
|
292
|
+
}
|
|
293
|
+
&.tag-shape-round-square {
|
|
294
|
+
border-radius: @com-border-radius-small;
|
|
295
|
+
}
|
|
296
|
+
&.tag-shape-square {
|
|
297
|
+
border-radius: 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Block
|
|
301
|
+
&.tag-block {
|
|
302
|
+
display: block;
|
|
303
|
+
padding: 0 @com-space-mini;
|
|
304
|
+
width: 100%;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Size
|
|
308
|
+
&.tag-size-large {
|
|
309
|
+
height: @com-input-height-large;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&.tag-size-big {
|
|
313
|
+
height: @com-input-height-big;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&.tag-size-medium {
|
|
317
|
+
height: @com-input-height-medium;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
&.tag-size-small {
|
|
321
|
+
padding: 0 @com-space-small;
|
|
322
|
+
height: @com-input-height-small;
|
|
323
|
+
|
|
324
|
+
font-size: @com-text-small;
|
|
325
|
+
|
|
326
|
+
.loading-indicator {
|
|
327
|
+
transform: translate3d(-50%, -50%, 0) scale(0.8);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&.tag-size-mini {
|
|
332
|
+
padding: 0 10px;
|
|
333
|
+
height: @com-input-height-mini;
|
|
334
|
+
|
|
335
|
+
font-size: @com-text-mini;
|
|
336
|
+
|
|
337
|
+
.loading-indicator {
|
|
338
|
+
transform: translate3d(-50%, -50%, 0) scale(0.6);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Disabled
|
|
343
|
+
&.tag-disabled {
|
|
344
|
+
opacity: 0.6;
|
|
345
|
+
cursor: default;
|
|
346
|
+
pointer-events: none;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
@media (hover: hover) {
|
|
351
|
+
.component-ui-button {
|
|
352
|
+
&:hover {
|
|
353
|
+
text-decoration: none;
|
|
354
|
+
color: var(--button-hover-color) !important;
|
|
355
|
+
|
|
356
|
+
.button-bg { opacity: 1; }
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
namespace components {
|
|
3
|
+
export { UiImpulseIndicator };
|
|
4
|
+
export { UiLoading };
|
|
5
|
+
}
|
|
6
|
+
namespace props {
|
|
7
|
+
export namespace color {
|
|
8
|
+
export let type: StringConstructor;
|
|
9
|
+
let _default: any;
|
|
10
|
+
export { _default as default };
|
|
11
|
+
}
|
|
12
|
+
export namespace size {
|
|
13
|
+
let type_1: StringConstructor;
|
|
14
|
+
export { type_1 as type };
|
|
15
|
+
let _default_1: any;
|
|
16
|
+
export { _default_1 as default };
|
|
17
|
+
}
|
|
18
|
+
export namespace variant {
|
|
19
|
+
let type_2: StringConstructor;
|
|
20
|
+
export { type_2 as type };
|
|
21
|
+
let _default_2: any;
|
|
22
|
+
export { _default_2 as default };
|
|
23
|
+
}
|
|
24
|
+
export namespace shape {
|
|
25
|
+
let type_3: StringConstructor;
|
|
26
|
+
export { type_3 as type };
|
|
27
|
+
let _default_3: any;
|
|
28
|
+
export { _default_3 as default };
|
|
29
|
+
}
|
|
30
|
+
export namespace href {
|
|
31
|
+
let type_4: StringConstructor;
|
|
32
|
+
export { type_4 as type };
|
|
33
|
+
let _default_4: string;
|
|
34
|
+
export { _default_4 as default };
|
|
35
|
+
}
|
|
36
|
+
export namespace type_5 {
|
|
37
|
+
let type_6: StringConstructor;
|
|
38
|
+
export { type_6 as type };
|
|
39
|
+
let _default_5: string;
|
|
40
|
+
export { _default_5 as default };
|
|
41
|
+
}
|
|
42
|
+
export { type_5 as type };
|
|
43
|
+
export namespace block {
|
|
44
|
+
let type_7: BooleanConstructor;
|
|
45
|
+
export { type_7 as type };
|
|
46
|
+
let _default_6: boolean;
|
|
47
|
+
export { _default_6 as default };
|
|
48
|
+
}
|
|
49
|
+
export namespace loading {
|
|
50
|
+
let type_8: BooleanConstructor;
|
|
51
|
+
export { type_8 as type };
|
|
52
|
+
let _default_7: boolean;
|
|
53
|
+
export { _default_7 as default };
|
|
54
|
+
}
|
|
55
|
+
export namespace disabled {
|
|
56
|
+
let type_9: (BooleanConstructor | NumberConstructor)[];
|
|
57
|
+
export { type_9 as type };
|
|
58
|
+
let _default_8: boolean;
|
|
59
|
+
export { _default_8 as default };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function data(): {
|
|
63
|
+
impulse: boolean;
|
|
64
|
+
};
|
|
65
|
+
namespace computed {
|
|
66
|
+
function computedType(): any;
|
|
67
|
+
function classes(): string[];
|
|
68
|
+
function stylesHoverColor(): string;
|
|
69
|
+
function styles(): {
|
|
70
|
+
background: string;
|
|
71
|
+
color: string;
|
|
72
|
+
};
|
|
73
|
+
function buttonBgStyle(): {
|
|
74
|
+
background: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
namespace methods {
|
|
78
|
+
function handleClick(e: any): void;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export default _default;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component class="component-ui-card" :is="cardIs" :to="to">
|
|
3
|
+
<div class="ui-card-icon" v-if="icon">
|
|
4
|
+
<img :src="icon">
|
|
5
|
+
<component v-if="iconTitle" :is="iconTitleIs" :to="iconLink" target="_blank" class="ui-card-icon-title">
|
|
6
|
+
{{ iconTitle }}
|
|
7
|
+
</component>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="ui-card-title" v-if="title"><strong>{{ title }}</strong></div>
|
|
10
|
+
<div class="ui-card-content" v-if="slots?.default">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="ui-card-footer" v-if="slots?.footer">
|
|
14
|
+
<slot name="footer"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</component>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
// Imports
|
|
21
|
+
import { useSlots, resolveComponent } from 'vue';
|
|
22
|
+
|
|
23
|
+
//
|
|
24
|
+
const slots = useSlots()
|
|
25
|
+
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
to: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
icon: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ''
|
|
34
|
+
},
|
|
35
|
+
iconTitle: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ''
|
|
38
|
+
},
|
|
39
|
+
iconLink: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ''
|
|
42
|
+
},
|
|
43
|
+
title: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ''
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const cardIs = (props.to || props.href) ? resolveComponent('NuxtLink') : 'div';
|
|
50
|
+
const iconTitleIs = props.iconLink ? resolveComponent('NuxtLink') : 'b';
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style lang="less">
|
|
54
|
+
// Variables
|
|
55
|
+
@com-border-radius-default: var(--ui-border-radius-big);
|
|
56
|
+
|
|
57
|
+
// Text size
|
|
58
|
+
@com-text-default: var(--ui-text-default);
|
|
59
|
+
@com-text-small: var(--ui-text-small);
|
|
60
|
+
|
|
61
|
+
// Font family
|
|
62
|
+
@com-font-header: var(--ui-font-header);
|
|
63
|
+
|
|
64
|
+
// Color
|
|
65
|
+
@com-color-header-text: var(--ui-color-header-text);
|
|
66
|
+
@com-color-surface: var(--ui-color-surface);
|
|
67
|
+
@com-color-text: var(--ui-color-text);
|
|
68
|
+
@com-color-primary: var(--ui-color-primary);
|
|
69
|
+
|
|
70
|
+
// Padding
|
|
71
|
+
@com-space-default: var(--ui-space-default);
|
|
72
|
+
@com-space-micro: var(--ui-space-micro);
|
|
73
|
+
@com-space-mini: var(--ui-space-mini);
|
|
74
|
+
|
|
75
|
+
.component-ui-card {
|
|
76
|
+
--ui-card-padding: @com-space-default;
|
|
77
|
+
|
|
78
|
+
position: relative;
|
|
79
|
+
|
|
80
|
+
color: @com-color-header-text;
|
|
81
|
+
background: @com-color-surface;
|
|
82
|
+
border-radius: @com-border-radius-default;
|
|
83
|
+
|
|
84
|
+
.ui-card-icon {
|
|
85
|
+
display: grid;
|
|
86
|
+
grid-template-columns: 50px auto;
|
|
87
|
+
gap: @com-space-default;
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding: var(--ui-card-padding) 0 0 30px;
|
|
90
|
+
height: 80px;
|
|
91
|
+
|
|
92
|
+
font-family: @com-font-header;
|
|
93
|
+
|
|
94
|
+
img {
|
|
95
|
+
width: 100%;
|
|
96
|
+
max-width: 50px;
|
|
97
|
+
max-height: 50px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
a, b {
|
|
101
|
+
padding-right: @com-space-mini;
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
color: @com-color-header-text;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ui-card-title {
|
|
108
|
+
display: block;
|
|
109
|
+
padding: var(--ui-card-padding) var(--ui-card-padding) @com-space-micro var(--ui-card-padding);
|
|
110
|
+
font-family: @com-font-header;
|
|
111
|
+
|
|
112
|
+
strong {
|
|
113
|
+
position: relative;
|
|
114
|
+
|
|
115
|
+
&:before {
|
|
116
|
+
content: '';
|
|
117
|
+
|
|
118
|
+
position: absolute;
|
|
119
|
+
bottom: 22%;
|
|
120
|
+
right: -8px;
|
|
121
|
+
|
|
122
|
+
width: 4px;
|
|
123
|
+
height: 4px;
|
|
124
|
+
border-radius: 50%;
|
|
125
|
+
|
|
126
|
+
background: @com-color-primary;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ui-card-content {
|
|
132
|
+
padding: 0 var(--ui-card-padding) var(--ui-card-padding) var(--ui-card-padding);
|
|
133
|
+
line-height: 1.5;
|
|
134
|
+
font-size: @com-text-small;
|
|
135
|
+
color: @com-color-text;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
</style>
|