@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.
- package/CapActionBar/README.md +11 -0
- package/CapActionBar/index.d.ts +5 -0
- package/CapActionBar/index.d.ts.map +1 -0
- package/CapActionBar/index.js +62 -58
- package/CapActionBar/index.js.map +1 -1
- package/CapActionBar/types.d.ts +80 -0
- package/CapActionBar/types.d.ts.map +1 -0
- package/CapListLayout/index.js +62 -58
- package/CapListLayout/index.js.map +1 -1
- package/assets/HOCs/ComponentWithLabelHOC/types.d.ts +0 -2
- package/assets/HOCs/ComponentWithLabelHOC/types.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +165 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { CapButtonProps } from '../CapButton';
|
|
2
|
+
import type { CapColumnProps } from '../CapColumn';
|
|
3
|
+
import type { CapFormItemProps } from '../CapFormItem/types';
|
|
4
|
+
import type { CapInputSearchProps } from '../CapInput';
|
|
5
|
+
import type { CapRadioGroupProps } from '../CapRadioGroup';
|
|
6
|
+
import type { CapRowProps } from '../CapRow/types';
|
|
7
|
+
import type { CapSelectProps } from '../CapSelect/types';
|
|
8
|
+
import type React from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration for radio button options
|
|
11
|
+
*/
|
|
12
|
+
export interface RadioButtonOption {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string | number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for a search input item
|
|
19
|
+
*/
|
|
20
|
+
export interface SearchItemConfig {
|
|
21
|
+
capColumn: CapColumnProps;
|
|
22
|
+
formItem: CapFormItemProps;
|
|
23
|
+
props: CapInputSearchProps;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for a filter item (can be select or radio button)
|
|
27
|
+
*/
|
|
28
|
+
export interface FilterItemConfig {
|
|
29
|
+
capColumn: CapColumnProps;
|
|
30
|
+
formItem: CapFormItemProps;
|
|
31
|
+
props: CapSelectProps | (CapRadioGroupProps & {
|
|
32
|
+
options: RadioButtonOption[];
|
|
33
|
+
});
|
|
34
|
+
radioButton?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Configuration for a sort select item
|
|
38
|
+
*/
|
|
39
|
+
export interface SortItemConfig {
|
|
40
|
+
capColumn: CapColumnProps;
|
|
41
|
+
formItem: CapFormItemProps;
|
|
42
|
+
props: CapSelectProps;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Configuration for an action button item
|
|
46
|
+
*/
|
|
47
|
+
export interface ActionItemConfig {
|
|
48
|
+
capColumn: CapColumnProps;
|
|
49
|
+
props: CapButtonProps & {
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Configuration for the row wrapper
|
|
55
|
+
*/
|
|
56
|
+
export interface RowConfig {
|
|
57
|
+
props: CapRowProps;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Props for CapActionBar component
|
|
61
|
+
*/
|
|
62
|
+
export interface CapActionBarProps {
|
|
63
|
+
/** Custom className for the action bar */
|
|
64
|
+
className?: string;
|
|
65
|
+
/** Configuration for search input */
|
|
66
|
+
search?: SearchItemConfig;
|
|
67
|
+
/** Configuration for first filter item (select or radio button) */
|
|
68
|
+
filterItemOne?: FilterItemConfig;
|
|
69
|
+
/** Configuration for second filter item (select) */
|
|
70
|
+
filterItemTwo?: FilterItemConfig;
|
|
71
|
+
/** Configuration for sort select */
|
|
72
|
+
sort?: SortItemConfig;
|
|
73
|
+
/** Configuration for first action button */
|
|
74
|
+
actionItemOne?: ActionItemConfig;
|
|
75
|
+
/** Configuration for second action button */
|
|
76
|
+
actionItemTwo?: ActionItemConfig;
|
|
77
|
+
/** Configuration for the row wrapper */
|
|
78
|
+
row?: RowConfig;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapActionBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,mBAAmB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,cAAc,GAAG,CAAC,kBAAkB,GAAG;QAAE,OAAO,EAAE,iBAAiB,EAAE,CAAA;KAAE,CAAC,CAAC;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,cAAc,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,cAAc,GAAG;QAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,mEAAmE;IACnE,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,oDAAoD;IACpD,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,oCAAoC;IACpC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,6CAA6C;IAC7C,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,wCAAwC;IACxC,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB"}
|
package/CapListLayout/index.js
CHANGED
|
@@ -2477,84 +2477,88 @@ var _default = exports["default"] = (0, _ComponentWithLabelHOC.default)(CapInput
|
|
|
2477
2477
|
|
|
2478
2478
|
exports.__esModule = true;
|
|
2479
2479
|
exports["default"] = void 0;
|
|
2480
|
-
var
|
|
2480
|
+
var _classnames = _interopRequireDefault(__webpack_require__(46942));
|
|
2481
2481
|
var _react = _interopRequireDefault(__webpack_require__(9206));
|
|
2482
2482
|
var _CapButton = _interopRequireDefault(__webpack_require__(80739));
|
|
2483
2483
|
var _CapColumn = _interopRequireDefault(__webpack_require__(4757));
|
|
2484
2484
|
var _CapFormItem = _interopRequireDefault(__webpack_require__(9660));
|
|
2485
|
-
var _CapInput =
|
|
2485
|
+
var _CapInput = __webpack_require__(15773);
|
|
2486
2486
|
var _CapRadioButton = _interopRequireDefault(__webpack_require__(50880));
|
|
2487
2487
|
var _CapRadioGroup = _interopRequireDefault(__webpack_require__(49269));
|
|
2488
2488
|
var _CapRow = _interopRequireDefault(__webpack_require__(69813));
|
|
2489
2489
|
var _CapSelect = _interopRequireDefault(__webpack_require__(80827));
|
|
2490
|
-
__webpack_require__(24952);
|
|
2490
|
+
var _styles = _interopRequireDefault(__webpack_require__(24952));
|
|
2491
2491
|
var _jsxRuntime = __webpack_require__(74848);
|
|
2492
|
-
const _excluded = ["options"]
|
|
2492
|
+
const _excluded = ["options"],
|
|
2493
|
+
_excluded2 = ["label", "value"];
|
|
2493
2494
|
/**
|
|
2494
2495
|
* CapActionBar
|
|
2495
2496
|
*/
|
|
2496
2497
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
2497
2498
|
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); }
|
|
2498
2499
|
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; }
|
|
2499
|
-
function RadioButtonComponent(
|
|
2500
|
-
|
|
2500
|
+
function RadioButtonComponent(_ref) {
|
|
2501
|
+
let {
|
|
2501
2502
|
options
|
|
2502
|
-
} =
|
|
2503
|
-
otherProps = _objectWithoutPropertiesLoose(
|
|
2503
|
+
} = _ref,
|
|
2504
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2504
2505
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRadioGroup.default, _extends({}, otherProps, {
|
|
2505
|
-
children: options.map((option, optionInd) =>
|
|
2506
|
-
|
|
2507
|
-
|
|
2506
|
+
children: options.map((option, optionInd) => {
|
|
2507
|
+
const {
|
|
2508
|
+
label,
|
|
2509
|
+
value
|
|
2510
|
+
} = option,
|
|
2511
|
+
restOptionProps = _objectWithoutPropertiesLoose(option, _excluded2);
|
|
2512
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapRadioButton.default, _extends({
|
|
2513
|
+
value: value
|
|
2514
|
+
}, restOptionProps, {
|
|
2515
|
+
children: label
|
|
2516
|
+
}), optionInd);
|
|
2517
|
+
})
|
|
2508
2518
|
}));
|
|
2509
2519
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
}))
|
|
2527
|
-
}))
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
}))
|
|
2531
|
-
}))
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
}))
|
|
2535
|
-
}))
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
}))
|
|
2539
|
-
}))
|
|
2540
|
-
}))
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
filterItemTwo: _propTypes.default.object,
|
|
2551
|
-
actionItemOne: _propTypes.default.object,
|
|
2552
|
-
actionItemTwo: _propTypes.default.object
|
|
2553
|
-
};
|
|
2554
|
-
RadioButtonComponent.propTypes = {
|
|
2555
|
-
onChange: _propTypes.default.func,
|
|
2556
|
-
options: _propTypes.default.array
|
|
2520
|
+
const CapActionBar = _ref2 => {
|
|
2521
|
+
let {
|
|
2522
|
+
className,
|
|
2523
|
+
search,
|
|
2524
|
+
filterItemOne,
|
|
2525
|
+
filterItemTwo,
|
|
2526
|
+
sort,
|
|
2527
|
+
actionItemOne,
|
|
2528
|
+
actionItemTwo,
|
|
2529
|
+
row
|
|
2530
|
+
} = _ref2;
|
|
2531
|
+
const rowProps = (row == null ? void 0 : row.props) || {};
|
|
2532
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CapRow.default, _extends({}, rowProps, {
|
|
2533
|
+
className: (0, _classnames.default)(_styles.default['cap-action-bar'], className),
|
|
2534
|
+
children: [search && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, search.capColumn, {
|
|
2535
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, search.formItem, {
|
|
2536
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapInput.CapInputSearch, _extends({}, search.props))
|
|
2537
|
+
}))
|
|
2538
|
+
})), filterItemOne && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, filterItemOne.capColumn, {
|
|
2539
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, filterItemOne.formItem, {
|
|
2540
|
+
children: filterItemOne.radioButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RadioButtonComponent, _extends({}, filterItemOne.props)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, filterItemOne.props))
|
|
2541
|
+
}))
|
|
2542
|
+
})), filterItemTwo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, filterItemTwo.capColumn, {
|
|
2543
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, filterItemTwo.formItem, {
|
|
2544
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, filterItemTwo.props))
|
|
2545
|
+
}))
|
|
2546
|
+
})), sort && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, sort.capColumn, {
|
|
2547
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapFormItem.default, _extends({}, sort.formItem, {
|
|
2548
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSelect.default, _extends({}, sort.props))
|
|
2549
|
+
}))
|
|
2550
|
+
})), actionItemOne && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, actionItemOne.capColumn, {
|
|
2551
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, _extends({}, actionItemOne.props, {
|
|
2552
|
+
children: actionItemOne.props.children
|
|
2553
|
+
}))
|
|
2554
|
+
})), actionItemTwo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapColumn.default, _extends({}, actionItemTwo.capColumn, {
|
|
2555
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapButton.default, _extends({}, actionItemTwo.props, {
|
|
2556
|
+
children: actionItemTwo.props.children
|
|
2557
|
+
}))
|
|
2558
|
+
}))]
|
|
2559
|
+
}));
|
|
2557
2560
|
};
|
|
2561
|
+
var _default = exports["default"] = CapActionBar;
|
|
2558
2562
|
|
|
2559
2563
|
/***/ }),
|
|
2560
2564
|
|