a846cbe7efa90b3eed716a2d5b69d30a.json
26.4 KB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport Track from './common/Track';\nimport createSlider from './common/createSlider';\nimport * as utils from './utils';\n\nvar Slider = /*#__PURE__*/function (_React$Component) {\n _inherits(Slider, _React$Component);\n\n var _super = _createSuper(Slider);\n /* eslint-enable */\n\n\n function Slider(props) {\n var _this;\n\n _classCallCheck(this, Slider);\n\n _this = _super.call(this, props);\n\n _this.onEnd = function (force) {\n var dragging = _this.state.dragging;\n\n _this.removeDocumentEvents();\n\n if (dragging || force) {\n _this.props.onAfterChange(_this.getValue());\n }\n\n _this.setState({\n dragging: false\n });\n };\n\n var defaultValue = props.defaultValue !== undefined ? props.defaultValue : props.min;\n var value = props.value !== undefined ? props.value : defaultValue;\n _this.state = {\n value: _this.trimAlignValue(value),\n dragging: false\n };\n warning(!('minimumTrackStyle' in props), 'minimumTrackStyle will be deprecated, please use trackStyle instead.');\n warning(!('maximumTrackStyle' in props), 'maximumTrackStyle will be deprecated, please use railStyle instead.');\n return _this;\n }\n /**\n * [Legacy] Used for inherit other component.\n * It's a bad code style which should be refactor.\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars, class-methods-use-this */\n\n\n _createClass(Slider, [{\n key: \"calcValueByPos\",\n value: function calcValueByPos(value) {\n return 0;\n }\n }, {\n key: \"calcOffset\",\n value: function calcOffset(value) {\n return 0;\n }\n }, {\n key: \"saveHandle\",\n value: function saveHandle(index, h) {}\n }, {\n key: \"removeDocumentEvents\",\n value: function removeDocumentEvents() {}\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var _this$props = this.props,\n min = _this$props.min,\n max = _this$props.max,\n value = _this$props.value,\n onChange = _this$props.onChange;\n\n if (!('min' in this.props || 'max' in this.props)) {\n return;\n }\n\n var theValue = value !== undefined ? value : prevState.value;\n var nextValue = this.trimAlignValue(theValue, this.props);\n\n if (nextValue === prevState.value) {\n return;\n } // eslint-disable-next-line\n\n\n this.setState({\n value: nextValue\n });\n\n if (!(min === prevProps.min && max === prevProps.max) && utils.isValueOutOfRange(theValue, this.props)) {\n onChange(nextValue);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(state) {\n var props = this.props;\n var isNotControlled = !('value' in props);\n var nextState = state.value > this.props.max ? _objectSpread(_objectSpread({}, state), {}, {\n value: this.props.max\n }) : state;\n\n if (isNotControlled) {\n this.setState(nextState);\n }\n\n var changedValue = nextState.value;\n props.onChange(changedValue);\n }\n }, {\n key: \"onStart\",\n value: function onStart(position) {\n this.setState({\n dragging: true\n });\n var props = this.props;\n var prevValue = this.getValue();\n props.onBeforeChange(prevValue);\n var value = this.calcValueByPos(position);\n this.startValue = value;\n this.startPosition = position;\n if (value === prevValue) return;\n this.prevMovedHandleIndex = 0;\n this.onChange({\n value: value\n });\n }\n }, {\n key: \"onMove\",\n value: function onMove(e, position) {\n utils.pauseEvent(e);\n var oldValue = this.state.value;\n var value = this.calcValueByPos(position);\n if (value === oldValue) return;\n this.onChange({\n value: value\n });\n }\n }, {\n key: \"onKeyboard\",\n value: function onKeyboard(e) {\n var _this$props2 = this.props,\n reverse = _this$props2.reverse,\n vertical = _this$props2.vertical;\n var valueMutator = utils.getKeyboardValueMutator(e, vertical, reverse);\n\n if (valueMutator) {\n utils.pauseEvent(e);\n var state = this.state;\n var oldValue = state.value;\n var mutatedValue = valueMutator(oldValue, this.props);\n var value = this.trimAlignValue(mutatedValue);\n if (value === oldValue) return;\n this.onChange({\n value: value\n });\n this.props.onAfterChange(value);\n this.onEnd();\n }\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.state.value;\n }\n }, {\n key: \"getLowerBound\",\n value: function getLowerBound() {\n var minPoint = this.props.startPoint || this.props.min;\n return this.state.value > minPoint ? minPoint : this.state.value;\n }\n }, {\n key: \"getUpperBound\",\n value: function getUpperBound() {\n if (this.state.value < this.props.startPoint) {\n return this.props.startPoint;\n }\n\n return this.state.value;\n }\n }, {\n key: \"trimAlignValue\",\n value: function trimAlignValue(v) {\n var nextProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (v === null) {\n return null;\n }\n\n var mergedProps = _objectSpread(_objectSpread({}, this.props), nextProps);\n\n var val = utils.ensureValueInRange(v, mergedProps);\n return utils.ensureValuePrecision(val, mergedProps);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n prefixCls = _this$props3.prefixCls,\n vertical = _this$props3.vertical,\n included = _this$props3.included,\n disabled = _this$props3.disabled,\n minimumTrackStyle = _this$props3.minimumTrackStyle,\n trackStyle = _this$props3.trackStyle,\n handleStyle = _this$props3.handleStyle,\n tabIndex = _this$props3.tabIndex,\n ariaLabelForHandle = _this$props3.ariaLabelForHandle,\n ariaLabelledByForHandle = _this$props3.ariaLabelledByForHandle,\n ariaValueTextFormatterForHandle = _this$props3.ariaValueTextFormatterForHandle,\n min = _this$props3.min,\n max = _this$props3.max,\n startPoint = _this$props3.startPoint,\n reverse = _this$props3.reverse,\n handleGenerator = _this$props3.handle;\n var _this$state = this.state,\n value = _this$state.value,\n dragging = _this$state.dragging;\n var offset = this.calcOffset(value);\n var handle = handleGenerator({\n className: \"\".concat(prefixCls, \"-handle\"),\n prefixCls: prefixCls,\n vertical: vertical,\n offset: offset,\n value: value,\n dragging: dragging,\n disabled: disabled,\n min: min,\n max: max,\n reverse: reverse,\n index: 0,\n tabIndex: tabIndex,\n ariaLabel: ariaLabelForHandle,\n ariaLabelledBy: ariaLabelledByForHandle,\n ariaValueTextFormatter: ariaValueTextFormatterForHandle,\n style: handleStyle[0] || handleStyle,\n ref: function ref(h) {\n return _this2.saveHandle(0, h);\n }\n });\n var trackOffset = startPoint !== undefined ? this.calcOffset(startPoint) : 0;\n var mergedTrackStyle = trackStyle[0] || trackStyle;\n var track = React.createElement(Track, {\n className: \"\".concat(prefixCls, \"-track\"),\n vertical: vertical,\n included: included,\n offset: trackOffset,\n reverse: reverse,\n length: offset - trackOffset,\n style: _objectSpread(_objectSpread({}, minimumTrackStyle), mergedTrackStyle)\n });\n return {\n tracks: track,\n handles: handle\n };\n }\n }]);\n\n return Slider;\n}(React.Component);\n\nexport default createSlider(Slider);","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/Slider.js"],"names":["_objectSpread","_classCallCheck","_createClass","_inherits","_createSuper","React","warning","Track","createSlider","utils","Slider","_React$Component","_super","props","_this","call","onEnd","force","dragging","state","removeDocumentEvents","onAfterChange","getValue","setState","defaultValue","undefined","min","value","trimAlignValue","key","calcValueByPos","calcOffset","saveHandle","index","h","componentDidUpdate","prevProps","prevState","_this$props","max","onChange","theValue","nextValue","isValueOutOfRange","isNotControlled","nextState","changedValue","onStart","position","prevValue","onBeforeChange","startValue","startPosition","prevMovedHandleIndex","onMove","e","pauseEvent","oldValue","onKeyboard","_this$props2","reverse","vertical","valueMutator","getKeyboardValueMutator","mutatedValue","getLowerBound","minPoint","startPoint","getUpperBound","v","nextProps","arguments","length","mergedProps","val","ensureValueInRange","ensureValuePrecision","render","_this2","_this$props3","prefixCls","included","disabled","minimumTrackStyle","trackStyle","handleStyle","tabIndex","ariaLabelForHandle","ariaLabelledByForHandle","ariaValueTextFormatterForHandle","handleGenerator","handle","_this$state","offset","className","concat","ariaLabel","ariaLabelledBy","ariaValueTextFormatter","style","ref","trackOffset","mergedTrackStyle","track","createElement","tracks","handles","Component"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,0CAA1B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,SA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AA,sBAAsB,EAAET,+BAfG;AAgB3BU,QAAAA,KAAK,EAAEd,WAAW,CAAC,CAAD,CAAX,IAAkBA,WAhBE;AAiB3Be,QAAAA,GAAG,EAAE,SAASA,GAAT,CAAalE,CAAb,EAAgB;AACnB,iBAAO4C,MAAM,CAAC9C,UAAP,CAAkB,CAAlB,EAAqBE,CAArB,CAAP;AACD;AAnB0B,OAAD,CAA5B;AAqBA,UAAImE,WAAW,GAAGlC,UAAU,KAAK1C,SAAf,GAA2B,KAAKM,UAAL,CAAgBoC,UAAhB,CAA3B,GAAyD,CAA3E;AACA,UAAImC,gBAAgB,GAAGlB,UAAU,CAAC,CAAD,CAAV,IAAiBA,UAAxC;AACA,UAAImB,KAAK,GAAGlG,KAAK,CAACmG,aAAN,CAAoBjG,KAApB,EAA2B;AACrCuF,QAAAA,SAAS,EAAE,GAAGC,MAAH,CAAUf,SAAV,EAAqB,QAArB,CAD0B;AAErCnB,QAAAA,QAAQ,EAAEA,QAF2B;AAGrCoB,QAAAA,QAAQ,EAAEA,QAH2B;AAIrCY,QAAAA,MAAM,EAAEQ,WAJ6B;AAKrCzC,QAAAA,OAAO,EAAEA,OAL4B;AAMrCY,QAAAA,MAAM,EAAEqB,MAAM,GAAGQ,WANoB;AAOrCF,QAAAA,KAAK,EAAEnG,aAAa,CAACA,aAAa,CAAC,EAAD,EAAKmF,iBAAL,CAAd,EAAuCmB,gBAAvC;AAPiB,OAA3B,CAAZ;AASA,aAAO;AACLG,QAAAA,MAAM,EAAEF,KADH;AAELG,QAAAA,OAAO,EAAEf;AAFJ,OAAP;AAID;AA9DA,GAlJkB,CAAT,CAAZ;;AAmNA,SAAOjF,MAAP;AACD,CAjQyB,CAiQxBL,KAAK,CAACsG,SAjQkB,CAA1B;;AAmQA,eAAenG,YAAY,CAACE,MAAD,CAA3B","sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport warning from \"rc-util/es/warning\";\nimport Track from './common/Track';\nimport createSlider from './common/createSlider';\nimport * as utils from './utils';\n\nvar Slider = /*#__PURE__*/function (_React$Component) {\n _inherits(Slider, _React$Component);\n\n var _super = _createSuper(Slider);\n\n /* eslint-enable */\n function Slider(props) {\n var _this;\n\n _classCallCheck(this, Slider);\n\n _this = _super.call(this, props);\n\n _this.onEnd = function (force) {\n var dragging = _this.state.dragging;\n\n _this.removeDocumentEvents();\n\n if (dragging || force) {\n _this.props.onAfterChange(_this.getValue());\n }\n\n _this.setState({\n dragging: false\n });\n };\n\n var defaultValue = props.defaultValue !== undefined ? props.defaultValue : props.min;\n var value = props.value !== undefined ? props.value : defaultValue;\n _this.state = {\n value: _this.trimAlignValue(value),\n dragging: false\n };\n warning(!('minimumTrackStyle' in props), 'minimumTrackStyle will be deprecated, please use trackStyle instead.');\n warning(!('maximumTrackStyle' in props), 'maximumTrackStyle will be deprecated, please use railStyle instead.');\n return _this;\n }\n /**\n * [Legacy] Used for inherit other component.\n * It's a bad code style which should be refactor.\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars, class-methods-use-this */\n\n\n _createClass(Slider, [{\n key: \"calcValueByPos\",\n value: function calcValueByPos(value) {\n return 0;\n }\n }, {\n key: \"calcOffset\",\n value: function calcOffset(value) {\n return 0;\n }\n }, {\n key: \"saveHandle\",\n value: function saveHandle(index, h) {}\n }, {\n key: \"removeDocumentEvents\",\n value: function removeDocumentEvents() {}\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var _this$props = this.props,\n min = _this$props.min,\n max = _this$props.max,\n value = _this$props.value,\n onChange = _this$props.onChange;\n\n if (!('min' in this.props || 'max' in this.props)) {\n return;\n }\n\n var theValue = value !== undefined ? value : prevState.value;\n var nextValue = this.trimAlignValue(theValue, this.props);\n\n if (nextValue === prevState.value) {\n return;\n } // eslint-disable-next-line\n\n\n this.setState({\n value: nextValue\n });\n\n if (!(min === prevProps.min && max === prevProps.max) && utils.isValueOutOfRange(theValue, this.props)) {\n onChange(nextValue);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(state) {\n var props = this.props;\n var isNotControlled = !('value' in props);\n var nextState = state.value > this.props.max ? _objectSpread(_objectSpread({}, state), {}, {\n value: this.props.max\n }) : state;\n\n if (isNotControlled) {\n this.setState(nextState);\n }\n\n var changedValue = nextState.value;\n props.onChange(changedValue);\n }\n }, {\n key: \"onStart\",\n value: function onStart(position) {\n this.setState({\n dragging: true\n });\n var props = this.props;\n var prevValue = this.getValue();\n props.onBeforeChange(prevValue);\n var value = this.calcValueByPos(position);\n this.startValue = value;\n this.startPosition = position;\n if (value === prevValue) return;\n this.prevMovedHandleIndex = 0;\n this.onChange({\n value: value\n });\n }\n }, {\n key: \"onMove\",\n value: function onMove(e, position) {\n utils.pauseEvent(e);\n var oldValue = this.state.value;\n var value = this.calcValueByPos(position);\n if (value === oldValue) return;\n this.onChange({\n value: value\n });\n }\n }, {\n key: \"onKeyboard\",\n value: function onKeyboard(e) {\n var _this$props2 = this.props,\n reverse = _this$props2.reverse,\n vertical = _this$props2.vertical;\n var valueMutator = utils.getKeyboardValueMutator(e, vertical, reverse);\n\n if (valueMutator) {\n utils.pauseEvent(e);\n var state = this.state;\n var oldValue = state.value;\n var mutatedValue = valueMutator(oldValue, this.props);\n var value = this.trimAlignValue(mutatedValue);\n if (value === oldValue) return;\n this.onChange({\n value: value\n });\n this.props.onAfterChange(value);\n this.onEnd();\n }\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.state.value;\n }\n }, {\n key: \"getLowerBound\",\n value: function getLowerBound() {\n var minPoint = this.props.startPoint || this.props.min;\n return this.state.value > minPoint ? minPoint : this.state.value;\n }\n }, {\n key: \"getUpperBound\",\n value: function getUpperBound() {\n if (this.state.value < this.props.startPoint) {\n return this.props.startPoint;\n }\n\n return this.state.value;\n }\n }, {\n key: \"trimAlignValue\",\n value: function trimAlignValue(v) {\n var nextProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (v === null) {\n return null;\n }\n\n var mergedProps = _objectSpread(_objectSpread({}, this.props), nextProps);\n\n var val = utils.ensureValueInRange(v, mergedProps);\n return utils.ensureValuePrecision(val, mergedProps);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n prefixCls = _this$props3.prefixCls,\n vertical = _this$props3.vertical,\n included = _this$props3.included,\n disabled = _this$props3.disabled,\n minimumTrackStyle = _this$props3.minimumTrackStyle,\n trackStyle = _this$props3.trackStyle,\n handleStyle = _this$props3.handleStyle,\n tabIndex = _this$props3.tabIndex,\n ariaLabelForHandle = _this$props3.ariaLabelForHandle,\n ariaLabelledByForHandle = _this$props3.ariaLabelledByForHandle,\n ariaValueTextFormatterForHandle = _this$props3.ariaValueTextFormatterForHandle,\n min = _this$props3.min,\n max = _this$props3.max,\n startPoint = _this$props3.startPoint,\n reverse = _this$props3.reverse,\n handleGenerator = _this$props3.handle;\n var _this$state = this.state,\n value = _this$state.value,\n dragging = _this$state.dragging;\n var offset = this.calcOffset(value);\n var handle = handleGenerator({\n className: \"\".concat(prefixCls, \"-handle\"),\n prefixCls: prefixCls,\n vertical: vertical,\n offset: offset,\n value: value,\n dragging: dragging,\n disabled: disabled,\n min: min,\n max: max,\n reverse: reverse,\n index: 0,\n tabIndex: tabIndex,\n ariaLabel: ariaLabelForHandle,\n ariaLabelledBy: ariaLabelledByForHandle,\n ariaValueTextFormatter: ariaValueTextFormatterForHandle,\n style: handleStyle[0] || handleStyle,\n ref: function ref(h) {\n return _this2.saveHandle(0, h);\n }\n });\n var trackOffset = startPoint !== undefined ? this.calcOffset(startPoint) : 0;\n var mergedTrackStyle = trackStyle[0] || trackStyle;\n var track = React.createElement(Track, {\n className: \"\".concat(prefixCls, \"-track\"),\n vertical: vertical,\n included: included,\n offset: trackOffset,\n reverse: reverse,\n length: offset - trackOffset,\n style: _objectSpread(_objectSpread({}, minimumTrackStyle), mergedTrackStyle)\n });\n return {\n tracks: track,\n handles: handle\n };\n }\n }]);\n\n return Slider;\n}(React.Component);\n\nexport default createSlider(Slider);"]},"metadata":{},"sourceType":"module"}