quasar-factory-lib 0.0.19 → 0.0.20

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.
@@ -1,2 +1 @@
1
- export default pinia;
2
- declare const pinia: import("pinia").Pinia;
1
+ export { default as tableStore } from './table.js';
@@ -0,0 +1,2 @@
1
+ import TableStore from './table.js';
2
+ export { TableStore };
@@ -1,4 +1,5 @@
1
- export const tableStore: import("pinia").StoreDefinition<"tableStore", {
1
+ export default tableStore;
2
+ declare const tableStore: import("pinia").StoreDefinition<"tableStore", {
2
3
  disableScannerButtons: import("@vueuse/shared").RemovableRef<boolean>;
3
4
  filterValue: import("@vueuse/shared").RemovableRef<string>;
4
5
  lastFilterValue: import("@vueuse/shared").RemovableRef<string>;
package/package.json CHANGED
@@ -97,6 +97,6 @@
97
97
  "release": "standard-version"
98
98
  },
99
99
  "type": "module",
100
- "version": "0.0.19",
100
+ "version": "0.0.20",
101
101
  "author": ""
102
102
  }
@@ -1,28 +1,21 @@
1
1
  <template>
2
- <q-dialog v-model="alert" :persistent="persistent">
2
+ <q-dialog v-model="alert" persistent>
3
3
  <q-card class="alert-card" :data-cy="dataCy">
4
4
  <q-card-section class="row items-center">
5
- <q-avatar
6
- :icon="avatarIcon"
7
- :color="avatarColor"
8
- :text-color="avatarTextColor"
9
- :size="avatarSize"
10
- :font-size="avatarFontSize"
11
- />
12
5
  <span class="q-ml-sm text-body1">{{ message }}</span>
13
6
  </q-card-section>
14
7
  <q-card-actions align="right">
15
8
  <q-btn
16
- :color="cancelBtnColor"
9
+ color="negative"
17
10
  flat
18
- :label="labelBtnCancel"
11
+ :label="$t('confirmDialog.cancel')"
19
12
  @click="onClickBtnCancel()"
20
13
  data-cy="cancel"
21
14
  />
22
15
  <q-btn
23
- :color="confirmBtnColor"
16
+ color="positive"
24
17
  flat
25
- :label="labelBtnConfirm"
18
+ :label="$t('confirmDialog.confirm')"
26
19
  @click="onClickBtnConfirm()"
27
20
  data-cy="confirm"
28
21
  />
@@ -55,56 +48,19 @@ export default defineComponent({
55
48
  }
56
49
  },
57
50
  props: {
58
- persistent: {
59
- type: Boolean,
60
- default: true,
61
- },
62
51
  dataCy: {
63
52
  type: String,
64
53
  default: '',
65
54
  },
66
- cancelBtnColor: {
67
- type: String,
68
- default: '',
69
- required: true,
70
- },
71
- labelBtnCancel: {
72
- type: String,
73
- default: '',
74
- required: true,
75
- },
76
- confirmBtnColor: {
77
- type: String,
78
- default: '',
79
- required: true,
80
- },
81
- labelBtnConfirm: {
82
- type: String,
83
- default: '',
84
- required: true,
85
- },
86
- avatarIcon: {
87
- type: String,
88
- default: 'warning',
89
- },
90
- avatarSize: {
91
- type: String,
92
- default: 'md',
93
- },
94
- avatarColor: {
95
- type: String,
96
- default: '',
97
- },
98
- avatarTextColor: {
99
- type: String,
100
- default: 'primary',
101
- },
102
- avatarFontSize: {
103
- type: String,
104
- default: '18px',
55
+ onClickBtnConfirm: {
56
+ type: Function,
57
+ default: function () { },
105
58
  },
59
+ onClickBtnCancel: {
60
+ type: Function,
61
+ default: function () { },
62
+ }
106
63
  },
107
- emit: ['onClickBtnCancel', 'onClickBtnConfirm'],
108
64
  methods: {
109
65
  openDialogAndSetMessage(msg: string): void {
110
66
  this.alert = true
@@ -112,13 +68,7 @@ export default defineComponent({
112
68
  },
113
69
  closeAlert() {
114
70
  this.alert = false
115
- },
116
- onClickBtnCancel() {
117
- this.closeAlert()
118
- },
119
- onClickBtnConfirm() {
120
- this.closeAlert()
121
- },
71
+ }
122
72
  }
123
73
  })
124
74
  </script>
@@ -1,13 +1,16 @@
1
1
  // import translateKeys from '../translateKeys'
2
2
 
3
3
  // const en: translateKeys = {
4
- const en = {
5
- test: 'Test',
4
+ const en = {
6
5
  table: {
7
6
  search: 'Search',
8
7
  cancel: 'Cancel',
9
8
  confirm: 'Save'
10
9
  },
10
+ confirmDialog: {
11
+ cancel: 'Cancel',
12
+ confirm: 'Confirm'
13
+ },
11
14
  form: {
12
15
  rules: {
13
16
  emptyField: 'The field cannot be empty',
@@ -1,18 +1,21 @@
1
1
  // import translateKeys from "../translateKeys"
2
2
 
3
3
  // const es: translateKeys = {
4
- const es = {
5
- test: 'Test',
6
- table: {
7
- search: 'Buscar',
8
- cancel: 'Cancelar',
9
- confirm: 'Guardar'
10
- },
11
- form: {
12
- rules: {
13
- emptyField: 'El campo no puede estar vacío',
14
- exceedCharactersTypeList: 'El campo no debe exceder más de {0} caracteres'
15
- }
16
- }
4
+ const es = {
5
+ table: {
6
+ search: 'Buscar',
7
+ cancel: 'Cancelar',
8
+ confirm: 'Guardar'
9
+ },
10
+ confirmDialog: {
11
+ cancel: 'Cancelar',
12
+ confirm: 'Confirmar'
13
+ },
14
+ form: {
15
+ rules: {
16
+ emptyField: 'El campo no puede estar vacío',
17
+ exceedCharactersTypeList: 'El campo no debe exceder más de {0} caracteres'
18
+ }
19
+ }
17
20
  }
18
21
  export default es
@@ -9,16 +9,8 @@
9
9
  >
10
10
  <ConfirmDialog
11
11
  ref="ConfirmRef"
12
- :cancelBtnColor="'red'"
13
- :labelBtnCancel="'Cancelar'"
14
- @onClickBtnCancel="onClickBtnCancel"
15
- :confirmBtnColor="'positive'"
16
- :labelBtnConfirm="'Confirmar'"
17
- @onClickBtnConfirm="onClickBtnConfirm"
18
- :avatarIcon="'warning'"
19
- :avatarSize="'xl'"
20
- :avatarFontSize="'40px'"
21
- :avatarTextColor="'primary'"
12
+ :onClickBtnConfirm="onClickBtnConfirm"
13
+ :onClickBtnCancel="onClickBtnCancel"
22
14
  />
23
15
  </div>
24
16
  </q-page>
@@ -41,11 +33,13 @@ export default {
41
33
  this.$refs.ConfirmRef.openDialogAndSetMessage("Confirm")
42
34
  },
43
35
  methods: {
44
- onClickBtnCancel() {
45
- console.log('cancel')
46
- },
47
36
  onClickBtnConfirm() {
48
37
  console.log('confirm')
38
+ this.$refs.ConfirmRef.closeAlert()
39
+ },
40
+ onClickBtnCancel() {
41
+ this.$refs.ConfirmRef.closeAlert()
42
+ console.log('cancel')
49
43
  }
50
44
  }
51
45
  }
@@ -50,7 +50,7 @@ import Table from '../components/Table/Table.vue'
50
50
  import setTableHeight from '../components/Table/utils/setTableHeight'
51
51
  import infiniteScroll from '../components/Table/utils/infiniteScroll'
52
52
  import FilterMethod from '../components/Table/utils/filterMethod'
53
- import { tableStore } from '../store/table.js'
53
+ import tableStore from '../store/table.js'
54
54
  export default {
55
55
  components: {
56
56
  Table
@@ -0,0 +1 @@
1
+ export { default as tableStore } from './table.js';
@@ -0,0 +1,3 @@
1
+ import TableStore from './table.js'
2
+ export { TableStore }
3
+
@@ -1,6 +1,6 @@
1
1
  import { defineStore } from 'pinia'
2
2
  import { useStorage } from '@vueuse/core'
3
- export const tableStore = defineStore('tableStore', {
3
+ const tableStore = defineStore('tableStore', {
4
4
  state: () => ({
5
5
  disableScannerButtons: useStorage('counter', false),
6
6
  filterValue: useStorage('filterValue', ''),
@@ -21,3 +21,5 @@ export const tableStore = defineStore('tableStore', {
21
21
 
22
22
  }
23
23
  })
24
+
25
+ export default tableStore