beyond-rails 0.0.235 → 0.0.240

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e972bbd922678dfc2e96398e28bf7c0ca244e43888bc725b3ded68ca31eba1bc
4
- data.tar.gz: 385681f6de17231ca6761d7a1432f005fd8b0a44fa1384e45e67864455004ac1
3
+ metadata.gz: 27fa06609359c2b1ee1113771ce48fa3c2693f925e1b3f909e85d18c08766f08
4
+ data.tar.gz: 9ac7de120419f1aa97f874876694fe9ace1ec2239657199afff0d32980c835d3
5
5
  SHA512:
6
- metadata.gz: e8b93b49eb4839c608d2d36b2b77b1b8e178b46a8af15d250a6d9aa6cae50dc35e900e42a7fb010bb4ed118d9a84b6f2b5604caceb3495ada627766b568bdc5f
7
- data.tar.gz: e3771b1aff459ea89efe73b6dd7b62a4b6d3e8e7630f406b683f7b0d4e7e4c927bdcf18d19682d806875add00a0b9bfe0443dbace28874eff8f9459e330002d7
6
+ metadata.gz: 1a54840c057c320dce8f19ebefb6388877e20bcebdf728a50cc5b8193822cb2a948e55423ed3802d20f1fa6628486947c79c847ea63a5637462b04a1400633ef
7
+ data.tar.gz: 399fd279bfc53c652babd56f10e481ce33bc994df4391588f26729825b971923ce51186ffe64e48238b3135e834b58131e0fd742ab1bad49107a0397f470339a
@@ -342,8 +342,11 @@ export default class BarChart {
342
342
  refresh() {
343
343
  this.raf(() => {
344
344
  this.clearBarPos()
345
+ this.clearCanvasSize(this.canvas)
346
+ this.layers.forEach(layer => this.clearCanvasSize(layer.canvas))
345
347
  this.setDomSizeIfNeeded()
346
348
  this.setCanvasSize(this.canvas)
349
+ this.layers.forEach(layer => this.setCanvasSize(layer.canvas))
347
350
  this.setLabelWidths()
348
351
  this.setLabelHeights()
349
352
  this.setAxisData()
@@ -466,6 +466,8 @@ export default class LineChart {
466
466
  refresh() {
467
467
  this.raf(() => {
468
468
  this.clearPointPos()
469
+ this.clearCanvasSize(this.canvas)
470
+ this.layers.forEach(layer => this.clearCanvasSize(layer.canvas))
469
471
  this.setDomSizeIfNeeded()
470
472
  this.setCanvasSize(this.canvas)
471
473
  this.layers.forEach(layer => this.setCanvasSize(layer.canvas))
@@ -203,6 +203,13 @@ export default function chartCommon(target) {
203
203
  canvas.getContext('2d').scale(dpr, dpr)
204
204
  }
205
205
 
206
+ clearCanvasSize(canvas) {
207
+ canvas.width = 0
208
+ canvas.height = 0
209
+ canvas.style.width = 0
210
+ canvas.style.height = 0
211
+ }
212
+
206
213
  setDomSizeIfNeeded() {
207
214
  if (isUndef(this.options.width)) {
208
215
  this.width = this.dom.offsetWidth
@@ -1,17 +1,32 @@
1
1
  export default function bindBtnFn(beyond, $) {
2
2
 
3
- const { Btn } = beyond
4
-
5
- $.fn.btn = function() {
6
-
7
- const btns = this.map((i, dom) => new Btn(dom))
8
-
9
- this.showLoader = btns.each((i, a) => a.showLoader())
10
-
11
- this.hideLoader = btns.each((i, a) => a.hideLoader())
12
-
13
- this.destroy = () => btns.each((i, a) => a.destroy())
3
+ $.fn.btn = function(type) {
14
4
 
5
+ if (type === 'loading') {
6
+ initBtns(this)
7
+ this.each((i, dom) => dom._btn.showLoader())
8
+ }
9
+ else if (type === 'reset') {
10
+ initBtns(this)
11
+ this.each((i, dom) => dom._btn.hideLoader())
12
+ }
13
+ else if (type === 'destroy') {
14
+ this.each((i, dom) => {
15
+ if (dom._btn) {
16
+ dom._btn.destroy()
17
+ delete dom._btn
18
+ }
19
+ })
20
+ }
15
21
  return this
16
22
  }
17
23
  }
24
+
25
+ function initBtns(self, options) {
26
+ const { Btn } = beyond
27
+ self.each((i, dom) => {
28
+ if (! dom._btn) {
29
+ dom._btn = new Btn(dom)
30
+ }
31
+ })
32
+ }
@@ -5,7 +5,17 @@ const unloadRows = []
5
5
  const onPage = row => {
6
6
  const { controller, action } = row
7
7
  const { dataset } = document.body
8
- return (dataset.controller === controller) && (dataset.action === action)
8
+
9
+ let controllerMatched = (dataset.controller === controller)
10
+ let actionMatched = (dataset.action === action)
11
+
12
+ if (controller === '*') {
13
+ controllerMatched = true
14
+ }
15
+ if (action === '*') {
16
+ actionMatched = true
17
+ }
18
+ return controllerMatched && actionMatched
9
19
  }
10
20
 
11
21
  export const $ = (selector, dom = document) => dom.querySelector(selector)
@@ -123,6 +123,10 @@ a.btn.btn-outline {
123
123
  }
124
124
  }
125
125
 
126
+ .btn-outline .ring-loader div {
127
+ border-color: $text-color-light transparent transparent transparent;
128
+ }
129
+
126
130
  .btn .badge {
127
131
  margin-left: .5rem;
128
132
  font-weight: 400;
@@ -20,8 +20,22 @@
20
20
  background-color: #fff;
21
21
  margin: 20px auto 0;
22
22
  max-width: 600px;
23
+ &.modal-sm {
24
+ max-width: 400px;
25
+ }
26
+ &.modal-lg {
27
+ max-width: 900px;
28
+ }
29
+ &.modal-xl {
30
+ max-width: 1140px;
31
+ }
23
32
  @media (max-width: $screen-sm) {
24
33
  max-width: 90%;
34
+ &.modal-sm,
35
+ &.modal-lg,
36
+ &.modal-xl {
37
+ max-width: 90%;
38
+ }
25
39
  }
26
40
  }
27
41
  &.js-active {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.235
4
+ version: 0.0.240
5
5
  platform: ruby
6
6
  authors:
7
7
  - kmsheng
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-02 00:00:00.000000000 Z
12
+ date: 2020-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sassc