@import '../commonStyle/index.less';

.@{prefix}-crud {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  &.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 10px;
    background-color: #fff;
  }

  &-action-tool-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }

  &-action-bar,
  &-tool-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }

  .tool-icon {
    cursor: pointer;
    padding: 5px;
    border: 1px solid #e3e3e3;
    border-radius: 50%;
    font-size: 15px;

    &:hover {
      border-color: #2e4dd9;
      color: #2e4dd9;
    }

    &.rotating {
      animation: rotating 0.5s linear;
    }
  }

  // column setting popup
  .column-setting-popup {
    .ant-popover-title {
      padding-right: 10px;
      padding-left: 10px;
    }

    .ant-popover-inner-content {
      width: 100%;
      padding: 8px 0 4px;
    }

    .column-setting-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .column-setting-list {
      display: flex;
      flex-direction: column;
      max-height: 300px;
      overflow-y: auto;
      margin-bottom: 0;
      padding-inline-start: 0;
      list-style: none;
      padding: 5px 0;
    }

    .column-setting-list::-webkit-scrollbar {
      width: 5px;
    }

    .column-setting-list::-webkit-scrollbar-track {
      border-radius: 3px;
    }

    .column-setting-list::-webkit-scrollbar-thumb {
      width: 5px;
      border-radius: 3px;
      background: #8b8b8b;
    }

    .column-setting-item {
      display: flex;
      align-items: center;
      padding: 8px 10px;
      user-select: none;
      border-radius: 4px;
      margin-bottom: 2px;
      min-height: 32px;

      &:hover {
        background-color: #f5f5f5;
      }
    }

    .column-drag-handle {
      cursor: move;
      margin-right: 8px;
      display: flex;
      align-items: center;
      color: #666;
    }

    .column-setting-footer {
      display: flex;
      justify-content: flex-end;
      padding-top: 4px;
      border-top: 1px solid #f0f0f0;
    }
  }

  // form display
  .@{prefix}-form {
    transition: all 0.3s ease-in-out;
    overflow: hidden;

    &.visible {
      max-height: 300px;
    }

    &.hidden {
      max-height: 0;
    }
  }

  &-table {
    flex: 1;
    overflow: hidden;
  }

  &-modalform-view {
    .ant-form-item-label > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before {
      display: none;
    }
  }

  @keyframes rotating {
    from {
      transform: rotate(0deg);
    }

    to {
      transform: rotate(360deg);
    }
  }
}
