playbook_ui 14.10.0.pre.rc.17 → 14.10.0.pre.rc.19

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: 2044fc2c1a58d8d4632d8feafa77f11bed85265c571cb4e89f627b3390c58faa
4
- data.tar.gz: 16e54cd1b328d28a44a041f15aa55999a71199952cc770d3d24046f61bc47814
3
+ metadata.gz: 0db00405bd73a7d733f9dcb81f68c86dab5104053480460df1bb4cd662f64cc4
4
+ data.tar.gz: 62318e1c0f631c6c9a233def0d6c114997b564bdbf4fcf4231f9009b746d3550
5
5
  SHA512:
6
- metadata.gz: 1b8b23e3024156ec53746bb29957cde5b919ec57912207c5a6624d7e4a724352095e34ed8da4549792f5d7bd769e5bc190087aded4959e3320b1f45d28f11f6a
7
- data.tar.gz: '04289107335c2ed969557d29d4e4c8baa0e5822351821c962c26b677468799ea32dc87b87f36318c260e567d87465507f38106f54308f3fe7256244060496335'
6
+ metadata.gz: 5db0081e5de8ef6e228810d22f313d64a722752fc1f74b5a37d0a8720be182b8b4d589c5198e90fa536dd5939bc0aeac676de1e48fe8f4ae9013ddb646a70202
7
+ data.tar.gz: 8d5ab849f68bdc5361c07d06f055d0760ea41bbf8792ab85e4732e085ad79ecb28b1c3229ed9cd2d4ec6876b0e808059aa404dd7559a567c25177cc92e469ce8
@@ -3,18 +3,13 @@ import React from "react"
3
3
  //CollapsibleTrail component
4
4
  const CollapsibleTrail = ({ leftOffset }: { leftOffset: number }) => {
5
5
  const style: { [key: string]: string | number } = {
6
- position: "absolute",
7
6
  left: `${leftOffset}em`,
8
- top: 0,
9
- bottom: 0,
10
- width: "2px",
11
- backgroundColor: "#E4E8F0",
12
7
  }
13
8
 
14
9
  return (
15
10
  <div
16
11
  className="collapsible-trail"
17
- style={style}
12
+ style={style}
18
13
  />
19
14
  )
20
15
  }
@@ -110,6 +110,14 @@
110
110
  height: auto;
111
111
  }
112
112
 
113
+ .collapsible-trail {
114
+ background-color: $border_light;
115
+ position: absolute;
116
+ top: 0;
117
+ bottom: 0;
118
+ width: 2px;
119
+ }
120
+
113
121
  // Responsive Styles
114
122
  @media only screen and (max-width: $screen-xl-min) {
115
123
  &[class*="table-responsive-scroll"] {
@@ -0,0 +1,36 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ }
31
+ ] %>
32
+
33
+ <%= pb_rails("advanced_table", props: { id: "collapsible_trail", table_data: @table_data, column_definitions: column_definitions }) do %>
34
+ <%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
35
+ <%= pb_rails("advanced_table/table_body", props: { table_data: @table_data, column_definitions: column_definitions, collapsible_trail: false }) %>
36
+ <% end %>
@@ -0,0 +1 @@
1
+ `collapsible_trail` is an optional prop that is set to 'true' by default. If set to 'false', it will remove the trail on the left of the rows when subRows are toggled open.
@@ -2,6 +2,7 @@ examples:
2
2
  rails:
3
3
  - advanced_table_beta: Default (Required Props)
4
4
  - advanced_table_beta_subrow_headers: SubRow Headers
5
+ - advanced_table_collapsible_trail_rails: Collapsible Trail
5
6
  - advanced_table_beta_sort: Enable Sorting
6
7
  - advanced_table_custom_cell_rails: Custom Components for Cells
7
8
 
@@ -14,14 +14,16 @@ module Playbook
14
14
  default: "header"
15
15
  prop :subrow_headers, type: Playbook::Props::Array,
16
16
  default: []
17
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
18
+ default: true
17
19
 
18
20
  def render_row_and_children(row, column_definitions, current_depth, first_parent_child)
19
21
  output = ActiveSupport::SafeBuffer.new
20
22
  is_first_child_of_subrow = current_depth.positive? && first_parent_child && subrow_headers[current_depth - 1].present?
21
23
 
22
- output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1] }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
24
+ output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1], collapsible_trail: collapsible_trail }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
23
25
 
24
- output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth })
26
+ output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth, collapsible_trail: collapsible_trail })
25
27
 
26
28
  if row[:children].present?
27
29
  output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id.to_s + id }) do
@@ -2,6 +2,14 @@
2
2
  <% object.column_definitions.each_with_index do |column, index| %>
3
3
  <%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
4
4
  <%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
5
+ <% if collapsible_trail && index.zero? %>
6
+ <% (1..depth).each do |i| %>
7
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
8
+ <% left_offset = i * 1.0 + additional_offset %>
9
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
10
+ <% end %>
11
+ <% end %>
12
+
5
13
  <div style="padding-left: <%= depth * 1.25 %>em">
6
14
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
7
15
  <% if index.zero? && object.row[:children].present? %>
@@ -9,6 +9,8 @@ module Playbook
9
9
  default: []
10
10
  prop :row
11
11
  prop :depth
12
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
13
+ default: true
12
14
 
13
15
  def classname
14
16
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
@@ -6,6 +6,14 @@
6
6
  <% object.column_definitions.each_with_index do |column, index| %>
7
7
  <%= pb_rails("table/table_cell", props: { tag: "div", classname: object.td_classname}) do %>
8
8
  <%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
9
+ <% if collapsible_trail && index.zero? %>
10
+ <% (1..depth).each do |i| %>
11
+ <% additional_offset = i > 1 ? (i - 1) * 0.25 : 0 %>
12
+ <% left_offset = i * 1.0 + additional_offset %>
13
+ <div class="collapsible-trail" style="left: <%= left_offset %>em"></div>
14
+ <% end %>
15
+ <% end %>
16
+
9
17
  <div style="padding-left: <%= depth * 1.25 %>em">
10
18
  <%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
11
19
  <% if index.zero? && object.row[:children].present? %>
@@ -12,6 +12,8 @@ module Playbook
12
12
  default: "header"
13
13
  prop :subrow_header, type: Playbook::Props::String,
14
14
  default: ""
15
+ prop :collapsible_trail, type: Playbook::Props::Boolean,
16
+ default: true
15
17
 
16
18
  def classname
17
19
  generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
@@ -90,50 +90,7 @@
90
90
  }
91
91
  }
92
92
  }
93
- &[class*=dark] {
94
- .pb_typeahead_wrapper .pb_typeahead_loading_indicator {
95
- color: $text_dk_light;
96
- }
97
- [class^=pb_text_input_kit].dark .text_input_wrapper .text_input {
98
- display: inherit !important;
99
- }
100
- .typeahead-kit-select__menu {
101
- background-color: $bg_dark;
102
- color: $white;
103
- z-index: $z_1;
104
- }
105
- .typeahead-kit-select__option:hover {
106
- background-color: $active_dark;
107
- }
108
- .typeahead-kit-select__indicator:hover {
109
- color: $white;
110
- }
111
- .typeahead-kit-select__input {
112
- color: white;
113
- input:focus {
114
- box-shadow: none;
115
- }
116
- }
117
- .typeahead-kit-select__single-value {
118
- color: white;
119
- }
120
- .typeahead-kit-select__option--is-focused {
121
- background-color: $active_dark;
122
- }
123
- [class^=pb_list_kit] {
124
- background-color: $bg_dark;
125
- }
126
- .pb_item_kit {
127
- button {
128
- color: white !important;
129
- }
130
- @media (hover:hover) {
131
- &:hover {
132
- background-color: rgba($white,.1);
133
- }
134
- }
135
- }
136
- }
93
+
137
94
  &.react-select, &.react-select .dark {
138
95
  .text_input {
139
96
  display: inherit;
@@ -182,7 +139,7 @@
182
139
  }
183
140
  }
184
141
  }
185
-
142
+
186
143
  .typeahead-kit-select__menu {
187
144
  z-index: $z_1;
188
145
  .typeahead-kit-select__menu-list {
@@ -215,5 +172,117 @@
215
172
  }
216
173
  }
217
174
  }
218
- }
219
175
 
176
+ &[class*=dark] {
177
+ .pb_typeahead_wrapper .pb_typeahead_loading_indicator {
178
+ color: $text_dk_light;
179
+ }
180
+ .pb_text_input_kit_label {
181
+ color: $text_dk_light;
182
+ }
183
+ [class^=pb_text_input_kit].dark .text_input_wrapper .text_input {
184
+ display: inherit !important;
185
+ }
186
+ .typeahead-kit-select__menu {
187
+ background-color: $bg_dark;
188
+ color: $white;
189
+ z-index: $z_1;
190
+ .typeahead-kit-select__menu-list {
191
+ padding: 0;
192
+ }
193
+ .typeahead-kit-select__single-value {
194
+ color: white;
195
+ }
196
+
197
+ .typeahead-kit-select__option {
198
+ &.typeahead-kit-select__option--is-focused {
199
+ background-color: $hover_dark;
200
+ }
201
+ &.typeahead-kit-select__option--is-selected {
202
+ background-color: $active_dark;
203
+ }
204
+ }
205
+ }
206
+ .text_input_wrapper{
207
+ color: text_dk_default;
208
+ }
209
+ .typeahead-kit-select__option:hover {
210
+ background-color: $active_dark;
211
+ }
212
+ .typeahead-kit-select__indicator {
213
+ color: $text_dk_default;
214
+ }
215
+ .typeahead-kit-select__indicator:hover {
216
+ color: $text_dk_lighter;
217
+ }
218
+ .typeahead-kit-select__input {
219
+ color: white;
220
+ input:focus {
221
+ box-shadow: none;
222
+ }
223
+ }
224
+ .typeahead-kit-select__option--is-focused {
225
+ background-color: $active_dark;
226
+ }
227
+ [class^=pb_list_kit] {
228
+ background-color: $bg_dark;
229
+ }
230
+ .pb_item_kit {
231
+ button {
232
+ color: white !important;
233
+ }
234
+ @media (hover:hover) {
235
+ &:hover {
236
+ background-color: $hover_dark;
237
+ }
238
+ }
239
+ }
240
+
241
+ .text_input {
242
+ .typeahead-kit-select__input-container{
243
+ color: $text_dk_default
244
+ }
245
+ .typeahead-kit-select {
246
+ &__single-value{
247
+ color: $text_dk_default;
248
+ }
249
+ }
250
+ &.typeahead-kit-select {
251
+ &__single-value{
252
+ color: $text_dk_default;
253
+ }
254
+ &__control {
255
+ &--is-focused {
256
+ @include pb_textarea_focus;
257
+ @include transition_default;
258
+ border-color: $active_dark;
259
+ background-color: rgba($focus_input_dark,$opacity_5);
260
+ box-shadow: none;
261
+ .typeahead-plus-icon {
262
+ display: none;
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+
269
+ &.inline {
270
+ &:not(:hover) {
271
+ .text_input {
272
+ background-color: transparent;
273
+ border-color: transparent;
274
+ }
275
+ .typeahead-kit-select__indicator {
276
+ color: transparent;
277
+ }
278
+ }
279
+
280
+ &:hover {
281
+ .text_input {
282
+ background-color: $hover_dark;
283
+ }
284
+ }
285
+ }
286
+
287
+ }
288
+ }
@@ -55,11 +55,18 @@ const TypeaheadWithHighlight = (props) => {
55
55
  marginRight="sm"
56
56
  name={name}
57
57
  size="sm"
58
+ {...props}
58
59
  />
59
60
  </FlexItem>
60
61
  <FlexItem>
61
- <Title size={4}><span dangerouslySetInnerHTML={{ __html: highlighted(name) }} /></Title>
62
- <Body color="light">
62
+ <Title
63
+ size={4}
64
+ {...props}
65
+ >
66
+ <span dangerouslySetInnerHTML={{ __html: highlighted(name) }} /></Title>
67
+ <Body color="light"
68
+ {...props}
69
+ >
63
70
  <span dangerouslySetInnerHTML={{ __html: highlighted(title) }} />{" • "}
64
71
  {territory}
65
72
  </Body>
@@ -25,8 +25,9 @@
25
25
  validation: object.validation,
26
26
  label: object.label,
27
27
  id: object.input_options[:id],
28
+ dark: object.dark,
28
29
  }) %>
29
- <%= pb_rails("list", props: { ordered: false, borderless: false, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
30
+ <%= pb_rails("list", props: { ordered: false, borderless: true, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
30
31
  <% end %>
31
32
  </div>
32
33
 
@@ -36,4 +37,4 @@
36
37
  <% end %>
37
38
  </template>
38
39
  <% end %>
39
- <% end %>
40
+ <% end %>