@community-release/nx-ui 0.0.29 → 0.0.31
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 +0 -10
- package/dist/module.d.ts +0 -10
- package/dist/module.json +1 -1
- package/dist/module.mjs +0 -10
- package/dist/runtime/components/checkbox.vue +1 -1
- package/dist/runtime/components/spoiler.vue +86 -0
- package/dist/runtime/components/text-spoiler.vue +86 -0
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
|
@@ -192,16 +192,6 @@ var module = defineNuxtModule({
|
|
|
192
192
|
global: false,
|
|
193
193
|
extensions: ["vue"]
|
|
194
194
|
});
|
|
195
|
-
addComponent({
|
|
196
|
-
filePath: resolve("./runtime/components/notice/notice-item"),
|
|
197
|
-
name: "ui-notice-item",
|
|
198
|
-
global: false
|
|
199
|
-
});
|
|
200
|
-
addComponent({
|
|
201
|
-
filePath: resolve("./runtime/components/accordion/accordion-item"),
|
|
202
|
-
name: "ui-accordion-item",
|
|
203
|
-
global: false
|
|
204
|
-
});
|
|
205
195
|
addComponent({
|
|
206
196
|
filePath: resolve("./runtime/components/map/zoom"),
|
|
207
197
|
name: "ui-map-zoom",
|
package/dist/module.d.ts
CHANGED
|
@@ -192,16 +192,6 @@ var module = defineNuxtModule({
|
|
|
192
192
|
global: false,
|
|
193
193
|
extensions: ["vue"]
|
|
194
194
|
});
|
|
195
|
-
addComponent({
|
|
196
|
-
filePath: resolve("./runtime/components/notice/notice-item"),
|
|
197
|
-
name: "ui-notice-item",
|
|
198
|
-
global: false
|
|
199
|
-
});
|
|
200
|
-
addComponent({
|
|
201
|
-
filePath: resolve("./runtime/components/accordion/accordion-item"),
|
|
202
|
-
name: "ui-accordion-item",
|
|
203
|
-
global: false
|
|
204
|
-
});
|
|
205
195
|
addComponent({
|
|
206
196
|
filePath: resolve("./runtime/components/map/zoom"),
|
|
207
197
|
name: "ui-map-zoom",
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -192,16 +192,6 @@ const module = defineNuxtModule({
|
|
|
192
192
|
global: false,
|
|
193
193
|
extensions: ["vue"]
|
|
194
194
|
});
|
|
195
|
-
addComponent({
|
|
196
|
-
filePath: resolve("./runtime/components/notice/notice-item"),
|
|
197
|
-
name: "ui-notice-item",
|
|
198
|
-
global: false
|
|
199
|
-
});
|
|
200
|
-
addComponent({
|
|
201
|
-
filePath: resolve("./runtime/components/accordion/accordion-item"),
|
|
202
|
-
name: "ui-accordion-item",
|
|
203
|
-
global: false
|
|
204
|
-
});
|
|
205
195
|
addComponent({
|
|
206
196
|
filePath: resolve("./runtime/components/map/zoom"),
|
|
207
197
|
name: "ui-map-zoom",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="component-ui-spoiler" :class="{'tag-active': isShown}">
|
|
3
|
+
<div class="content">
|
|
4
|
+
<div>
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="title" @click="handleClick">{{ isShown ? hideText : showText }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { watch, ref } from 'vue';
|
|
14
|
+
|
|
15
|
+
// Data
|
|
16
|
+
const emit = defineEmits(['update:modelValue']);
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
showText: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'Show'
|
|
21
|
+
},
|
|
22
|
+
hideText: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'Hide'
|
|
25
|
+
},
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: [Boolean, null],
|
|
28
|
+
default: null
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
let isShown = ref(false);
|
|
33
|
+
let hasModel = props.modelValue !== null;
|
|
34
|
+
|
|
35
|
+
if (hasModel) {
|
|
36
|
+
watch(() => props.modelValue, (v) => {
|
|
37
|
+
isShown.value = v;
|
|
38
|
+
}, { immediate: true });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Methods
|
|
42
|
+
function handleClick() {
|
|
43
|
+
if (hasModel) {
|
|
44
|
+
emit('update:modelValue', !isShown.value);
|
|
45
|
+
} else {
|
|
46
|
+
isShown.value = !isShown.value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="less">
|
|
52
|
+
.component-ui-spoiler {
|
|
53
|
+
@com-space-mini: var(--ui-space-mini);
|
|
54
|
+
@com-ani-ease: var(--ui-ani-ease);
|
|
55
|
+
@com-ani-time: var(--ui-ani-time);
|
|
56
|
+
@com-color-primary-text: var(--ui-color-primary-text);
|
|
57
|
+
@com-font-weight-medium: var(--ui-font-weight-medium);
|
|
58
|
+
|
|
59
|
+
> .title {
|
|
60
|
+
padding-top: @com-space-mini;
|
|
61
|
+
|
|
62
|
+
color: @com-color-primary-text;
|
|
63
|
+
font-weight: @com-font-weight-medium;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
|
|
66
|
+
-webkit-user-select: none;
|
|
67
|
+
user-select: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
> .content {
|
|
71
|
+
transition: grid-template-rows @com-ani-time @com-ani-ease;
|
|
72
|
+
display: grid;
|
|
73
|
+
grid-template-rows: 0fr;
|
|
74
|
+
|
|
75
|
+
div {
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.tag-active {
|
|
81
|
+
> .content {
|
|
82
|
+
grid-template-rows: 1fr;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="component-ui-text-spoiler">
|
|
3
|
+
<div class="content">{{ computedText }}</div>
|
|
4
|
+
<div class="title" @click="handleClick">{{ isShown ? hideText : showText }}</div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { watch, ref, computed } from 'vue';
|
|
10
|
+
|
|
11
|
+
// Data
|
|
12
|
+
const emit = defineEmits(['update:modelValue']);
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
text: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '...'
|
|
17
|
+
},
|
|
18
|
+
showText: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'Show'
|
|
21
|
+
},
|
|
22
|
+
hideText: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'Hide'
|
|
25
|
+
},
|
|
26
|
+
length: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 0
|
|
29
|
+
},
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: [Boolean, null],
|
|
32
|
+
default: null
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
let isShown = ref(false);
|
|
37
|
+
let hasModel = props.modelValue !== null;
|
|
38
|
+
|
|
39
|
+
if (hasModel) {
|
|
40
|
+
watch(() => props.modelValue, (v) => {
|
|
41
|
+
isShown.value = v;
|
|
42
|
+
}, { immediate: true });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const computedText = computed(() => {
|
|
46
|
+
if (!isShown.value && props.text.length > props.length) {
|
|
47
|
+
return props.text.slice(0, props.length) + '...';
|
|
48
|
+
} else {
|
|
49
|
+
return props.text;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Methods
|
|
54
|
+
function handleClick() {
|
|
55
|
+
if (hasModel) {
|
|
56
|
+
emit('update:modelValue', !isShown.value);
|
|
57
|
+
} else {
|
|
58
|
+
isShown.value = !isShown.value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="less">
|
|
64
|
+
.component-ui-text-spoiler {
|
|
65
|
+
@com-space-mini: var(--ui-space-mini);
|
|
66
|
+
@com-ani-ease: var(--ui-ani-ease);
|
|
67
|
+
@com-ani-time: var(--ui-ani-time);
|
|
68
|
+
@com-color-primary-text: var(--ui-color-primary-text);
|
|
69
|
+
@com-font-weight-medium: var(--ui-font-weight-medium);
|
|
70
|
+
|
|
71
|
+
> .title {
|
|
72
|
+
padding-top: @com-space-mini;
|
|
73
|
+
|
|
74
|
+
color: @com-color-primary-text;
|
|
75
|
+
font-weight: @com-font-weight-medium;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
|
|
78
|
+
-webkit-user-select: none;
|
|
79
|
+
user-select: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
> .content {
|
|
83
|
+
position: relative;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</style>
|