quasar-factory-lib 0.0.18 → 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.18",
100
+ "version": "0.0.20",
101
101
  "author": ""
102
102
  }
@@ -28,7 +28,7 @@
28
28
  <script lang="ts">
29
29
  import { defineComponent } from 'vue'
30
30
  export default defineComponent({
31
- name: 'Alert',
31
+ name: 'AlertDialog',
32
32
  data() {
33
33
  return {
34
34
  showPopUp: false,
@@ -67,7 +67,7 @@ export default defineComponent({
67
67
  },
68
68
  emit: ['dialogClosed'],
69
69
  methods: {
70
- showPopupMessage(message: string): void {
70
+ openAlertAndSetMessage(message: string): void {
71
71
  this.showPopUp = true
72
72
  this.message = message
73
73
  },
@@ -1,6 +1,6 @@
1
1
  import type { App, Plugin } from 'vue'
2
2
 
3
- import Alert from './Alert.vue'
3
+ import AlertDialog from './AlertDialog.vue'
4
4
 
5
5
  import { registerComponent } from '@/utils/plugins'
6
6
 
@@ -10,11 +10,11 @@ import { registerComponent } from '@/utils/plugins'
10
10
  /** export button plugin */
11
11
  export default {
12
12
  install (app: App) {
13
- registerComponent(app, 'Alert', Alert)
13
+ registerComponent(app, 'AlertDialog', AlertDialog)
14
14
  }
15
15
  } as Plugin
16
16
 
17
17
  /** export button components */
18
- export { Alert as Alert }
18
+ export { AlertDialog as AlertDialog }
19
19
 
20
20
 
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <q-dialog v-model="alert" persistent>
3
+ <q-card class="alert-card" :data-cy="dataCy">
4
+ <q-card-section class="row items-center">
5
+ <span class="q-ml-sm text-body1">{{ message }}</span>
6
+ </q-card-section>
7
+ <q-card-actions align="right">
8
+ <q-btn
9
+ color="negative"
10
+ flat
11
+ :label="$t('confirmDialog.cancel')"
12
+ @click="onClickBtnCancel()"
13
+ data-cy="cancel"
14
+ />
15
+ <q-btn
16
+ color="positive"
17
+ flat
18
+ :label="$t('confirmDialog.confirm')"
19
+ @click="onClickBtnConfirm()"
20
+ data-cy="confirm"
21
+ />
22
+ </q-card-actions>
23
+ </q-card>
24
+ </q-dialog>
25
+ </template>
26
+
27
+ <style>
28
+ .alert-card {
29
+ width: 100%;
30
+ max-width: 250px;
31
+ }
32
+ @media only screen and (max-width: 1100px) {
33
+ .alert-card {
34
+ width: 100%;
35
+ max-width: 450px;
36
+ }
37
+ }
38
+ </style>
39
+
40
+ <script lang="ts">
41
+ import { defineComponent } from 'vue'
42
+ export default defineComponent({
43
+ name: 'ConfirmDialog',
44
+ data() {
45
+ return {
46
+ alert: false,
47
+ message: '',
48
+ }
49
+ },
50
+ props: {
51
+ dataCy: {
52
+ type: String,
53
+ default: '',
54
+ },
55
+ onClickBtnConfirm: {
56
+ type: Function,
57
+ default: function () { },
58
+ },
59
+ onClickBtnCancel: {
60
+ type: Function,
61
+ default: function () { },
62
+ }
63
+ },
64
+ methods: {
65
+ openDialogAndSetMessage(msg: string): void {
66
+ this.alert = true
67
+ this.message = msg
68
+ },
69
+ closeAlert() {
70
+ this.alert = false
71
+ }
72
+ }
73
+ })
74
+ </script>
@@ -1,6 +1,6 @@
1
1
  import type { App, Plugin } from 'vue'
2
2
 
3
- import Confirm from './Confirm.vue'
3
+ import ConfirmDialog from './ConfirmDialog.vue'
4
4
 
5
5
  import { registerComponent } from '@/utils/plugins'
6
6
 
@@ -10,9 +10,9 @@ import { registerComponent } from '@/utils/plugins'
10
10
  /** export button plugin */
11
11
  export default {
12
12
  install (app: App) {
13
- registerComponent(app, 'Confirm', Confirm)
13
+ registerComponent(app, 'ConfirmDialog', ConfirmDialog)
14
14
  }
15
15
  } as Plugin
16
16
 
17
17
  /** export button components */
18
- export { Confirm as Confirm }
18
+ export { ConfirmDialog as ConfirmDialog }
@@ -1,5 +1,5 @@
1
1
  import MyTable from './Table'
2
- import Alert from './Alert'
3
- import Confirm from './Confirm'
4
- export { MyTable, Alert, Confirm }
2
+ import AlertDialog from './Alert'
3
+ import ConfirmDialog from './Confirm'
4
+ export { MyTable, AlertDialog, ConfirmDialog }
5
5
 
@@ -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
package/src/index.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import '@quasar/extras/material-icons/material-icons.css'
2
2
  import { Quasar } from 'quasar'
3
3
  import { App, Plugin } from 'vue'
4
- import { MyTable, Alert, Confirm } from './components/plugins.ts'
4
+ import { MyTable, AlertDialog, ConfirmDialog } from './components/plugins.ts'
5
5
  import { registerPlugin, setVueInstance } from './utils/plugins.ts'
6
6
  import TranslateKeys from './i18n/translateKeys.ts'
7
7
  import { createPinia } from 'pinia'
8
- export { MyTable, Alert, Confirm } from './components/index.ts'
8
+ export { MyTable, AlertDialog, ConfirmDialog } from './components/index.ts'
9
9
 
10
10
  export type { TranslateKeys }
11
11
  // import plugins from "./components/plugins";
@@ -22,8 +22,8 @@ const plugin: Plugin = {
22
22
  console.log('[Quasar Components] Installing...')
23
23
  setVueInstance(app)
24
24
  registerPlugin(app, MyTable)
25
- registerPlugin(app, Alert)
26
- registerPlugin(app, Confirm)
25
+ registerPlugin(app, AlertDialog)
26
+ registerPlugin(app, ConfirmDialog)
27
27
  app.use(i18n)
28
28
  app.use(pinia)
29
29
  i18n.global.locale = 'en'
@@ -7,16 +7,16 @@
7
7
  <div
8
8
  class="full-width"
9
9
  >
10
- <Alert ref="AlertRef" :icon="'done'" :iconColor="'positive'" :btnLabel="'Sair'" />
10
+ <AlertDialog ref="AlertRef" :icon="'done'" :iconColor="'positive'" :btnLabel="'Sair'" />
11
11
  </div>
12
12
  </q-page>
13
13
  </q-page-container>
14
14
  </template>
15
15
  <script lang="ts">
16
- import Alert from '../components/Alert/Alert.vue'
16
+ import AlertDialog from '../components/Alert/AlertDialog.vue'
17
17
  export default {
18
18
  components: {
19
- Alert
19
+ AlertDialog
20
20
  },
21
21
  data () {
22
22
  return {
@@ -26,7 +26,7 @@ export default {
26
26
  computed: {
27
27
  },
28
28
  mounted () {
29
- this.$refs.AlertRef.showPopupMessage("Alert")
29
+ this.$refs.AlertRef.openAlertAndSetMessage("Alert")
30
30
  },
31
31
  methods: {
32
32
  }
@@ -7,28 +7,20 @@
7
7
  <div
8
8
  class="full-width"
9
9
  >
10
- <Confirm
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>
25
17
  </q-page-container>
26
18
  </template>
27
19
  <script lang="ts">
28
- import Confirm from '../components/Confirm/Confirm.vue'
20
+ import ConfirmDialog from '../components/Confirm/ConfirmDialog.vue'
29
21
  export default {
30
22
  components: {
31
- Confirm
23
+ ConfirmDialog
32
24
  },
33
25
  data () {
34
26
  return {
@@ -38,14 +30,16 @@ export default {
38
30
  computed: {
39
31
  },
40
32
  mounted () {
41
- this.$refs.ConfirmRef.showPopupAndSetMessage("Confirm")
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
@@ -1,120 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- persistent: {
3
- type: BooleanConstructor;
4
- default: boolean;
5
- };
6
- dataCy: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- cancelBtnColor: {
11
- type: StringConstructor;
12
- default: string;
13
- required: true;
14
- };
15
- labelBtnCancel: {
16
- type: StringConstructor;
17
- default: string;
18
- required: true;
19
- };
20
- confirmBtnColor: {
21
- type: StringConstructor;
22
- default: string;
23
- required: true;
24
- };
25
- labelBtnConfirm: {
26
- type: StringConstructor;
27
- default: string;
28
- required: true;
29
- };
30
- avatarIcon: {
31
- type: StringConstructor;
32
- default: string;
33
- };
34
- avatarSize: {
35
- type: StringConstructor;
36
- default: string;
37
- };
38
- avatarColor: {
39
- type: StringConstructor;
40
- default: string;
41
- };
42
- avatarTextColor: {
43
- type: StringConstructor;
44
- default: string;
45
- };
46
- avatarFontSize: {
47
- type: StringConstructor;
48
- default: string;
49
- };
50
- }>, {}, {
51
- alert: boolean;
52
- message: string;
53
- }, {}, {
54
- showPopupAndSetMessage(msg: string): void;
55
- closeAlert(): void;
56
- onClickBtnCancel(): void;
57
- onClickBtnConfirm(): void;
58
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
59
- persistent: {
60
- type: BooleanConstructor;
61
- default: boolean;
62
- };
63
- dataCy: {
64
- type: StringConstructor;
65
- default: string;
66
- };
67
- cancelBtnColor: {
68
- type: StringConstructor;
69
- default: string;
70
- required: true;
71
- };
72
- labelBtnCancel: {
73
- type: StringConstructor;
74
- default: string;
75
- required: true;
76
- };
77
- confirmBtnColor: {
78
- type: StringConstructor;
79
- default: string;
80
- required: true;
81
- };
82
- labelBtnConfirm: {
83
- type: StringConstructor;
84
- default: string;
85
- required: true;
86
- };
87
- avatarIcon: {
88
- type: StringConstructor;
89
- default: string;
90
- };
91
- avatarSize: {
92
- type: StringConstructor;
93
- default: string;
94
- };
95
- avatarColor: {
96
- type: StringConstructor;
97
- default: string;
98
- };
99
- avatarTextColor: {
100
- type: StringConstructor;
101
- default: string;
102
- };
103
- avatarFontSize: {
104
- type: StringConstructor;
105
- default: string;
106
- };
107
- }>> & Readonly<{}>, {
108
- dataCy: string;
109
- persistent: boolean;
110
- cancelBtnColor: string;
111
- labelBtnCancel: string;
112
- confirmBtnColor: string;
113
- labelBtnConfirm: string;
114
- avatarIcon: string;
115
- avatarSize: string;
116
- avatarColor: string;
117
- avatarTextColor: string;
118
- avatarFontSize: string;
119
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
120
- export default _default;
@@ -1,123 +0,0 @@
1
- <template>
2
- <q-dialog v-model="alert" :persistent="persistent">
3
- <q-card class="alert-card" :data-cy="dataCy">
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
- <span class="q-ml-sm text-body1">{{ message }}</span>
13
- </q-card-section>
14
- <q-card-actions align="right">
15
- <q-btn
16
- :color="cancelBtnColor"
17
- flat
18
- :label="labelBtnCancel"
19
- @click="onClickBtnCancel()"
20
- data-cy="cancel"
21
- />
22
- <q-btn
23
- :color="confirmBtnColor"
24
- flat
25
- :label="labelBtnConfirm"
26
- @click="onClickBtnConfirm()"
27
- data-cy="confirm"
28
- />
29
- </q-card-actions>
30
- </q-card>
31
- </q-dialog>
32
- </template>
33
-
34
- <style>
35
- .alert-card {
36
- width: 100%;
37
- max-width: 250px;
38
- }
39
- @media only screen and (max-width: 1100px) {
40
- .alert-card {
41
- width: 100%;
42
- max-width: 450px;
43
- }
44
- }
45
- </style>
46
-
47
- <script lang="ts">
48
- import { defineComponent } from 'vue'
49
- export default defineComponent({
50
- data() {
51
- return {
52
- alert: false,
53
- message: '',
54
- }
55
- },
56
- props: {
57
- persistent: {
58
- type: Boolean,
59
- default: true,
60
- },
61
- dataCy: {
62
- type: String,
63
- default: '',
64
- },
65
- cancelBtnColor: {
66
- type: String,
67
- default: '',
68
- required: true,
69
- },
70
- labelBtnCancel: {
71
- type: String,
72
- default: '',
73
- required: true,
74
- },
75
- confirmBtnColor: {
76
- type: String,
77
- default: '',
78
- required: true,
79
- },
80
- labelBtnConfirm: {
81
- type: String,
82
- default: '',
83
- required: true,
84
- },
85
- avatarIcon: {
86
- type: String,
87
- default: 'warning',
88
- },
89
- avatarSize: {
90
- type: String,
91
- default: 'md',
92
- },
93
- avatarColor: {
94
- type: String,
95
- default: '',
96
- },
97
- avatarTextColor: {
98
- type: String,
99
- default: 'primary',
100
- },
101
- avatarFontSize: {
102
- type: String,
103
- default: '18px',
104
- },
105
- },
106
- emit: ['onClickBtnCancel', 'onClickBtnConfirm'],
107
- methods: {
108
- showPopupAndSetMessage(msg: string): void {
109
- this.alert = true
110
- this.message = msg
111
- },
112
- closeAlert() {
113
- this.alert = false
114
- },
115
- onClickBtnCancel() {
116
- this.closeAlert()
117
- },
118
- onClickBtnConfirm() {
119
- this.closeAlert()
120
- },
121
- }
122
- })
123
- </script>