pgo-ui 1.1.49 → 1.1.51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgo-ui",
3
- "version": "1.1.49",
3
+ "version": "1.1.51",
4
4
  "description": "A Vue 3 component library with PGO design system",
5
5
  "private": false,
6
6
  "type": "module",
@@ -959,6 +959,15 @@ const formatCellValue = (value, header) => {
959
959
  if (header.format && typeof header.format === 'function') {
960
960
  return header.format(value)
961
961
  }
962
+ if (header.displayType === 'date' && value) {
963
+ const d = new Date(value)
964
+ if (!isNaN(d.getTime())) {
965
+ const dd = String(d.getDate()).padStart(2, '0')
966
+ const mm = String(d.getMonth() + 1).padStart(2, '0')
967
+ const yyyy = d.getFullYear()
968
+ return `${dd}-${mm}-${yyyy}`
969
+ }
970
+ }
962
971
  return value ?? ''
963
972
  }
964
973
 
@@ -134,7 +134,7 @@
134
134
  </template>
135
135
 
136
136
  <script setup>
137
- import { ref, computed, watch, defineAsyncComponent, inject, reactive, onMounted, nextTick } from 'vue'
137
+ import { ref, computed, watch, defineAsyncComponent, inject, reactive, onMounted, onBeforeUnmount, nextTick } from 'vue'
138
138
  import Form from './Form.vue';
139
139
  import Modal from '../Modal.vue'
140
140
  import { Banner, LabelField } from '../index'
@@ -1022,6 +1022,15 @@
1022
1022
  dataChanged.value = true;
1023
1023
  fetchData();
1024
1024
  };
1025
+
1026
+ const onEscKey = (e) => {
1027
+ if (e.key === 'Escape' && open.value) {
1028
+ handleClose()
1029
+ }
1030
+ }
1031
+ onMounted(() => document.addEventListener('keydown', onEscKey))
1032
+ onBeforeUnmount(() => document.removeEventListener('keydown', onEscKey))
1033
+
1025
1034
  // Initialize on mount
1026
1035
  initializeVariables();
1027
1036
  initializeFormData();
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./index-HmqNPZr5.js";
2
- export {
3
- f as default
4
- };