CE-1887 - update some block attributes as needed for working-version of android mobile scan apps

This commit is contained in:
2024-10-31 11:22:56 -05:00
parent 45439d7596
commit 46e54ed8e3
23 changed files with 1698 additions and 132 deletions

View File

@ -40,6 +40,13 @@ public class CompositeWidgetData extends AbstractBlockWidgetData<CompositeWidget
{ {
private List<AbstractBlockWidgetData<?, ?, ?, ?>> blocks = new ArrayList<>(); private List<AbstractBlockWidgetData<?, ?, ?, ?>> blocks = new ArrayList<>();
private ModalMode modalMode;
public enum ModalMode
{
MODAL
}
private Layout layout; private Layout layout;
private Map<String, Serializable> styleOverrides = new HashMap<>(); private Map<String, Serializable> styleOverrides = new HashMap<>();
private String overlayHtml; private String overlayHtml;
@ -54,6 +61,7 @@ public class CompositeWidgetData extends AbstractBlockWidgetData<CompositeWidget
{ {
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
// note, these are used in QQQ FMD CompositeWidget.tsx // // note, these are used in QQQ FMD CompositeWidget.tsx //
// and qqq-android CompositeWidgetBlock.kt //
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
FLEX_COLUMN, FLEX_COLUMN,
FLEX_ROW_WRAPPED, FLEX_ROW_WRAPPED,
@ -307,4 +315,35 @@ public class CompositeWidgetData extends AbstractBlockWidgetData<CompositeWidget
this.overlayStyleOverrides.put(key, value); this.overlayStyleOverrides.put(key, value);
} }
/*******************************************************************************
** Getter for modalMode
*******************************************************************************/
public ModalMode getModalMode()
{
return (this.modalMode);
}
/*******************************************************************************
** Setter for modalMode
*******************************************************************************/
public void setModalMode(ModalMode modalMode)
{
this.modalMode = modalMode;
}
/*******************************************************************************
** Fluent setter for modalMode
*******************************************************************************/
public CompositeWidgetData withModalMode(ModalMode modalMode)
{
this.modalMode = modalMode;
return (this);
}
} }

View File

@ -30,4 +30,335 @@ import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockStyles
*******************************************************************************/ *******************************************************************************/
public class BaseStyles implements BlockStylesInterface public class BaseStyles implements BlockStylesInterface
{ {
private Directional<String> padding;
private String backgroundColor;
/***************************************************************************
**
***************************************************************************/
public static class Directional<T>
{
private T top;
private T bottom;
private T left;
private T right;
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public Directional()
{
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public Directional(T top, T right, T bottom, T left)
{
this.top = top;
this.right = right;
this.bottom = bottom;
this.left = left;
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> of(T top, T right, T bottom, T left)
{
return (new Directional<>(top, right, bottom, left));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> of(T value)
{
return (new Directional<>(value, value, value, value));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofTop(T top)
{
return (new Directional<>(top, null, null, null));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofRight(T right)
{
return (new Directional<>(null, right, null, null));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofBottom(T bottom)
{
return (new Directional<>(null, null, bottom, null));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofLeft(T left)
{
return (new Directional<>(null, null, null, left));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofX(T x)
{
return (new Directional<>(null, x, null, x));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofY(T y)
{
return (new Directional<>(y, null, y, null));
}
/***************************************************************************
**
***************************************************************************/
public static <T> Directional<T> ofXY(T x, T y)
{
return (new Directional<>(y, x, y, x));
}
/*******************************************************************************
** Getter for top
**
*******************************************************************************/
public T getTop()
{
return top;
}
/*******************************************************************************
** Setter for top
**
*******************************************************************************/
public void setTop(T top)
{
this.top = top;
}
/*******************************************************************************
** Fluent setter for top
**
*******************************************************************************/
public Directional<T> withTop(T top)
{
this.top = top;
return (this);
}
/*******************************************************************************
** Getter for bottom
**
*******************************************************************************/
public T getBottom()
{
return bottom;
}
/*******************************************************************************
** Setter for bottom
**
*******************************************************************************/
public void setBottom(T bottom)
{
this.bottom = bottom;
}
/*******************************************************************************
** Fluent setter for bottom
**
*******************************************************************************/
public Directional<T> withBottom(T bottom)
{
this.bottom = bottom;
return (this);
}
/*******************************************************************************
** Getter for left
**
*******************************************************************************/
public T getLeft()
{
return left;
}
/*******************************************************************************
** Setter for left
**
*******************************************************************************/
public void setLeft(T left)
{
this.left = left;
}
/*******************************************************************************
** Fluent setter for left
**
*******************************************************************************/
public Directional<T> withLeft(T left)
{
this.left = left;
return (this);
}
/*******************************************************************************
** Getter for right
**
*******************************************************************************/
public T getRight()
{
return right;
}
/*******************************************************************************
** Setter for right
**
*******************************************************************************/
public void setRight(T right)
{
this.right = right;
}
/*******************************************************************************
** Fluent setter for right
**
*******************************************************************************/
public Directional<T> withRight(T right)
{
this.right = right;
return (this);
}
}
/*******************************************************************************
** Getter for padding
*******************************************************************************/
public Directional<String> getPadding()
{
return (this.padding);
}
/*******************************************************************************
** Setter for padding
*******************************************************************************/
public void setPadding(Directional<String> padding)
{
this.padding = padding;
}
/*******************************************************************************
** Fluent setter for padding
*******************************************************************************/
public BaseStyles withPadding(Directional<String> padding)
{
this.padding = padding;
return (this);
}
/*******************************************************************************
** Getter for backgroundColor
*******************************************************************************/
public String getBackgroundColor()
{
return (this.backgroundColor);
}
/*******************************************************************************
** Setter for backgroundColor
*******************************************************************************/
public void setBackgroundColor(String backgroundColor)
{
this.backgroundColor = backgroundColor;
}
/*******************************************************************************
** Fluent setter for backgroundColor
*******************************************************************************/
public BaseStyles withBackgroundColor(String backgroundColor)
{
this.backgroundColor = backgroundColor;
return (this);
}
} }

View File

@ -19,20 +19,19 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.actionbutton; package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.AbstractBlockWidgetData; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.AbstractBlockWidgetData;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseSlots; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseSlots;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseStyles;
/******************************************************************************* /*******************************************************************************
** a button (for a process - not sure yet what this could do in a standalone ** a button (for a process - not sure yet what this could do in a standalone
** widget?) to submit the process screen to run a specific action (e.g., not just ** widget?) to submit the process screen to run a specific action (e.g., not just
** 'next') ** 'next'), or do other control-ish things
*******************************************************************************/ *******************************************************************************/
public class ActionButtonBlockData extends AbstractBlockWidgetData<ActionButtonBlockData, ActionButtonValues, BaseSlots, BaseStyles> public class ButtonBlockData extends AbstractBlockWidgetData<ButtonBlockData, ButtonValues, BaseSlots, ButtonStyles>
{ {
/******************************************************************************* /*******************************************************************************
@ -41,7 +40,7 @@ public class ActionButtonBlockData extends AbstractBlockWidgetData<ActionButtonB
@Override @Override
public String getBlockTypeName() public String getBlockTypeName()
{ {
return "ACTION_BUTTON"; return "BUTTON";
} }
} }

View File

@ -19,101 +19,124 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.actionbutton; package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockValuesInterface; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockStylesInterface;
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/
public class ActionButtonValues implements BlockValuesInterface public class ButtonStyles implements BlockStylesInterface
{ {
private String label; private String color;
private String actionCode; private String format;
/******************************************************************************* /***************************************************************************
** Constructor
** **
*******************************************************************************/ ***************************************************************************/
public ActionButtonValues() public enum StandardColor
{ {
SUCCESS,
WARNING,
ERROR,
INFO,
MUTED
} }
/******************************************************************************* /***************************************************************************
** Constructor
** **
*******************************************************************************/ ***************************************************************************/
public ActionButtonValues(String label, String actionCode) public enum StandardFormat
{ {
setLabel(label); OUTLINED,
setActionCode(actionCode); FILLED,
TEXT
} }
/******************************************************************************* /*******************************************************************************
** Getter for label ** Getter for color
*******************************************************************************/ *******************************************************************************/
public String getLabel() public String getColor()
{ {
return (this.label); return (this.color);
} }
/******************************************************************************* /*******************************************************************************
** Setter for label ** Setter for color
*******************************************************************************/ *******************************************************************************/
public void setLabel(String label) public void setColor(String color)
{ {
this.label = label; this.color = color;
} }
/******************************************************************************* /*******************************************************************************
** Fluent setter for label ** Fluent setter for color
*******************************************************************************/ *******************************************************************************/
public ActionButtonValues withLabel(String label) public ButtonStyles withColor(String color)
{ {
this.label = label; this.color = color;
return (this); return (this);
} }
/******************************************************************************* /*******************************************************************************
** Getter for actionCode ** Getter for format
*******************************************************************************/ *******************************************************************************/
public String getActionCode() public String getFormat()
{ {
return (this.actionCode); return (this.format);
} }
/******************************************************************************* /*******************************************************************************
** Setter for actionCode ** Setter for format
*******************************************************************************/ *******************************************************************************/
public void setActionCode(String actionCode) public void setFormat(String format)
{ {
this.actionCode = actionCode; this.format = format;
} }
/******************************************************************************* /*******************************************************************************
** Fluent setter for actionCode ** Fluent setter for format
*******************************************************************************/ *******************************************************************************/
public ActionButtonValues withActionCode(String actionCode) public ButtonStyles withFormat(String format)
{ {
this.actionCode = actionCode; this.format = format;
return (this);
}
/*******************************************************************************
** Setter for format
*******************************************************************************/
public void setFormat(StandardFormat format)
{
this.format = (format == null ? null : format.name().toLowerCase());
}
/*******************************************************************************
** Fluent setter for format
*******************************************************************************/
public ButtonStyles withFormat(StandardFormat format)
{
setFormat(format);
return (this); return (this);
} }

View File

@ -0,0 +1,218 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockValuesInterface;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
/*******************************************************************************
**
*******************************************************************************/
public class ButtonValues implements BlockValuesInterface
{
private String label;
private String actionCode;
private String controlCode;
private QIcon startIcon;
private QIcon endIcon;
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public ButtonValues()
{
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public ButtonValues(String label, String actionCode)
{
setLabel(label);
setActionCode(actionCode);
}
/*******************************************************************************
** Getter for label
*******************************************************************************/
public String getLabel()
{
return (this.label);
}
/*******************************************************************************
** Setter for label
*******************************************************************************/
public void setLabel(String label)
{
this.label = label;
}
/*******************************************************************************
** Fluent setter for label
*******************************************************************************/
public ButtonValues withLabel(String label)
{
this.label = label;
return (this);
}
/*******************************************************************************
** Getter for actionCode
*******************************************************************************/
public String getActionCode()
{
return (this.actionCode);
}
/*******************************************************************************
** Setter for actionCode
*******************************************************************************/
public void setActionCode(String actionCode)
{
this.actionCode = actionCode;
}
/*******************************************************************************
** Fluent setter for actionCode
*******************************************************************************/
public ButtonValues withActionCode(String actionCode)
{
this.actionCode = actionCode;
return (this);
}
/*******************************************************************************
** Getter for startIcon
*******************************************************************************/
public QIcon getStartIcon()
{
return (this.startIcon);
}
/*******************************************************************************
** Setter for startIcon
*******************************************************************************/
public void setStartIcon(QIcon startIcon)
{
this.startIcon = startIcon;
}
/*******************************************************************************
** Fluent setter for startIcon
*******************************************************************************/
public ButtonValues withStartIcon(QIcon startIcon)
{
this.startIcon = startIcon;
return (this);
}
/*******************************************************************************
** Getter for endIcon
*******************************************************************************/
public QIcon getEndIcon()
{
return (this.endIcon);
}
/*******************************************************************************
** Setter for endIcon
*******************************************************************************/
public void setEndIcon(QIcon endIcon)
{
this.endIcon = endIcon;
}
/*******************************************************************************
** Fluent setter for endIcon
*******************************************************************************/
public ButtonValues withEndIcon(QIcon endIcon)
{
this.endIcon = endIcon;
return (this);
}
/*******************************************************************************
** Getter for controlCode
*******************************************************************************/
public String getControlCode()
{
return (this.controlCode);
}
/*******************************************************************************
** Setter for controlCode
*******************************************************************************/
public void setControlCode(String controlCode)
{
this.controlCode = controlCode;
}
/*******************************************************************************
** Fluent setter for controlCode
*******************************************************************************/
public ButtonValues withControlCode(String controlCode)
{
this.controlCode = controlCode;
return (this);
}
}

View File

@ -22,51 +22,29 @@
package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.image; package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.image;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockStylesInterface; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseStyles;
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/
public class ImageStyles implements BlockStylesInterface public class ImageStyles extends BaseStyles
{ {
private String width; private String width;
private String height; private String height;
private boolean bordered = false;
/******************************************************************************* /*******************************************************************************
** Getter for bordered ** Fluent setter for padding
*******************************************************************************/ *******************************************************************************/
public boolean getBordered() @Override
public ImageStyles withPadding(Directional<String> padding)
{ {
return (this.bordered); super.setPadding(padding);
}
/*******************************************************************************
** Setter for bordered
*******************************************************************************/
public void setBordered(boolean bordered)
{
this.bordered = bordered;
}
/*******************************************************************************
** Fluent setter for bordered
*******************************************************************************/
public ImageStyles withBordered(boolean bordered)
{
this.bordered = bordered;
return (this); return (this);
} }
/******************************************************************************* /*******************************************************************************
** Getter for width ** Getter for width
*******************************************************************************/ *******************************************************************************/

View File

@ -32,8 +32,11 @@ import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
public class InputFieldValues implements BlockValuesInterface public class InputFieldValues implements BlockValuesInterface
{ {
private QFieldMetaData fieldMetaData; private QFieldMetaData fieldMetaData;
private Boolean autoFocus; private Boolean autoFocus;
private Boolean submitOnEnter; private Boolean submitOnEnter;
private Boolean hideSoftKeyboard;
private String placeholder;
@ -149,4 +152,66 @@ public class InputFieldValues implements BlockValuesInterface
return (this); return (this);
} }
/*******************************************************************************
** Getter for placeholder
*******************************************************************************/
public String getPlaceholder()
{
return (this.placeholder);
}
/*******************************************************************************
** Setter for placeholder
*******************************************************************************/
public void setPlaceholder(String placeholder)
{
this.placeholder = placeholder;
}
/*******************************************************************************
** Fluent setter for placeholder
*******************************************************************************/
public InputFieldValues withPlaceholder(String placeholder)
{
this.placeholder = placeholder;
return (this);
}
/*******************************************************************************
** Getter for hideSoftKeyboard
*******************************************************************************/
public Boolean getHideSoftKeyboard()
{
return (this.hideSoftKeyboard);
}
/*******************************************************************************
** Setter for hideSoftKeyboard
*******************************************************************************/
public void setHideSoftKeyboard(Boolean hideSoftKeyboard)
{
this.hideSoftKeyboard = hideSoftKeyboard;
}
/*******************************************************************************
** Fluent setter for hideSoftKeyboard
*******************************************************************************/
public InputFieldValues withHideSoftKeyboard(Boolean hideSoftKeyboard)
{
this.hideSoftKeyboard = hideSoftKeyboard;
return (this);
}
} }

View File

@ -30,9 +30,10 @@ import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockStyles
*******************************************************************************/ *******************************************************************************/
public class TextStyles implements BlockStylesInterface public class TextStyles implements BlockStylesInterface
{ {
private StandardColor standardColor; private String color;
private String format;
private boolean isAlert; private String weight;
private String size;
@ -50,6 +51,81 @@ public class TextStyles implements BlockStylesInterface
/***************************************************************************
**
***************************************************************************/
public enum StandardFormat
{
DEFAULT,
ALERT,
BANNER
}
/***************************************************************************
**
***************************************************************************/
public enum StandardSize
{
LARGEST,
HEADLINE,
TITLE,
BODY,
SMALLEST
}
/***************************************************************************
**
***************************************************************************/
public enum StandardWeight
{
EXTRA_LIGHT("extralight"),
THIN("thin"),
MEDIUM("medium"),
SEMI_BOLD("semibold"),
BLACK("black"),
BOLD("bold"),
EXTRA_BOLD("extrabold"),
W100("100"),
W200("200"),
W300("300"),
W400("400"),
W500("500"),
W600("600"),
W700("700"),
W800("800"),
W900("900");
private final String value;
/*******************************************************************************
** Constructor
**
*******************************************************************************/
StandardWeight(String value)
{
this.value = value;
}
/*******************************************************************************
** Getter for value
**
*******************************************************************************/
public String getValue()
{
return value;
}
}
/******************************************************************************* /*******************************************************************************
** Constructor ** Constructor
** **
@ -65,69 +141,214 @@ public class TextStyles implements BlockStylesInterface
***************************************************************************/ ***************************************************************************/
public TextStyles(StandardColor standardColor) public TextStyles(StandardColor standardColor)
{ {
setStandardColor(standardColor); setColor(standardColor);
} }
/******************************************************************************* /*******************************************************************************
** Getter for standardColor ** Getter for format
*******************************************************************************/ *******************************************************************************/
public StandardColor getStandardColor() public String getFormat()
{ {
return (this.standardColor); return (this.format);
} }
/******************************************************************************* /*******************************************************************************
** Setter for standardColor ** Setter for format
*******************************************************************************/ *******************************************************************************/
public void setStandardColor(StandardColor standardColor) public void setFormat(String format)
{ {
this.standardColor = standardColor; this.format = format;
} }
/******************************************************************************* /*******************************************************************************
** Fluent setter for standardColor ** Fluent setter for format
*******************************************************************************/ *******************************************************************************/
public TextStyles withStandardColor(StandardColor standardColor) public TextStyles withFormat(String format)
{ {
this.standardColor = standardColor; this.format = format;
return (this);
}
/*******************************************************************************
** Setter for format
*******************************************************************************/
public void setFormat(StandardFormat format)
{
this.format = format == null ? null : format.name().toLowerCase();
}
/*******************************************************************************
** Fluent setter for format
*******************************************************************************/
public TextStyles withFormat(StandardFormat format)
{
this.setFormat(format);
return (this);
}
/*******************************************************************************
** Getter for weight
*******************************************************************************/
public String getWeight()
{
return (this.weight);
}
/*******************************************************************************
** Setter for weight
*******************************************************************************/
public void setWeight(String weight)
{
this.weight = weight;
}
/*******************************************************************************
** Fluent setter for weight
*******************************************************************************/
public TextStyles withWeight(String weight)
{
this.weight = weight;
return (this);
}
/*******************************************************************************
** Setter for weight
*******************************************************************************/
public void setWeight(StandardWeight weight)
{
setWeight(weight == null ? null : weight.getValue());
}
/*******************************************************************************
** Fluent setter for weight
*******************************************************************************/
public TextStyles withWeight(StandardWeight weight)
{
setWeight(weight);
return (this);
}
/*******************************************************************************
** Getter for size
*******************************************************************************/
public String getSize()
{
return (this.size);
}
/*******************************************************************************
** Setter for size
*******************************************************************************/
public void setSize(String size)
{
this.size = size;
}
/*******************************************************************************
** Fluent setter for size
*******************************************************************************/
public TextStyles withSize(String size)
{
this.size = size;
return (this); return (this);
} }
/******************************************************************************* /*******************************************************************************
** Getter for isAlert ** Setter for size
*******************************************************************************/ *******************************************************************************/
public boolean getIsAlert() public void setSize(StandardSize size)
{ {
return (this.isAlert); this.size = (size == null ? null : size.name().toLowerCase());
} }
/******************************************************************************* /*******************************************************************************
** Setter for isAlert ** Fluent setter for size
*******************************************************************************/ *******************************************************************************/
public void setIsAlert(boolean isAlert) public TextStyles withSize(StandardSize size)
{ {
this.isAlert = isAlert; setSize(size);
}
/*******************************************************************************
** Fluent setter for isAlert
*******************************************************************************/
public TextStyles withIsAlert(boolean isAlert)
{
this.isAlert = isAlert;
return (this); return (this);
} }
/*******************************************************************************
** Getter for color
*******************************************************************************/
public String getColor()
{
return (this.color);
}
/*******************************************************************************
** Setter for color
*******************************************************************************/
public void setColor(String color)
{
this.color = color;
}
/*******************************************************************************
** Fluent setter for color
*******************************************************************************/
public TextStyles withColor(String color)
{
this.color = color;
return (this);
}
/*******************************************************************************
** Setter for color
*******************************************************************************/
public void setColor(StandardColor color)
{
this.color = color == null ? null : color.name();
}
/*******************************************************************************
** Fluent setter for color
*******************************************************************************/
public TextStyles withColor(StandardColor color)
{
setColor(color);
return (this);
}
} }

View File

@ -23,6 +23,7 @@ package com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockValuesInterface; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockValuesInterface;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
/******************************************************************************* /*******************************************************************************
@ -32,6 +33,9 @@ public class TextValues implements BlockValuesInterface
{ {
private String text; private String text;
private QIcon startIcon;
private QIcon endIcon;
/******************************************************************************* /*******************************************************************************
@ -84,4 +88,66 @@ public class TextValues implements BlockValuesInterface
return (this); return (this);
} }
/*******************************************************************************
** Getter for startIcon
*******************************************************************************/
public QIcon getStartIcon()
{
return (this.startIcon);
}
/*******************************************************************************
** Setter for startIcon
*******************************************************************************/
public void setStartIcon(QIcon startIcon)
{
this.startIcon = startIcon;
}
/*******************************************************************************
** Fluent setter for startIcon
*******************************************************************************/
public TextValues withStartIcon(QIcon startIcon)
{
this.startIcon = startIcon;
return (this);
}
/*******************************************************************************
** Getter for endIcon
*******************************************************************************/
public QIcon getEndIcon()
{
return (this.endIcon);
}
/*******************************************************************************
** Setter for endIcon
*******************************************************************************/
public void setEndIcon(QIcon endIcon)
{
this.endIcon = endIcon;
}
/*******************************************************************************
** Fluent setter for endIcon
*******************************************************************************/
public TextValues withEndIcon(QIcon endIcon)
{
this.endIcon = endIcon;
return (this);
}
} }

View File

@ -47,6 +47,8 @@ public class QFrontendStepMetaData extends QStepMetaData
private List<QFieldMetaData> recordListFields; private List<QFieldMetaData> recordListFields;
private Map<String, QFieldMetaData> formFieldMap; private Map<String, QFieldMetaData> formFieldMap;
private String format;
private List<QHelpContent> helpContents; private List<QHelpContent> helpContents;
@ -403,4 +405,35 @@ public class QFrontendStepMetaData extends QStepMetaData
QInstanceHelpContentManager.removeHelpContentByRoleSetFromList(roles, this.helpContents); QInstanceHelpContentManager.removeHelpContentByRoleSetFromList(roles, this.helpContents);
} }
/*******************************************************************************
** Getter for format
*******************************************************************************/
public String getFormat()
{
return (this.format);
}
/*******************************************************************************
** Setter for format
*******************************************************************************/
public void setFormat(String format)
{
this.format = format;
}
/*******************************************************************************
** Fluent setter for format
*******************************************************************************/
public QFrontendStepMetaData withFormat(String format)
{
this.format = format;
return (this);
}
} }

View File

@ -84,6 +84,17 @@ public class FrontendStep implements ToSchema
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional indicator of the screen format preferred by the application to be used for this screen. Different frontends may support different formats, and implement them differently.")
public String getFormat()
{
return (this.wrapped.getFormat());
}
/*************************************************************************** /***************************************************************************
** **
***************************************************************************/ ***************************************************************************/

View File

@ -75,7 +75,7 @@ public class WidgetBlock implements Serializable, ToSchema
***************************************************************************/ ***************************************************************************/
public enum BlockType public enum BlockType
{ {
ACTION_BUTTON, BUTTON,
AUDIO, AUDIO,
BIG_NUMBER, BIG_NUMBER,
COMPOSITE, COMPOSITE,
@ -159,6 +159,22 @@ public class WidgetBlock implements Serializable, ToSchema
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("For COMPOSITE type blocks, optional control to make the widget appear modally")
public CompositeWidgetData.ModalMode getModalMode()
{
if(this.wrapped instanceof CompositeWidgetData compositeWidgetData)
{
return (compositeWidgetData.getModalMode());
}
return (null);
}
/*************************************************************************** /***************************************************************************
** **
***************************************************************************/ ***************************************************************************/

View File

@ -0,0 +1,92 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.audio.AudioValues;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
/*******************************************************************************
**
*******************************************************************************/
@OpenAPIDescription("Values used for an AUDIO type widget block")
public final class WidgetBlockAudioValues implements WidgetBlockValues
{
@OpenAPIExclude()
private AudioValues wrapped;
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockAudioValues(AudioValues textValues)
{
this.wrapped = textValues;
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockAudioValues()
{
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("The path to the audio file on the server")
public String getPath()
{
return (this.wrapped.getPath());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("Control if the file should automatically play when the block is rendered")
public Boolean getAutoPlay()
{
return (this.wrapped.getAutoPlay());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("Control if on-screen controls should be shown to allow the user to control playback")
public Boolean getShowControls()
{
return (this.wrapped.getShowControls());
}
}

View File

@ -22,7 +22,7 @@
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components; package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.actionbutton.ActionButtonValues; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseStyles;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription; import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude; import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
@ -30,21 +30,19 @@ import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExc
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/
@OpenAPIDescription("Values used for an ACTION_BUTTON type widget block") public final class WidgetBlockBaseStyles implements WidgetBlockStyles
public final class WidgetBlockActionButtonValues implements WidgetBlockValues
{ {
@OpenAPIExclude() @OpenAPIExclude()
private ActionButtonValues wrapped; private BaseStyles wrapped;
/******************************************************************************* /***************************************************************************
** Constructor
** **
*******************************************************************************/ ***************************************************************************/
public WidgetBlockActionButtonValues(ActionButtonValues actionButtonValues) public WidgetBlockBaseStyles(BaseStyles baseStyles)
{ {
this.wrapped = actionButtonValues; this.wrapped = baseStyles;
} }
@ -53,7 +51,7 @@ public final class WidgetBlockActionButtonValues implements WidgetBlockValues
** Constructor ** Constructor
** **
*******************************************************************************/ *******************************************************************************/
public WidgetBlockActionButtonValues() public WidgetBlockBaseStyles()
{ {
} }
@ -62,21 +60,20 @@ public final class WidgetBlockActionButtonValues implements WidgetBlockValues
/*************************************************************************** /***************************************************************************
** **
***************************************************************************/ ***************************************************************************/
@OpenAPIDescription("User-facing label to display in the button") @OpenAPIDescription("Optional padding to apply to the block")
public String getLabel() public BaseStyles.Directional<String> getPadding()
{ {
return (this.wrapped.getLabel()); return (this.wrapped.getPadding());
} }
/*************************************************************************** /***************************************************************************
** **
***************************************************************************/ ***************************************************************************/
@OpenAPIDescription("Code used within the app as the value submitted when the button is clicked") @OpenAPIDescription("A background color to use for the block")
public String getActionCode() public String getBackgroundColor()
{ {
return (this.wrapped.getActionCode()); return (this.wrapped.getBackgroundColor());
} }
} }

View File

@ -0,0 +1,84 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button.ButtonStyles;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
/*******************************************************************************
**
*******************************************************************************/
public final class WidgetBlockButtonStyles implements WidgetBlockStyles
{
@OpenAPIExclude()
private ButtonStyles wrapped;
/***************************************************************************
**
***************************************************************************/
public WidgetBlockButtonStyles(ButtonStyles buttonStyles)
{
this.wrapped = buttonStyles;
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockButtonStyles()
{
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("A Color to use for the button. May be specified as a StandardColor (one of: "
+ "SUCCESS, WARNING, ERROR, INFO, MUTED) or an RGB code.")
public String getColor()
{
return (this.wrapped.getColor());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional indicator of the screen format preferred by the application to be used for this block, "
+ "such as OUTLINED, FILLED, or TEXT. Different frontends may support different formats, and implement them differently.")
public String getFormat()
{
return (this.wrapped.getFormat());
}
}

View File

@ -0,0 +1,123 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button.ButtonValues;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
/*******************************************************************************
**
*******************************************************************************/
@OpenAPIDescription("Values used for a BUTTON type widget block")
public final class WidgetBlockButtonValues implements WidgetBlockValues
{
@OpenAPIExclude()
private ButtonValues wrapped;
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockButtonValues(ButtonValues buttonValues)
{
this.wrapped = buttonValues;
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockButtonValues()
{
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("User-facing label to display in the button")
public String getLabel()
{
return (this.wrapped.getLabel());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("Code used within the app as the value submitted when the button is clicked")
public String getActionCode()
{
return (this.wrapped.getActionCode());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("""
Instructions for what should happen in the frontend (e.g., within a screen), when the button is clicked.
To show a modal composite block, use format: `showModal:${blockId}` (e.g., `showModal:myBlock`)
To hide a modal composite block, use format: `hideModal:${blockId}` (e.g., `hideModal:myBlock`)
To toggle visibility of a modal composite block, use format: `toggleModal:${blockId}` (e.g., `toggleModal:myBlock`)
""")
public String getControlCode()
{
return (this.wrapped.getControlCode());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional icon to display before the text in the button")
public Icon getStartIcon()
{
return (this.wrapped.getStartIcon() == null ? null : new Icon(this.wrapped.getStartIcon()));
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional icon to display after the text in the button")
public Icon getEndIcon()
{
return (this.wrapped.getEndIcon() == null ? null : new Icon(this.wrapped.getEndIcon()));
}
}

View File

@ -0,0 +1,92 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseStyles;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.image.ImageStyles;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
/*******************************************************************************
**
*******************************************************************************/
public final class WidgetBlockImageStyles implements WidgetBlockStyles
{
@OpenAPIExclude()
private ImageStyles wrapped;
/***************************************************************************
**
***************************************************************************/
public WidgetBlockImageStyles(ImageStyles imageStyles)
{
this.wrapped = imageStyles;
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockImageStyles()
{
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("A request to render the image at a specified width.")
public String getWidth()
{
return (this.wrapped.getWidth());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("A request to render the image at a specified height.")
public String getHeight()
{
return (this.wrapped.getHeight());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("Optional padding to apply to the image")
public BaseStyles.Directional<String> getPadding()
{
return (this.wrapped.getPadding());
}
}

View File

@ -0,0 +1,71 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.image.ImageValues;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIDescription;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
/*******************************************************************************
**
*******************************************************************************/
@OpenAPIDescription("Values used for an IMAGE type widget block")
public final class WidgetBlockImageValues implements WidgetBlockValues
{
@OpenAPIExclude()
private ImageValues wrapped;
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockImageValues(ImageValues textValues)
{
this.wrapped = textValues;
}
/*******************************************************************************
** Constructor
**
*******************************************************************************/
public WidgetBlockImageValues()
{
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("The path to the image on the server")
public String getPath()
{
return (this.wrapped.getPath());
}
}

View File

@ -90,4 +90,26 @@ public final class WidgetBlockInputFieldValues implements WidgetBlockValues
return (this.wrapped.getSubmitOnEnter()); return (this.wrapped.getSubmitOnEnter());
} }
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("Indicate if the frontend uses a software/on-screen keyboard, if the application should try to hide it (e.g., upon auto-focus).")
public Boolean getHideSoftKeyboard()
{
return (this.wrapped.getHideSoftKeyboard());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("Optional placeholder text to display in the input box.")
public String getPlaceholder()
{
return (this.wrapped.getPlaceholder());
}
} }

View File

@ -24,6 +24,9 @@ package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.logging.QLogger; import com.kingsrook.qqq.backend.core.logging.QLogger;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockStylesInterface; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockStylesInterface;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.base.BaseStyles;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button.ButtonStyles;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.image.ImageStyles;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextStyles; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextStyles;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.ToSchema; import com.kingsrook.qqq.middleware.javalin.schemabuilder.ToSchema;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude; import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExclude;
@ -33,6 +36,9 @@ import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExc
** **
*******************************************************************************/ *******************************************************************************/
public sealed interface WidgetBlockStyles extends ToSchema permits public sealed interface WidgetBlockStyles extends ToSchema permits
WidgetBlockBaseStyles,
WidgetBlockButtonStyles,
WidgetBlockImageStyles,
WidgetBlockTextStyles WidgetBlockTextStyles
{ {
@OpenAPIExclude @OpenAPIExclude
@ -49,10 +55,25 @@ public sealed interface WidgetBlockStyles extends ToSchema permits
return (null); return (null);
} }
if(blockStyles instanceof TextStyles s) if(blockStyles instanceof ButtonStyles s)
{
return (new WidgetBlockButtonStyles(s));
}
else if(blockStyles instanceof ImageStyles s)
{
return (new WidgetBlockImageStyles(s));
}
else if(blockStyles instanceof TextStyles s)
{ {
return (new WidgetBlockTextStyles(s)); return (new WidgetBlockTextStyles(s));
} }
//////////////////////////////////////////////////////////////////////////////////////////////
// note - important for this one to be last, since it's a base class to some of the above!! //
//////////////////////////////////////////////////////////////////////////////////////////////
else if(blockStyles instanceof BaseStyles s)
{
return (new WidgetBlockBaseStyles(s));
}
LOG.warn("Unrecognized block value type: " + blockStyles.getClass().getName()); LOG.warn("Unrecognized block value type: " + blockStyles.getClass().getName());
return (null); return (null);

View File

@ -45,6 +45,8 @@ public final class WidgetBlockTextStyles implements WidgetBlockStyles
this.wrapped = textStyles; this.wrapped = textStyles;
} }
/******************************************************************************* /*******************************************************************************
** Constructor ** Constructor
** **
@ -54,23 +56,51 @@ public final class WidgetBlockTextStyles implements WidgetBlockStyles
} }
/*************************************************************************** /***************************************************************************
** **
***************************************************************************/ ***************************************************************************/
@OpenAPIDescription("Indicate if the text should be displayed as an alert (e.g., modal popup)") @OpenAPIDescription("A Color to display the text in. May be specified as a StandardColor (one of: "
public Boolean getIsAlert() + "SUCCESS, WARNING, ERROR, INFO, MUTED) or an RGB code.")
public String getColor()
{ {
return (this.wrapped.getIsAlert()); return (this.wrapped.getColor());
} }
/*************************************************************************** /***************************************************************************
** **
***************************************************************************/ ***************************************************************************/
@OpenAPIDescription("A Standard Color to display the text in (e.g., not a hex or RGB code).") @OpenAPIDescription("An optional indicator of the screen format preferred by the application to be used for this block. "
public TextStyles.StandardColor getStandardColor() + "Different frontends may support different formats, and implement them differently.")
public String getFormat()
{ {
return (this.wrapped.getStandardColor()); return (this.wrapped.getFormat());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional indicator of the weight at which the text should be rendered. May be a named value (one of"
+ "extralight, thin, medium, black, semibold, bold, extrabold) or a numeric, e.g., 100, 200, ..., 900")
public String getWeight()
{
return (this.wrapped.getWeight());
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional indicator of the size at which the text should be rendered. May be a named value (one of"
+ "largest, headline, title, body, smallest) or a numeric size - both are up to the frontend to interpret.")
public String getSize()
{
return (this.wrapped.getSize());
} }
} }

View File

@ -68,4 +68,26 @@ public final class WidgetBlockTextValues implements WidgetBlockValues
return (this.wrapped.getText()); return (this.wrapped.getText());
} }
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional icon to display before the text")
public Icon getStartIcon()
{
return (this.wrapped.getStartIcon() == null ? null : new Icon(this.wrapped.getStartIcon()));
}
/***************************************************************************
**
***************************************************************************/
@OpenAPIDescription("An optional icon to display after the text")
public Icon getEndIcon()
{
return (this.wrapped.getEndIcon() == null ? null : new Icon(this.wrapped.getEndIcon()));
}
} }

View File

@ -24,7 +24,9 @@ package com.kingsrook.qqq.middleware.javalin.specs.v1.responses.components;
import com.kingsrook.qqq.backend.core.logging.QLogger; import com.kingsrook.qqq.backend.core.logging.QLogger;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockValuesInterface; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.BlockValuesInterface;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.actionbutton.ActionButtonValues; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.audio.AudioValues;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.button.ButtonValues;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.image.ImageValues;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.inputfield.InputFieldValues; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.inputfield.InputFieldValues;
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextValues; import com.kingsrook.qqq.backend.core.model.dashboard.widgets.blocks.text.TextValues;
import com.kingsrook.qqq.middleware.javalin.schemabuilder.ToSchema; import com.kingsrook.qqq.middleware.javalin.schemabuilder.ToSchema;
@ -35,9 +37,11 @@ import com.kingsrook.qqq.middleware.javalin.schemabuilder.annotations.OpenAPIExc
** **
*******************************************************************************/ *******************************************************************************/
public sealed interface WidgetBlockValues extends ToSchema permits public sealed interface WidgetBlockValues extends ToSchema permits
WidgetBlockActionButtonValues, WidgetBlockAudioValues,
WidgetBlockTextValues, WidgetBlockButtonValues,
WidgetBlockInputFieldValues WidgetBlockImageValues,
WidgetBlockInputFieldValues,
WidgetBlockTextValues
{ {
@OpenAPIExclude @OpenAPIExclude
QLogger LOG = QLogger.getLogger(WidgetBlockValues.class); QLogger LOG = QLogger.getLogger(WidgetBlockValues.class);
@ -53,17 +57,25 @@ public sealed interface WidgetBlockValues extends ToSchema permits
return (null); return (null);
} }
if(blockValues instanceof TextValues v) if(blockValues instanceof AudioValues v)
{ {
return (new WidgetBlockTextValues(v)); return (new WidgetBlockAudioValues(v));
}
else if(blockValues instanceof ButtonValues v)
{
return (new WidgetBlockButtonValues(v));
}
else if(blockValues instanceof ImageValues v)
{
return (new WidgetBlockImageValues(v));
} }
else if(blockValues instanceof InputFieldValues v) else if(blockValues instanceof InputFieldValues v)
{ {
return (new WidgetBlockInputFieldValues(v)); return (new WidgetBlockInputFieldValues(v));
} }
else if(blockValues instanceof ActionButtonValues v) else if(blockValues instanceof TextValues v)
{ {
return (new WidgetBlockActionButtonValues(v)); return (new WidgetBlockTextValues(v));
} }
LOG.warn("Unrecognized block value type: " + blockValues.getClass().getName()); LOG.warn("Unrecognized block value type: " + blockValues.getClass().getName());