Snippets

Роман Торощин Спецификация для конфигурирования фильтров в админке АИЖК

Created by Роман Торощин last modified

Выпадающий список (<select>)

{
  "type": "select",
  "key": "status_id",
  "defaultValue": "property-1",
  "addons": [
    {
      "position": "left",
      "type": "icon",
      "iconClass": "text-muted fa-search",
      "iconUrl": null
    },
    {
      "position": "right",
      "type": "text",
      "label": "Статус"
    }
  ],
  "placeholder": "Статус",
  "disabled": false,
  "readonly": false,
  "options": [
    {
      "type": "group",
      "label": "Группа 1",
      "options": [
        {
          "type": "option",
          "label": "Свойство 1",
          "value": "property-1",
          "disabled": false
        },
        {
          "type": "option",
          "label": "Свойство 2",
          "value": "property-2",
          "disabled": false
        }
      ]
    },
    {
      "type": "option",
      "label": "Свойство 3",
      "value": "property-3",
      "disabled": false
    }
  ]
}

МультиБатон

{
  "type": "multiButton",
  "key": "rating",
  "multiple": "true|false",
  "addons": [
    {
      "position": "left",
      "type": "text",
      "label": "Оценка"
    }
  ],
  "defaultValues": [1, 2],
  "disabled": false,
  "readonly": false,
  "buttons": [
    { "label": "1", "value": 1, "disabled": false },
    { "label": "2", "value": 2, "disabled": false },
    { "label": "3", "value": 3, "disabled": false },
    { "label": "4", "value": 4, "disabled": false },
    { "label": "5", "value": 5, "disabled": false },
    { "label": "Все", "value": "all", "disabled": false }
  ]
}

Строка ввода (поиск)

{
  "type": "searchInput",  
  "placeholder": "",
  "addons": [
    {
      "position": "left",
      "type": "icon",
      "iconClass": "text-muted fa-search",
      "iconUrl": null
    }
  ],
  "defaultValue": "",  
  "key": "full_name",
  "disabled": false,
  "readonly": false  
}

Диапазон дат (селектбокс)

{
  "key": "period",
  "type": "dateRangeSelect",
  "defaultIndex": 0,
  "bounds": {
    "from": "2015-02-05T00:00:00",
    "to": "2015-02-05T00:00:00"    
  },
  "values": [
    {     
      "label": "За все время",
      "btnLabel": "За все время",
      "from": null,
      "to": null,
      "showDateBounds": false
    },
    {      
      "label": "7 дней",
      "btnLabel": "Последние 7 дней",
      "from": "2015-02-05T00:00:00",
      "to": "2015-02-05T00:00:00",
      "showDateBounds": false
    },
    {      
      "label": "14 дней",
      "btnLabel": "Последние 14 дней",
      "from": "2015-02-05T00:00:00",
      "to": "2015-02-05T00:00:00",
      "showDateBounds": false
    },
    {      
      "label": "30 дней",
      "btnLabel": "Последние 30 дней",
      "from": "2015-02-05T00:00:00",
      "to": "2015-02-05T00:00:00",
      "showDateBounds": false
    },
    {      
      "label": "Диапазон",
      "btnLabel": "",
      "from": "2015-02-05T00:00:00|null",
      "to": "2015-02-05T00:00:00|null",
      "showDateBounds": true
    }
  ]
}

Спаренные числовые инпуты

{
    "key": "",
    "type": "integerRange",
    "bounds": {
      "from": "0|null",
      "to": "5|null"    
    },
    "min": 0,
    "max": 10,
    "addons": [],
}

Структура ответа от сервера

{
  "metadata": {
    "total": 10,
  },

  "filters": []
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.