playbook_ui 15.0.0.pre.alpha.PLAY198710641 → 15.0.0.pre.alpha.PLAY236510413
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 +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +4 -12
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -10
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +0 -3
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +0 -8
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -6
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +0 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -1
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_nav/_item.tsx +5 -19
- data/app/pb_kits/playbook/pb_nav/item.html.erb +2 -6
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +1 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +8 -24
- data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +10 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +9 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +17 -3
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +15 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +14 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +14 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +4 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +4 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +6 -18
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +7 -29
- data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +4 -69
- data/dist/chunks/{_line_graph-CUfJ7E4h.js → _line_graph-B5Dr0Huy.js} +1 -1
- data/dist/chunks/{_typeahead-DCp1lVJx.js → _typeahead-GbjDoSSQ.js} +2 -2
- data/dist/chunks/{_weekday_stacked-B-e7xOfU.js → _weekday_stacked-DjQv3Sok.js} +3 -3
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -10
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/forms/builder/form_field_builder.rb +2 -37
- data/lib/playbook/version.rb +1 -1
- metadata +6 -61
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.scss +0 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +0 -62
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +0 -35
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +0 -49
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +0 -38
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +0 -51
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +0 -46
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +0 -62
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +0 -47
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +0 -60
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +0 -25
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +0 -36
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +0 -44
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +0 -100
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +0 -126
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +0 -32
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +0 -48
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +0 -68
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +0 -81
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +0 -31
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +0 -42
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +0 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +0 -35
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +0 -51
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +0 -27
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbBarGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +0 -28
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +0 -31
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +0 -5
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +0 -12
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +0 -25
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +0 -4
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +0 -17
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +0 -18
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +0 -44
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +0 -5
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +0 -16
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +0 -30
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +0 -16
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +0 -30
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +0 -26
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +0 -41
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +0 -1
@@ -1,51 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { PbBarGraph } from 'playbook-ui'
|
3
|
-
|
4
|
-
|
5
|
-
const chartData = [{
|
6
|
-
name: 'Installation',
|
7
|
-
data: [1475, 200, 3000, 654, 656],
|
8
|
-
},
|
9
|
-
{
|
10
|
-
name: 'Manufacturing',
|
11
|
-
data: [1270, 800, 200, 454, 956],
|
12
|
-
}, {
|
13
|
-
name: 'Sales & Distribution',
|
14
|
-
data: [975, 1600, 1500, 924, 500],
|
15
|
-
}]
|
16
|
-
|
17
|
-
const chartOptions = {
|
18
|
-
series: chartData,
|
19
|
-
title: {
|
20
|
-
text: "Bar Graph with Stacked Columns",
|
21
|
-
},
|
22
|
-
xAxis: {
|
23
|
-
categories: ["Jan", "Feb", "Mar", "Apr", "May"],
|
24
|
-
},
|
25
|
-
yAxis: {
|
26
|
-
title: {
|
27
|
-
text: "Number of Employees",
|
28
|
-
},
|
29
|
-
},
|
30
|
-
plotOptions: {
|
31
|
-
column: {
|
32
|
-
stacking: 'normal',
|
33
|
-
borderWidth: 0,
|
34
|
-
}
|
35
|
-
},
|
36
|
-
legend: { enabled: true },
|
37
|
-
};
|
38
|
-
|
39
|
-
|
40
|
-
const PbBarGraphStacked = () => {
|
41
|
-
|
42
|
-
return (
|
43
|
-
<div>
|
44
|
-
<PbBarGraph
|
45
|
-
options={chartOptions}
|
46
|
-
/>
|
47
|
-
</div>
|
48
|
-
)
|
49
|
-
}
|
50
|
-
|
51
|
-
export default PbBarGraphStacked
|
@@ -1,27 +0,0 @@
|
|
1
|
-
examples:
|
2
|
-
|
3
|
-
rails:
|
4
|
-
- pb_bar_graph_default: Default
|
5
|
-
- pb_bar_graph_legend: Legend
|
6
|
-
- pb_bar_graph_legend_position: Legend Position
|
7
|
-
- pb_bar_graph_height: Height
|
8
|
-
- pb_bar_graph_spline: Spline
|
9
|
-
- pb_bar_graph_colors: Color Overrides
|
10
|
-
- pb_bar_graph_stacked: Stacked
|
11
|
-
- pb_bar_graph_negative_numbers: Negative Numbers
|
12
|
-
- pb_bar_graph_secondary_y_axis: Secondary Y-Axis
|
13
|
-
- pb_bar_graph_horizontal: Horizontal Bar Graph
|
14
|
-
|
15
|
-
|
16
|
-
react:
|
17
|
-
- pb_bar_graph_default: Default
|
18
|
-
- pb_bar_graph_legend: Legend
|
19
|
-
- pb_bar_graph_legend_position: Legend Position
|
20
|
-
- pb_bar_graph_legend_non_clickable: Legend Non Clickable
|
21
|
-
- pb_bar_graph_height: Height
|
22
|
-
- pb_bar_graph_spline: Spline
|
23
|
-
- pb_bar_graph_colors: Color Overrides
|
24
|
-
- pb_bar_graph_stacked: Stacked
|
25
|
-
- pb_bar_graph_negative_numbers: Negative Numbers
|
26
|
-
- pb_bar_graph_secondary_y_axis: Secondary Y-Axis
|
27
|
-
- pb_bar_graph_horizontal: Horizontal Bar Graph
|
@@ -1,11 +0,0 @@
|
|
1
|
-
export { default as PbBarGraphDefault } from './_pb_bar_graph_default.jsx'
|
2
|
-
export { default as PbBarGraphLegend } from './_pb_bar_graph_legend.jsx'
|
3
|
-
export { default as PbBarGraphLegendPosition } from './_pb_bar_graph_legend_position.jsx'
|
4
|
-
export { default as PbBarGraphLegendNonClickable } from './_pb_bar_graph_legend_non_clickable.jsx'
|
5
|
-
export { default as PbBarGraphHeight } from './_pb_bar_graph_height.jsx'
|
6
|
-
export { default as PbBarGraphSpline } from './_pb_bar_graph_spline.jsx'
|
7
|
-
export { default as PbBarGraphColors } from './_pb_bar_graph_colors.jsx'
|
8
|
-
export { default as PbBarGraphStacked } from './_pb_bar_graph_stacked.jsx'
|
9
|
-
export { default as PbBarGraphNegativeNumbers } from './_pb_bar_graph_negative_numbers.jsx'
|
10
|
-
export { default as PbBarGraphSecondaryYAxis } from './_pb_bar_graph_secondary_y_axis.jsx'
|
11
|
-
export { default as PbBarGraphHorizontal } from './_pb_bar_graph_horizontal.jsx'
|
@@ -1,106 +0,0 @@
|
|
1
|
-
import colors from '../tokens/exports/_colors.module.scss'
|
2
|
-
import typography from '../tokens/exports/_typography.module.scss'
|
3
|
-
|
4
|
-
const barGraphTheme = {
|
5
|
-
title: {
|
6
|
-
text: "",
|
7
|
-
style: {
|
8
|
-
color: colors.text_lt_default,
|
9
|
-
fontFamily: typography.font_family_base,
|
10
|
-
fontWeight: typography.bold,
|
11
|
-
fontSize: typography.heading_3,
|
12
|
-
},
|
13
|
-
},
|
14
|
-
subtitle: {
|
15
|
-
text: "",
|
16
|
-
style: {
|
17
|
-
fontFamily: typography.font_family_base,
|
18
|
-
color: colors.text_lt_light,
|
19
|
-
fontWeight: typography.regular,
|
20
|
-
fontSize: typography.text_base,
|
21
|
-
},
|
22
|
-
},
|
23
|
-
chart: {
|
24
|
-
type: "column",
|
25
|
-
},
|
26
|
-
tooltip: {
|
27
|
-
backgroundColor: {
|
28
|
-
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
29
|
-
stops: [
|
30
|
-
[0, colors.bg_dark],
|
31
|
-
[1, colors.bg_dark],
|
32
|
-
],
|
33
|
-
},
|
34
|
-
style: {
|
35
|
-
fontFamily: typography.font_family_base,
|
36
|
-
color: colors.text_dk_default,
|
37
|
-
fontWeight: typography.regular,
|
38
|
-
fontSize: typography.text_smaller,
|
39
|
-
},
|
40
|
-
},
|
41
|
-
colors: [
|
42
|
-
colors.data_1,
|
43
|
-
colors.data_2,
|
44
|
-
colors.data_3,
|
45
|
-
colors.data_4,
|
46
|
-
colors.data_5,
|
47
|
-
colors.data_6,
|
48
|
-
colors.data_7,
|
49
|
-
],
|
50
|
-
credits: { enabled: false },
|
51
|
-
legend: {
|
52
|
-
enabled: false,
|
53
|
-
itemStyle: {
|
54
|
-
color: colors.text_lt_light,
|
55
|
-
fill: colors.text_lt_light,
|
56
|
-
fontSize: typography.text_smaller,
|
57
|
-
},
|
58
|
-
},
|
59
|
-
xAxis: {
|
60
|
-
gridLineWidth: 0,
|
61
|
-
lineColor: colors.border_light,
|
62
|
-
tickColor: colors.border_light,
|
63
|
-
labels: {
|
64
|
-
style: {
|
65
|
-
fontFamily: typography.font_family_base,
|
66
|
-
color: colors.text_lt_lighter,
|
67
|
-
fontWeight: typography.bold,
|
68
|
-
fontSize: typography.text_smaller,
|
69
|
-
},
|
70
|
-
},
|
71
|
-
title: {
|
72
|
-
style: {
|
73
|
-
color: colors.text_lt_default,
|
74
|
-
fontFamily: typography.font_family_base,
|
75
|
-
fontWeight: typography.regular,
|
76
|
-
fontSize: typography.heading_4,
|
77
|
-
},
|
78
|
-
},
|
79
|
-
},
|
80
|
-
yAxis: {
|
81
|
-
alternateGridColor: undefined as string | undefined,
|
82
|
-
minorTickInterval: null as number | null,
|
83
|
-
gridLineColor: colors.border_light,
|
84
|
-
minorGridLineColor: colors.border_light,
|
85
|
-
lineWidth: 0,
|
86
|
-
tickWidth: 0,
|
87
|
-
labels: {
|
88
|
-
style: {
|
89
|
-
fontFamily: typography.font_family_base,
|
90
|
-
color: colors.text_lt_lighter,
|
91
|
-
fontWeight: typography.bold,
|
92
|
-
fontSize: typography.text_smaller,
|
93
|
-
},
|
94
|
-
},
|
95
|
-
title: {
|
96
|
-
style: {
|
97
|
-
fontFamily: typography.font_family_base,
|
98
|
-
color: colors.text_lt_lighter,
|
99
|
-
fontWeight: typography.bold,
|
100
|
-
fontSize: typography.text_smaller,
|
101
|
-
},
|
102
|
-
},
|
103
|
-
},
|
104
|
-
}
|
105
|
-
|
106
|
-
export default barGraphTheme;
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= react_component('PbBarGraph', object.react_props) %>
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbPbBarGraph
|
5
|
-
class PbBarGraph < ::Playbook::KitBase
|
6
|
-
prop :options, default: {}
|
7
|
-
prop :container_props, default: {}
|
8
|
-
|
9
|
-
def react_props
|
10
|
-
{
|
11
|
-
options: options,
|
12
|
-
containerProps: container_props_hash,
|
13
|
-
}
|
14
|
-
end
|
15
|
-
|
16
|
-
def container_props_hash
|
17
|
-
container_props.merge({
|
18
|
-
id: id,
|
19
|
-
className: classname,
|
20
|
-
}).compact
|
21
|
-
end
|
22
|
-
|
23
|
-
def classname
|
24
|
-
generate_classname("pb_pb_bar_graph")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { render, screen } from '../utilities/test-utils';
|
3
|
-
import PbBarGraph from './_pb_bar_graph';
|
4
|
-
|
5
|
-
beforeEach(() => {
|
6
|
-
// Silences error logs within the test suite.
|
7
|
-
jest.spyOn(console, 'error');
|
8
|
-
jest.spyOn(console, 'warn');
|
9
|
-
console.error.mockImplementation(() => {});
|
10
|
-
console.warn.mockImplementation(() => {});
|
11
|
-
});
|
12
|
-
|
13
|
-
afterEach(() => {
|
14
|
-
console.error.mockRestore();
|
15
|
-
console.warn.mockRestore();
|
16
|
-
});
|
17
|
-
|
18
|
-
const testId = 'bargraph1';
|
19
|
-
|
20
|
-
test('bargraph uses exact classname', () => {
|
21
|
-
render(
|
22
|
-
<PbBarGraph
|
23
|
-
className='super_important_class'
|
24
|
-
data={{ testid: testId }}
|
25
|
-
id='bar-default'
|
26
|
-
/>
|
27
|
-
);
|
28
|
-
|
29
|
-
const kit = screen.getByTestId(testId);
|
30
|
-
expect(kit).toHaveClass('super_important_class');
|
31
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
The `align` prop can be used to set alignment. This prop is set to 'left' by default.
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, the timestamp kit will display the date and time as shown here. If the date is NOT within the current year, the year will also be shown while dates in the current year will not show the year.
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Use variant `elapsed` to show time ago. This variant can be customized in several ways:
|
2
|
-
|
3
|
-
Use the optional `showUser`/`show_user` prop to show user as part of the text. When showing the user, pass in the user name using the `text` prop as shown. `showUser`/`show_user` is set to false by default.
|
4
|
-
|
5
|
-
Use the optional `hideUpdated`/`hide_updated` prop to hide the 'Last updated' text if needed.
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
|
5
|
-
const TimestampShowCurrentYear = (props) => {
|
6
|
-
return (
|
7
|
-
<div>
|
8
|
-
<Timestamp
|
9
|
-
showCurrentYear
|
10
|
-
timestamp={new Date()}
|
11
|
-
{...props}
|
12
|
-
/>
|
13
|
-
<br />
|
14
|
-
<Timestamp
|
15
|
-
showCurrentYear
|
16
|
-
showTime={false}
|
17
|
-
timestamp={new Date()}
|
18
|
-
{...props}
|
19
|
-
/>
|
20
|
-
|
21
|
-
</div>
|
22
|
-
)
|
23
|
-
}
|
24
|
-
|
25
|
-
export default TimestampShowCurrentYear
|
@@ -1 +0,0 @@
|
|
1
|
-
Use the `showCurrentYear`/`show_current_year` prop to show the year even if it is the current year. This is set to false by default.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const TimestampShowDate = (props) => {
|
5
|
-
return (
|
6
|
-
<div>
|
7
|
-
<Timestamp
|
8
|
-
align="left"
|
9
|
-
showDate={false}
|
10
|
-
timestamp={new Date()}
|
11
|
-
{...props}
|
12
|
-
/>
|
13
|
-
</div>
|
14
|
-
)
|
15
|
-
}
|
16
|
-
|
17
|
-
export default TimestampShowDate
|
@@ -1 +0,0 @@
|
|
1
|
-
The `showDate`/`show_date` prop is set to true by default but can be set to false to hide the date.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
show_time: false,
|
4
|
-
}) %>
|
5
|
-
|
6
|
-
<br>
|
7
|
-
|
8
|
-
<%= pb_rails("timestamp", props: {
|
9
|
-
timestamp: DateTime.now + 4.years,
|
10
|
-
show_time: false,
|
11
|
-
}) %>
|
12
|
-
|
13
|
-
<br>
|
14
|
-
|
15
|
-
<%= pb_rails("timestamp", props: {
|
16
|
-
timestamp: DateTime.now - 1.year,
|
17
|
-
show_time: false
|
18
|
-
}) %>
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
const futureYear = new Date().getFullYear() + 4
|
6
|
-
const pastYear = new Date().getFullYear() - 1
|
7
|
-
const month = new Date().getMonth()
|
8
|
-
const date = new Date().getDate()
|
9
|
-
const hours = new Date().getHours()
|
10
|
-
const minutes = new Date().getMinutes()
|
11
|
-
const futureDate = new Date(futureYear, month, date, hours, minutes)
|
12
|
-
const pastDate = new Date(pastYear, month, date, hours, minutes)
|
13
|
-
|
14
|
-
const TimestampShowTime = (props) => {
|
15
|
-
return (
|
16
|
-
<div>
|
17
|
-
<Timestamp
|
18
|
-
align="left"
|
19
|
-
showTime={false}
|
20
|
-
timestamp={todaysDate}
|
21
|
-
{...props}
|
22
|
-
/>
|
23
|
-
<br />
|
24
|
-
|
25
|
-
<Timestamp
|
26
|
-
align="left"
|
27
|
-
showTime={false}
|
28
|
-
timestamp={futureDate}
|
29
|
-
{...props}
|
30
|
-
/>
|
31
|
-
|
32
|
-
<br />
|
33
|
-
|
34
|
-
<Timestamp
|
35
|
-
align="left"
|
36
|
-
showTime={false}
|
37
|
-
timestamp={pastDate}
|
38
|
-
{...props}
|
39
|
-
/>
|
40
|
-
</div>
|
41
|
-
)
|
42
|
-
}
|
43
|
-
|
44
|
-
export default TimestampShowTime
|
@@ -1 +0,0 @@
|
|
1
|
-
The `showTime`/`show_time` prop is set to true by default but can be set to false to hide the time.
|
@@ -1 +0,0 @@
|
|
1
|
-
The `showTimezone`/`show_timezone` prop can be used to show the timezone as well. This is set to false by default. **NOTE**: This prop must be used in conjunction with the `timezone` prop to specify which timezone to display.
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Use variant `updated` to show last updated at timestamp.
|
2
|
-
|
3
|
-
This variant can be customized using the optional `showUser`/`show_user` prop to show user as part of the text. When showing the user, pass in the user name using the `text` prop as shown.
|
4
|
-
|
5
|
-
`showUser`/`show_user` is set to false by default.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
variant: "updated",
|
4
|
-
show_user: true,
|
5
|
-
show_current_year: true,
|
6
|
-
text: "Maricris Nonato"
|
7
|
-
}) %>
|
8
|
-
|
9
|
-
<br>
|
10
|
-
|
11
|
-
<%= pb_rails("timestamp", props: {
|
12
|
-
timestamp: DateTime.now,
|
13
|
-
variant: "updated",
|
14
|
-
show_user: false,
|
15
|
-
show_current_year: true
|
16
|
-
}) %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
|
6
|
-
const TimestampUpdatedShowCurrentYear = (props) => {
|
7
|
-
return (
|
8
|
-
<div>
|
9
|
-
<Timestamp
|
10
|
-
showCurrentYear
|
11
|
-
showUser
|
12
|
-
text="Maricris Nonato"
|
13
|
-
timestamp={todaysDate}
|
14
|
-
variant="updated"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<Timestamp
|
21
|
-
showCurrentYear
|
22
|
-
timestamp={todaysDate}
|
23
|
-
variant="updated"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
</div>
|
27
|
-
)
|
28
|
-
}
|
29
|
-
|
30
|
-
export default TimestampUpdatedShowCurrentYear
|
@@ -1 +0,0 @@
|
|
1
|
-
The `updated` variant can also be used in conjunction with the `showCurrentYear`/`show_current_year` prop to show the year even if it is the current year.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
variant: "updated",
|
4
|
-
show_user: true,
|
5
|
-
show_date: false,
|
6
|
-
text: "Maricris Nonato"
|
7
|
-
}) %>
|
8
|
-
|
9
|
-
<br>
|
10
|
-
|
11
|
-
<%= pb_rails("timestamp", props: {
|
12
|
-
timestamp: DateTime.now,
|
13
|
-
variant: "updated",
|
14
|
-
show_user: false,
|
15
|
-
show_date: false
|
16
|
-
}) %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
|
6
|
-
const TimestampUpdatedShowDate = (props) => {
|
7
|
-
return (
|
8
|
-
<div>
|
9
|
-
<Timestamp
|
10
|
-
showDate={false}
|
11
|
-
showUser
|
12
|
-
text="Maricris Nonato"
|
13
|
-
timestamp={todaysDate}
|
14
|
-
variant="updated"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<Timestamp
|
21
|
-
showDate={false}
|
22
|
-
timestamp={todaysDate}
|
23
|
-
variant="updated"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
</div>
|
27
|
-
)
|
28
|
-
}
|
29
|
-
|
30
|
-
export default TimestampUpdatedShowDate
|
@@ -1 +0,0 @@
|
|
1
|
-
The `updated` variant can also be used in conjunction with the `showDate`/`show_date` prop. This prop is set to true by default but can be set to false to hide the date.
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
variant: "updated",
|
4
|
-
show_user: true,
|
5
|
-
show_time: false,
|
6
|
-
text: "Maricris Nonato"
|
7
|
-
}) %>
|
8
|
-
|
9
|
-
<br>
|
10
|
-
|
11
|
-
<%= pb_rails("timestamp", props: {
|
12
|
-
timestamp: DateTime.now,
|
13
|
-
variant: "updated",
|
14
|
-
show_user: false,
|
15
|
-
show_time: false
|
16
|
-
}) %>
|
17
|
-
|
18
|
-
<br>
|
19
|
-
|
20
|
-
<%= pb_rails("timestamp", props: {
|
21
|
-
timestamp: DateTime.now,
|
22
|
-
variant: "updated",
|
23
|
-
show_current_year: true,
|
24
|
-
show_user: false,
|
25
|
-
show_time: false
|
26
|
-
}) %>
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
|
6
|
-
const TimestampUpdatedShowTime = (props) => {
|
7
|
-
return (
|
8
|
-
<div>
|
9
|
-
<Timestamp
|
10
|
-
showTime={false}
|
11
|
-
showUser
|
12
|
-
text="Maricris Nonato"
|
13
|
-
timestamp={todaysDate}
|
14
|
-
variant="updated"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<Timestamp
|
21
|
-
showTime={false}
|
22
|
-
timestamp={todaysDate}
|
23
|
-
variant="updated"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
|
27
|
-
<br />
|
28
|
-
|
29
|
-
<Timestamp
|
30
|
-
showCurrentYear
|
31
|
-
showTime={false}
|
32
|
-
timestamp={todaysDate}
|
33
|
-
variant="updated"
|
34
|
-
{...props}
|
35
|
-
/>
|
36
|
-
|
37
|
-
</div>
|
38
|
-
)
|
39
|
-
}
|
40
|
-
|
41
|
-
export default TimestampUpdatedShowTime
|
@@ -1 +0,0 @@
|
|
1
|
-
The `updated` variant can also be used in conjunction with the `showTime`/`show_time` prop. This prop is set to true by default but can be set to false to hide the time. This can also be used in conjunction with `showCurrentYear`/`show_current_year` to show the year even if it is the current year.
|