tsv2-library 1.1.0-dev-alpha.5 → 1.1.0-dev-alpha.6

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.
@@ -56,6 +56,10 @@ export interface AssetFilterProps {
56
56
  * The list of filter fields to hide. This has a higher priority than `showFields`.
57
57
  */
58
58
  hideFields?: AssetFilterFields[];
59
+ /**
60
+ * To determine the tag type options
61
+ */
62
+ tagType?: 'RFID' | 'QR' | 'RFID & QR';
59
63
  }
60
64
 
61
65
  export type AssetFilterEmits = {
@@ -54669,6 +54669,12 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
54669
54669
  const totalRecords2 = ref();
54670
54670
  const loadingTable = ref(false);
54671
54671
  const prevQueryParams = shallowRef({});
54672
+ const visibleOrDefaultColumns = computed(
54673
+ () => {
54674
+ var _a;
54675
+ return ((_a = visibleColumns.value) == null ? void 0 : _a.length) ? visibleColumns.value : props.columns.filter((col) => col.visible !== false);
54676
+ }
54677
+ );
54672
54678
  const queryParams = computed(() => {
54673
54679
  var _a;
54674
54680
  return {
@@ -54678,7 +54684,9 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
54678
54684
  limit: props.usePaginator ? tableRows.value : void 0,
54679
54685
  sortOrder: sortOrder2.value,
54680
54686
  sortBy: sortBy.value,
54681
- columns: JSON.stringify(visibleColumns.value.map((col) => col.field)),
54687
+ columns: JSON.stringify(
54688
+ visibleOrDefaultColumns.value.map((col) => col.field)
54689
+ ),
54682
54690
  ...props.filters
54683
54691
  // This will resets the previous filters.
54684
54692
  };
@@ -55367,6 +55375,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
55367
55375
  createVNode(_sfc_main$1N, {
55368
55376
  onClick: (_a = customColumn.value) == null ? void 0 : _a.toggleMenu,
55369
55377
  class: "!w-4 !h-4 !mx-auto",
55378
+ "data-ts-section": "columnvisibilitytoggle",
55370
55379
  icon: "ellipsis-h",
55371
55380
  info: "Column Visibility",
55372
55381
  "tooltip-pos": "left"
@@ -61974,7 +61983,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
61974
61983
  tableName: {},
61975
61984
  fetchOptions: {},
61976
61985
  showFields: {},
61977
- hideFields: {}
61986
+ hideFields: {},
61987
+ tagType: {}
61978
61988
  }, {
61979
61989
  "filter": { required: true },
61980
61990
  "filterModifiers": {},
@@ -62035,7 +62045,17 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
62035
62045
  "In Audit",
62036
62046
  "None"
62037
62047
  ];
62038
- const TAG_OPTIONS = ["RFID", "QR", "RFID & QR", "Non TAG"];
62048
+ const TAG_OPTIONS = computed(() => {
62049
+ const TAG_MAP = {
62050
+ "QR": ["QR", "RFID & QR"],
62051
+ "RFID": ["RFID", "RFID & QR"],
62052
+ "RFID & QR": ["QR", "RFID", "RFID & QR"]
62053
+ };
62054
+ const DEFAULT_TAG_OPTIONS = ["RFID", "QR", "RFID & QR", "Non TAG"];
62055
+ if (!props.tagType)
62056
+ return DEFAULT_TAG_OPTIONS;
62057
+ return TAG_MAP[props.tagType] ?? DEFAULT_TAG_OPTIONS;
62058
+ });
62039
62059
  const WARRANTY_STATUS_OPTIONS = ["Active", "Deactive", "Not Set"];
62040
62060
  const loadingOptions2 = ref({});
62041
62061
  const filterOptions2 = ref({});
@@ -62122,7 +62142,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
62122
62142
  filter4.value = {};
62123
62143
  setTimeout(() => {
62124
62144
  emit("updateFields");
62125
- }, 500);
62145
+ }, 700);
62126
62146
  },
62127
62147
  { deep: true }
62128
62148
  );
@@ -62199,11 +62219,11 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
62199
62219
  key: 6,
62200
62220
  modelValue: filter4.value.tagType,
62201
62221
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => filter4.value.tagType = $event),
62202
- options: TAG_OPTIONS,
62222
+ options: TAG_OPTIONS.value,
62203
62223
  "data-ts-section": "tag-filter-input",
62204
62224
  label: "TAG",
62205
62225
  placeholder: "Select TAG"
62206
- }, null, 8, ["modelValue"])) : createCommentVNode("", true),
62226
+ }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
62207
62227
  showFilterList.value.includes("measurement") ? (openBlock(), createBlock(_sfc_main$13, {
62208
62228
  key: 7,
62209
62229
  modelValue: filter4.value.measurement,
@@ -62916,8 +62936,9 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
62916
62936
  "onUpdate:visibleColumns": _cache[4] || (_cache[4] = ($event) => visibleColumns.value = $event),
62917
62937
  "fetch-options": handleFetchOptions,
62918
62938
  "table-name": TABLE_NAME,
62939
+ "tag-type": typeof props.tagType !== "boolean" ? props.tagType : void 0,
62919
62940
  onUpdateFields: _cache[5] || (_cache[5] = ($event) => containerKey.value++)
62920
- }, null, 8, ["filter", "visible-columns"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(filterLists.value, (field2) => {
62941
+ }, null, 8, ["filter", "visible-columns", "tag-type"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(filterLists.value, (field2) => {
62921
62942
  return openBlock(), createElementBlock(Fragment, null, [
62922
62943
  field2.fieldName === "group" ? (openBlock(), createBlock(_sfc_main$19, {
62923
62944
  key: field2.label,
@@ -63152,6 +63173,13 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
63152
63173
  const searchModel = ref();
63153
63174
  const selectedUser = ref();
63154
63175
  const columns2 = selectUserColumns();
63176
+ const resetState = () => {
63177
+ selectedUser.value = void 0;
63178
+ showWarning.value = false;
63179
+ showFilter.value = false;
63180
+ filterQuery.value = void 0;
63181
+ searchModel.value = void 0;
63182
+ };
63155
63183
  const selectUser = () => {
63156
63184
  if (!selectedUser.value || !Object.keys(selectedUser.value).length) {
63157
63185
  showWarning.value = true;
@@ -63160,10 +63188,6 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
63160
63188
  emit("update:visible", false);
63161
63189
  }
63162
63190
  };
63163
- const resetState = () => {
63164
- selectedUser.value = void 0;
63165
- showWarning.value = false;
63166
- };
63167
63191
  const bindFetchFunction = async (params) => {
63168
63192
  if (props.fetchFunction) {
63169
63193
  return await props.fetchFunction(params);
@@ -69104,18 +69128,18 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
69104
69128
  };
69105
69129
  const increment = () => {
69106
69130
  const incremented = +(field2.value ?? 0) + 1;
69107
- if (props.max && props.max >= incremented || props.max == null)
69131
+ if (typeof props.max == "number" && props.max >= incremented || props.max == null)
69108
69132
  onUpdateValue(incremented, "modelValue");
69109
69133
  };
69110
69134
  const decrement = () => {
69111
69135
  const decremented = +(field2.value ?? 0) - 1;
69112
- if (props.min && props.min <= decremented || props.min == null)
69136
+ if (typeof props.min === "number" && props.min <= decremented || props.min == null)
69113
69137
  onUpdateValue(decremented, "modelValue");
69114
69138
  };
69115
69139
  const findMinOrMaxValue = (value) => {
69116
- if (props.min && value < props.min)
69140
+ if (typeof props.min === "number" && value < props.min)
69117
69141
  return props.min;
69118
- else if (props.max && value > props.max)
69142
+ else if (typeof props.max === "number" && value > props.max)
69119
69143
  return props.max;
69120
69144
  return value;
69121
69145
  };