@regcheq/ui-vue-2 1.4.1 → 1.5.0

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/index.css CHANGED
@@ -1464,11 +1464,33 @@
1464
1464
  align-items: center;
1465
1465
  gap: 8px;
1466
1466
  }
1467
- .rq-search-input .rq-field {
1467
+ .rq-search-input__field {
1468
+ position: relative;
1468
1469
  flex: 1;
1469
1470
  min-width: 220px;
1470
1471
  max-width: 234px;
1471
1472
  }
1473
+ .rq-search-input .rq-field {
1474
+ width: 100%;
1475
+ }
1476
+ .rq-search-input__clear {
1477
+ position: absolute;
1478
+ top: 50%;
1479
+ right: 12px;
1480
+ transform: translateY(-50%);
1481
+ display: flex;
1482
+ align-items: center;
1483
+ justify-content: center;
1484
+ padding: 0;
1485
+ background: none;
1486
+ border: none;
1487
+ cursor: pointer;
1488
+ color: #71717a;
1489
+ transition: color 100ms ease;
1490
+ }
1491
+ .rq-search-input__clear:hover {
1492
+ color: #3f3f46;
1493
+ }
1472
1494
  .rq-search-input__visually-hidden {
1473
1495
  position: absolute;
1474
1496
  width: 1px;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ref, watch, computed } from '@vue/composition-api';
1
+ import { ref, watch, computed } from 'vue';
2
2
 
3
3
  /**
4
4
  * @license lucide-vue v0.517.0 - ISC
@@ -32971,7 +32971,7 @@ var __vue_render__$e = function () {
32971
32971
  nativeOn: {
32972
32972
  click: function ($event) {
32973
32973
  $event.stopPropagation();
32974
- return function () {}();
32974
+ return function () {}.apply(null, arguments);
32975
32975
  }
32976
32976
  }
32977
32977
  }), _vm._v(" "), _c("div", {
@@ -33079,7 +33079,7 @@ var __vue_render__$d = function () {
33079
33079
  nativeOn: {
33080
33080
  click: function ($event) {
33081
33081
  $event.stopPropagation();
33082
- return function () {}();
33082
+ return function () {}.apply(null, arguments);
33083
33083
  }
33084
33084
  }
33085
33085
  }), _vm._v(" "), _c("span", {
@@ -33194,7 +33194,7 @@ var __vue_render__$c = function () {
33194
33194
  nativeOn: {
33195
33195
  click: function ($event) {
33196
33196
  $event.stopPropagation();
33197
- return function () {}();
33197
+ return function () {}.apply(null, arguments);
33198
33198
  }
33199
33199
  }
33200
33200
  }), _vm._v(" "), _c("span", {
@@ -33301,7 +33301,7 @@ var __vue_render__$b = function () {
33301
33301
  nativeOn: {
33302
33302
  click: function ($event) {
33303
33303
  $event.stopPropagation();
33304
- return function () {}();
33304
+ return function () {}.apply(null, arguments);
33305
33305
  }
33306
33306
  }
33307
33307
  })], 1), _vm._v(" "), _c("div", {
@@ -33947,12 +33947,24 @@ const searchInputVariants = cva('rq-search-input', {
33947
33947
  //
33948
33948
  //
33949
33949
  //
33950
+ //
33951
+ //
33952
+ //
33953
+ //
33954
+ //
33955
+ //
33956
+ //
33957
+ //
33958
+ //
33959
+ //
33960
+ //
33950
33961
 
33951
33962
  var script$7 = {
33952
33963
  name: 'SearchInput',
33953
33964
  components: {
33954
33965
  Input: __vue_component__$m,
33955
- Button: __vue_component__$l
33966
+ Button: __vue_component__$l,
33967
+ X
33956
33968
  },
33957
33969
  props: {
33958
33970
  value: {
@@ -33970,11 +33982,18 @@ var script$7 = {
33970
33982
  },
33971
33983
  inputId() {
33972
33984
  return `rq-search-input-${this._uid}`;
33985
+ },
33986
+ hasValue() {
33987
+ return !!this.value;
33973
33988
  }
33974
33989
  },
33975
33990
  methods: {
33976
33991
  onKeydown(event) {
33977
33992
  if (event.key === 'Enter') this.$emit('search', this.value);
33993
+ },
33994
+ onClear() {
33995
+ this.$emit('input', '');
33996
+ this.$emit('search', '');
33978
33997
  }
33979
33998
  }
33980
33999
  };
@@ -33994,7 +34013,9 @@ var __vue_render__$7 = function () {
33994
34013
  attrs: {
33995
34014
  for: _vm.inputId
33996
34015
  }
33997
- }, [_vm._v(_vm._s(_vm.placeholder))]), _vm._v(" "), _c("Input", {
34016
+ }, [_vm._v(_vm._s(_vm.placeholder))]), _vm._v(" "), _c("div", {
34017
+ staticClass: "rq-search-input__field"
34018
+ }, [_c("Input", {
33998
34019
  attrs: {
33999
34020
  id: _vm.inputId,
34000
34021
  value: _vm.value,
@@ -34007,7 +34028,20 @@ var __vue_render__$7 = function () {
34007
34028
  },
34008
34029
  keydown: _vm.onKeydown
34009
34030
  }
34010
- }), _vm._v(" "), _c("Button", {
34031
+ }), _vm._v(" "), _vm.hasValue ? _c("button", {
34032
+ staticClass: "rq-search-input__clear",
34033
+ attrs: {
34034
+ type: "button",
34035
+ "aria-label": "Limpiar búsqueda"
34036
+ },
34037
+ on: {
34038
+ click: _vm.onClear
34039
+ }
34040
+ }, [_c("X", {
34041
+ attrs: {
34042
+ size: 16
34043
+ }
34044
+ })], 1) : _vm._e()], 1), _vm._v(" "), _c("Button", {
34011
34045
  attrs: {
34012
34046
  variant: "primary",
34013
34047
  "icon-left": "Search"
@@ -37799,7 +37833,9 @@ var __vue_render__$4 = function () {
37799
37833
  attrs: {
37800
37834
  colspan: _vm.columns.length + (_vm.selectable ? 1 : 0)
37801
37835
  }
37802
- }, [_vm._t("empty", [_c("span", [_vm._v("Sin datos")])])], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
37836
+ }, [_vm._t("empty", function () {
37837
+ return [_c("span", [_vm._v("Sin datos")])];
37838
+ })], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
37803
37839
  return _c("tr", {
37804
37840
  key: row.id,
37805
37841
  staticClass: "rq-table__tr rq-table__tr--body",
@@ -37837,7 +37873,9 @@ var __vue_render__$4 = function () {
37837
37873
  "rq-table__td--pinned": header.id in _vm.pinnedLeftWidths
37838
37874
  },
37839
37875
  style: _vm.getColStyle(header)
37840
- }, [_vm._t("cell-" + header.id, [_vm._v("\n " + _vm._s(row.getValue(header.id)) + "\n ")], {
37876
+ }, [_vm._t("cell-" + header.id, function () {
37877
+ return [_vm._v("\n " + _vm._s(row.getValue(header.id)) + "\n ")];
37878
+ }, {
37841
37879
  row: row.original,
37842
37880
  value: row.getValue(header.id)
37843
37881
  })], 2);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var compositionApi = require('@vue/composition-api');
3
+ var vue = require('vue');
4
4
 
5
5
  /**
6
6
  * @license lucide-vue v0.517.0 - ISC
@@ -32973,7 +32973,7 @@ var __vue_render__$e = function () {
32973
32973
  nativeOn: {
32974
32974
  click: function ($event) {
32975
32975
  $event.stopPropagation();
32976
- return function () {}();
32976
+ return function () {}.apply(null, arguments);
32977
32977
  }
32978
32978
  }
32979
32979
  }), _vm._v(" "), _c("div", {
@@ -33081,7 +33081,7 @@ var __vue_render__$d = function () {
33081
33081
  nativeOn: {
33082
33082
  click: function ($event) {
33083
33083
  $event.stopPropagation();
33084
- return function () {}();
33084
+ return function () {}.apply(null, arguments);
33085
33085
  }
33086
33086
  }
33087
33087
  }), _vm._v(" "), _c("span", {
@@ -33196,7 +33196,7 @@ var __vue_render__$c = function () {
33196
33196
  nativeOn: {
33197
33197
  click: function ($event) {
33198
33198
  $event.stopPropagation();
33199
- return function () {}();
33199
+ return function () {}.apply(null, arguments);
33200
33200
  }
33201
33201
  }
33202
33202
  }), _vm._v(" "), _c("span", {
@@ -33303,7 +33303,7 @@ var __vue_render__$b = function () {
33303
33303
  nativeOn: {
33304
33304
  click: function ($event) {
33305
33305
  $event.stopPropagation();
33306
- return function () {}();
33306
+ return function () {}.apply(null, arguments);
33307
33307
  }
33308
33308
  }
33309
33309
  })], 1), _vm._v(" "), _c("div", {
@@ -33949,12 +33949,24 @@ const searchInputVariants = cva('rq-search-input', {
33949
33949
  //
33950
33950
  //
33951
33951
  //
33952
+ //
33953
+ //
33954
+ //
33955
+ //
33956
+ //
33957
+ //
33958
+ //
33959
+ //
33960
+ //
33961
+ //
33962
+ //
33952
33963
 
33953
33964
  var script$7 = {
33954
33965
  name: 'SearchInput',
33955
33966
  components: {
33956
33967
  Input: __vue_component__$m,
33957
- Button: __vue_component__$l
33968
+ Button: __vue_component__$l,
33969
+ X
33958
33970
  },
33959
33971
  props: {
33960
33972
  value: {
@@ -33972,11 +33984,18 @@ var script$7 = {
33972
33984
  },
33973
33985
  inputId() {
33974
33986
  return `rq-search-input-${this._uid}`;
33987
+ },
33988
+ hasValue() {
33989
+ return !!this.value;
33975
33990
  }
33976
33991
  },
33977
33992
  methods: {
33978
33993
  onKeydown(event) {
33979
33994
  if (event.key === 'Enter') this.$emit('search', this.value);
33995
+ },
33996
+ onClear() {
33997
+ this.$emit('input', '');
33998
+ this.$emit('search', '');
33980
33999
  }
33981
34000
  }
33982
34001
  };
@@ -33996,7 +34015,9 @@ var __vue_render__$7 = function () {
33996
34015
  attrs: {
33997
34016
  for: _vm.inputId
33998
34017
  }
33999
- }, [_vm._v(_vm._s(_vm.placeholder))]), _vm._v(" "), _c("Input", {
34018
+ }, [_vm._v(_vm._s(_vm.placeholder))]), _vm._v(" "), _c("div", {
34019
+ staticClass: "rq-search-input__field"
34020
+ }, [_c("Input", {
34000
34021
  attrs: {
34001
34022
  id: _vm.inputId,
34002
34023
  value: _vm.value,
@@ -34009,7 +34030,20 @@ var __vue_render__$7 = function () {
34009
34030
  },
34010
34031
  keydown: _vm.onKeydown
34011
34032
  }
34012
- }), _vm._v(" "), _c("Button", {
34033
+ }), _vm._v(" "), _vm.hasValue ? _c("button", {
34034
+ staticClass: "rq-search-input__clear",
34035
+ attrs: {
34036
+ type: "button",
34037
+ "aria-label": "Limpiar búsqueda"
34038
+ },
34039
+ on: {
34040
+ click: _vm.onClear
34041
+ }
34042
+ }, [_c("X", {
34043
+ attrs: {
34044
+ size: 16
34045
+ }
34046
+ })], 1) : _vm._e()], 1), _vm._v(" "), _c("Button", {
34013
34047
  attrs: {
34014
34048
  variant: "primary",
34015
34049
  "icon-left": "Search"
@@ -37198,23 +37232,23 @@ function getCoreRowModel() {
37198
37232
 
37199
37233
  function useTable(props, emit) {
37200
37234
  // --- Estado Vue ---
37201
- const columnOrder = compositionApi.ref([]);
37202
- const columnPinning = compositionApi.ref({
37235
+ const columnOrder = vue.ref([]);
37236
+ const columnPinning = vue.ref({
37203
37237
  left: [],
37204
37238
  right: []
37205
37239
  });
37206
- const rowSelection = compositionApi.ref({});
37207
- const activeChevronKey = compositionApi.ref(null);
37208
- const draggingKey = compositionApi.ref(null);
37209
- const dragOverKey = compositionApi.ref(null);
37240
+ const rowSelection = vue.ref({});
37241
+ const activeChevronKey = vue.ref(null);
37242
+ const draggingKey = vue.ref(null);
37243
+ const dragOverKey = vue.ref(null);
37210
37244
 
37211
37245
  // --- Sincronizar props → estado Vue ---
37212
- compositionApi.watch(() => props.columnOrder, val => {
37246
+ vue.watch(() => props.columnOrder, val => {
37213
37247
  columnOrder.value = val ? [...val] : props.columns.map(c => c.key);
37214
37248
  }, {
37215
37249
  immediate: true
37216
37250
  });
37217
- compositionApi.watch(() => props.pinnedColumns, val => {
37251
+ vue.watch(() => props.pinnedColumns, val => {
37218
37252
  columnPinning.value = {
37219
37253
  left: val ? [...val] : [],
37220
37254
  right: []
@@ -37224,13 +37258,13 @@ function useTable(props, emit) {
37224
37258
  });
37225
37259
 
37226
37260
  // --- TanStack: solo para el row model (getValue, getRowModel) ---
37227
- const tanstackColumns = compositionApi.computed(() => props.columns.map(col => ({
37261
+ const tanstackColumns = vue.computed(() => props.columns.map(col => ({
37228
37262
  id: col.key,
37229
37263
  accessorKey: col.key,
37230
37264
  header: col.label,
37231
37265
  size: col.width || 150
37232
37266
  })));
37233
- const table = compositionApi.computed(() => createTable({
37267
+ const table = vue.computed(() => createTable({
37234
37268
  columns: tanstackColumns.value,
37235
37269
  data: props.rows,
37236
37270
  getCoreRowModel: getCoreRowModel(),
@@ -37252,7 +37286,7 @@ function useTable(props, emit) {
37252
37286
  //
37253
37287
  // Regla: pinned (en el orden de columnPinning.left) primero,
37254
37288
  // luego el resto (en el orden de columnOrder).
37255
- const orderedColumnKeys = compositionApi.computed(() => {
37289
+ const orderedColumnKeys = vue.computed(() => {
37256
37290
  const leftKeys = columnPinning.value.left || [];
37257
37291
  const leftSet = new Set(leftKeys);
37258
37292
  const pinned = leftKeys.filter(k => columnOrder.value.includes(k));
@@ -37262,7 +37296,7 @@ function useTable(props, emit) {
37262
37296
 
37263
37297
  // headerGroups: estructura que itera el template, idéntica a la de TanStack
37264
37298
  // pero con orden garantizado
37265
- const headerGroups = compositionApi.computed(() => [{
37299
+ const headerGroups = vue.computed(() => [{
37266
37300
  id: 'main',
37267
37301
  headers: orderedColumnKeys.value.map(key => {
37268
37302
  const colDef = props.columns.find(c => c.key === key) || {};
@@ -37277,11 +37311,11 @@ function useTable(props, emit) {
37277
37311
  };
37278
37312
  })
37279
37313
  }]);
37280
- const tableRows = compositionApi.computed(() => table.value.getRowModel().rows);
37314
+ const tableRows = vue.computed(() => table.value.getRowModel().rows);
37281
37315
 
37282
37316
  // --- Offsets sticky para columnas fijadas ---
37283
37317
  // Sigue el orden de columnPinning.left (igual que orderedColumnKeys para pinned)
37284
- const pinnedLeftWidths = compositionApi.computed(() => {
37318
+ const pinnedLeftWidths = vue.computed(() => {
37285
37319
  const left = columnPinning.value.left || [];
37286
37320
  if (!left.length) return {};
37287
37321
  const offsets = {};
@@ -37343,11 +37377,11 @@ function useTable(props, emit) {
37343
37377
  }
37344
37378
 
37345
37379
  // --- Handlers de selección de filas ---
37346
- const allSelected = compositionApi.computed(() => {
37380
+ const allSelected = vue.computed(() => {
37347
37381
  if (!props.rows.length) return false;
37348
37382
  return props.rows.every(row => rowSelection.value[String(row[props.rowId])]);
37349
37383
  });
37350
- const someSelected = compositionApi.computed(() => !allSelected.value && props.rows.some(row => rowSelection.value[String(row[props.rowId])]));
37384
+ const someSelected = vue.computed(() => !allSelected.value && props.rows.some(row => rowSelection.value[String(row[props.rowId])]));
37351
37385
  function toggleRow(rowId) {
37352
37386
  const sel = {
37353
37387
  ...rowSelection.value
@@ -37801,7 +37835,9 @@ var __vue_render__$4 = function () {
37801
37835
  attrs: {
37802
37836
  colspan: _vm.columns.length + (_vm.selectable ? 1 : 0)
37803
37837
  }
37804
- }, [_vm._t("empty", [_c("span", [_vm._v("Sin datos")])])], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
37838
+ }, [_vm._t("empty", function () {
37839
+ return [_c("span", [_vm._v("Sin datos")])];
37840
+ })], 2)]) : _vm._e(), _vm._v(" "), _vm._l(_vm.tableRows, function (row) {
37805
37841
  return _c("tr", {
37806
37842
  key: row.id,
37807
37843
  staticClass: "rq-table__tr rq-table__tr--body",
@@ -37839,7 +37875,9 @@ var __vue_render__$4 = function () {
37839
37875
  "rq-table__td--pinned": header.id in _vm.pinnedLeftWidths
37840
37876
  },
37841
37877
  style: _vm.getColStyle(header)
37842
- }, [_vm._t("cell-" + header.id, [_vm._v("\n " + _vm._s(row.getValue(header.id)) + "\n ")], {
37878
+ }, [_vm._t("cell-" + header.id, function () {
37879
+ return [_vm._v("\n " + _vm._s(row.getValue(header.id)) + "\n ")];
37880
+ }, {
37843
37881
  row: row.original,
37844
37882
  value: row.getValue(header.id)
37845
37883
  })], 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regcheq/ui-vue-2",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "files": [
@@ -26,8 +26,7 @@
26
26
  "prepare": "husky"
27
27
  },
28
28
  "peerDependencies": {
29
- "vue": "^2.6.0",
30
- "@vue/composition-api": "^1.7.0"
29
+ "vue": "^2.7.0"
31
30
  },
32
31
  "dependencies": {
33
32
  "@tanstack/table-core": "^8.21.3",
@@ -73,13 +72,12 @@
73
72
  "semantic-release": "^22.0.12",
74
73
  "storybook": "7.6.17",
75
74
  "style-loader": "^3.3.3",
76
- "@vue/composition-api": "^1.7.2",
77
- "vue": "2.6.11",
75
+ "vue": "2.7.16",
78
76
  "vue-docgen-api": "^4.79.2",
79
77
  "vue-docgen-loader": "^2.0.1",
80
78
  "vue-loader": "^15.11.1",
81
79
  "vue-style-loader": "^4.1.3",
82
- "vue-template-compiler": "2.6.11",
80
+ "vue-template-compiler": "2.7.16",
83
81
  "webpack": "^5.88.0"
84
82
  }
85
83
  }