playbook_ui 9.3.1.pre.alpha2 → 9.4.0.alpha.sisense

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: 76b05713c20d439c9cf190dbe2886c18c91c0d928cacc1f1d144b661bc252c5b
4
- data.tar.gz: f901248e28de4081688cbe230ad247a1e8c50a73b59f92d4e035022205b32898
3
+ metadata.gz: 25233c2ba44758372c3923f79446c511bcbf4d9b4e7f4f498a92a5fbc4def5d8
4
+ data.tar.gz: b2dd8010fdb453209ca810547174820b4453fbb400180ba917634062e4438eae
5
5
  SHA512:
6
- metadata.gz: '097d05cd4d878abb596d6a6990152267a26c9ad54d50622209842ff66a13f49cdaf12dedb18b3ee681e36ab8deb943abdc2e29e87f5ee998a7462ff7abb5a581'
7
- data.tar.gz: 7d83fa036724ec01a9e67cb9e06d6cf74b271b3a29fa9637b29682a7646b9115d354dbc00e5afe06dbe1a9dbc7f34c7229e5a6faa4cdee3c6585147af97e1b1d
6
+ metadata.gz: 22fd5e6c87f220ad277a3907c3d87a41dc821afedf07ed5da30617a2a57741bdf246acf2e1dace90fa779fc09647b49780c60db59b5fb782694be6519f623113
7
+ data.tar.gz: 3492cb7035113fededb0f2222daa06c84f5fbfe7c04fd7f92a5a9f438f093338a72fbe2a7051a5a69e152f5a1bf75aae629378515ce923d3ef06162bb878743e
@@ -1,5 +1,5 @@
1
1
  import { commonSettings } from '../pb_dashboard/commonSettings.js'
2
- import typography from '../tokens/_typography.scss'
2
+ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  const sizeColumns = function(highchart) {
5
5
  const column = highchart.plotOptions.column
@@ -53,9 +53,10 @@ const Checkbox = (props: CheckboxProps) => {
53
53
 
54
54
  useEffect(() => {
55
55
  if (checkRef.current) {
56
+ checkRef.current.checked = checked
56
57
  checkRef.current.indeterminate = indeterminate
57
58
  }
58
- }, [indeterminate])
59
+ }, [indeterminate, checked])
59
60
 
60
61
  return (
61
62
  <label
@@ -4,12 +4,13 @@
4
4
  $transition: $transition_cubic;
5
5
 
6
6
  [class^=pb_checkbox_kit] {
7
- display: inline-flex;
8
7
  cursor: pointer;
8
+ display: inline-flex;
9
+ vertical-align: middle;
9
10
  .pb_checkbox_label {
10
- padding-left: $space_xs;
11
11
  cursor: pointer;
12
12
  font-size: $text_lt_default;
13
+ padding-left: $space_xs;
13
14
  user-select: none;
14
15
  }
15
16
 
@@ -1,15 +1,73 @@
1
- import React from 'react'
2
- import { Checkbox } from '../..'
1
+ import React, { useState } from 'react'
2
+ import { Checkbox, Table } from '../..'
3
3
 
4
4
  const CheckboxIndeterminate = (props) => {
5
+ const [checkboxes, setCheckboxes] = useState([
6
+ { name: 'Coffee', checked: false },
7
+ { name: 'Ice Cream', checked: false },
8
+ { name: 'Chocolate', checked: true },
9
+ ])
10
+
11
+ const isAllChecked = !checkboxes.find((checkbox) => !checkbox.checked)
12
+ const isNoneChecked = !checkboxes.find((checkbox) => checkbox.checked)
13
+
14
+ const processCheckboxes = (checked) =>
15
+ checkboxes.slice(0).map((checkbox) => {
16
+ checkbox.checked = checked
17
+ return checkbox
18
+ })
19
+
20
+ const onToggleAll = () => {
21
+ setCheckboxes(
22
+ isNoneChecked ? processCheckboxes(true) : processCheckboxes(false)
23
+ )
24
+ }
25
+
26
+ const updateCheckboxes = (checkbox, index) => {
27
+ const newCheckboxes = checkboxes.slice(0)
28
+ newCheckboxes[index].checked = !checkbox.checked
29
+ setCheckboxes(newCheckboxes)
30
+ }
31
+
5
32
  return (
6
- <Checkbox
7
- indeterminate
8
- name="checkbox-name"
9
- text="Indeterminate State"
10
- value="check-box value"
11
- {...props}
12
- />
33
+ <Table
34
+ container={false}
35
+ size="md"
36
+ >
37
+ <thead>
38
+ <tr>
39
+ <th>
40
+ <Checkbox
41
+ checked={isAllChecked}
42
+ indeterminate={!isAllChecked && !isNoneChecked}
43
+ name="checkbox-name"
44
+ onChange={onToggleAll}
45
+ text={isNoneChecked ? 'Check All' : 'Uncheck All'}
46
+ value="check-box value"
47
+ {...props}
48
+ />
49
+ </th>
50
+ </tr>
51
+ </thead>
52
+ <tbody>
53
+ {checkboxes.map((checkbox, index) => (
54
+ <tr key={index}>
55
+ <td>
56
+ <Checkbox
57
+ checked={checkbox.checked}
58
+ name={checkbox.name}
59
+ onChange={() => {
60
+ updateCheckboxes(checkbox, index)
61
+ }}
62
+ text={checkbox.name}
63
+ value="check-box value"
64
+ {...props}
65
+ />
66
+ </td>
67
+ </tr>
68
+ ))}
69
+ </tbody>
70
+ </Table>
13
71
  )
14
72
  }
15
73
 
@@ -1,5 +1,5 @@
1
- import colors from '../tokens/_colors.scss'
2
- import typography from '../tokens/_typography.scss'
1
+ import colors from '../tokens/exports/_colors.scss'
2
+ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  const pbIndicator = {
5
5
  title: {
@@ -1,5 +1,5 @@
1
1
  import { commonSettings } from '../pb_dashboard/commonSettings.js'
2
- import typography from '../tokens/_typography.scss'
2
+ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  const markerStyles = (highchart) => {
5
5
  highchart.plotOptions.line.marker.enabled = true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "9.3.1.pre.alpha2"
4
+ VERSION = "9.4.0.alpha.sisense"
5
5
  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: 9.3.1.pre.alpha2
4
+ version: 9.4.0.alpha.sisense
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: 2021-04-12 00:00:00.000000000 Z
12
+ date: 2021-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2107,8 +2107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2107
2107
  - !ruby/object:Gem::Version
2108
2108
  version: 1.3.1
2109
2109
  requirements: []
2110
- rubyforge_project:
2111
- rubygems_version: 2.7.3
2110
+ rubygems_version: 3.1.4
2112
2111
  signing_key:
2113
2112
  specification_version: 4
2114
2113
  summary: Playbook Design System