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

// TextInput variables

.jewel
	&.textinput
		position: relative
		display: inline-flex
		overflow: hidden

		&::before
			top: calc(50% - 100%)
			left: calc(50% - 100%)
			width: 200%
			height: 200%
			z-index: 1

		&::after

		&::before, &::after
			position: absolute
			pointer-events: none
			content: ""

		input
			+appear(none)

			width: 100%
			height: auto
			max-width: 100%

			flex: 1 0 auto
			outline: none

			text:
				align: left
			line-height: normal !important

			&[disabled]
				cursor: unset

		&.icon
			input

			i
				&.fonticon
					cursor: default
					pointer-events: none
					top: 50%
					right: initial
					position: absolute
					text-align: center
					margin-top: -6px

					&.material-icons
						margin-top: -.5em

			&.right
				input

				i
					&.fonticon
						left: initial

		&.truncate
			input
				overflow: hidden
				text-overflow: ellipsis

j|TextInput
	IBeadModel: ClassReference("org.apache.royale.jewel.beads.models.TextModel")

@media -royale-swf
	j|TextInput
		IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView")
		IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController")
		IBorderBead: ClassReference('org.apache.royale.html.beads.SingleLineBorderBead')
		IBackgroundBead: ClassReference('org.apache.royale.html.beads.SolidBackgroundBead')


// Jewel TextArea

// TextArea variables

.jewel
	&.textarea
		position: relative
		display: inline-flex

		textarea
			+appear(none)
			resize: none

			max-width: 100%

			flex: 1 0 auto
			outline: none

			text:
				align: left
			line-height: normal !important

			&[disabled]
				cursor: unset

j|TextArea
	IBeadModel: ClassReference("org.apache.royale.jewel.beads.models.TextModel")
	//IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView")
	//IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController")
