@community-release/nx-ui 0.0.28 → 0.0.30

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 CHANGED
@@ -192,11 +192,6 @@ var module = defineNuxtModule({
192
192
  global: false,
193
193
  extensions: ["vue"]
194
194
  });
195
- addComponent({
196
- filePath: resolve("./runtime/components/accordion/item"),
197
- name: "ui-accordion-item",
198
- global: false
199
- });
200
195
  addComponent({
201
196
  filePath: resolve("./runtime/components/map/zoom"),
202
197
  name: "ui-map-zoom",
package/dist/module.d.ts CHANGED
@@ -192,11 +192,6 @@ var module = defineNuxtModule({
192
192
  global: false,
193
193
  extensions: ["vue"]
194
194
  });
195
- addComponent({
196
- filePath: resolve("./runtime/components/accordion/item"),
197
- name: "ui-accordion-item",
198
- global: false
199
- });
200
195
  addComponent({
201
196
  filePath: resolve("./runtime/components/map/zoom"),
202
197
  name: "ui-map-zoom",
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.28"
4
+ "version": "0.0.30"
5
5
  }
package/dist/module.mjs CHANGED
@@ -192,11 +192,6 @@ const module = defineNuxtModule({
192
192
  global: false,
193
193
  extensions: ["vue"]
194
194
  });
195
- addComponent({
196
- filePath: resolve("./runtime/components/accordion/item"),
197
- name: "ui-accordion-item",
198
- global: false
199
- });
200
195
  addComponent({
201
196
  filePath: resolve("./runtime/components/map/zoom"),
202
197
  name: "ui-map-zoom",
@@ -11,6 +11,7 @@
11
11
  // Imports
12
12
  import { ref, computed, provide } from 'vue';
13
13
  import comProps from '#build/ui.accordion.mjs';
14
+ import UiAccordionItem from './accordion-item.vue';
14
15
 
15
16
  // Data
16
17
  const props = defineProps({
@@ -52,5 +52,6 @@ export default function(callback, start, end, duration) {
52
52
  if (progress < 1) requestAnimationFrame(step);
53
53
  };
54
54
 
55
- requestAnimationFrame(step);
55
+ if (typeof requestAnimationFrame !== 'undefined')
56
+ requestAnimationFrame(step);
56
57
  }
@@ -22,7 +22,7 @@
22
22
 
23
23
  <script setup>
24
24
  // Imports
25
- import { computed, } from 'vue';
25
+ import { computed } from 'vue';
26
26
 
27
27
  //
28
28
  const props = defineProps({
@@ -17,7 +17,7 @@
17
17
  <script setup>
18
18
  import { storeToRefs } from 'pinia';
19
19
  import { useUINoticeStore } from './store';
20
- import UiNoticeItem from './item.vue';
20
+ import UiNoticeItem from './notice-item.vue';
21
21
 
22
22
  const store = useUINoticeStore();
23
23
  const { items } = storeToRefs(store);
@@ -0,0 +1,87 @@
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
+
27
+ modelValue: {
28
+ type: [Boolean, null],
29
+ default: null
30
+ }
31
+ });
32
+
33
+ let isShown = ref(false);
34
+ let hasModel = props.modelValue !== null;
35
+
36
+ if (hasModel) {
37
+ watch(() => props.modelValue, (v) => {
38
+ isShown.value = v;
39
+ }, { immediate: true });
40
+ }
41
+
42
+ // Methods
43
+ function handleClick() {
44
+ if (hasModel) {
45
+ emit('update:modelValue', !isShown.value);
46
+ } else {
47
+ isShown.value = !isShown.value;
48
+ }
49
+ }
50
+ </script>
51
+
52
+ <style lang="less">
53
+ .component-ui-spoiler {
54
+ @com-space-mini: var(--ui-space-mini);
55
+ @com-ani-ease: var(--ui-ani-ease);
56
+ @com-ani-time: var(--ui-ani-time);
57
+ @com-color-primary-text: var(--ui-color-primary-text);
58
+ @com-font-weight-medium: var(--ui-font-weight-medium);
59
+
60
+ > .title {
61
+ padding-top: @com-space-mini;
62
+
63
+ color: @com-color-primary-text;
64
+ font-weight: @com-font-weight-medium;
65
+ cursor: pointer;
66
+
67
+ -webkit-user-select: none;
68
+ user-select: none;
69
+ }
70
+
71
+ > .content {
72
+ transition: grid-template-rows @com-ani-time @com-ani-ease;
73
+ display: grid;
74
+ grid-template-rows: 0fr;
75
+
76
+ div {
77
+ overflow: hidden;
78
+ }
79
+ }
80
+
81
+ &.tag-active {
82
+ > .content {
83
+ grid-template-rows: 1fr;
84
+ }
85
+ }
86
+ }
87
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "nx-ui - Nuxt UI library",
5
5
  "repository": {
6
6
  "type": "git",