////////////////////////////////////////////////////////////////////////////////
//
//  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
$textinput-margin: 0 !default
$textinput-padding-vertical: .68em !default
$textinput-padding-horizontal: 1.12em !default

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

		input
			+appear(none)
			margin: $textinput-margin
			padding: $textinput-padding-vertical $textinput-padding-horizontal

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

			flex: 1 0 auto
			outline: none

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

			&[disabled]
				cursor: unset

		&.icon
			input
				padding-left: $textinput-padding-horizontal + 1

			i
				&.fonticon
					cursor: default
					pointer-events: none
					top: 50%
					left: .45em
					right: auto
					position: absolute
					text-align: center
					margin-top: -.5em

			&.right
				input
					padding-right: $textinput-padding-horizontal + 1
					padding-left: $textinput-padding-horizontal

				i
					&.fonticon
						left: auto
						right: .45em


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
$textarea-margin: 0 !default
$textarea-padding: .72em 1.12em !default

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

		textarea
			+appear(none)
			margin: $textarea-margin
			padding: $textarea-padding
			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")
