Skip to content

Commit

Permalink
feat: split up dateTimePicker to 3 prefabs, with correct options
Browse files Browse the repository at this point in the history
  • Loading branch information
SH0PK33P3R committed Sep 16, 2020
1 parent c52e5b5 commit 98ec4e5
Show file tree
Hide file tree
Showing 3 changed files with 689 additions and 38 deletions.
341 changes: 341 additions & 0 deletions src/prefabs/datePicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,341 @@
(() => ({
name: 'DatePicker',
icon: 'DatePickerIcon',
category: 'FORM',
structure: [
{
name: 'DateTimePicker',
options: [
{
value: '',
label: 'Property',
key: 'property',
type: 'PROPERTY',
},
{
value: ['Label'],
label: 'Label',
key: 'label',
type: 'VARIABLE',
configuration: {
condition: {
type: 'SHOW',
option: 'property',
comparator: 'EQ',
value: '',
},
},
},
{
value: [],
label: 'Label',
key: 'propertyLabelOverride',
type: 'VARIABLE',
configuration: {
placeholder: 'Label of property',
condition: {
type: 'HIDE',
option: 'property',
comparator: 'EQ',
value: '',
},
},
},
{
label: 'Type',
key: 'type',
value: 'date',
type: 'CUSTOM',
configuration: {
condition: {
type: 'SHOW',
option: 'label',
comparator: 'EQ',
value: false,
},
},
},
{
type: 'TOGGLE',
label: 'Disable Toolbar',
key: 'disableToolbar',
value: false,
},
{
value: [],
label: 'Value',
key: 'defaultValue',
type: 'VARIABLE',
},
{
value: 'MM/dd/yyyy',
label: 'Format',
key: 'dateFormat',
type: 'TEXT',
},
{
value: '',
label: 'Input',
key: 'actionInputId',
type: 'ACTION_INPUT',
},
{
value: false,
label: 'Required',
key: 'required',
type: 'TOGGLE',
},
{
value: false,
label: 'Error',
key: 'error',
type: 'TOGGLE',
},
{
type: 'TOGGLE',
label: 'Disabled',
key: 'disabled',
value: false,
},
{
value: [],
label: 'Placeholder',
key: 'placeholder',
type: 'VARIABLE',
},
{
value: [],
label: 'Helper text',
key: 'helperText',
type: 'VARIABLE',
},
{
label: 'Variant',
key: 'variant',
value: 'inline',
type: 'CUSTOM',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Dialog', value: 'dialog' },
{ name: 'Inline', value: 'inline' },
{ name: 'Static', value: 'static' },
],
},
},
{
label: 'Input Variant',
key: 'inputvariant',
value: 'outlined',
type: 'CUSTOM',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Standard', value: 'standard' },
{ name: 'Outlined', value: 'outlined' },
{ name: 'Filled', value: 'filled' },
],
},
},
{
type: 'TOGGLE',
label: 'Full width',
key: 'fullWidth',
value: true,
},
{
label: 'Size',
key: 'size',
value: 'medium',
type: 'CUSTOM',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'Medium', value: 'medium' },
{ name: 'Small', value: 'small' },
],
},
},
{
label: 'Margin',
key: 'margin',
value: 'normal',
type: 'CUSTOM',
configuration: {
as: 'BUTTONGROUP',
dataType: 'string',
allowedInput: [
{ name: 'None', value: 'none' },
{ name: 'Dense', value: 'dense' },
{ name: 'Normal', value: 'normal' },
],
},
},
{
value: false,
label: 'Styles',
key: 'styles',
type: 'TOGGLE',
},
{
type: 'COLOR',
label: 'Background color',
key: 'backgroundColor',
value: 'White',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Background color popup',
key: 'backgroundColorPopup',
value: 'Primary',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Border color',
key: 'borderColor',
value: 'Accent1',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Border color (hover)',
key: 'borderHoverColor',
value: 'Black',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Border color (focus)',
key: 'borderFocusColor',
value: 'Primary',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
value: false,
label: 'Hide label',
key: 'hideLabel',
type: 'TOGGLE',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Label color',
key: 'labelColor',
value: 'Accent3',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Text color',
key: 'textColor',
value: 'Black',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Placeholder color',
key: 'placeholderColor',
value: 'Light',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Helper color',
key: 'helperColor',
value: 'Accent2',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
{
type: 'COLOR',
label: 'Error color',
key: 'errorColor',
value: 'Danger',
configuration: {
condition: {
type: 'SHOW',
option: 'styles',
comparator: 'EQ',
value: true,
},
},
},
],
descendants: [],
},
],
}))();
Loading

0 comments on commit 98ec4e5

Please sign in to comment.