@capillarytech/blaze-ui 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ # CapActionBar
2
+
3
+ A flexible action bar component that provides a consistent layout for search inputs, filters, sort controls, and action buttons. This component wraps Ant Design's Row and Col components to create a structured action bar interface.
4
+
5
+ ## Migration from Ant Design v3 to v6
6
+
7
+ This component has been migrated from Ant Design v3 to v6 with the following changes:
8
+
9
+ ### Breaking Changes
10
+
11
+ No breaking changes
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { CapActionBarProps } from './types';
3
+ declare const CapActionBar: React.FC<CapActionBarProps>;
4
+ export default CapActionBar;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapActionBar/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,SAAS,CAAC;AAsBpE,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiE7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -22439,84 +22439,88 @@ var exports = __webpack_exports__;
22439
22439
 
22440
22440
  exports.__esModule = true;
22441
22441
  exports["default"] = void 0;
22442
- var _propTypes = _interopRequireDefault(__webpack_require__(43363));
22442
+ var _classnames = _interopRequireDefault(__webpack_require__(46942));
22443
22443
  var _react = _interopRequireDefault(__webpack_require__(9206));
22444
22444
  var _CapButton = _interopRequireDefault(__webpack_require__(80739));
22445
22445
  var _CapColumn = _interopRequireDefault(__webpack_require__(4757));
22446
22446
  var _CapFormItem = _interopRequireDefault(__webpack_require__(9660));
22447
- var _CapInput = _interopRequireDefault(__webpack_require__(15773));
22447
+ var _CapInput = __webpack_require__(15773);
22448
22448
  var _CapRadioButton = _interopRequireDefault(__webpack_require__(50880));
22449
22449
  var _CapRadioGroup = _interopRequireDefault(__webpack_require__(49269));
22450
22450
  var _CapRow = _interopRequireDefault(__webpack_require__(69813));
22451
22451
  var _CapSelect = _interopRequireDefault(__webpack_require__(80827));
22452
- __webpack_require__(24952);
22452
+ var _styles = _interopRequireDefault(__webpack_require__(24952));
22453
22453
  var _jsxRuntime = __webpack_require__(74848);
22454
- const _excluded = ["options"];
22454
+ const _excluded = ["options"],
22455
+ _excluded2 = ["label", "value"];
22455
22456
  /**
22456
22457
  * CapActionBar
22457
22458
  */
22458
22459
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22459
22460
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
22460
22461
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
22461
- function RadioButtonComponent(props) {
22462
- const {
22462
+ function RadioButtonComponent(_ref) {
22463
+ let {
22463
22464
  options
22464
- } = props,
22465
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
22465
+ } = _ref,
22466
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
22466
22467
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRadioGroup.default, _extends({}, otherProps, {
22467
- children: options.map((option, optionInd) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRadioButton.default, _extends({}, option, {
22468
- children: option.label
22469
- }), optionInd))
22468
+ children: options.map((option, optionInd) => {
22469
+ const {
22470
+ label,
22471
+ value
22472
+ } = option,
22473
+ restOptionProps = _objectWithoutPropertiesLoose(option, _excluded2);
22474
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRadioButton.default, _extends({
22475
+ value: value
22476
+ }, restOptionProps, {
22477
+ children: label
22478
+ }), optionInd);
22479
+ })
22470
22480
  }));
22471
22481
  }
22472
- class CapActionBar extends _react.default.Component {
22473
- render() {
22474
- const rowProps = this.props.row ? this.props.row.props : [];
22475
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, _extends({}, rowProps, {
22476
- className: this.props.className ? "cap-action-bar-v2 " + this.props.className : 'cap-action-bar-v2',
22477
- children: [this.props.search && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, this.props.search.capColumn, {
22478
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, this.props.search.formItem, {
22479
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapInput.default.Search, _extends({}, this.props.search.props))
22480
- }))
22481
- })), this.props.filterItemOne && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, this.props.filterItemOne.capColumn, {
22482
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, this.props.filterItemOne.formItem, {
22483
- children: this.props.filterItemOne.radioButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RadioButtonComponent, _extends({}, this.props.filterItemOne.props)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, this.props.filterItemOne.props))
22484
- }))
22485
- })), this.props.filterItemTwo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, this.props.filterItemTwo.capColumn, {
22486
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, this.props.filterItemTwo.formItem, {
22487
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, this.props.filterItemTwo.props))
22488
- }))
22489
- })), this.props.sort && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, this.props.sort.capColumn, {
22490
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, this.props.sort.formItem, {
22491
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, this.props.sort.props))
22492
- }))
22493
- })), this.props.actionItemOne && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, this.props.actionItemOne.capColumn, {
22494
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, _extends({}, this.props.actionItemOne.props, {
22495
- children: this.props.actionItemOne.props.children
22496
- }))
22497
- })), this.props.actionItemTwo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, this.props.actionItemTwo.capColumn, {
22498
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, _extends({}, this.props.actionItemTwo.props, {
22499
- children: this.props.actionItemTwo.props.children
22500
- }))
22501
- }))]
22502
- }));
22503
- }
22504
- }
22505
- exports["default"] = CapActionBar;
22506
- CapActionBar.propTypes = {
22507
- className: _propTypes.default.string,
22508
- search: _propTypes.default.object,
22509
- filterItemOne: _propTypes.default.object,
22510
- row: _propTypes.default.object,
22511
- sort: _propTypes.default.object,
22512
- filterItemTwo: _propTypes.default.object,
22513
- actionItemOne: _propTypes.default.object,
22514
- actionItemTwo: _propTypes.default.object
22515
- };
22516
- RadioButtonComponent.propTypes = {
22517
- onChange: _propTypes.default.func,
22518
- options: _propTypes.default.array
22482
+ const CapActionBar = _ref2 => {
22483
+ let {
22484
+ className,
22485
+ search,
22486
+ filterItemOne,
22487
+ filterItemTwo,
22488
+ sort,
22489
+ actionItemOne,
22490
+ actionItemTwo,
22491
+ row
22492
+ } = _ref2;
22493
+ const rowProps = (row == null ? void 0 : row.props) || {};
22494
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, _extends({}, rowProps, {
22495
+ className: (0, _classnames.default)(_styles.default['cap-action-bar'], className),
22496
+ children: [search && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, search.capColumn, {
22497
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, search.formItem, {
22498
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapInput.CapInputSearch, _extends({}, search.props))
22499
+ }))
22500
+ })), filterItemOne && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, filterItemOne.capColumn, {
22501
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, filterItemOne.formItem, {
22502
+ children: filterItemOne.radioButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RadioButtonComponent, _extends({}, filterItemOne.props)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, filterItemOne.props))
22503
+ }))
22504
+ })), filterItemTwo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, filterItemTwo.capColumn, {
22505
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, filterItemTwo.formItem, {
22506
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, filterItemTwo.props))
22507
+ }))
22508
+ })), sort && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, sort.capColumn, {
22509
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, sort.formItem, {
22510
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, sort.props))
22511
+ }))
22512
+ })), actionItemOne && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, actionItemOne.capColumn, {
22513
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, _extends({}, actionItemOne.props, {
22514
+ children: actionItemOne.props.children
22515
+ }))
22516
+ })), actionItemTwo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, actionItemTwo.capColumn, {
22517
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, _extends({}, actionItemTwo.props, {
22518
+ children: actionItemTwo.props.children
22519
+ }))
22520
+ }))]
22521
+ }));
22519
22522
  };
22523
+ var _default = exports["default"] = CapActionBar;
22520
22524
  })();
22521
22525
 
22522
22526
  module.exports = __webpack_exports__;