@community-release/nx-ui 0.0.46 → 0.0.48

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
@@ -187,7 +187,7 @@ var module = defineNuxtModule({
187
187
  }
188
188
  addPlugin({
189
189
  src: resolve("./runtime/plugins/variables"),
190
- mode: "server"
190
+ mode: "all"
191
191
  });
192
192
  addPlugin({
193
193
  src: resolve("./runtime/plugins/methods"),
package/dist/module.d.ts CHANGED
@@ -187,7 +187,7 @@ var module = defineNuxtModule({
187
187
  }
188
188
  addPlugin({
189
189
  src: resolve("./runtime/plugins/variables"),
190
- mode: "server"
190
+ mode: "all"
191
191
  });
192
192
  addPlugin({
193
193
  src: resolve("./runtime/plugins/methods"),
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.46"
4
+ "version": "0.0.48"
5
5
  }
package/dist/module.mjs CHANGED
@@ -187,7 +187,7 @@ const module = defineNuxtModule({
187
187
  }
188
188
  addPlugin({
189
189
  src: resolve("./runtime/plugins/variables"),
190
- mode: "server"
190
+ mode: "all"
191
191
  });
192
192
  addPlugin({
193
193
  src: resolve("./runtime/plugins/methods"),
@@ -1,9 +1,8 @@
1
1
  <template>
2
- <component
2
+ <a
3
+ v-if="computedType == 'a'"
3
4
  class="component-ui component-ui-button"
4
- :is="computedType"
5
- :href="href"
6
- :to="href"
5
+ :href="href"
7
6
  :class="classes"
8
7
  :style="styles"
9
8
  @click="handleClick"
@@ -20,15 +19,39 @@
20
19
  </span>
21
20
 
22
21
  <ui-loading class="loading-indicator" :active="loading"></ui-loading>
23
- </component>
22
+ </a>
23
+ <button
24
+ v-else
25
+ class="component-ui component-ui-button"
26
+ :class="classes"
27
+ :style="styles"
28
+ @click="handleClick"
29
+ ref="refCom"
30
+ >
31
+ <div class="button-bg" :style="buttonBgStyle"></div>
32
+
33
+ <ui-impulse-indicator :impulse="impulse" />
34
+
35
+ <span class="button-content">
36
+ <span><slot name="prepend"></slot></span>
37
+ <span class="slot-default"><slot></slot></span>
38
+ <span><slot name="append"></slot></span>
39
+ </span>
40
+
41
+ <ui-loading class="loading-indicator" :active="loading"></ui-loading>
42
+ </button>
24
43
  </template>
25
44
 
26
45
  <script setup>
27
46
  // Imports
28
- import { ref, computed } from 'vue';
47
+ import { ref, computed, resolveComponent } from 'vue';
29
48
  import UiImpulseIndicator from '../impulse-indicator.vue';
30
49
  import UiLoading from '../loading.vue';
31
50
  import comProps from '#build/ui.button.mjs';
51
+ import { useRouter } from 'vue-router';
52
+
53
+ // Composables
54
+ const router = useRouter();
32
55
 
33
56
  // Data
34
57
  const props = defineProps({
@@ -52,10 +75,6 @@
52
75
  type: String,
53
76
  default: '',
54
77
  },
55
- type: {
56
- type: String,
57
- default: '',
58
- },
59
78
  block: {
60
79
  type: Boolean,
61
80
  default: false,
@@ -73,10 +92,8 @@
73
92
  const refCom = ref(null);
74
93
 
75
94
  const impulse = ref(false);
76
-
77
- const computedType = computed(() => {
78
- return props.type !== '' ? props.type : (props.href !== '' ? 'a' : 'button');
79
- });
95
+
96
+ const computedType = props.href ? 'a' : 'button';
80
97
 
81
98
  const classes = computed(() => {
82
99
  let ar = [];
@@ -138,6 +155,15 @@
138
155
  width : refCom.value.offsetWidth,
139
156
  height : refCom.value.offsetHeight
140
157
  };
158
+
159
+ // Handle navigate
160
+ if (computedType == 'a') {
161
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;
162
+
163
+ e.preventDefault();
164
+
165
+ router.push(props.href);
166
+ }
141
167
  }
142
168
  </script>
143
169
 
@@ -73,8 +73,8 @@ const props = defineProps({
73
73
  },
74
74
  });
75
75
 
76
- const cardIs = (props.to || props.href) ? resolveComponent('NuxtLink') : 'div';
77
- const iconTitleIs = props.iconLink ? resolveComponent('NuxtLink') : 'b';
76
+ const cardIs = (props.to || props.href) ? 'NuxtLink' : 'div';
77
+ const iconTitleIs = props.iconLink ? 'NuxtLink' : 'b';
78
78
  </script>
79
79
 
80
80
  <style lang="less">
@@ -99,7 +99,6 @@ const classes = computed(() => {
99
99
  if (props.error) ar.push('tag-error');
100
100
  if (focus.value) ar.push('tag-focus');
101
101
  if (props.disabled) ar.push('tag-disabled');
102
- if (props.label) ar.push('tag-label');
103
102
 
104
103
  return ar;
105
104
  });
@@ -208,37 +207,32 @@ onMounted(() => {
208
207
  -ms-user-select: none;
209
208
  user-select: none;
210
209
 
210
+ display: flex;
211
+ flex-direction: column;
212
+ justify-content: center;
213
+ align-items: flex-start;
214
+
211
215
  position: absolute;
212
216
  top: 0;
213
217
  left: 0;
214
- width: 100%;
215
- height: 100%;
216
-
217
- cursor: pointer;
218
-
219
218
  padding-right: 45px;
220
219
  padding-left: 10px;
220
+ width: 100%;
221
221
  height: 100%;
222
222
 
223
- cursor: pointer;
224
-
225
223
  border: 1px solid @com-color-border;
226
224
  border-radius: @com-border-radius-default;
227
225
 
228
- label, strong {
226
+ cursor: pointer;
227
+
228
+ div, strong {
229
+ width: 100%;
229
230
  overflow: hidden;
230
231
  text-overflow: ellipsis;
231
232
  white-space: nowrap;
232
-
233
- position: absolute;
234
- left: 10px;
235
- right: 30px;
236
233
  }
237
234
 
238
235
  strong {
239
- transform: translateY(-50%);
240
- top: 50%;
241
- bottom: auto;
242
236
  font-family: @com-font-header;
243
237
  font-weight: @com-value-font-weight;
244
238
  color: @com-color-header-text;
@@ -260,25 +254,6 @@ onMounted(() => {
260
254
  }
261
255
  }
262
256
 
263
- &.tag-label {
264
- .value {
265
- label {
266
- top: 3px;
267
- margin: 0;
268
- padding: 0 0 5px 0;
269
- font-size: @com-text-small;
270
-
271
- color: @com-color-gray-text;
272
- }
273
-
274
- strong {
275
- transform: none;
276
- top: 20px;
277
- bottom: 0;
278
- }
279
- }
280
- }
281
-
282
257
  &.tag-disabled {
283
258
  opacity: 0.6;
284
259
  cursor: not-allowed;
@@ -293,8 +268,6 @@ onMounted(() => {
293
268
  border-color: transparent;
294
269
  outline: @com-outline;
295
270
  }
296
-
297
-
298
271
  }
299
272
 
300
273
  &.tag-error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "nx-ui - Nuxt UI library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,15 +23,15 @@
23
23
  "@nuxtjs/color-mode": "^3.5.2",
24
24
  "@nuxtjs/i18n": "^9.2.0",
25
25
  "@pinia/nuxt": "^0.10.1",
26
- "pinia": "^3.0.1",
27
26
  "ol": "^9.1.0",
27
+ "pinia": "^3.0.1",
28
28
  "vue": "^3.5.13"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@nuxt/devtools": "latest",
32
32
  "@nuxt/module-builder": "^0.5.5",
33
33
  "@nuxt/schema": "^3.11.2",
34
- "@nuxt/test-utils": "^3.12.0",
34
+ "@nuxt/test-utils": "^3.19.2",
35
35
  "@vitejs/plugin-vue": "^5.2.1",
36
36
  "@vue/test-utils": "^2.4.6",
37
37
  "@vuedoc/md": "^4.0.0-beta8",
@@ -42,11 +42,15 @@
42
42
  "less": "^3.9.0",
43
43
  "less-loader": "^5.0.0",
44
44
  "nuxt": "^3.15.4",
45
+ "playwright-core": "^1.54.1",
45
46
  "vite-raw-plugin": "^1.0.2",
46
47
  "vitest": "^1.6.0",
47
48
  "vue-docgen-cli": "^4.79.0",
48
49
  "vue-tsc": "^2.0.24"
49
50
  },
51
+ "peerDependencies": {
52
+ "vue-router": "^4.5.0"
53
+ },
50
54
  "resolutions": {
51
55
  "string-width": "4.2.3"
52
56
  },