@mixd-id/web-scaffold 0.1.2301231360 → 0.1.2301231362

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": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.2301231360",
4
+ "version": "0.1.2301231362",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -132,54 +132,75 @@ export default {
132
132
  this.$nextTick(() => {
133
133
  const rect = caller.getBoundingClientRect()
134
134
 
135
- let maxHeight, bottom
135
+ let maxHeight
136
+ let top, right, bottom, left
137
+ let transformOrigin
136
138
 
137
139
  switch(this.position){
138
140
 
139
141
  case 'bottom-right':
140
- this.computedStyle = {
141
- right: (window.innerWidth - (Math.round(rect.x) + rect.width)) + 'px',
142
- top: Math.round(rect.y + rect.height + 8) + 'px',
143
- maxHeight: (window.innerHeight - Math.round(rect.y + rect.height + 16)) + 'px',
144
- transformOrigin: 'top right'
145
- }
142
+ right = window.innerWidth - (Math.round(rect.x) + rect.width)
143
+ top = Math.round(rect.y + rect.height + 8)
144
+ maxHeight = window.innerHeight - Math.round(rect.y + rect.height + 16)
145
+ transformOrigin = 'top right'
146
146
  break
147
147
 
148
148
  case 'top-left':
149
-
150
149
  maxHeight = Math.round(rect.top - 16)
151
150
  bottom = window.innerHeight - rect.top + 8
152
-
153
- this.computedStyle = {
154
- left: Math.round(rect.x) + 'px',
155
- bottom: bottom + 'px',
156
- maxHeight: maxHeight + 'px',
157
- transformOrigin: 'bottom left'
158
- }
151
+ left = Math.round(rect.x)
152
+ transformOrigin = 'bottom left'
159
153
  break
160
154
 
161
155
  case 'top-right':
162
-
163
156
  maxHeight = Math.round(rect.top - 16)
164
157
  bottom = window.innerHeight - rect.top + 8
165
-
166
- this.computedStyle = {
167
- right: (window.innerWidth - (Math.round(rect.x) + rect.width)) + 'px',
168
- bottom: bottom + 'px',
169
- maxHeight: maxHeight + 'px',
170
- transformOrigin: 'bottom right'
171
- }
158
+ right = window.innerWidth - (Math.round(rect.x) + rect.width)
159
+ transformOrigin = 'bottom right'
172
160
  break
173
161
 
174
162
  default:
175
- this.computedStyle = {
176
- left: Math.round(rect.x) + 'px',
177
- top: Math.round(rect.y + rect.height + 8) + 'px',
178
- maxHeight: (window.innerHeight - Math.round(rect.y + rect.height + 16)) + 'px',
179
- transformOrigin: 'top left'
163
+ left = Math.round(rect.x)
164
+ top = Math.round(rect.y + rect.height + 8)
165
+ //maxHeight = window.innerHeight - Math.round(rect.y + rect.height + 16)
166
+ transformOrigin = 'top left'
167
+ break
168
+ }
169
+
170
+ if(left){
171
+ if(left + this.$refs.contextMenu.clientWidth >= (window.innerWidth - 16)){
172
+ left = window.innerWidth - (this.$refs.contextMenu.clientWidth + 16)
173
+
174
+ if(transformOrigin === 'top left'){
175
+ transformOrigin = 'top right'
180
176
  }
177
+ }
181
178
  }
182
179
 
180
+ if(top){
181
+ if(top + this.$refs.contextMenu.clientHeight >= (window.innerHeight - 16)){
182
+ top = window.innerHeight - (this.$refs.contextMenu.clientHeight + 16)
183
+
184
+ if(transformOrigin === 'top left'){
185
+ transformOrigin = 'bottom left'
186
+ }
187
+ else if(transformOrigin === 'top right'){
188
+ transformOrigin = 'bottom right'
189
+ }
190
+ }
191
+ }
192
+
193
+ this.computedStyle = {
194
+ left: left ? left + 'px' : left,
195
+ right: right ? right + 'px' : right,
196
+ top: top ? top + 'px' : top,
197
+ bottom: bottom ? bottom + 'px' : bottom,
198
+ maxHeight: maxHeight ? maxHeight + 'px' : maxHeight,
199
+ transformOrigin: transformOrigin
200
+ }
201
+
202
+ console.log('width', this.computedStyle)
203
+
183
204
  this.onOpen()
184
205
  })
185
206
 
@@ -219,7 +240,8 @@ export default {
219
240
  <style module>
220
241
 
221
242
  .contextMenu{
222
- @apply fixed z-20 bg-base-50 backdrop-blur-md min-w-[150px] overflow-y-auto rounded-lg border-[1px] border-text-50 shadow-2xl;
243
+ @apply fixed z-20 bg-base-50 backdrop-blur-md min-w-[150px] overflow-y-auto rounded-lg;
244
+ @apply border-[1px] border-text-50 shadow-2xl whitespace-nowrap;
223
245
  transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
224
246
  opacity: 0;
225
247
  transform: scale(.3);
@@ -280,6 +280,7 @@
280
280
  <option value="">{{ $t('Default') }}</option>
281
281
  <option value="date">{{ $t('Date') }}</option>
282
282
  <option value="month">{{ $t('Month') }}</option>
283
+ <option value="quarter">{{ $t('Quarterly') }}</option>
283
284
  <option value="year">{{ $t('Year') }}</option>
284
285
  </Dropdown>
285
286
  </div>
@@ -464,7 +465,7 @@ export default{
464
465
  return `rgb(${gridColor})`
465
466
  }
466
467
  },
467
- stacked: this.preset.summary.stacked
468
+ stacked: this.preset.summary.mode === 'bar' ? this.preset.summary.stacked : undefined
468
469
  },
469
470
  y: {
470
471
  grid: {
@@ -472,7 +473,7 @@ export default{
472
473
  return `rgb(${gridColor})`
473
474
  }
474
475
  },
475
- stacked: this.preset.summary.stacked
476
+ stacked: this.preset.summary.mode === 'bar' ? this.preset.summary.stacked : undefined
476
477
  }
477
478
  }
478
479
  }
@@ -589,8 +590,30 @@ export default{
589
590
  data(){
590
591
  return {
591
592
  chartOpt: {
592
- backgroundColors: [ '#5D9CEC', '#4FC1E9', '#48CFAD', '#A0D468', '#FFCE54', '#FC6E51', '#ED5565', '#AC92EC', '#EC87C0' ],
593
- borderColors: [ '#4A89DC', '#3BAFDA', '#37BC9B', '#8CC152', '#F6BB42', '#E9573F', '#DA4453', '#967ADC', '#D770AD' ],
593
+ backgroundColors: [
594
+ '#5D9CEC',
595
+ '#A0D468',
596
+ '#FFCE54',
597
+ '#FC6E51',
598
+ '#48CFAD',
599
+ '#AC92EC',
600
+ '#4FC1E9',
601
+ '#FFCE54',
602
+ '#ED5565',
603
+ '#EC87C0'
604
+ ],
605
+ borderColors: [
606
+ '#4A89DC',
607
+ '#8CC152',
608
+ '#F6BB42',
609
+ '#E9573F',
610
+ '#37BC9B',
611
+ '#967ADC',
612
+ '#3BAFDA',
613
+ '#F6BB42',
614
+ '#DA4453',
615
+ '#D770AD'
616
+ ],
594
617
  },
595
618
  layout: {
596
619
  presetOpen: false,
@@ -216,6 +216,12 @@ let ListPage1 = {
216
216
  summaryColumns.push({ key:"dfDate", label:rowLabel, width:"200px", visible:true, type:"date", format:"MMM YYYY" })
217
217
  break
218
218
 
219
+ case 'quarter':
220
+ attributes.push([Sequelize.fn("CONCAT", Sequelize.fn('YEAR', Sequelize.col(rowKey)), ' Q', Sequelize.fn('QUARTER', Sequelize.col(rowKey))), "dfDate"])
221
+ group.push([Sequelize.fn("CONCAT", Sequelize.fn('YEAR', Sequelize.col(rowKey)), ' Q', Sequelize.fn('QUARTER', Sequelize.col(rowKey))), "dfDate"])
222
+ summaryColumns.push({ key:"dfDate", label:rowLabel, width:"200px", visible:true, type:"date", format:"MMM YYYY" })
223
+ break
224
+
219
225
  case 'year':
220
226
  attributes.push([Sequelize.fn("DATE_FORMAT", Sequelize.col(rowKey), '%Y'), "dfDate"])
221
227
  group.push([Sequelize.fn("DATE_FORMAT", Sequelize.col(rowKey), '%Y'), "dfDate"])