vueless 0.0.467 → 0.0.469

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/constants.js CHANGED
@@ -68,5 +68,4 @@ export const SYSTEM_CONFIG_KEY = {
68
68
 
69
69
  /* Other */
70
70
  export const PX_IN_REM = 16;
71
- export const HYPHEN_SYMBOL = "-";
72
71
  export const NESTED_COMPONENT_REG_EXP = /\{U[^}]*}/g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.467",
3
+ "version": "0.0.469",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -5,6 +5,7 @@
5
5
  ref="buttonRef"
6
6
  :disabled="disabled"
7
7
  v-bind="buttonAttrs"
8
+ :style="buttonStyle"
8
9
  :tabindex="!loading ? tabindex : -1"
9
10
  :data-test="dataTest"
10
11
  >
@@ -80,7 +81,7 @@
80
81
  </template>
81
82
 
82
83
  <script setup>
83
- import { computed, ref, watchEffect, useId } from "vue";
84
+ import { computed, ref, watchEffect, useId, watch } from "vue";
84
85
 
85
86
  import { getDefault } from "../utils/utilUI.js";
86
87
  import ULoader from "../ui.loader/ULoader.vue";
@@ -255,6 +256,8 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
255
256
  useAttrs(props);
256
257
 
257
258
  const buttonRef = ref(null);
259
+ const buttonStyle = ref(null);
260
+ const buttonWidth = ref(0);
258
261
 
259
262
  const loaderSize = computed(() => {
260
263
  const sizes = {
@@ -286,6 +289,20 @@ const iconColor = computed(() => {
286
289
  return props.variant === "primary" ? "white" : props.color;
287
290
  });
288
291
 
292
+ watch(
293
+ () => props.loading,
294
+ (newValue) => {
295
+ if (newValue && buttonRef.value) {
296
+ buttonWidth.value = buttonRef.value.offsetWidth;
297
+ }
298
+
299
+ buttonStyle.value = {
300
+ width: newValue ? `${buttonWidth.value}px` : "auto",
301
+ };
302
+ },
303
+ { immediate: true },
304
+ );
305
+
289
306
  watchEffect(() => {
290
307
  props.loading && buttonRef.value.blur();
291
308
  });
@@ -177,6 +177,7 @@
177
177
  :columns="columns"
178
178
  :config="config"
179
179
  :attrs="keysAttrs"
180
+ :empty-cell-label="emptyCellLabel"
180
181
  @click="onClickRow"
181
182
  @click-cell="onClickCell"
182
183
  @toggle-row-visibility="onToggleRowVisibility"
@@ -320,6 +321,14 @@ const props = defineProps({
320
321
  required: true,
321
322
  },
322
323
 
324
+ /**
325
+ * Label to display for empty cell values.
326
+ */
327
+ emptyCellLabel: {
328
+ type: String,
329
+ default: getDefault(defaultConfig, UTable).emptyCellLabel,
330
+ },
331
+
323
332
  /**
324
333
  * Show date divider line between dates.
325
334
  */
@@ -157,7 +157,7 @@ import { computed, onMounted, useSlots, useTemplateRef } from "vue";
157
157
  import { cx } from "../utils/utilUI.js";
158
158
  import useUI from "../composables/useUI.js";
159
159
 
160
- import { HYPHEN_SYMBOL, PX_IN_REM } from "../constants.js";
160
+ import { PX_IN_REM } from "../constants.js";
161
161
  import { getFilteredRow } from "./utilTable.js";
162
162
 
163
163
  import { useMutationObserver } from "../composables/useMutationObserver.js";
@@ -178,6 +178,11 @@ const props = defineProps({
178
178
  required: true,
179
179
  },
180
180
 
181
+ emptyCellLabel: {
182
+ type: String,
183
+ required: true,
184
+ },
185
+
181
186
  tag: {
182
187
  type: String,
183
188
  default: "tr",
@@ -311,7 +316,7 @@ function isEmptyValue(value) {
311
316
  function formatCellValue(value) {
312
317
  const nestedValue = value && typeof value === "object" && "value" in value ? value.value : value;
313
318
 
314
- return isEmptyValue(nestedValue) ? HYPHEN_SYMBOL : nestedValue;
319
+ return isEmptyValue(nestedValue) ? props.emptyCellLabel : nestedValue;
315
320
  }
316
321
 
317
322
  function getNestedShift() {
@@ -92,6 +92,7 @@ export default /*tw*/ {
92
92
  noData: "There is no data in the table.",
93
93
  },
94
94
  defaults: {
95
+ emptyCellLabel: "—",
95
96
  nesting: false,
96
97
  compact: false,
97
98
  selectable: false,
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.467",
4
+ "version": "0.0.469",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -8554,6 +8554,15 @@
8554
8554
  "type": "array"
8555
8555
  }
8556
8556
  },
8557
+ {
8558
+ "name": "emptyCellLabel",
8559
+ "description": "Label to display for empty cell values.",
8560
+ "value": {
8561
+ "kind": "expression",
8562
+ "type": "string"
8563
+ },
8564
+ "default": "—"
8565
+ },
8557
8566
  {
8558
8567
  "name": "dateDivider",
8559
8568
  "description": "Show date divider line between dates.",
@@ -8817,6 +8826,15 @@
8817
8826
  "type": "array"
8818
8827
  }
8819
8828
  },
8829
+ {
8830
+ "name": "emptyCellLabel",
8831
+ "required": true,
8832
+ "value": {
8833
+ "kind": "expression",
8834
+ "type": "string"
8835
+ },
8836
+ "default": "—"
8837
+ },
8820
8838
  {
8821
8839
  "name": "tag",
8822
8840
  "value": {