Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class="wpuf-items-center">
class="wpuf-block text-sm/6 wpuf-font-medium wpuf-text-gray-900 !wpuf-mb-0">
<input
type="radio"
:name="'radio_' + editing_form_field.id + '_' + option_field.name"
:value="key"
:name="option_field.name"
v-model="value"
Expand All @@ -32,7 +31,6 @@ class="wpuf-flex wpuf-items-center"
<label class="!wpuf-mb-0">
<input
type="radio"
:name="'radio_' + editing_form_field.id + '_' + option_field.name"
:value="key"
v-model="value"
:name="option_field.name"
Expand Down
122 changes: 122 additions & 0 deletions assets/css/admin/form-builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,18 @@ html {
--tw-text-opacity: 1;
color: var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)));
}

.wpuf-table tr.wpuf-hover:hover,
.wpuf-table tr.wpuf-hover:nth-child(even):hover {
--tw-bg-opacity: 1;
background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
}

.wpuf-table-zebra tr.wpuf-hover:hover,
.wpuf-table-zebra tr.wpuf-hover:nth-child(even):hover {
--tw-bg-opacity: 1;
background-color: var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));
}
}

.wpuf-btn {
Expand Down Expand Up @@ -1945,6 +1957,44 @@ input.wpuf-tab:checked + .wpuf-tab-content,
display: block;
}

.wpuf-table {
position: relative;
width: 100%;
border-radius: var(--rounded-box, 1rem);
text-align: left;
font-size: 0.875rem;
line-height: 1.25rem;
}

.wpuf-table :where(.wpuf-table-pin-rows thead tr) {
position: sticky;
top: 0px;
z-index: 1;
--tw-bg-opacity: 1;
background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
}

.wpuf-table :where(.wpuf-table-pin-rows tfoot tr) {
position: sticky;
bottom: 0px;
z-index: 1;
--tw-bg-opacity: 1;
background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
}

.wpuf-table :where(.wpuf-table-pin-cols tr th) {
position: sticky;
left: 0px;
right: 0px;
--tw-bg-opacity: 1;
background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
}

.wpuf-table-zebra tbody tr:nth-child(even) :where(.wpuf-table-pin-cols tr th) {
--tw-bg-opacity: 1;
background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
}
Comment on lines +1985 to +1996
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Pinned column rule likely broken (left and right set simultaneously) and excludes td.

Setting both left: 0 and right: 0 on sticky cells will stretch them and cause overlap; also only th is targeted (not td). Prefer logical properties and include both header/body cells. Add a stacking context for pinned cells.

Apply this diff:

-.wpuf-table :where(.wpuf-table-pin-cols tr th) {
-  position: sticky;
-  left: 0px;
-  right: 0px;
-  --tw-bg-opacity: 1;
-  background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
-}
+.wpuf-table :where(.wpuf-table-pin-cols tr :is(th, td)) {
+  position: sticky;
+  inset-inline-start: 0;
+  z-index: 1;
+  --tw-bg-opacity: 1;
+  background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
+}
 
-.wpuf-table-zebra tbody tr:nth-child(even) :where(.wpuf-table-pin-cols tr th) {
+.wpuf-table-zebra :where(.wpuf-table-pin-cols) tbody tr:nth-child(even) :is(th, td) {
   --tw-bg-opacity: 1;
   background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.wpuf-table :where(.wpuf-table-pin-cols tr th) {
position: sticky;
left: 0px;
right: 0px;
--tw-bg-opacity: 1;
background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
}
.wpuf-table-zebra tbody tr:nth-child(even) :where(.wpuf-table-pin-cols tr th) {
--tw-bg-opacity: 1;
background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
}
.wpuf-table :where(.wpuf-table-pin-cols tr :is(th, td)) {
position: sticky;
inset-inline-start: 0;
z-index: 1;
--tw-bg-opacity: 1;
background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
}
.wpuf-table-zebra :where(.wpuf-table-pin-cols) tbody tr:nth-child(even) :is(th, td) {
--tw-bg-opacity: 1;
background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
}
🤖 Prompt for AI Agents
In assets/css/admin/form-builder.css around lines 1985 to 1996, the
pinned-column rule sets both left:0 and right:0 (which stretches/stacks cells)
and only targets th, excluding td; change the rule to use logical
inset-inline-start (or left) only (remove right/right:auto), expand the selector
to include both th and td (e.g. :where(.wpuf-table-pin-cols tr th,
.wpuf-table-pin-cols tr td)), and add a stacking context (z-index and/or
transform: translateZ(0) or will-change) so pinned cells sit above other content
while preserving background color and opacity variables.


.wpuf-toggle {
flex-shrink: 0;
--tglbg: var(--fallback-b1,oklch(var(--b1)/1));
Expand Down Expand Up @@ -2775,6 +2825,18 @@ input.wpuf-tab:checked + .wpuf-tab-content,
color: var(--fallback-pc,oklch(var(--pc)/var(--tw-text-opacity)));
}

.wpuf-table:where([dir="rtl"], [dir="rtl"] *) {
text-align: right;
}

.wpuf-table :where(th, td) {
padding-left: 1rem;
padding-right: 1rem;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
vertical-align: middle;
}

.wpuf-table tr.wpuf-active,
.wpuf-table tr.wpuf-active:nth-child(even),
.wpuf-table-zebra tbody tr:nth-child(even) {
Expand All @@ -2789,6 +2851,26 @@ input.wpuf-tab:checked + .wpuf-tab-content,
background-color: var(--fallback-b3,oklch(var(--b3)/var(--tw-bg-opacity)));
}

.wpuf-table :where(thead tr, tbody tr:not(:last-child), tbody tr:first-child:last-child) {
border-bottom-width: 1px;
--tw-border-opacity: 1;
border-bottom-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));
}

.wpuf-table :where(thead, tfoot) {
white-space: nowrap;
font-size: 0.75rem;
line-height: 1rem;
font-weight: 700;
color: var(--fallback-bc,oklch(var(--bc)/0.6));
}

.wpuf-table :where(tfoot) {
border-top-width: 1px;
--tw-border-opacity: 1;
border-top-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-border-opacity)));
}

@keyframes toast-pop {
0% {
transform: scale(0.9);
Expand Down Expand Up @@ -2895,22 +2977,58 @@ input.wpuf-tab:checked + .wpuf-tab-content,
}
}

.wpuf-btm-nav-xs {
height: 2.5rem;
}

.wpuf-btm-nav-xs > *:where(.wpuf-active) {
border-top-width: 1px;
}

.wpuf-btm-nav-xs .wpuf-btm-nav-label {
font-size: 0.75rem;
line-height: 1rem;
}

.wpuf-btm-nav-sm {
height: 3rem;
}

.wpuf-btm-nav-sm > *:where(.wpuf-active) {
border-top-width: 2px;
}

.wpuf-btm-nav-sm .wpuf-btm-nav-label {
font-size: 0.75rem;
line-height: 1rem;
}

.wpuf-btm-nav-md {
height: 4rem;
}

.wpuf-btm-nav-md > *:where(.wpuf-active) {
border-top-width: 2px;
}

.wpuf-btm-nav-md .wpuf-btm-nav-label {
font-size: 0.875rem;
line-height: 1.25rem;
}

.wpuf-btm-nav-lg {
height: 5rem;
}

.wpuf-btm-nav-lg > *:where(.wpuf-active) {
border-top-width: 4px;
}

.wpuf-btm-nav-lg .wpuf-btm-nav-label {
font-size: 1rem;
line-height: 1.5rem;
}

.wpuf-join.wpuf-join-vertical {
flex-direction: column;
}
Expand Down Expand Up @@ -3960,6 +4078,10 @@ input.wpuf-tab:checked + .wpuf-tab-content,
display: inline-flex;
}

.wpuf-table {
display: table;
}

.wpuf-flow-root {
display: flow-root;
}
Expand Down
6 changes: 2 additions & 4 deletions assets/js-templates/form-components.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<label v-if="!is_invisible(field)" :for="'wpuf-' + field.name ? field.name : 'cls'">
{{ field.label }} <span v-if="field.required && 'yes' === field.required" class="required">*</span>
</label>
<span v-if="field.icon && field.show_icon === 'yes'"
<span v-if="field.icon && field.show_icon === 'yes'"
class="wpuf-field-label-icon wpuf-inline-flex wpuf-items-center wpuf-ml-2"
v-html="field.icon">
</span>
Expand Down Expand Up @@ -120,7 +120,7 @@ class="wpuf-block wpuf-text-sm wpuf-font-medium wpuf-leading-6 wpuf-text-gray-90
{{ field.label }} <span v-if="field.required && 'yes' === field.required"
class="required">*</span>
</label>
<span v-if="field.icon && field.show_icon === 'yes'"
<span v-if="field.icon && field.show_icon === 'yes'"
class="wpuf-field-label-icon wpuf-inline-flex wpuf-items-center wpuf-ml-2"
v-html="field.icon">
</span>
Expand Down Expand Up @@ -506,7 +506,6 @@ class="wpuf-items-center">
class="wpuf-block text-sm/6 wpuf-font-medium wpuf-text-gray-900 !wpuf-mb-0">
<input
type="radio"
:name="'radio_' + editing_form_field.id + '_' + option_field.name"
:value="key"
:name="option_field.name"
v-model="value"
Expand All @@ -523,7 +522,6 @@ class="wpuf-flex wpuf-items-center"
<label class="!wpuf-mb-0">
<input
type="radio"
:name="'radio_' + editing_form_field.id + '_' + option_field.name"
:value="key"
v-model="value"
:name="option_field.name"
Expand Down
Loading
Loading