playbook_ui 2.8.5 → 2.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 229984eb14913e37a64ee5c9ba4cdbbe3cdc6013d07bbb6011c645c5659812aa
4
- data.tar.gz: b783ad17356bfd25bbf6723eb18d9c9201a0ffcd2df880dc6a8fe5723c2c2667
3
+ metadata.gz: 76a94704ea4a1aee3b57ea302589c863ce195ef2e5a13bbf57006cdf66f43f7b
4
+ data.tar.gz: d59135b0711cbeee71a8499149b567eea897ae2d1e5704c9358f69d6f8b34c82
5
5
  SHA512:
6
- metadata.gz: 073c2fad169caeb9cabdc209596226c450e4574fb13ca6f02adedc63e80e3e7b47b6fcca2b376e5f2acd9ba01f0147e7c8ec2e676f7874ad647fc096f85eb675
7
- data.tar.gz: 87b55dd06352b79ccc3a3a97d1a8b733732230ffe122b84b95d6c236a0a2731741fff4d36ad08596ae943d2dac530d247f048ec2f9f43964d8fe283678a9320d
6
+ metadata.gz: 53ffc31b9f170dbfcbc10d58e109f2298ba3824268ccc868714ed10249302e4e9337e1092c51ff7480f9888f521392124f9296a817e20a8199abb22fb5b316ad
7
+ data.tar.gz: f62eb9b6ecf504cc7896a7291c23492c6e6dd6d51ad6d6e90e905b61ee4defde8f041529911106748ab3fe4ac550cd408672dc0cc16f7e02d71f052f1b6a0892
@@ -1,14 +1,16 @@
1
- import "../../../../fonts/fontawesome.js";
2
- import "../../../../fonts/regular.js";
3
- import "../pb_dashboard/pbChartPlugin.js";
4
- import "./main.scss";
5
- import "./kits.js";
1
+ import "../../../../fonts/fontawesome.js"
2
+ import "../../../../fonts/regular.js"
3
+ import pbChart from "../plugins/pb_chart_plugin.js"
4
+ import "./main.scss"
5
+ import "./kits.js"
6
+
7
+ window.pbChart = pbChart
6
8
 
7
9
  // Move to separate file
8
10
  $(document).on("click", "[data-toggle]", function(e) {
9
- e.preventDefault();
10
- var kit_container = $(this).closest('.pb--doc');
11
- var toggle_target = $(this).data('toggle');
12
- $(kit_container).find('[data-action="toggle"]').hide();
13
- $(kit_container).find('[data-togglable="'+toggle_target+'"]').show();
14
- });
11
+ e.preventDefault()
12
+ var kit_container = $(this).closest('.pb--doc')
13
+ var toggle_target = $(this).data('toggle')
14
+ $(kit_container).find('[data-action="toggle"]').hide()
15
+ $(kit_container).find('[data-togglable="'+toggle_target+'"]').show()
16
+ })
@@ -27,6 +27,9 @@ import lineGraphSettings from "../pb_line_graph/lineGraphSettings";
27
27
  import barGraphSettings from "../pb_bar_graph/barGraphSettings";
28
28
  import dashboardValueSettings from "../pb_dashboard_value/dashboardValueSettings";
29
29
 
30
+ // Other JS/Plugins
31
+ import pbChart from "../plugins/pb_chart_plugin"
32
+
30
33
  // All Exports for Consumption in Nitro
31
34
  export {
32
35
  Avatar,
@@ -53,5 +56,6 @@ export {
53
56
  commonSettings,
54
57
  lineGraphSettings,
55
58
  barGraphSettings,
56
- dashboardValueSettings
59
+ dashboardValueSettings,
60
+ pbChart,
57
61
  };
@@ -6,14 +6,16 @@
6
6
  ) %>
7
7
  <% content_for :pb_js do %>
8
8
  <%= javascript_tag do %>
9
- new pbChart('.selector', {
10
- id: "<%= object.id %>",
11
- chartData: <%= object.chart_data %>,
12
- type: "<%= object.chart_type %>",
13
- title: "<%= object.title %>",
14
- subtitle: "<%= object.subtitle %>",
15
- axisTitle: "<%= object.axis_title %>",
16
- pointStart: <%= object.point_start %>,
17
- });
9
+ window.addEventListener('DOMContentLoaded', function() {
10
+ new pbChart('.selector', {
11
+ id: "<%= object.id %>",
12
+ chartData: <%= object.chart_data %>,
13
+ type: "<%= object.chart_type %>",
14
+ title: "<%= object.title %>",
15
+ subtitle: "<%= object.subtitle %>",
16
+ axisTitle: "<%= object.axis_title %>",
17
+ pointStart: <%= object.point_start %>,
18
+ })
19
+ })
18
20
  <% end %>
19
21
  <% end %>
@@ -6,14 +6,16 @@
6
6
  ) %>
7
7
  <% content_for :pb_js do %>
8
8
  <%= javascript_tag do %>
9
- new pbChart('.selector', {
10
- id: "<%= object.id %>",
11
- chartData: <%= object.chart_data %>,
12
- type: "<%= object.chart_type %>",
13
- title: "<%= object.title %>",
14
- subtitle: "<%= object.subtitle %>",
15
- axisTitle: "<%= object.axis_title %>",
16
- pointStart: <%= object.point_start %>,
17
- });
9
+ window.addEventListener('DOMContentLoaded', function() {
10
+ new pbChart('.selector', {
11
+ id: "<%= object.id %>",
12
+ chartData: <%= object.chart_data %>,
13
+ type: "<%= object.chart_type %>",
14
+ title: "<%= object.title %>",
15
+ subtitle: "<%= object.subtitle %>",
16
+ axisTitle: "<%= object.axis_title %>",
17
+ pointStart: <%= object.point_start %>,
18
+ })
19
+ })
18
20
  <% end %>
19
21
  <% end %>
@@ -0,0 +1,88 @@
1
+ import { highchartsTheme } from '../pb_dashboard/pbChartsLightTheme.js'
2
+
3
+ class pbChart {
4
+ defaults = {
5
+ callbackInitializeBefore: () => {},
6
+ callbackInitializeAfter: () => {},
7
+ callbackRefreshBefore: () => {},
8
+ callbackRefreshAfter: () => {},
9
+ callbackDestroyBefore: () => {},
10
+ callbackDestroyAfter: () => {},
11
+ property: 'Value'
12
+ }
13
+
14
+ extendDefaults(defaults, options) {
15
+ for (let property in options) {
16
+ if (options.hasOwnProperty(property)) {
17
+ defaults[property] = options[property]
18
+ }
19
+ }
20
+ return defaults
21
+ }
22
+
23
+ constructor(element, options) {
24
+ this.element = element
25
+ this.options = options
26
+ this.settings = this.extendDefaults(this.defaults, options)
27
+ this.setupChart()
28
+ }
29
+
30
+ setupChart() {
31
+ Highcharts.setOptions(highchartsTheme)
32
+
33
+ Highcharts.chart(this.defaults.id, {
34
+ title: {
35
+ text: this.defaults.title
36
+ },
37
+ chart: {
38
+ type: this.defaults.type
39
+ },
40
+ subtitle: {
41
+ text: this.defaults.subtitle
42
+ },
43
+ yAxis: {
44
+ title: {
45
+ text: this.defaults.axisTitle
46
+ }
47
+ },
48
+ plotOptions: {
49
+ series: {
50
+ pointStart: this.defaults.pointStart
51
+ }
52
+ },
53
+ series: this.defaults.chartData,
54
+ credits: false,
55
+ })
56
+ }
57
+
58
+ refresh(silent = false) {
59
+ if (!silent) {
60
+ this.settings.callbackRefreshBefore.call()
61
+ }
62
+
63
+ this.this.destroy(silent)
64
+ this.this.initialize(silent)
65
+ if (!silent) {
66
+ this.settings.callbackRefreshAfter.call()
67
+ }
68
+ }
69
+
70
+ destroy(silent = false) {
71
+ if (!silent) {
72
+ this.settings.callbackDestroyBefore.call()
73
+ }
74
+ if (!silent) {
75
+ this.settings.callbackDestroyAfter.call()
76
+ }
77
+ }
78
+
79
+ refreshSilently() {
80
+ this.this.refresh(true)
81
+ }
82
+
83
+ destroySilently() {
84
+ this.this.destroy(true)
85
+ }
86
+ }
87
+
88
+ export default pbChart
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "2.8.5".freeze
4
+ VERSION = "2.8.6".freeze
5
5
  end
@@ -1,9 +1,10 @@
1
- namespace :pb_release do
1
+ # frozen_string_literal: true
2
2
 
3
+ namespace :pb_release do
3
4
  desc "Update the version number in preparation to release"
4
5
  task version: :environment do
5
6
  old_version = Playbook::VERSION
6
- new_version = ''
7
+ new_version = ""
7
8
  STDOUT.puts "What would you like the next release number to be? Currently #{old_version}"
8
9
  new_version = STDIN.gets.chomp
9
10
 
@@ -13,20 +14,20 @@ namespace :pb_release do
13
14
  # Update package.json
14
15
  package = File.read("package.json")
15
16
  new_package = package.gsub(/"version": "#{old_version}",/, "\"version\": \"#{new_version}\",")
16
- File.open("package.json", "w") {|file| file.puts new_package }
17
+ File.open("package.json", "w") { |file| file.puts new_package }
17
18
  puts "Updated package.json"
18
19
 
19
20
  # Update version.rb
20
21
  version_rb = File.read("lib/playbook/version.rb")
21
22
  new_version_rb = version_rb.gsub(/VERSION = "#{old_version}".freeze/, "VERSION = \"#{new_version}\".freeze")
22
- File.open("lib/playbook/version.rb", "w") {|file| file.puts new_version_rb }
23
+ File.open("lib/playbook/version.rb", "w") { |file| file.puts new_version_rb }
23
24
  puts "Updated lib/playbook/version.rb"
24
25
 
25
26
  # Update gemfile.lock
26
- gemfile = File.read("gemfile.lock")
27
+ gemfile = File.read("Gemfile.lock")
27
28
  new_gemfile = gemfile.gsub(/playbook_ui \(#{Regexp.escape(old_version)}\)/, "playbook_ui (#{new_version})")
28
- File.open("gemfile.lock", "w") {|file| file.puts new_gemfile }
29
- puts "Updated gemfile.lock"
29
+ File.open("Gemfile.lock", "w") { |file| file.puts new_gemfile }
30
+ puts "Updated Gemfile.lock"
30
31
  puts "\n\n"
31
32
 
32
33
  puts "Commit your changes and create a PR to merge to master"
@@ -53,7 +54,7 @@ namespace :pb_release do
53
54
 
54
55
  # Tags
55
56
  puts "\nPushed to NPM. Now lets create a tag..."
56
- description = ''
57
+ description = ""
57
58
  puts "\nWrite a brief tag release description. You can edit this later on GitHub."
58
59
  description = STDIN.gets.chomp
59
60
  puts "\nCreating Tag..."
@@ -63,7 +64,5 @@ namespace :pb_release do
63
64
 
64
65
  puts "\n\n"
65
66
  puts "Complete! Don't forget to add your release notes https://github.com/powerhome/playbook/releases/tag/#{version}"
66
-
67
67
  end
68
-
69
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.5
4
+ version: 2.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-08-30 00:00:00.000000000 Z
12
+ date: 2019-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: method_source
@@ -463,7 +463,6 @@ files:
463
463
  - app/pb_kits/playbook/pb_card/docs/example.yml
464
464
  - app/pb_kits/playbook/pb_card/docs/index.js
465
465
  - app/pb_kits/playbook/pb_dashboard/commonSettings.js
466
- - app/pb_kits/playbook/pb_dashboard/pbChartPlugin.js
467
466
  - app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js
468
467
  - app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb
469
468
  - app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx
@@ -819,6 +818,7 @@ files:
819
818
  - app/pb_kits/playbook/pb_vertical_nav/docs/index.js
820
819
  - app/pb_kits/playbook/pb_vertical_nav/item.rb
821
820
  - app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb
821
+ - app/pb_kits/playbook/plugins/pb_chart_plugin.js
822
822
  - app/pb_kits/playbook/tokens/_animation-curves.scss
823
823
  - app/pb_kits/playbook/tokens/_border_radius.scss
824
824
  - app/pb_kits/playbook/tokens/_colors.scss
@@ -906,7 +906,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
906
906
  version: '0'
907
907
  requirements: []
908
908
  rubyforge_project:
909
- rubygems_version: 2.7.8
909
+ rubygems_version: 2.7.3
910
910
  signing_key:
911
911
  specification_version: 4
912
912
  summary: Playbook Design System
@@ -1,120 +0,0 @@
1
- import { highchartsTheme } from './pbChartsLightTheme.js';
2
-
3
-
4
- (function(root, factory) {
5
- const plugin_name = 'pbChart';
6
-
7
- if (typeof define === 'function' && define.amd) {
8
- define([], factory(plugin_name));
9
- } else if (typeof exports === 'object') {
10
- module.exports = factory(plugin_name);
11
- } else {
12
- root[plugin_name] = factory(plugin_name);
13
- }
14
- }((window || module || {}), function(plugin_name) {
15
- 'use strict';
16
-
17
- const plugin = {};
18
-
19
- const defaults = {
20
- callbackInitializeBefore: () => {},
21
- callbackInitializeAfter: () => {},
22
- callbackRefreshBefore: () => {},
23
- callbackRefreshAfter: () => {},
24
- callbackDestroyBefore: () => {},
25
- callbackDestroyAfter: () => {},
26
- property: 'Value'
27
- };
28
-
29
- function Plugin(element, options) {
30
- plugin.this = this;
31
- plugin.name = plugin_name;
32
- plugin.element = element;
33
- plugin.defaults = defaults;
34
- plugin.options = options;
35
- plugin.settings = extendDefaults(defaults, options);
36
- plugin.this.initialize();
37
- }
38
-
39
-
40
- const extendDefaults = (defaults, options) => {
41
- for (let property in options) {
42
- if (options.hasOwnProperty(property)) {
43
- defaults[property] = options[property];
44
- }
45
- }
46
-
47
- return defaults;
48
- };
49
-
50
-
51
- Plugin.prototype = {
52
- initialize: (silent = false) => {
53
- plugin.this.destroySilently();
54
-
55
- if (!silent) {
56
- plugin.settings.callbackInitializeBefore.call();
57
- }
58
-
59
- Highcharts.setOptions(highchartsTheme);
60
- Highcharts.chart(plugin.defaults.id, {
61
- title: {
62
- text: plugin.defaults.title
63
- },
64
- chart: {
65
- type: plugin.defaults.type
66
- },
67
- subtitle: {
68
- text: plugin.defaults.subtitle
69
- },
70
- yAxis: {
71
- title: {
72
- text: plugin.defaults.axisTitle
73
- }
74
- },
75
- plotOptions: {
76
- series: {
77
- pointStart: plugin.defaults.pointStart
78
- }
79
- },
80
- series: plugin.defaults.chartData,
81
- credits: false,
82
- });
83
-
84
- if (!silent) {
85
- plugin.settings.callbackInitializeAfter.call();
86
- }
87
- },
88
-
89
- refresh: (silent = false) => {
90
- if (!silent) {
91
- plugin.settings.callbackRefreshBefore.call();
92
- }
93
-
94
- plugin.this.destroy(silent);
95
- plugin.this.initialize(silent);
96
- if (!silent) {
97
- plugin.settings.callbackRefreshAfter.call();
98
- }
99
- },
100
-
101
- destroy: (silent = false) => {
102
- if (!silent) {
103
- plugin.settings.callbackDestroyBefore.call();
104
- }
105
- if (!silent) {
106
- plugin.settings.callbackDestroyAfter.call();
107
- }
108
- },
109
-
110
- refreshSilently: () => {
111
- plugin.this.refresh(true);
112
- },
113
-
114
- destroySilently: () => {
115
- plugin.this.destroy(true);
116
- }
117
- };
118
-
119
- return Plugin;
120
- }));