_FeatureForm.scss 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. @mixin featureForm() {
  2. $group-border-width: 3px;
  3. $panel-background-color: var(--calcite-ui-background);
  4. .esri-feature-form {
  5. background-color: $panel-background-color;
  6. padding: var(--esri-widget-padding);
  7. }
  8. .esri-feature-form__form {
  9. display: flex;
  10. flex-direction: column;
  11. }
  12. .esri-feature-form__label {
  13. @include wordbreak();
  14. display: flex;
  15. justify-content: space-between;
  16. flex-direction: column;
  17. margin-bottom: $cap-spacing;
  18. position: relative;
  19. opacity: 1;
  20. transition: opacity 250ms, margin 250ms;
  21. &:last-child {
  22. margin-bottom: 0;
  23. }
  24. }
  25. .esri-feature-form__form-header {
  26. margin-bottom: $cap-spacing;
  27. .esri-feature-form__description-text ~ .esri-widget__heading {
  28. margin-bottom: 0;
  29. }
  30. .esri-feature-form__description-text {
  31. margin-top: 0;
  32. }
  33. }
  34. .esri-feature-form__input {
  35. margin-top: $cap-spacing--third;
  36. width: 100%;
  37. // for textarea
  38. resize: horizontal;
  39. }
  40. .esri-feature-form__input--date,
  41. .esri-feature-form__input--time {
  42. resize: none;
  43. }
  44. .esri-feature-form__input--disabled {
  45. opacity: $opacity--disabled;
  46. }
  47. .esri-feature-form__input--invalid {
  48. border: 1px solid $border-color--error;
  49. }
  50. .esri-feature-form__input-icon--invalid {
  51. position: absolute;
  52. top: 28px;
  53. inset-inline-end: 4px;
  54. color: $font-color--error;
  55. background-color: $panel-background-color;
  56. }
  57. .esri-feature-form__input:focus + .esri-feature-form__input-icon--invalid {
  58. display: none;
  59. }
  60. .esri-feature-form__field-error-message {
  61. padding: $side-spacing--half 0;
  62. font-size: $font-size--small;
  63. }
  64. .esri-feature-form__date-input-container {
  65. display: flex;
  66. }
  67. .esri-feature-form__date-input-part {
  68. width: 50%;
  69. display: flex;
  70. flex-direction: column;
  71. // only want to hide the border if there date/time inputs are side-by-side
  72. &:nth-last-child(2) .esri-feature-form__input {
  73. border-right: none;
  74. }
  75. &--lone {
  76. width: 100%;
  77. }
  78. }
  79. .esri-feature-form__date-format-hint {
  80. color: $interactive-font-color;
  81. font-size: $font-size--small;
  82. padding: 0.5em 0.5em 0 0.5em;
  83. }
  84. .esri-feature-form__input--radio-group {
  85. display: flex;
  86. flex-direction: column;
  87. }
  88. .esri-feature-form__input--radio-label {
  89. display: flex;
  90. align-items: center;
  91. }
  92. .esri-feature-form__input--radio {
  93. margin: $side-spacing--half;
  94. }
  95. .esri-feature-form__input--switch {
  96. margin: $side-spacing--half 0;
  97. }
  98. .esri-feature-form__group-description {
  99. margin: $cap-spacing--half 0 $cap-spacing--third 0;
  100. }
  101. .esri-feature-form__group {
  102. border: none;
  103. border-bottom: 1px solid $border-color;
  104. padding: 0 0 $cap-spacing 0;
  105. margin: 0 0 $cap-spacing 0;
  106. min-inline-size: unset;
  107. transition: border-color 250ms;
  108. &-label {
  109. margin-bottom: 0;
  110. }
  111. &-header {
  112. align-items: center;
  113. display: flex;
  114. cursor: pointer;
  115. justify-content: space-between;
  116. margin: 0 0 $cap-spacing--half 0;
  117. padding: $cap-spacing--half 0;
  118. // button reset
  119. border: none;
  120. background-color: inherit;
  121. font-family: inherit;
  122. text-align: unset;
  123. width: 100%;
  124. }
  125. &-title {
  126. flex: 0 1 auto;
  127. }
  128. &-toggle-icon {
  129. justify-self: flex-end;
  130. flex: 0 0 16px;
  131. margin: 0 $side-spacing--half;
  132. }
  133. &:last-child {
  134. border-bottom: none;
  135. margin-bottom: 0;
  136. padding-bottom: 0;
  137. }
  138. }
  139. .esri-feature-form__group--sequential {
  140. border-bottom: none;
  141. border-inline-start: $group-border-width solid $border-color;
  142. padding-bottom: 0;
  143. padding-inline-start: $cap-spacing--half;
  144. padding-inline-end: $cap-spacing--half;
  145. .esri-feature-form__group-header {
  146. padding-top: 0;
  147. }
  148. &:not(.esri-feature-form__group--collapsed) {
  149. .esri-feature-form__group-header {
  150. cursor: auto;
  151. }
  152. }
  153. }
  154. .esri-feature-form__group--active {
  155. border-inline-start-color: $border-color--active;
  156. }
  157. .esri-feature-form__group--collapsed {
  158. .esri-feature-form__group-header {
  159. margin-bottom: 0;
  160. }
  161. .esri-feature-form__label {
  162. pointer-events: none;
  163. opacity: 0;
  164. height: 0;
  165. margin: 0;
  166. transition: none;
  167. }
  168. }
  169. .esri-feature-form__description-text {
  170. margin: $cap-spacing--quarter 0 0 0;
  171. font-size: $font-size--small;
  172. color: $interactive-font-color;
  173. }
  174. [dir="rtl"] {
  175. .esri-feature-form__date-input-part {
  176. &:first-child .esri-feature-form__input {
  177. border-right: 1px solid $border-color;
  178. border-left: none;
  179. }
  180. }
  181. }
  182. }
  183. @if $include_FeatureForm == true {
  184. @include featureForm();
  185. }