playbook_ui_docs 13.13.0.pre.alpha.PLAY1090csstokens1675 → 13.13.0.pre.alpha.play10221678

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: 5bb0a545b88b6360207fb88113d4ae35088a1e63d3ddbada1ee3cb64abc34383
4
- data.tar.gz: 5a635feff777a5f8b00b08c7e7447bdf7ae60feeef59d810626f8ed269fe7624
3
+ metadata.gz: 8ed5f092b2d08dbaa2e7a36c3fcfd931e2f5cfe26d35fd553789bb029c620e63
4
+ data.tar.gz: 947c21a797f7c633cf6b1982acdc408f782e68d761ae1ec8fa0938ff07883b14
5
5
  SHA512:
6
- metadata.gz: b79ac876ba8cc0b4f7e13c6a6c2a4802b1975fadf31e86ceb7ff0d2e872980147ef773be6d542b11d098fdb592a2ba7dda24db85195d6aaabd3080d9ffcaa933
7
- data.tar.gz: 6b7d6a9e0f18fe844c5046776271286c96f80ddbb0a5ca3b4990a698717025732c9046263c87a0e65b886d9b665273ad087484935ef970766b2d68a4dd94459f
6
+ metadata.gz: 44d1f4c358ffb7f2b5ff5f44a913d1a669a1afdfaea4114a3abac63d4a8b61b0a25ca357242cbde6183f93e53658c71da36558927cc026611350885c8de339d6
7
+ data.tar.gz: 96a590487494497046d5dbd904863d109a6a770ec6a38de8d443495162040e340cf097ef3a7b8153b6b1a40ef618346b236db0b92f202759a362c92e9d4c342a
@@ -0,0 +1,29 @@
1
+ <%= pb_rails("date_picker", props: {
2
+ allow_input: true,
3
+ custom_quick_pick_dates: {
4
+ dates: [
5
+ # Allow Playbook to handle the logic...
6
+ {
7
+ label: "Last 15 months",
8
+ value: {
9
+ timePeriod: "months",
10
+ amount: 15,
11
+ },
12
+ },
13
+ # Or, be explicit with an exact date range for more control...
14
+ {
15
+ label: "First Week of June 2022",
16
+ value: ["06/01/2022", "06/07/2022"],
17
+ },
18
+ ],
19
+ },
20
+ end_date_id: "quick-pick-end-date",
21
+ end_date_name: "quick-pick-end-date",
22
+ mode: "range",
23
+ picker_id: "date-picker-quick-pick-custom",
24
+ placeholder: "mm/dd/yyyy to mm/dd/yyyy",
25
+ selection_type: "quickpick",
26
+ start_date_id: "quick-pick-start-date",
27
+ start_date_name: "quick-pick-start-date"
28
+ }) %>
29
+
@@ -0,0 +1,34 @@
1
+ import React from "react"
2
+ import DatePicker from "../_date_picker"
3
+
4
+ const DatePickerQuickPickCustom = (props) => (
5
+ <>
6
+ <DatePicker
7
+ allowInput
8
+ customQuickPickDates={{
9
+ dates: [
10
+ // Allow Playbook to handle the logic...
11
+ {
12
+ label: "Last 15 months",
13
+ value: {
14
+ timePeriod: "months",
15
+ amount: 15,
16
+ },
17
+ },
18
+ // Or, be explicit with an exact date range for more control...
19
+ {
20
+ label: "First Week of June 2022",
21
+ value: ["06/01/2022", "06/07/2022"],
22
+ },
23
+ ],
24
+ }}
25
+ mode='range'
26
+ pickerId='date-picker-quick-pick-custom-override'
27
+ placeholder='mm/dd/yyyy to mm/dd/yyyy'
28
+ selectionType='quickpick'
29
+ {...props}
30
+ />
31
+ </>
32
+ )
33
+
34
+ export default DatePickerQuickPickCustom
@@ -0,0 +1,7 @@
1
+ The customQuickPickDates/custom_quick_pick_dates prop allows for the user/dev to define their own quick pick dates.
2
+ The prop accepts an object with two key/value pairs: dates & override (separate doc example below).
3
+
4
+ The dates property accepts an array of objects. Each object in the array has label and value properties. The label is what will be displayed in the UI of the dropdown menu. The value property is just the date that is going to be passed to the datepicker. The value property can be an array of two strings that represent a range, allowing for the dev to be extremely specific. Additionally, the dates array allows for a clean, simple API under that automatically converts dates in a common vernacular.
5
+
6
+ The timePeriod property accepts "days", "weeks", "months", "quarters" or "years", representing past time periods.
7
+ The amount property accepts any number.
@@ -0,0 +1,28 @@
1
+ <%= pb_rails("date_picker", props: {
2
+ allow_input: true,
3
+ custom_quick_pick_dates: {
4
+ override: false,
5
+ dates: [
6
+ {
7
+ label: "Last 15 months",
8
+ value: {
9
+ timePeriod: "months",
10
+ amount: 15,
11
+ },
12
+ },
13
+ {
14
+ label: "First Week of June 2022",
15
+ value: ["06/01/2022", "06/07/2022"],
16
+ },
17
+ ],
18
+ },
19
+ end_date_id: "quick-pick-end-date",
20
+ end_date_name: "quick-pick-end-date",
21
+ mode: "range",
22
+ picker_id: "date-picker-quick-pick-override",
23
+ placeholder: "mm/dd/yyyy to mm/dd/yyyy",
24
+ selection_type: "quickpick",
25
+ start_date_id: "quick-pick-start-date",
26
+ start_date_name: "quick-pick-start-date"
27
+ }) %>
28
+
@@ -0,0 +1,34 @@
1
+ import React from "react"
2
+ import DatePicker from "../_date_picker"
3
+
4
+ const DatePickerQuickPickCustomOverride = (props) => (
5
+ <>
6
+ <DatePicker
7
+ allowInput
8
+ customQuickPickDates={{
9
+ override: false,
10
+ dates: [
11
+ {
12
+ label: "Last 15 months",
13
+ value: {
14
+ timePeriod: "months",
15
+ amount: 15,
16
+ },
17
+ },
18
+ {
19
+ label: "First Week of June 2022",
20
+ value: ["06/01/2022", "06/07/2022"],
21
+ },
22
+ ],
23
+ }}
24
+ marginTop='lg'
25
+ mode='range'
26
+ pickerId='date-picker-quick-pick-custom'
27
+ placeholder='mm/dd/yyyy to mm/dd/yyyy'
28
+ selectionType='quickpick'
29
+ {...props}
30
+ />
31
+ </>
32
+ )
33
+
34
+ export default DatePickerQuickPickCustomOverride
@@ -0,0 +1 @@
1
+ The customQuickPickDates/custom_quick_pick_dates prop allows for an override boolean. The override allows for the user to completely override the quick pick dates that ship with the component. Default of `override` is set to true. If you would like to simply append your dates to the default quick pick dates, set this prop to false explicitly.
@@ -1,5 +1,5 @@
1
- import React from 'react'
2
- import DatePicker from '../_date_picker'
1
+ import React from "react"
2
+ import DatePicker from "../_date_picker"
3
3
 
4
4
  const DatePickerQuickPickReact = (props) => (
5
5
  <>
@@ -10,6 +10,8 @@ examples:
10
10
  - date_picker_range: Range
11
11
  - date_picker_quick_pick_rails: Range (Quick Pick)
12
12
  - date_picker_quick_pick_range_limit: Range (Quick Pick w/ “This” Range limit)
13
+ - date_picker_quick_pick_custom: Custom Quick Pick Dates
14
+ - date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
13
15
  - date_picker_format: Format
14
16
  - date_picker_disabled: Disabled Dates
15
17
  - date_picker_min_max: Min Max
@@ -37,6 +39,8 @@ examples:
37
39
  - date_picker_range: Range
38
40
  - date_picker_quick_pick_react: Range (Quick Pick)
39
41
  - date_picker_quick_pick_range_limit: Range (Quick Pick w/ “This” Range limit)
42
+ - date_picker_quick_pick_custom: Custom Quick Pick Dates
43
+ - date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
40
44
  - date_picker_format: Format
41
45
  - date_picker_disabled: Disabled Dates
42
46
  - date_picker_min_max: Min Max
@@ -22,3 +22,5 @@ export { default as DatePickerAllowInput } from './_date_picker_allow_input'
22
22
  export { default as DatePickerQuickPickReact } from './_date_picker_quick_pick_react'
23
23
  export { default as DatePickerQuickPickRangeLimit } from './_date_picker_quick_pick_range_limit'
24
24
  export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
25
+ export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
26
+ export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'