////////////////////////////////////////////////////////////////////////////////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License"); you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////

// Jewel SimpleTable

// SimpleTable variables

.jewel.simpletable
    position: relative
    white-space: nowrap
    border-spacing: 0px
    overflow: hidden

    .jewel.tableheadercell
        position: relative
        vertical-align: bottom
        text-overflow: ellipsis
        letter-spacing: 0
        padding: 12px
        text-align: left
        
    .jewel.tbody 
        .jewel.tablerow
            position: relative
            transition-duration: .28s
            // transition-timing-function: cubic-bezier(.4,0,.2,1)
            transition-property: background-color
    
    //td
    .jewel.tablecell
        position: relative
        > *
            padding: 12px

j|SimpleTable
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")


// Jewel Table

// Table variables
$tableitem-min-height: 34px
.jewel.table
    position: relative
    white-space: nowrap
    border-spacing: 0px
    overflow: hidden

    // th
    .jewel.tableheadercell
        position: relative
        vertical-align: bottom
        text-overflow: ellipsis
        letter-spacing: 0
        padding: 12px
        text-align: left
    
    .jewel.tbody 
        .jewel.tablerow
            position: relative
            transition-duration: .28s
            // transition-timing-function: cubic-bezier(.4,0,.2,1)
            transition-property: background-color

    // td
    .jewel.tablecell
        position: relative
        // > *
        //     padding: 12px
        
    &.fixedHeader
        table-layout: fixed

        // .jewel.thead tr
        //     display: block

        .jewel.tbody
            display: block
            overflow: auto
            // width must be table width
            
            .jewel.tablerow
                display: block
            
        .jewel.tablecell
            display: inline-block

j|Table
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.TableLayout")
    IBeadView: ClassReference("org.apache.royale.jewel.beads.views.TableView")
    IBeadModel: ClassReference("org.apache.royale.jewel.beads.models.TableModel")
    IItemRendererClassFactory: ClassReference("org.apache.royale.core.SelectableItemRendererClassFactory")
    IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.TableItemRenderer")
    IBeadController: ClassReference("org.apache.royale.jewel.beads.controllers.TableCellSelectionMouseController")
    ISelectableItemRenderer: ClassReference("org.apache.royale.jewel.beads.itemRenderers.ClassSelectorListSelectableItemRendererBead")
    IDataProviderItemRendererMapper: ClassReference("org.apache.royale.jewel.beads.itemRenderers.TableItemRendererFactoryForCollectionView")
    IViewport: ClassReference("org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport")
    IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
    IContentView: ClassReference("org.apache.royale.jewel.supportClasses.table.TBodyContentArea")


.jewel.tableitem
    padding: 10px
    cursor: pointer
    text-decoration: none
    align-items: center
    letter-spacing: 0
    line-height: normal !important
    overflow: hidden
    cursor: auto
    // pointer-events: none
    
    &.selectable
        cursor: pointer
        // pointer-events: auto

    &.with-childs
        padding: 6px
    &.calendar
        border-radius: 4px
        
        &.selected
            font-weight: bold
    
.empty-cell
    pointer-events: none

j|TableItemRenderer
    IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ItemRendererMouseController")



j|TBody
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")
j|THead
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")
j|TFoot
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")

j|TableCell
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")
j|TableHeaderCell
j|TableRow
    IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")
j|TableColumn


@media -royale-swf
    j|SimpleTable
        // IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead")
        // IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead")

    j|TableCell
        // IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.TableCellLayout")
        // IBeadView: ClassReference("org.apache.royale.html.beads.TableCellView")

    j|TableHeaderCell
        // IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.TableHeaderLayout")
        // IBeadView: ClassReference("org.apache.royale.html.beads.TableCellView")

// Table Component
// j|Table
    // IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.SimpleTableLayout")
    // IBeadView: ClassReference("org.apache.royale.jewel.beads.views.TableView")


