@bildvitta/quasar-ui-asteroid 3.20.0-beta.21 → 3.20.0-beta.21-alpha.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bildvitta/quasar-ui-asteroid",
3
3
  "description": "Asteroid",
4
- "version": "3.20.0-beta.21",
4
+ "version": "3.20.0-beta.21-alpha.0",
5
5
  "author": "Bild & Vitta <systemteam@bild.com.br>",
6
6
  "license": "MIT",
7
7
  "main": "./src/asteroid.js",
@@ -12,7 +12,7 @@
12
12
  "src"
13
13
  ],
14
14
  "scripts": {
15
- "build": "npx rollup -c --bundleConfigAsCjs"
15
+ "build": "npx rollup -c"
16
16
  },
17
17
  "publishConfig": {
18
18
  "access": "public",
@@ -27,45 +27,46 @@
27
27
  "components"
28
28
  ],
29
29
  "devDependencies": {
30
- "@rollup/plugin-json": "^6.0.0",
31
- "@rollup/plugin-replace": "^5.0.2",
32
- "@rollup/plugin-url": "^8.0.1",
33
- "@vue/compiler-sfc": "^3.3.4",
34
- "autoprefixer": "^10.4.14",
35
- "core-js": "^3.30.2",
36
- "postcss": "^8.4.24",
37
- "rimraf": "^5.0.1",
38
- "rollup": "^3.23.1",
39
- "rollup-plugin-local-resolve": "^1.0.7",
40
- "rollup-plugin-scss": "^4.0.0",
41
- "rollup-plugin-vue": "^6.0.0",
42
- "sass": "^1.62.1"
30
+ "@rollup/plugin-json": "6.1.0",
31
+ "@rollup/plugin-replace": "6.0.3",
32
+ "@rollup/plugin-terser": "1.0.0",
33
+ "@rollup/plugin-url": "8.0.2",
34
+ "@vue/compiler-sfc": "3.5.32",
35
+ "autoprefixer": "10.5.0",
36
+ "core-js": "3.49.0",
37
+ "postcss": "8.5.10",
38
+ "rimraf": "6.1.3",
39
+ "rollup": "4.60.1",
40
+ "rollup-plugin-local-resolve": "1.0.7",
41
+ "rollup-plugin-scss": "4.0.1",
42
+ "rollup-plugin-vue": "6.0.0",
43
+ "sass": "1.99.0"
43
44
  },
44
45
  "dependencies": {
45
- "@bildvitta/composables": "^1.0.0-beta.7",
46
- "@bildvitta/store-adapter": "^1.0.0",
46
+ "@bildvitta/composables": "1.0.0-beta.12",
47
+ "@bildvitta/store-adapter": "1.0.0",
47
48
  "autonumeric": "4.10.9",
48
- "axios": "1.4.0",
49
- "date-fns": "^2.30.0",
50
- "pdfjs-dist": "4.3.136",
51
- "debug": "^4.3.4",
52
- "fuse.js": "^6.6.2",
53
- "gleap": "^14.2.7",
54
- "humps": "^2.0.1",
55
- "lodash-es": "^4.17.21",
56
- "pica": "^9.0.1",
57
- "signature_pad": "^4.1.5",
49
+ "axios": "1.15.0",
50
+ "date-fns": "4.1.0",
51
+ "debug": "4.4.3",
52
+ "fuse.js": "7.3.0",
53
+ "gleap": "15.2.8",
54
+ "humps": "2.0.1",
55
+ "lodash-es": "4.18.1",
56
+ "pdfjs-dist": "4.10.38",
57
+ "pica": "9.0.1",
58
+ "signature_pad": "5.1.3",
58
59
  "sortablejs": "1.15.7"
59
60
  },
60
61
  "peerDependencies": {
61
- "@quasar/extras": "^1.16.0",
62
- "vue-router": "^4.3.2",
63
62
  "@fawmi/vue-google-maps": "0.9.79",
64
- "vue-chartjs": "^5.2.0",
65
- "chart.js": "^4.3.0",
66
- "chartjs-plugin-datalabels": "^2.2.0",
67
- "chartjs-plugin-zoom": "^2.0.1",
68
- "quasar": "^2.18.1"
63
+ "@quasar/extras": "1.18.0",
64
+ "chart.js": "4.5.1",
65
+ "chartjs-plugin-datalabels": "2.2.0",
66
+ "chartjs-plugin-zoom": "2.2.0",
67
+ "quasar": "2.19.3",
68
+ "vue-chartjs": "5.3.3",
69
+ "vue-router": "5.0.4"
69
70
  },
70
71
  "browserslist": [
71
72
  "defaults"
@@ -34,7 +34,6 @@ defineOptions({ name: 'QasAppBar' })
34
34
  const props = defineProps({
35
35
  appUserProps: {
36
36
  type: Object,
37
- required: true,
38
37
  default: () => ({})
39
38
  },
40
39
 
@@ -136,14 +136,12 @@ defineOptions({
136
136
  const props = defineProps({
137
137
  appUserProps: {
138
138
  type: Object,
139
- required: true,
140
139
  default: () => ({})
141
140
  },
142
141
 
143
142
  brand: {
144
- default: '',
145
- required: true,
146
- type: String
143
+ type: String,
144
+ default: ''
147
145
  },
148
146
 
149
147
  homeRoute: {
@@ -158,7 +156,6 @@ const props = defineProps({
158
156
 
159
157
  miniBrand: {
160
158
  type: String,
161
- required: true,
162
159
  default: ''
163
160
  },
164
161
 
@@ -106,9 +106,8 @@ const props = defineProps({
106
106
  },
107
107
 
108
108
  user: {
109
- default: () => ({}),
110
- required: true,
111
- type: Object
109
+ type: Object,
110
+ default: () => ({})
112
111
  },
113
112
 
114
113
  useDataOnSmallScreen: {
@@ -276,9 +276,9 @@ function getNormalizedYear ({ isNext, isPrevious, month, year }) {
276
276
  }
277
277
 
278
278
  function getNormalizedMonth ({ month, isPrevious, isNext }) {
279
- if (isPrevious) return isJanuary(month) ? (month = 12) : month - 1
279
+ if (isPrevious) return isJanuary(month) ? 12 : month - 1
280
280
 
281
- if (isNext) return isDecember(month) ? (month = 1) : month + 1
281
+ if (isNext) return isDecember(month) ? 1 : month + 1
282
282
 
283
283
  return month
284
284
  }
@@ -15,9 +15,8 @@ defineOptions({ name: 'QasDebugger' })
15
15
 
16
16
  const props = defineProps({
17
17
  inspect: {
18
- default: () => [],
19
- required: true,
20
- type: Array
18
+ type: Array,
19
+ default: () => []
21
20
  }
22
21
  })
23
22
  </script>
@@ -22,7 +22,6 @@ const props = defineProps({
22
22
 
23
23
  field: {
24
24
  type: Object,
25
- required: true,
26
25
  default: () => ({})
27
26
  },
28
27
 
@@ -7,7 +7,7 @@
7
7
  <qas-search-input v-model="internalSearch" :placeholder="searchPlaceholder" :use-search-on-type="useSearchOnType" @clear="clearSearch" @filter="filter()" @update:model-value="onSearch">
8
8
  <template v-if="showFilterActions" #after-clear>
9
9
  <slot :context="mx_context" :filter="filter" :filters="activeFilters" name="filter-button" :remove-filter="removeFilter">
10
- <pv-filters-actions ref="filtersActions" v-model:filtersButton="internalFilters" v-bind="filtersActionsProps" />
10
+ <pv-filters-actions ref="filtersActions" v-model:filters-button="internalFilters" v-bind="filtersActionsProps" />
11
11
  </slot>
12
12
  </template>
13
13
  </qas-search-input>
@@ -17,7 +17,7 @@
17
17
 
18
18
  <div v-else-if="showFilterActions" class="col-12">
19
19
  <slot :context="mx_context" :filter="filter" :filters="activeFilters" name="filter-button" :remove-filter="removeFilter">
20
- <pv-filters-actions ref="filtersActions" v-model:filtersButton="internalFilters" v-bind="filtersActionsProps" />
20
+ <pv-filters-actions ref="filtersActions" v-model:filters-button="internalFilters" v-bind="filtersActionsProps" />
21
21
  </slot>
22
22
  </div>
23
23
  </div>
@@ -109,9 +109,8 @@ const props = defineProps({
109
109
  },
110
110
 
111
111
  modelValue: {
112
- default: () => ({}),
113
- required: true,
114
- type: Object
112
+ type: Object,
113
+ default: () => ({})
115
114
  },
116
115
 
117
116
  order: {
@@ -47,8 +47,7 @@ const props = defineProps({
47
47
 
48
48
  url: {
49
49
  type: String,
50
- default: '',
51
- required: true
50
+ default: ''
52
51
  },
53
52
 
54
53
  params: {
@@ -72,8 +72,7 @@ export default {
72
72
 
73
73
  title: {
74
74
  type: String,
75
- default: '',
76
- required: true
75
+ default: ''
77
76
  }
78
77
  },
79
78
 
@@ -1,17 +1,30 @@
1
1
  <template>
2
2
  <div ref="signatureContainer" class="qas-signature-pad relative-position">
3
- <canvas :id="canvasId" :ref="$attrs.ref" class="qas-signature-pad__canvas rounded-borders vertical-bottom" :height="height" />
4
- <qas-btn v-if="!empty" class="absolute-bottom-right q-mb-sm q-mr-sm" icon="sym_r_delete" variant="primary" @click="clearSignature" />
3
+ <canvas
4
+ :id="canvasId"
5
+ class="qas-signature-pad__canvas rounded-borders vertical-bottom"
6
+ :height="height"
7
+ />
8
+
9
+ <qas-btn
10
+ v-if="!empty"
11
+ class="absolute-bottom-right q-mb-sm q-mr-sm"
12
+ icon="sym_r_delete"
13
+ variant="primary"
14
+ @click="clearSignature"
15
+ />
5
16
  </div>
6
17
 
7
18
  <div>
8
- <slot :clear-signature="clearSignature" :get-signature-data="getSignatureData" />
19
+ <slot
20
+ :clear-signature="clearSignature"
21
+ :get-signature-data="getSignatureData"
22
+ />
9
23
  </div>
10
24
  </template>
11
25
 
12
26
  <script>
13
27
  import QasBtn from '../btn/QasBtn.vue'
14
-
15
28
  import { uid } from 'quasar'
16
29
  import isEqual from 'lodash-es/isEqual'
17
30
  import SignaturePad from 'signature_pad'
@@ -19,9 +32,7 @@ import SignaturePad from 'signature_pad'
19
32
  export default {
20
33
  name: 'QasSignaturePad',
21
34
 
22
- components: {
23
- QasBtn
24
- },
35
+ components: { QasBtn },
25
36
 
26
37
  props: {
27
38
  empty: {
@@ -30,18 +41,18 @@ export default {
30
41
  },
31
42
 
32
43
  height: {
33
- default: '250',
34
- type: String
44
+ type: String,
45
+ default: '250'
35
46
  },
36
47
 
37
48
  signatureOptions: {
38
- default: () => ({}),
39
- type: Object
49
+ type: Object,
50
+ default: () => ({})
40
51
  },
41
52
 
42
53
  type: {
43
- default: 'image/png',
44
- type: String
54
+ type: String,
55
+ default: 'image/png'
45
56
  }
46
57
  },
47
58
 
@@ -52,9 +63,7 @@ export default {
52
63
  data () {
53
64
  return {
54
65
  canvasId: uid(),
55
- hasEndStrokeEvent: false,
56
- signaturePad: null,
57
- SignaturePad: null
66
+ signaturePad: null
58
67
  }
59
68
  },
60
69
 
@@ -69,45 +78,65 @@ export default {
69
78
 
70
79
  mounted () {
71
80
  window.addEventListener('resize', this.setCanvasWidth)
72
- this.setCanvasWidth()
73
81
 
82
+ this.setCanvasWidth()
74
83
  this.setupSignaturePad()
75
84
  },
76
85
 
77
86
  unmounted () {
78
87
  window.removeEventListener('resize', this.setCanvasWidth)
79
- this.signaturePad.off()
88
+
89
+ this.destroySignaturePad()
80
90
  },
81
91
 
82
92
  methods: {
93
+ destroySignaturePad () {
94
+ if (!this.signaturePad) return
95
+
96
+ this.signaturePad.off()
97
+ this.signaturePad.onEnd = null
98
+ this.signaturePad = null
99
+ },
100
+
83
101
  clearSignature () {
102
+ if (!this.signaturePad) return
103
+
84
104
  this.signaturePad.clear()
85
105
  this.updateEmptyModel()
86
106
  },
87
107
 
88
108
  getSignatureData () {
109
+ if (!this.signaturePad) return ''
110
+
89
111
  return this.signaturePad.toDataURL(this.type)
90
112
  },
91
113
 
92
114
  setCanvasWidth () {
93
- const signatureContainer = this.$refs.signatureContainer
94
- const canvasElement = signatureContainer.querySelector('canvas')
95
- canvasElement.setAttribute('width', signatureContainer.offsetWidth)
115
+ const container = this.$refs.signatureContainer
116
+ if (!container) return
117
+
118
+ const canvas = container.querySelector('canvas')
119
+ if (!canvas) return
120
+
121
+ canvas.width = container.offsetWidth
96
122
  },
97
123
 
98
124
  setupSignaturePad () {
99
- const canvasElement = document.getElementById(this.canvasId)
100
- this.signaturePad = new SignaturePad(canvasElement, this.signatureOptions)
125
+ const canvas = document.getElementById(this.canvasId)
126
+ if (!canvas) return
101
127
 
102
- if (!this.hasEndStrokeEvent) {
103
- this.signaturePad.addEventListener('endStroke', this.updateEmptyModel)
104
- }
128
+ this.destroySignaturePad()
129
+
130
+ this.signaturePad = new SignaturePad(canvas, this.signatureOptions)
131
+
132
+ this.signaturePad.onEnd = this.updateEmptyModel
105
133
 
106
- this.hasEndStrokeEvent = true
107
134
  this.clearSignature()
108
135
  },
109
136
 
110
137
  updateEmptyModel () {
138
+ if (!this.signaturePad) return
139
+
111
140
  this.$emit('update:empty', this.signaturePad.isEmpty())
112
141
  }
113
142
  }
@@ -145,9 +145,8 @@ export default {
145
145
  },
146
146
 
147
147
  results: {
148
- default: () => [],
149
- required: true,
150
- type: Array
148
+ type: Array,
149
+ default: () => []
151
150
  },
152
151
 
153
152
  rowKey: {
@@ -52,9 +52,8 @@ const props = defineProps({
52
52
  },
53
53
 
54
54
  tabs: {
55
- default: () => ({}),
56
- required: true,
57
- type: [Object, Array]
55
+ type: [Object, Array],
56
+ default: () => ({})
58
57
  },
59
58
 
60
59
  querySlug: {
@@ -79,7 +79,6 @@ export default {
79
79
  },
80
80
 
81
81
  label: {
82
- default: '',
83
82
  required: true,
84
83
  type: String
85
84
  },
@@ -3,6 +3,11 @@
3
3
  @mixin set-error-message ($important: false) {
4
4
  @include set-typography($caption, $important);
5
5
 
6
- padding-top: if($important, var(--qas-spacing-sm) !important, var(--qas-spacing-sm));
7
- color: if($important, $negative !important, $negative);
6
+ @if $important {
7
+ padding-top: var(--qas-spacing-sm) !important;
8
+ color: $negative !important;
9
+ } @else {
10
+ padding-top: var(--qas-spacing-sm);
11
+ color: $negative;
12
+ }
8
13
  }
@@ -1,8 +1,15 @@
1
1
  @use 'sass:map';
2
2
 
3
3
  @mixin set-typography($name, $important: false) {
4
- font-size: if($important, map.get($name, 'size') !important, map.get($name, 'size'));
5
- font-weight: if($important, map.get($name, 'weight') !important, map.get($name, 'weight'));
6
- letter-spacing: if($important, map.get($name, 'letter-spacing') !important, map.get($name, 'letter-spacing'));
7
- line-height: if($important, map.get($name, 'line-height') !important, map.get($name, 'line-height'));
4
+ @if $important {
5
+ font-size: map.get($name, 'size') !important;
6
+ font-weight: map.get($name, 'weight') !important;
7
+ letter-spacing: map.get($name, 'letter-spacing') !important;
8
+ line-height: map.get($name, 'line-height') !important;
9
+ } @else {
10
+ font-size: map.get($name, 'size');
11
+ font-weight: map.get($name, 'weight');
12
+ letter-spacing: map.get($name, 'letter-spacing');
13
+ line-height: map.get($name, 'line-height');
14
+ }
8
15
  }
@@ -1,13 +1,14 @@
1
- import { format, parseISO, isMatch } from 'date-fns'
1
+ import { format, parseISO, isMatch, isValid } from 'date-fns'
2
2
  import { ptBR } from 'date-fns/locale'
3
3
 
4
4
  // Private
5
5
  function __format (value, token, options = {}) {
6
- if (!value) {
7
- return ''
8
- }
6
+ if (!value) return ''
9
7
 
10
8
  value = value instanceof Date ? value : parseISO(value)
9
+
10
+ if (!isValid(value)) return ''
11
+
11
12
  return format(value, token, { locale: ptBR, ...options })
12
13
  }
13
14