////////////////////////////////////////////////////////////////////////////////
//
//  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
        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

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


// Jewel Table

// Table variables
$tableitem-min-height: 34px
.jewel.table
    
    table
        width: 100%
        border-spacing: 0px

    // th
    .jewel.tableheadercell
        position: relative
        vertical-align: bottom
        text-overflow: ellipsis
        letter-spacing: 0
        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
        height: 100%
        
    &.fixedHeader
        overflow-y: auto

        .jewel.tableheadercell
                position: sticky
                top: 0
                z-index: 1

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")
    IBeadKeyController: ClassReference("org.apache.royale.jewel.beads.controllers.TableKeyDownController")
    IItemRendererInitializer: ClassReference("org.apache.royale.jewel.beads.itemRenderers.TableItemRendererInitializer")
    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")
    // this bead was created for SWF, so we should try to avoid this for JS in the future
    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

    &.calendar
        // border-radius: 4px
        
        &.selected
            // font-weight: bold
    
.empty-cell
    pointer-events: none

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



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")


