Пример #1
0
layout = html.Div([
    # Will lose the data when browser/tab closes.
    dcc.Store(id='public-tokens',
              storage_type='session',
              data={
                  'tokens': [],
                  'institutions': []
              }),
    # TODO: Handle Expired Tokens (30 min)
    # TODO: Save credentials (credentials retrieved from
    #  client.Institutions.get_by_id(auth_response.get('item')...
    dcc.Dropdown(id='institution-dropdown'),
    # TODO: Use stepper to reveal corresponding children
    sd_material_ui.Stepper(
        id='use-guide',
        activeStep=0,
        finishedText='Institution Added! Restart?',
        stepCount=3,
        stepLabels=['Open Plaid Link', 'Store Token', 'Select From Dropdown']),
    plaidash.LoginForm(
        id='plaid-link',
        clientName='Butters',
        env=PLAID_ENV,
        publicKey=PLAID_PUBLIC_KEY,
        product=PLAID_PRODUCTS,
        # institution=)
    ),
    html.Button('Store current token', id='store-button'),
    sd_material_ui.Snackbar(id='token-alert',
                            open=False,
                            message='Token Added to Dropdown',
                            action='Select It'),
Пример #2
0
                             'value': 2,
                             'label': 'Tab 2'
                         }],
                         id='tabs'),
     html.Button('Reset Tab',
                 id='reset-tab',
                 style={'marginRight': '14px'}),
     html.P(id='tabs-output', style={'display': 'contents'}),
 ]),
 spacer,
 html.Div([
     html.P([html.Strong('Sample for Stepper')]),
     sd_material_ui.Stepper(
         id='stepper',
         style={'background': 'inherit'},
         # nextButtonStyle={'display': 'None'},
         # backButtonStyle={'display': 'None'},
         # finishedButtonStyle={'display': 'None'},
         activeStep=0),
     html.Button('Add one step', id='stepper-button'),
     html.P(id='stepper-output')
 ]),
 spacer,
 html.Div([
     html.P([html.Strong('Sample for Date Picker')]),
     sd_material_ui.Picker(id='date-picker',
                           value='2020-12-25T13:11:00.000Z',
                           type='date',
                           label='This is a date picker'),
     html.P(id='date-picker-output')
 ]),
Пример #3
0
                html.H3('Header Tab 1'),
                html.H3('Header Tab 2'),
                html.H3('Header Tab 3'),
            ], tabPropsArray=[{'value': 0, 'label': 'Tab 0'},
                              {'value': 1, 'label': 'Tab 1'},
                              {'value': 2, 'label': 'Tab 2'}],
                id='tabs'),
            html.Button('Reset Tab', id='reset-tab', style={'marginRight': '14px'}),
            html.P(id='tabs-output', style={'display': 'contents'}),
        ]),

        spacer,

        html.Div([
                    html.P([html.Strong('Sample for Stepper')]),
                    sd_material_ui.Stepper(id='stepper', style={'background': 'inherit'}),
                ]),

        final_spacer,
    ], style=dict(display='flex', flexWrap='wrap')),

    ], style={'listStyleType': 'none'})


@app.callback(
    dash.dependencies.Output('tabs', 'value'),
    [dash.dependencies.Input('reset-tab', 'n_clicks')],)
def callback_reset_tab(n: int):
    if not n:
        raise dash.exceptions.PreventUpdate
    return False
Пример #4
0
                                exactMatch=True,
                                dashCallbackDelay=250,
                                dataSource=[],
                                searchEndpointAPI='/my-search',
                                searchJSONStructure={
                                    'version': 1,
                                    'extra-args': {
                                        'more-fields': 'my-token-here'
                                    }
                                },
                                fullWidth=True,
                                floatingLabelText="Type here"),
    html.Div('', id='output-autocomplete-search'),
    spacer,
    sd_material_ui.Stepper(id='input-stepper',
                           activeStep=0,
                           stepCount=4,
                           stepLabels=['Step', 'right', 'this', 'way']),
    html.Div('', id='output-stepper'),
    final_spacer,
])


@app.callback(dash.dependencies.Output('question-output-id', 'children'), [
    dash.dependencies.Input('questions-id', 'value'),
    dash.dependencies.Input('questions-id', 'n_clicks'),
], [dash.dependencies.State('questions-id', 'n_clicks_previous')])
def update_questions_output(value, n_clicks, n_clicks_previous):
    time.sleep(5)
    return '{} {} {}'.format(value, n_clicks, n_clicks_previous)