playbook_ui 16.8.0.pre.alpha.PLAY298616637 → 16.8.0.pre.alpha.tablewidths16466
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/pb_card/_card.tsx +1 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +6 -9
- data/app/pb_kits/playbook/pb_currency/currency.rb +10 -5
- data/app/pb_kits/playbook/pb_currency/currency.test.js +1 -44
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +2 -42
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +5 -8
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -12
- data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +0 -60
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -3
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +0 -19
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_react.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +0 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_react.md +1 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +1 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_react.md +1 -3
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -16
- data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +1 -3
- data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +0 -1
- data/app/pb_kits/playbook/pb_draggable/index.js +7 -149
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +0 -1
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +1 -67
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.html.erb +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.jsx +21 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_fa_kit.md +7 -0
- data/app/pb_kits/playbook/pb_icon/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_icon/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -4
- data/app/pb_kits/playbook/pb_list/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +1 -2
- data/dist/chunks/{_pb_line_graph-BdDqs3Vu.js → _pb_line_graph-BgsTI0CL.js} +1 -1
- data/dist/chunks/{_typeahead-B8k7RBsj.js → _typeahead-D2TWdJTn.js} +1 -1
- data/dist/chunks/{globalProps-DF0MuVPf.js → globalProps-DOB47YGB.js} +1 -1
- data/dist/chunks/{lib-DsBJM_F3.js → lib-BzglXly2.js} +1 -1
- data/dist/chunks/vendor.js +2 -2
- data/dist/menu.yml +127 -67
- 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/version.rb +1 -1
- metadata +10 -12
- data/app/pb_kits/playbook/pb_draggable/touchDrag.test.js +0 -38
- data/app/pb_kits/playbook/pb_draggable/utilities/touchDrag.ts +0 -173
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_centered_data.html.erb +0 -90
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_centered_data.jsx +0 -100
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_centered_data.md +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f46fd7de41487efa37647c36cc3d1d55e2260ccda34ff0f094dc4f3c21608c4
|
|
4
|
+
data.tar.gz: 60e1b0388423c2a75088ba9210b0e9456c27fb7a7b5822b5753f1c46f1abfa53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 236bb6ec1f254c88d37bfa99aa2bb530aba234550a5635bfd19c9bb76fe0240bf818ccd4f2b859424662c2e15d1f31cae47d0831e172a9c2926e1eaa4cf3ade7
|
|
7
|
+
data.tar.gz: 63776f5d3b77b41da7a95ad4d67e89d244a0981fb8cc2220c3fc8996f5506eb2b4f94cf30989d848afc83d2104dbe17092e00851e4b4cd46ebd5a63985ddb543
|
|
@@ -162,7 +162,7 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
|
162
162
|
{
|
|
163
163
|
dragHandle ? (
|
|
164
164
|
<Flex>
|
|
165
|
-
<span className="card_draggable_handle
|
|
165
|
+
<span className="card_draggable_handle">
|
|
166
166
|
<Icon
|
|
167
167
|
icon="grip-dots-vertical"
|
|
168
168
|
paddingRight="xs"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<% if object.draggable_item %>
|
|
5
5
|
<%= pb_rails("flex", props: { align: "center" }) do %>
|
|
6
6
|
<% if object.drag_handle %>
|
|
7
|
-
<span
|
|
7
|
+
<span classname="card_draggable_handle">
|
|
8
8
|
<%= pb_rails("icon", props: { icon: "grip-dots-vertical", padding_right: "xs" }) %>
|
|
9
9
|
</span>
|
|
10
10
|
<% end %>
|
|
@@ -59,13 +59,12 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
|
59
59
|
commaSeparator = false,
|
|
60
60
|
} = props
|
|
61
61
|
|
|
62
|
-
const isAmountEmpty = (value: string | number): boolean => (
|
|
63
|
-
value === '' || value == null || (typeof value === 'string' && value.trim() === '')
|
|
64
|
-
)
|
|
65
|
-
|
|
66
62
|
// Convert numeric input to string format
|
|
67
63
|
const convertAmount = (input: string | number): string => {
|
|
68
64
|
if (typeof input === 'number') {
|
|
65
|
+
if (input === 0 && !nullDisplay) {
|
|
66
|
+
return ""
|
|
67
|
+
}
|
|
69
68
|
return input.toFixed(2)
|
|
70
69
|
}
|
|
71
70
|
return input
|
|
@@ -82,9 +81,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
|
82
81
|
variantClass = '_bold'
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
const [
|
|
86
|
-
const decimal = (decimalPart || '00').padEnd(2, '0').slice(0, 2)
|
|
87
|
-
const whole = currencyAmount === '' ? '' : (wholePart === '' ? '0' : wholePart)
|
|
84
|
+
const [whole, decimal = '00'] = currencyAmount.split('.')
|
|
88
85
|
const ariaProps = buildAriaProps(aria)
|
|
89
86
|
const dataProps = buildDataProps(data)
|
|
90
87
|
const htmlProps = buildHtmlProps(htmlOptions)
|
|
@@ -138,7 +135,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
|
138
135
|
<Caption dark={dark}>{label}</Caption>
|
|
139
136
|
<div className={`pb_currency_wrapper${variantClass || emphasizedClass}`}>
|
|
140
137
|
{unstyled ? (
|
|
141
|
-
nullDisplay &&
|
|
138
|
+
nullDisplay && !amount ? (
|
|
142
139
|
<div>{nullDisplay}</div>
|
|
143
140
|
) : (
|
|
144
141
|
<>
|
|
@@ -151,7 +148,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
|
|
|
151
148
|
</>
|
|
152
149
|
)
|
|
153
150
|
) : (
|
|
154
|
-
nullDisplay &&
|
|
151
|
+
nullDisplay && !amount ? (
|
|
155
152
|
<Title
|
|
156
153
|
className="pb_currency_value"
|
|
157
154
|
dark={dark}
|
|
@@ -68,7 +68,7 @@ module Playbook
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def title_text
|
|
71
|
-
if null_display
|
|
71
|
+
if null_display
|
|
72
72
|
null_display
|
|
73
73
|
elsif swap_negative
|
|
74
74
|
absolute_amount(abbr_or_format_amount)
|
|
@@ -125,7 +125,14 @@ module Playbook
|
|
|
125
125
|
# Convert numeric input to string format
|
|
126
126
|
def convert_amount(input)
|
|
127
127
|
if input.is_a?(Numeric)
|
|
128
|
-
|
|
128
|
+
if input.zero? && null_display.nil?
|
|
129
|
+
""
|
|
130
|
+
else
|
|
131
|
+
format("%.2f", input)
|
|
132
|
+
end
|
|
133
|
+
# Handle string representations of zero
|
|
134
|
+
elsif input.to_s.strip.match?(/^-?0+(\.0+)?$/) && null_display.nil?
|
|
135
|
+
""
|
|
129
136
|
else
|
|
130
137
|
input.to_s
|
|
131
138
|
end
|
|
@@ -135,7 +142,6 @@ module Playbook
|
|
|
135
142
|
return "" if currency_amount.blank?
|
|
136
143
|
|
|
137
144
|
value = currency_amount.split(".").first
|
|
138
|
-
value = "0" if value.blank?
|
|
139
145
|
if comma_separator
|
|
140
146
|
number_with_delimiter(value.gsub(",", ""))
|
|
141
147
|
else
|
|
@@ -146,8 +152,7 @@ module Playbook
|
|
|
146
152
|
def decimal_value
|
|
147
153
|
return "00" if currency_amount.blank?
|
|
148
154
|
|
|
149
|
-
|
|
150
|
-
fraction.ljust(2, "0")[0, 2]
|
|
155
|
+
currency_amount.split(".")[1] || "00"
|
|
151
156
|
end
|
|
152
157
|
|
|
153
158
|
def units_element
|
|
@@ -178,48 +178,5 @@ test('handles numeric amounts correctly', () => {
|
|
|
178
178
|
expect(screen.getByTestId('test-numeric-no-symbol')).toHaveTextContent('400.50')
|
|
179
179
|
expect(screen.getByTestId('test-numeric-medium-size')).toHaveTextContent('$500.55')
|
|
180
180
|
expect(screen.getByTestId('test-numeric-negative')).toHaveTextContent('-$600.70')
|
|
181
|
-
expect(screen.getByTestId('test-numeric-null')).toHaveTextContent('
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
test('renders zero values with leading digit', () => {
|
|
185
|
-
render(
|
|
186
|
-
<>
|
|
187
|
-
<Currency
|
|
188
|
-
amount="0"
|
|
189
|
-
data={{ testid: 'test-string-zero' }}
|
|
190
|
-
/>
|
|
191
|
-
<Currency
|
|
192
|
-
amount={0}
|
|
193
|
-
data={{ testid: 'test-numeric-zero' }}
|
|
194
|
-
/>
|
|
195
|
-
</>
|
|
196
|
-
)
|
|
197
|
-
|
|
198
|
-
expect(screen.getByTestId('test-string-zero')).toHaveTextContent('$0.00')
|
|
199
|
-
expect(screen.getByTestId('test-numeric-zero')).toHaveTextContent('$0.00')
|
|
200
|
-
})
|
|
201
|
-
|
|
202
|
-
test('normalizes string zero with single decimal digit to .00', () => {
|
|
203
|
-
render(
|
|
204
|
-
<Currency
|
|
205
|
-
amount="0.0"
|
|
206
|
-
commaSeparator
|
|
207
|
-
data={{ testid: 'test-string-zero-single-decimal' }}
|
|
208
|
-
/>
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
expect(screen.getByTestId('test-string-zero-single-decimal')).toHaveTextContent('$0.00')
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
test('nullDisplay only applies when amount is empty', () => {
|
|
215
|
-
render(
|
|
216
|
-
<Currency
|
|
217
|
-
amount="-.53"
|
|
218
|
-
data={{ testid: 'test-null-display-negative' }}
|
|
219
|
-
nullDisplay="$0.00"
|
|
220
|
-
/>
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
expect(screen.getByTestId('test-null-display-negative')).toHaveTextContent('-$')
|
|
224
|
-
expect(screen.getByTestId('test-null-display-negative')).not.toHaveTextContent('$0.00')
|
|
181
|
+
expect(screen.getByTestId('test-numeric-null')).toHaveTextContent('$.00')
|
|
225
182
|
})
|
|
@@ -12,41 +12,6 @@ import Caption from '../pb_caption/_caption'
|
|
|
12
12
|
import Body from '../pb_body/_body'
|
|
13
13
|
import colors from "../tokens/exports/_colors.module.scss"
|
|
14
14
|
|
|
15
|
-
function isValidDateInstance(value: Date): boolean {
|
|
16
|
-
return !Number.isNaN(value.getTime())
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function normalizeDefaultDate<T>(defaultDate: T): T {
|
|
20
|
-
if (defaultDate instanceof Date) {
|
|
21
|
-
return (isValidDateInstance(defaultDate) ? defaultDate : '') as unknown as T
|
|
22
|
-
}
|
|
23
|
-
if (Array.isArray(defaultDate)) {
|
|
24
|
-
const normalized = defaultDate.filter(
|
|
25
|
-
(d) => !(d instanceof Date) || isValidDateInstance(d)
|
|
26
|
-
)
|
|
27
|
-
return (normalized.length ? normalized : '') as unknown as T
|
|
28
|
-
}
|
|
29
|
-
return defaultDate
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function serializeDefaultDateForFilterReset(defaultDate: unknown): string | undefined {
|
|
33
|
-
if (defaultDate === '' || defaultDate == null) return undefined
|
|
34
|
-
if (Array.isArray(defaultDate)) {
|
|
35
|
-
const parts = defaultDate.map((d) => {
|
|
36
|
-
if (d == null || d === '') return ''
|
|
37
|
-
if (d instanceof Date) {
|
|
38
|
-
return isValidDateInstance(d) ? d.toISOString() : ''
|
|
39
|
-
}
|
|
40
|
-
return String(d)
|
|
41
|
-
}).filter(Boolean)
|
|
42
|
-
return parts.length ? parts.join(',') : undefined
|
|
43
|
-
}
|
|
44
|
-
if (defaultDate instanceof Date) {
|
|
45
|
-
return isValidDateInstance(defaultDate) ? defaultDate.toISOString() : undefined
|
|
46
|
-
}
|
|
47
|
-
return String(defaultDate)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
15
|
type DatePickerProps = {
|
|
51
16
|
allowInput?: boolean,
|
|
52
17
|
aria?: { [key: string]: string },
|
|
@@ -148,12 +113,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
148
113
|
} = props
|
|
149
114
|
|
|
150
115
|
const ariaProps = buildAriaProps(aria)
|
|
151
|
-
const
|
|
152
|
-
const filterResetDefaultSerialized = serializeDefaultDateForFilterReset(normalizedDefaultDate)
|
|
153
|
-
const dataProps = buildDataProps({
|
|
154
|
-
...data,
|
|
155
|
-
...(filterResetDefaultSerialized ? { 'default-value': filterResetDefaultSerialized } : {}),
|
|
156
|
-
})
|
|
116
|
+
const dataProps = buildDataProps(data)
|
|
157
117
|
const htmlProps = buildHtmlProps(htmlOptions)
|
|
158
118
|
const inputAriaProps = buildAriaProps(inputAria)
|
|
159
119
|
const inputDataProps = buildDataProps(inputData)
|
|
@@ -176,7 +136,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
176
136
|
datePickerHelper({
|
|
177
137
|
allowInput,
|
|
178
138
|
customQuickPickDates,
|
|
179
|
-
defaultDate
|
|
139
|
+
defaultDate,
|
|
180
140
|
disableDate,
|
|
181
141
|
disableRange,
|
|
182
142
|
disableWeekdays,
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
date_picker_root_attrs['data-default-value'] = object.serialized_default_date_for_dom if object.serialized_default_date_for_dom.present?
|
|
7
|
-
%>
|
|
8
|
-
<%= pb_content_tag(:div, date_picker_root_attrs) do %>
|
|
1
|
+
<%= pb_content_tag(:div,
|
|
2
|
+
class: object.classname + object.error_class,
|
|
3
|
+
'data-pb-date-picker' => true,
|
|
4
|
+
'data-validation-message' => object.validation_message,
|
|
5
|
+
) do %>
|
|
9
6
|
<div class="input_wrapper">
|
|
10
7
|
<% if !object.hide_label && object.label %>
|
|
11
8
|
<label for="<%= object.picker_id %>">
|
|
@@ -145,18 +145,6 @@ module Playbook
|
|
|
145
145
|
def angle_down_path
|
|
146
146
|
"app/pb_kits/playbook/utilities/icons/angle-down.svg"
|
|
147
147
|
end
|
|
148
|
-
|
|
149
|
-
# Serialized business default for opt-in smart filter reset (Nitro / data-default-value).
|
|
150
|
-
def serialized_default_date_for_dom
|
|
151
|
-
case default_date
|
|
152
|
-
when nil, ""
|
|
153
|
-
nil
|
|
154
|
-
when Array
|
|
155
|
-
default_date.compact_blank.map(&:to_s).join(",")
|
|
156
|
-
else
|
|
157
|
-
default_date.to_s.presence
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
148
|
end
|
|
161
149
|
end
|
|
162
150
|
end
|
|
@@ -40,66 +40,6 @@ describe('DatePicker Kit', () => {
|
|
|
40
40
|
expect(kit).toHaveClass('pb_date_picker_kit mb_sm')
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
-
test('exposes data-default-value on kit root when defaultDate is set', () => {
|
|
44
|
-
const testId = 'datepicker-def-attr'
|
|
45
|
-
render(
|
|
46
|
-
<DatePicker
|
|
47
|
-
data={{ testid: testId }}
|
|
48
|
-
defaultDate={DEFAULT_DATE}
|
|
49
|
-
pickerId="date-picker-def-attr"
|
|
50
|
-
/>
|
|
51
|
-
)
|
|
52
|
-
const kit = screen.getByTestId(testId)
|
|
53
|
-
expect(kit).toHaveAttribute('data-default-value', DEFAULT_DATE.toISOString())
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
test('omits data-default-value when defaultDate is empty', () => {
|
|
57
|
-
const testId = 'datepicker-no-def-attr'
|
|
58
|
-
render(
|
|
59
|
-
<DatePicker
|
|
60
|
-
data={{ testid: testId }}
|
|
61
|
-
defaultDate=""
|
|
62
|
-
pickerId="date-picker-no-def-attr"
|
|
63
|
-
/>
|
|
64
|
-
)
|
|
65
|
-
const kit = screen.getByTestId(testId)
|
|
66
|
-
expect(kit).not.toHaveAttribute('data-default-value')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
test('renders without error when defaultDate is an invalid Date', () => {
|
|
70
|
-
const testId = 'datepicker-invalid-date'
|
|
71
|
-
const invalidDate = new Date('UndefinedT00:00')
|
|
72
|
-
|
|
73
|
-
expect(() => {
|
|
74
|
-
render(
|
|
75
|
-
<DatePicker
|
|
76
|
-
data={{ testid: testId }}
|
|
77
|
-
defaultDate={invalidDate}
|
|
78
|
-
pickerId="date-picker-invalid-date"
|
|
79
|
-
/>
|
|
80
|
-
)
|
|
81
|
-
}).not.toThrow()
|
|
82
|
-
|
|
83
|
-
const kit = screen.getByTestId(testId)
|
|
84
|
-
expect(kit).not.toHaveAttribute('data-default-value')
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
test('omits data-default-value when defaultDate is constructed from undefined', () => {
|
|
88
|
-
const testId = 'datepicker-undefined-date'
|
|
89
|
-
const invalidDate = new Date(undefined + 'T00:00')
|
|
90
|
-
|
|
91
|
-
render(
|
|
92
|
-
<DatePicker
|
|
93
|
-
data={{ testid: testId }}
|
|
94
|
-
defaultDate={invalidDate}
|
|
95
|
-
pickerId="date-picker-undefined-date"
|
|
96
|
-
/>
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
const kit = screen.getByTestId(testId)
|
|
100
|
-
expect(kit).not.toHaveAttribute('data-default-value')
|
|
101
|
-
})
|
|
102
|
-
|
|
103
43
|
test('inLine alone adds inline-date-picker class and inline control icons, not the calendar icon', () => {
|
|
104
44
|
const testId = 'datepicker-inline-only'
|
|
105
45
|
render(
|
|
@@ -278,9 +278,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
|
278
278
|
// Default Date + Min/Max Date Initialization Helper Functions section ----/
|
|
279
279
|
const toDateObject = (dateValue: any): Date | null => {
|
|
280
280
|
if (!dateValue) return null
|
|
281
|
-
if (dateValue instanceof Date)
|
|
282
|
-
return isNaN(dateValue.getTime()) ? null : dateValue
|
|
283
|
-
}
|
|
281
|
+
if (dateValue instanceof Date) return dateValue
|
|
284
282
|
if (typeof dateValue === 'string') {
|
|
285
283
|
const parsed = new Date(dateValue)
|
|
286
284
|
return isNaN(parsed.getTime()) ? null : parsed
|
|
@@ -8,25 +8,6 @@
|
|
|
8
8
|
cursor: grab;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
&.is_touch_active {
|
|
12
|
-
.pb_draggable_handle,
|
|
13
|
-
.card_draggable_handle {
|
|
14
|
-
color: $text_lt_default;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.pb_draggable_handle,
|
|
19
|
-
.card_draggable_handle {
|
|
20
|
-
touch-action: none;
|
|
21
|
-
-webkit-touch-callout: none;
|
|
22
|
-
user-select: none;
|
|
23
|
-
cursor: grab;
|
|
24
|
-
|
|
25
|
-
&:active {
|
|
26
|
-
color: $text_lt_default;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
11
|
&.is_dragging {
|
|
31
12
|
position: relative;
|
|
32
13
|
|
|
@@ -5,5 +5,3 @@ Use the `draggable` kit and manage state as shown.
|
|
|
5
5
|
`draggable/draggable_container` kit creates the container within which the cards can be dragged and dropped.
|
|
6
6
|
|
|
7
7
|
The Card kit is optimized to work with the draggable kit. To enable drag, use the `draggable_item` and `drag_id` props on the Card kit as shown. An additional optional boolean prop (set to true by default) of `drag_handle` is also available to show the drag handle icon.
|
|
8
|
-
|
|
9
|
-
On touch devices, drag from the grip handle (no long press). Swiping the card body scrolls as usual. Keep `drag_handle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -6,5 +6,4 @@ Use `DraggableProvider` and manage state as shown.
|
|
|
6
6
|
|
|
7
7
|
The Card kit is optimized to work with the draggable kit. To enable drag, use the `draggableItem` and `dragId` props on the Card kit as shown. An additional optional boolean prop (set to true by default) of `dragHandle` is also available to show the drag handle icon.
|
|
8
8
|
|
|
9
|
-
On touch devices, drag from the grip handle (no long press). Swiping the card body scrolls as usual. Keep `dragHandle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
10
9
|
|
|
@@ -3,5 +3,3 @@ For a simplified version of the Draggable API for the List kit, you can do the f
|
|
|
3
3
|
The List kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on List kit with an array of the included items AND `drag_id` prop on ListItems. You will also need to include the `items` prop containing your array of listed items for the Draggable API.
|
|
4
4
|
|
|
5
5
|
An additional optional boolean prop (set to true by default) of `drag_handle` is also available on ListItem kit to show the drag handle icon.
|
|
6
|
-
|
|
7
|
-
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `drag_handle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
@@ -2,6 +2,4 @@ For a simplified version of the Draggable API for the List kit, you can do the f
|
|
|
2
2
|
|
|
3
3
|
Use `DraggableProvider` and manage state as shown.
|
|
4
4
|
|
|
5
|
-
The List kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on List kit AND `dragId` prop on ListItem. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on
|
|
6
|
-
|
|
7
|
-
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `dragHandle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
5
|
+
The List kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on List kit AND `dragId` prop on ListItem. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on List kit to show the drag handle icon.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
For a simplified version of the Draggable API for the SelectableList kit, you can do the following:
|
|
2
2
|
|
|
3
|
-
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on SelectableList kit AND `drag_id` prop within the SelectableList kit prop. An additional optional boolean prop (set to true by default) of `drag_handle` is also available on SelectableList kit to show the drag handle icon.
|
|
4
|
-
|
|
5
|
-
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `drag_handle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
3
|
+
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on SelectableList kit AND `drag_id` prop within the SelectableList kit prop. An additional optional boolean prop (set to true by default) of `drag_handle` is also available on SelectableList kit to show the drag handle icon.
|
|
@@ -2,6 +2,4 @@ For a simplified version of the Draggable API for the SelectableList kit, you ca
|
|
|
2
2
|
|
|
3
3
|
Use `DraggableProvider` and manage state as shown.
|
|
4
4
|
|
|
5
|
-
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on SelectableList kit AND `dragId` prop on SelectableList.Item. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on SelectableList kit to show the drag handle icon.
|
|
6
|
-
|
|
7
|
-
On touch devices, drag from the grip handle (no long press). Swiping the rest of the row scrolls as usual. Keep `dragHandle` enabled on mobile. Desktop mouse drag is unchanged.
|
|
5
|
+
The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enableDrag` prop on SelectableList kit AND `dragId` prop on SelectableList.Item. An additional optional boolean prop (set to true by default) of `dragHandle` is also available on SelectableList kit to show the drag handle icon.
|
|
@@ -211,14 +211,6 @@ test("Attached draggable HTML attributes", () => {
|
|
|
211
211
|
expect(item).toHaveAttribute("draggable");
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
test("draggable items expose data-pb-drag-id for touch reordering", () => {
|
|
215
|
-
render(<DefaultDraggableKit />);
|
|
216
|
-
const kit = screen.getByTestId(testId);
|
|
217
|
-
|
|
218
|
-
const item = kit.querySelector(".pb_draggable_item");
|
|
219
|
-
expect(item).toHaveAttribute("data-pb-drag-id", "1");
|
|
220
|
-
});
|
|
221
|
-
|
|
222
214
|
test("generated dragHandle with List", () => {
|
|
223
215
|
render(<DraggableKitWithList />);
|
|
224
216
|
const kit = screen.getByTestId(testId);
|
|
@@ -310,14 +302,6 @@ const DraggableMultipleContainers = () => {
|
|
|
310
302
|
);
|
|
311
303
|
};
|
|
312
304
|
|
|
313
|
-
test("draggable containers expose data-pb-drag-container when provided", () => {
|
|
314
|
-
render(<DraggableMultipleContainers />);
|
|
315
|
-
const kit = screen.getByTestId(testId);
|
|
316
|
-
|
|
317
|
-
const container = kit.querySelector('[data-testid="container-To Do"]');
|
|
318
|
-
expect(container).toHaveAttribute("data-pb-drag-container", "To Do");
|
|
319
|
-
});
|
|
320
|
-
|
|
321
305
|
test("renders multiple containers with correct items", () => {
|
|
322
306
|
render(<DraggableMultipleContainers />);
|
|
323
307
|
|