inputs-series.html 12.2 KB
<link rel="import" href="../../bower_components/polymer/polymer.html" />

<!--<link rel="import" href="../../bower_components/paper-material/paper-material.html" />-->

<!--<link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">-->
<!--<link rel="import" href="../../bower_components/paper-menu/paper-menu.html">-->
<!--<link rel="import" href="../../bower_components/paper-item/paper-item.html">-->

<!--<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">-->
<!--<link rel="import" href="../../bower_components/iron-icons/iron-icons.html">-->
<!--<link rel="import" href="../../bower_components/iron-icon/iron-icon.html">-->

<!--<link rel="import" href="../../bower_components/paper-input/paper-textarea.html">-->
<!--<link rel="import" href="../../bower_components/paper-input/paper-input.html">-->

<!--<link rel="import" href="../../bower_components/paper-button/paper-button.html">-->

<!--<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">-->

<!--<link rel="import" href="../items-vslider-controllet/items-vslider-controllet.html" />-->

<!--<script src="../../../DEEPCLIENT/js/deepClient.js"></script>-->

<dom-module id="select-visualization-controllet">

    <template>

        <style is="custom-style">
            :host {
            --paper-dropdown-menu-icon: {
                 color: #2196F3;
             };
            }

            #datalet_selection_container {
                display: flex;
                font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                font-size: 16px;
                margin-top: 8px;
            }

            #items_vslider_controllet {
                position: relative;
                min-width: 172px;
            }

            #datalet_selection_inputs {
                position: relative;
                height: 100vh;
                margin-left: 32px;
                min-width: 258px;
            }

            #datalet_selection_labels {
                position: relative;
                height: 100vh;
                margin-left: 32px;
                min-width: 258px;
            }

            #datalet_selection_column {
                position: relative;
                width: 100%;
                margin-left: 32px;
            }

            #datalet_selection_datalet {
                position: relative;
                height: 100vh;
                width: 100%;
            }

            #datalet_selection_datalet_placeholder {
                padding: 16px;
            }

            .inputs{
                position: relative;
            }

            .input_header {
                height: 32px;
                padding-top: 16px;
                text-align: center;
                font-weight: 700;
                background-color: #B6B6B6;
            }

            #expert_container {
                display: none;
            }

            #expert_header {
                display: none;

                height: 32px;
                padding-top: 16px;
                margin-top: 8px;
                text-align: center;
                font-weight: 700;
                color: #00BCD4;
                cursor: pointer;
            }

            .field_nema {
                height: 40px;
                padding-top: 8px;

                margin-top: 8px;
                padding-left: 16px;
                font-weight: 700;
                color: #2196F3;
                background-color: #E0E0E0;
            }

            .info_button {
                position: absolute;
                top: 18px;
                right: 0px;
            }

            paper-input {
                display: inline-block;
                height: 48px;
                /*padding: 0px 8px;*/
                width: 210px;
                padding-left: 8px;
                padding-bottom: 8px;
                --paper-input-container-focus-color: #2196F3;
            }

            paper-input.base_input {
                width: 242px;
            }

            paper-textarea {
                width: 242px;
                padding-left: 8px;
                padding-bottom: 4px;
                --paper-input-container-focus-color: #2196F3;
            }

            paper-dropdown-menu {
                height: 48px;
                width: 210px;;
                padding-left: 8px;
                padding-bottom: 8px;
                --paper-input-container-focus-color: #2196F3;
            }

            paper-item.iron-selected {
                background-color: #2196F3;
                color: #FFFFFF;
            }

            paper-icon-button {
                color: #2196F3;
                --paper-icon-button-ink-color: #2196F3;
                margin: 0px;
            }

            paper-button {
                position: absolute;
                bottom: 16px;
                right: 11px;

                height: 48px;
                width: 172px;
                background-color: #00BCD4;
                color: white;
                font-weight: 700;
                padding: 16px;
            }

            paper-button:hover {
                background-color: #00AABF;

                box-shadow: 0px 8px 12px #888;
                -webkit-box-shadow: 0px 8px 12px #888;
                -moz-box-shadow: 0px 8px 12px #888;
            }

            paper-button[disabled] {
                background-color: #B6B6B6;
            }

            #dialog_info_input {
                border: 2px solid #2196F3;
                background-color: #E0E0E0;
                min-width: 248px;
            }
        </style>

        <iron-ajax id="selectedDatalet_request" on-response="_handleSelectedDatalet"></iron-ajax>

        <div id="datalet_selection_container">

            <paper-material id="datalet_selection_inputs" elevation="5">
                <div class="input_header"><span id="inputs"></span></div>
                <template is="dom-repeat" items="{{inputs}}" index-as="ddl_index">
                    <div class="inputs">
                        <paper-dropdown-menu id={{ddl_index}} label={{_getLabelName(item.name)}}>
                            <paper-menu class="dropdown-content">
                                <template is="dom-repeat" items={{fields}}>
                                    <paper-item id={{index}} on-tap="_addInput">{{_fieldName(item)}}</paper-item>
                                    <!--{{_fieldName(item)}}-->
                                </template>
                            </paper-menu>
                        </paper-dropdown-menu>
                        <div class="info_button">
                            <paper-icon-button id={{item.name}} on-click="_showInfo" icon="info-outline" title="{{_getLabelName(item.name)}} info"></paper-icon-button>
                        </div>
                    </div>
                </template>

                <!-- EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE -->

                <div id="expert_header" on-click="_showExpertMode"><span id="groupBy"></span></div>

                <div id="expert_container">

                    <div class="inputs">
                        <paper-dropdown-menu id="group_by">
                            <paper-menu class="dropdown-content">
                                <template is="dom-repeat" items={{fields}}>
                                    <paper-item id={{index}} on-tap="_showGroupedFields">{{_fieldName(item)}}</paper-item>
                                </template>
                            </paper-menu>
                        </paper-dropdown-menu>
                        <div class="info_button">
                            <paper-icon-button id="gb" on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button>
                        </div>
                    </div>

                    <template is="dom-repeat" items="{{groupedFields}}">
                        <div class="inputs">
                            <paper-dropdown-menu id="calculate_{{index}}" label="{{_calculateLabel()}}">
                                <paper-menu class="dropdown-content">
                                    <!--foreach functions-->
                                    <paper-item id="0" on-tap="_addGroupByInput">{{_operationName(0)}} {{_fieldName(item)}}</paper-item>
                                    <paper-item id="1" on-tap="_addGroupByInput">{{_operationName(1)}} {{_fieldName(item)}}</paper-item>
                                    <paper-item id="2" on-tap="_addGroupByInput">{{_operationName(2)}} {{_fieldName(item)}}</paper-item>
                                    <paper-item id="3" on-tap="_addGroupByInput">{{_operationName(3)}} {{_fieldName(item)}}</paper-item>
                                    <paper-item id="4" on-tap="_addGroupByInput">{{_operationName(4)}} {{_fieldName(item)}}</paper-item>
                                    <paper-item id="5" on-tap="_addGroupByInput">{{_operationName(5)}} {{_fieldName(item)}}</paper-item>
                                    <paper-item id="6" on-tap="_addGroupByInput">{{_operationName(6)}} {{_fieldName(item)}}</paper-item>
                                </paper-menu>
                            </paper-dropdown-menu>
                            <div class="info_button">
                                <paper-icon-button id={{_fieldName(item)}} on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button>
                            </div>
                        </div>
                    </template>

                </div>

                <!-- EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE EXPERT MODE -->

            </paper-material>

eeeeeeeeeeeeeeeeeeee
        </div>

    </template>

    <script>

        Polymer({

            is : 'select-visualization-controllet',

            properties : {

                deepUrl : {
                    type : String,
                    value : undefined
                },

                dataletsListUrl : {
                    type : String,
                    value : undefined
                },

                selectedDatalet : {
                    type  : String,
                    value : undefined
                },

                preselectedDatalet : {
                    type  : String,
                    value : undefined
                },

                loadPreview : {
                    type :  Boolean,
                    value : false
                },

                type : {
                    type : String,
                    value : undefined
                },

                inputs : {
                    type : Array,
                    value : []
                },

                labels : {
                    type : Array,
                    value : []
                },

                filters : {
                    type : Array,
                    value : []
                },

                aggregators : {
                    type : Array,
                    value : []
                },

                orders : {
                    type : Array,
                    value : []
                },

                fields : {
                    type : Array,
                    value : []
                },

                selectedFields : {
                    type : Array,
                    value : []
                },

                groupedFields : {
                    type : Array,
                    value : []
                },

                dataletPreset : {
                    type  : Object,
                    value : []
                },

                dataUrl : {
                    type  : String,
                    value : undefined
                },

                params:{
                    type: Object,
                    value: undefined
                },

                expert : {
                    type  : Boolean,
                    value : false
                },

                functions : {
                    type  : Array,
                    value : ["COUNT", "SUM", "MIN", "MAX", "AVG", "FIRST", "LAST"]
                },

                modify : {
                    type  : Boolean,
                    value : false
                }

            },

        });

    </script>

</dom-module>