playbook_ui 14.24.0 → 14.25.0.pre.alpha.testingcss9700
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_advanced_table/Components/RegularTableView.tsx +8 -2
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +34 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +56 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.jsx +57 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +10 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +2 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.html.erb +24 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.md +3 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date/_date.tsx +5 -3
- data/app/pb_kits/playbook/pb_date/date.html.erb +6 -6
- data/app/pb_kits/playbook/pb_date/date.rb +2 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dropdown/index.js +3 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +22 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +43 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +2 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +6 -0
- data/app/pb_kits/playbook/pb_pagination/_pagination.test.jsx +212 -0
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +8 -1
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +112 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +3 -0
- data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_pagination/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +11 -1
- data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +49 -1
- data/dist/chunks/_line_graph-DPTwfQR-.js +544 -0
- data/dist/chunks/_typeahead-CEqlHw0H.js +30978 -0
- data/dist/chunks/_weekday_stacked-D3dG14OB.js +20894 -0
- data/dist/chunks/lazysizes-BUUj27EF.js +611 -0
- data/dist/chunks/lib-CIetbXpr.js +9609 -0
- data/dist/chunks/pb_form_validation-D_g9rOE9.js +60 -0
- data/dist/chunks/vendor.js +11 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-doc.js +67243 -3
- data/dist/playbook-rails-react-bindings.js +112 -1
- data/dist/playbook-rails.js +2464 -1
- data/dist/playbook.css +92354 -2
- data/dist/reset.css +89 -1
- data/lib/playbook/version.rb +2 -2
- metadata +25 -8
- data/dist/chunks/_line_graph-BLS62QjW.js +0 -1
- data/dist/chunks/_typeahead-CZL6rvfn.js +0 -6
- data/dist/chunks/_weekday_stacked-Cv8-Sf6X.js +0 -37
- data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
- data/dist/chunks/lib-DgtxnJqa.js +0 -29
- data/dist/chunks/pb_form_validation-_NsOWfBS.js +0 -1
@@ -0,0 +1,60 @@
|
|
1
|
+
import { P as PbEnhancedElement, d as debounce } from "./lib-CIetbXpr.js";
|
2
|
+
const KIT_SELECTOR = '[class^="pb_"][class*="_kit"]';
|
3
|
+
const ERROR_MESSAGE_SELECTOR = ".pb_body_kit_negative";
|
4
|
+
const FORM_SELECTOR = 'form[data-pb-form-validation="true"]';
|
5
|
+
const REQUIRED_FIELDS_SELECTOR = "input[required],textarea[required],select[required]";
|
6
|
+
const FIELD_EVENTS = [
|
7
|
+
"change",
|
8
|
+
"valid",
|
9
|
+
"invalid"
|
10
|
+
];
|
11
|
+
class PbFormValidation extends PbEnhancedElement {
|
12
|
+
static get selector() {
|
13
|
+
return FORM_SELECTOR;
|
14
|
+
}
|
15
|
+
connect() {
|
16
|
+
this.formValidationFields.forEach((field) => {
|
17
|
+
FIELD_EVENTS.forEach((e) => {
|
18
|
+
field.addEventListener(e, debounce((event) => {
|
19
|
+
this.validateFormField(event);
|
20
|
+
}, 250), false);
|
21
|
+
});
|
22
|
+
});
|
23
|
+
}
|
24
|
+
validateFormField(event) {
|
25
|
+
event.preventDefault();
|
26
|
+
const { target } = event;
|
27
|
+
target.setCustomValidity("");
|
28
|
+
const isValid = event.target.validity.valid;
|
29
|
+
if (isValid) {
|
30
|
+
this.clearError(target);
|
31
|
+
} else {
|
32
|
+
this.showValidationMessage(target);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
showValidationMessage(target) {
|
36
|
+
const { parentElement } = target;
|
37
|
+
this.clearError(target);
|
38
|
+
parentElement.closest(KIT_SELECTOR).classList.add("error");
|
39
|
+
const errorMessageContainer = this.errorMessageContainer;
|
40
|
+
if (target.dataset.message) target.setCustomValidity(target.dataset.message);
|
41
|
+
errorMessageContainer.innerHTML = target.validationMessage;
|
42
|
+
parentElement.appendChild(errorMessageContainer);
|
43
|
+
}
|
44
|
+
clearError(target) {
|
45
|
+
const { parentElement } = target;
|
46
|
+
parentElement.closest(KIT_SELECTOR).classList.remove("error");
|
47
|
+
const errorMessageContainer = parentElement.querySelector(ERROR_MESSAGE_SELECTOR);
|
48
|
+
if (errorMessageContainer) errorMessageContainer.remove();
|
49
|
+
}
|
50
|
+
get errorMessageContainer() {
|
51
|
+
const errorContainer = document.createElement("div");
|
52
|
+
const kitClassName = ERROR_MESSAGE_SELECTOR.replace(/\./, "");
|
53
|
+
errorContainer.classList.add(kitClassName);
|
54
|
+
return errorContainer;
|
55
|
+
}
|
56
|
+
get formValidationFields() {
|
57
|
+
return this._formValidationFields = this._formValidationFields || this.element.querySelectorAll(REQUIRED_FIELDS_SELECTOR);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
window.PbFormValidation = PbFormValidation;
|
data/dist/chunks/vendor.js
CHANGED
@@ -1 +1,11 @@
|
|
1
|
-
import"./_weekday_stacked-
|
1
|
+
import "./_weekday_stacked-D3dG14OB.js";
|
2
|
+
import "./lazysizes-BUUj27EF.js";
|
3
|
+
import "./_typeahead-CEqlHw0H.js";
|
4
|
+
import "./_line_graph-DPTwfQR-.js";
|
5
|
+
import "./lib-CIetbXpr.js";
|
6
|
+
import "react/jsx-runtime";
|
7
|
+
import "react";
|
8
|
+
import "react-dom";
|
9
|
+
import "react-trix";
|
10
|
+
import "trix";
|
11
|
+
import "react-is";
|
data/dist/menu.yml
CHANGED
@@ -57,7 +57,7 @@ kits:
|
|
57
57
|
enhanced_element_used: true
|
58
58
|
- name: column_configuration
|
59
59
|
parent: advanced_table
|
60
|
-
kit_section: ["Column Visibility Control", "Column Visibility Control With State", "Column Visibility Control with Custom Dropdown", "Column Visibility Control with Multi-Header Columns", "Multi-Header Columns", "Multi-Header Columns (Multiple Levels)", "Multi-Header Columns with Custom Cells"]
|
60
|
+
kit_section: ["Column Visibility Control", "Column Visibility Control With State", "Column Visibility Control with Custom Dropdown", "Column Visibility Control with Multi-Header Columns", "Multi-Header Columns", "Multi-Header Columns (Multiple Levels)", "Multi-Header Columns with Custom Cells", "Multi-Header Columns with Vertical Borders"]
|
61
61
|
platforms: *1
|
62
62
|
status: stable
|
63
63
|
icons_used: true
|
@@ -81,7 +81,7 @@ kits:
|
|
81
81
|
enhanced_element_used: true
|
82
82
|
- name: styling
|
83
83
|
parent: advanced_table
|
84
|
-
kit_section: ["Collapsible Trail","Row Styling", "Column Styling", "Column Styling with Multiple Headers", "Column Group Border Color"]
|
84
|
+
kit_section: ["Collapsible Trail","Row Styling", "Padding Control using Row Styling", "Column Styling", "Column Styling with Multiple Headers", "Padding Control using Column Styling", "Column Group Border Color"]
|
85
85
|
platforms: *1
|
86
86
|
status: stable
|
87
87
|
icons_used: true
|