Skip to content

Commit

Permalink
Merge pull request #3488 from bettyblocks/acceptance
Browse files Browse the repository at this point in the history
Release to Master
  • Loading branch information
stefan-betty authored Oct 7, 2024
2 parents e1dbc82 + 9a2fbac commit 46d2691
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 3 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
# [2.192.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.191.2...v2.192.0) (2024-09-26)
# [2.193.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.192.0...v2.193.0) (2024-10-04)


### Bug Fixes

* **PAGE-4710:** Background image of box are now shown ([aa0a6a8](https://github.com/bettyblocks/material-ui-component-set/commit/aa0a6a8b22ced1e6585635901a0da80ceda2bbec))


### Features

* add option and interaction to set auto focus on input ([c56ef82](https://github.com/bettyblocks/material-ui-component-set/commit/c56ef82d5341cd4192f00bd18fcf9a451252bb21))
* added widget and update box position ([36cf8fe](https://github.com/bettyblocks/material-ui-component-set/commit/36cf8fe5eae281f755820a16b582d3d051bf1fe5))

# [2.192.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.191.2...v2.192.0) (2024-10-03)

### Bug Fixes

* **PAGE-4710:** Background image of box are now shown ([aa0a6a8](https://github.com/bettyblocks/material-ui-component-set/commit/aa0a6a8b22ced1e6585635901a0da80ceda2bbec))


### Features

* introduce sanofi and remove double entry for spc1 ([e5d6f80](https://github.com/bettyblocks/material-ui-component-set/commit/e5d6f8060c7ad1f4b497f800eafd2bcc717a89ca))
* add option and interaction to set auto focus on input ([c56ef82](https://github.com/bettyblocks/material-ui-component-set/commit/c56ef82d5341cd4192f00bd18fcf9a451252bb21))
* added widget and update box position ([36cf8fe](https://github.com/bettyblocks/material-ui-component-set/commit/36cf8fe5eae281f755820a16b582d3d051bf1fe5))

# [2.192.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.191.2...v2.192.0) (2024-10-03)


### Features

* add option and interaction to set auto focus on input ([c56ef82](https://github.com/bettyblocks/material-ui-component-set/commit/c56ef82d5341cd4192f00bd18fcf9a451252bb21))
* added widget and update box position ([36cf8fe](https://github.com/bettyblocks/material-ui-component-set/commit/36cf8fe5eae281f755820a16b582d3d051bf1fe5))

# [2.192.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.191.2...v2.192.0) (2024-10-01)


### Features

* added widget and update box position ([36cf8fe](https://github.com/bettyblocks/material-ui-component-set/commit/36cf8fe5eae281f755820a16b582d3d051bf1fe5))

## [2.191.2](https://github.com/bettyblocks/material-ui-component-set/compare/v2.191.1...v2.191.2) (2024-09-25)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "component-set",
"version": "2.192.0",
"version": "2.193.0",
"main": "dist/templates.json",
"license": "UNLICENSED",
"private": false,
Expand Down
10 changes: 10 additions & 0 deletions src/components/textinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
const {
actionVariableId: name,
autoComplete,
autoFocus,
disabled,
error,
label,
Expand Down Expand Up @@ -68,6 +69,7 @@
const parsedLabel = useText(label);
const labelText = parsedLabel;
const debouncedOnChangeRef = useRef(null);
const inputRef = useRef();

const { current: labelControlRef } = useRef(generateUUID());

Expand Down Expand Up @@ -209,10 +211,16 @@
handleValidation(validity);
};

const focusHandler = () =>
setTimeout(() => {
inputRef.current.focus();
}, 0);

B.defineFunction('Clear', () => setCurrentValue(''));
B.defineFunction('Enable', () => setIsDisabled(false));
B.defineFunction('Disable', () => setIsDisabled(true));
B.defineFunction('Reset', () => setCurrentValue(useText(value)));
B.defineFunction('Focus', () => focusHandler());

const handleClickShowPassword = () => {
togglePassword(!showPassword);
Expand Down Expand Up @@ -286,11 +294,13 @@
)}
<InputCmp
id={labelControlRef}
inputRef={inputRef}
name={name}
value={currentValue}
type={showPassword ? 'text' : inputType}
multiline={multiline}
autoComplete={autoComplete ? 'on' : 'off'}
autoFocus={!isDev && autoFocus}
rows={rows}
label={labelText}
placeholder={placeholderText}
Expand Down
21 changes: 21 additions & 0 deletions src/prefabs/emptyWidget.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {
prefab as makePrefab,
Icon,
wrapper,
} from '@betty-blocks/component-sdk';

const attrs = {
icon: Icon.ContainerIcon,
keywords: ['Empty', 'widget'],
category: 'LAYOUT',
};

export default makePrefab('Empty Widget', attrs, undefined, [
wrapper(
{
label: 'Empty widget',
options: {},
},
[],
),
]);
8 changes: 8 additions & 0 deletions src/prefabs/pageWithErrors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ const beforeCreate = ({
value: ['0rem', '0rem', 'M', '0rem'],
}),
);
setOption(
backgroundBox,
'backgroundType',
(opt: PrefabComponentOption) => ({
...opt,
value: 'url',
}),
);
setOption(
backgroundBox,
'backgroundUrl',
Expand Down
12 changes: 12 additions & 0 deletions src/prefabs/pageWithHomepageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,18 @@ export default makePrefab('Homepage, inspirational', attrs, beforeCreate, [
'https://assets.bettyblocks.com/63b1c6ccc6874e0796e5cc5b7e41b3da_assets/files/Homepage_banner_gradient',
],
}),
backgroundType: option('CUSTOM', {
label: 'Background type',
value: 'url',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Image', value: 'img' },
{ name: 'Data/URL', value: 'url' },
],
},
}),
},
},
[
Expand Down
12 changes: 12 additions & 0 deletions src/prefabs/pageWithLoginAndRegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,18 @@ export default makePrefab(
},
},
),
backgroundType: option('CUSTOM', {
label: 'Background type',
value: 'url',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Image', value: 'img' },
{ name: 'Data/URL', value: 'url' },
],
},
}),
backgroundUrl: variable('Background url', {
value: [
'https://assets.bettyblocks.com/7730f33d3a624ec6b5383b5dc26c79d6_assets/files/login-background.jpeg',
Expand Down
12 changes: 12 additions & 0 deletions src/prefabs/pageWithLoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,18 @@ const prefabStructure: PrefabComponent[] = [
backgroundOptions: toggle('Show background options', {
value: true,
}),
backgroundType: option('CUSTOM', {
label: 'Background type',
value: 'url',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Image', value: 'img' },
{ name: 'Data/URL', value: 'url' },
],
},
}),
backgroundUrl: variable('Background url', {
value: [
'https://assets.bettyblocks.com/1e9019bb1c5c4af2ba799c2ee1761af0_assets/files/login-background',
Expand Down
12 changes: 12 additions & 0 deletions src/prefabs/pageWithRegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,18 @@ export default makePrefab('User, account register only', attrs, beforeCreate, [
as: 'UNIT',
},
}),
backgroundType: option('CUSTOM', {
label: 'Background type',
value: 'url',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Image', value: 'img' },
{ name: 'Data/URL', value: 'url' },
],
},
}),
backgroundOptions: toggle('Show background options', {
value: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/prefabs/structures/Box/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const boxOptions = {
['Sticky', 'sticky'],
],
{
value: 'static',
value: 'relative',
configuration: {
dataType: 'string',
},
Expand Down
1 change: 1 addition & 0 deletions src/prefabs/structures/TextInput/options/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const validation = {
}),

autoComplete: toggle('Autocomplete', { value: false }),
autoFocus: toggle('Autofocus', { value: false }),
disabled: toggle('Disabled'),
placeholder: variable('Placeholder'),
helperText: variable('Helper text'),
Expand Down

0 comments on commit 46d2691

Please sign in to comment.