Repository URL to install this package:
Version:
0.9.5 ▾
|
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const exotic_1 = require("exotic");
const mobx_react_1 = require("xmobx/mobx-react");
const ToggleList_1 = require("molecules/ToggleList");
const SelectionState_1 = require("src/state/SelectionState");
const fixtures_1 = require("./fixtures");
const styled_1 = require("./styled");
const SelectDropDown_1 = require("molecules/SelectDropDown");
const renderActiveItem = (props) => (react_1.default.createElement(SelectDropDown_1.ActiveOption, Object.assign({}, props, { label: "Distance" })));
const renderItem = (itemProps, state) => {
console.debug('[RadioDropDown] renderItem: ', itemProps.isSelected);
const { label } = itemProps, remainingProps = __rest(itemProps, ["label"]);
return (react_1.default.createElement(ToggleList_1.ToggleItem, Object.assign({ key: label, isRadio: true }, itemProps)));
// return <ToggleList breedType="radio" list={list} />)
};
let RadioIconDropDown = class RadioIconDropDown extends react_1.default.Component {
constructor() {
super(...arguments);
/**
* Multi state object creation for selection state
*/
this.observableState = new SelectionState_1.SelectionState();
}
componentWillMount() {
const attributes = Object.assign({}, this.props, { list: this.props.list, onChange: exotic_1.NO_OP });
this.observableState.decorateWithProps(attributes);
}
render() {
// console.log('[StoreHoursDropDown] list', storeHoursList)
return (react_1.default.createElement(styled_1.StyledSelectDropDown, Object.assign({ list: this.props.list, renderActiveItem: renderActiveItem, renderItem: renderItem }, this.props)));
}
};
RadioIconDropDown.defaultProps = {
className: '',
list: fixtures_1.list || exotic_1.EMPTY_ARRAY,
};
RadioIconDropDown = __decorate([
mobx_react_1.observer
], RadioIconDropDown);
exports.RadioIconDropDown = RadioIconDropDown;
exports.default = RadioIconDropDown;
//# sourceMappingURL=RadioIconDropDown.js.map