@elliemae/ds-mini-toolbar 2.2.0-alpha.2 → 2.2.0-beta.0
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/cjs/Components/MiniToolbar.js +49 -60
- package/cjs/Components/ToolbarShortcut.js +60 -60
- package/cjs/Components/outOfTheBox/Button.js +27 -39
- package/cjs/Components/outOfTheBox/ComboBox.js +25 -39
- package/cjs/Components/outOfTheBox/IconItem.js +30 -44
- package/cjs/Components/outOfTheBox/SearchBox.js +48 -51
- package/cjs/Components/outOfTheBox/Separator.js +18 -38
- package/cjs/Components/outOfTheBox/index.js +26 -53
- package/cjs/hooks/useGenerateItems.js +101 -87
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +12 -38
- package/cjs/propTypes.js +27 -61
- package/cjs/styles.js +29 -62
- package/esm/Components/MiniToolbar.js +33 -25
- package/esm/Components/ToolbarShortcut.js +46 -26
- package/esm/Components/outOfTheBox/Button.js +18 -10
- package/esm/Components/outOfTheBox/ComboBox.js +17 -10
- package/esm/Components/outOfTheBox/IconItem.js +22 -15
- package/esm/Components/outOfTheBox/SearchBox.js +38 -22
- package/esm/Components/outOfTheBox/Separator.js +10 -9
- package/esm/Components/outOfTheBox/index.js +13 -24
- package/esm/hooks/useGenerateItems.js +85 -62
- package/esm/index.d.js +1 -2
- package/esm/index.js +2 -9
- package/esm/propTypes.js +19 -29
- package/esm/styles.js +17 -33
- package/package.json +6 -6
- package/types/Components/MiniToolbar.d.ts +1 -1
- package/cjs/Components/MiniToolbar.js.map +0 -7
- package/cjs/Components/ToolbarShortcut.js.map +0 -7
- package/cjs/Components/outOfTheBox/Button.js.map +0 -7
- package/cjs/Components/outOfTheBox/ComboBox.js.map +0 -7
- package/cjs/Components/outOfTheBox/IconItem.js.map +0 -7
- package/cjs/Components/outOfTheBox/SearchBox.js.map +0 -7
- package/cjs/Components/outOfTheBox/Separator.js.map +0 -7
- package/cjs/Components/outOfTheBox/index.js.map +0 -7
- package/cjs/hooks/useGenerateItems.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/esm/Components/MiniToolbar.js.map +0 -7
- package/esm/Components/ToolbarShortcut.js.map +0 -7
- package/esm/Components/outOfTheBox/Button.js.map +0 -7
- package/esm/Components/outOfTheBox/ComboBox.js.map +0 -7
- package/esm/Components/outOfTheBox/IconItem.js.map +0 -7
- package/esm/Components/outOfTheBox/SearchBox.js.map +0 -7
- package/esm/Components/outOfTheBox/Separator.js.map +0 -7
- package/esm/Components/outOfTheBox/index.js.map +0 -7
- package/esm/hooks/useGenerateItems.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styles.js.map +0 -7
|
@@ -1,39 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var Separator_exports = {};
|
|
29
|
-
__export(Separator_exports, {
|
|
30
|
-
MiniToolbarSeparator: () => MiniToolbarSeparator
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_styles = __toESM(require("../../styles"));
|
|
35
|
-
const MiniToolbarSeparator = () => /* @__PURE__ */ import_react.default.createElement(import_styles.Separator, {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('react');
|
|
7
|
+
var styles = require('../../styles.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
|
+
|
|
13
|
+
var _Separator;
|
|
14
|
+
|
|
15
|
+
const MiniToolbarSeparator = () => _Separator || (_Separator = /*#__PURE__*/_jsx__default["default"](styles.Separator, {
|
|
36
16
|
"data-testid": "ds-mini-toolbar__separator"
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
exports.MiniToolbarSeparator = MiniToolbarSeparator;
|
|
@@ -1,53 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var outOfTheBox_exports = {};
|
|
29
|
-
__export(outOfTheBox_exports, {
|
|
30
|
-
BUTTON: () => BUTTON,
|
|
31
|
-
COMBO_BOX: () => COMBO_BOX,
|
|
32
|
-
ICON_ITEM: () => ICON_ITEM,
|
|
33
|
-
MiniToolbarButton: () => import_Button.MiniToolbarButton,
|
|
34
|
-
MiniToolbarComboBox: () => import_ComboBox.MiniToolbarComboBox,
|
|
35
|
-
MiniToolbarIcon: () => import_IconItem.MiniToolbarIcon,
|
|
36
|
-
MiniToolbarSearchBox: () => import_SearchBox.MiniToolbarSearchBox,
|
|
37
|
-
MiniToolbarSeparator: () => import_Separator.MiniToolbarSeparator,
|
|
38
|
-
SEARCH_BOX: () => SEARCH_BOX,
|
|
39
|
-
SEPARATOR: () => SEPARATOR
|
|
40
|
-
});
|
|
41
|
-
var React = __toESM(require("react"));
|
|
42
|
-
var import_Button = __toESM(require("./Button"));
|
|
43
|
-
var import_IconItem = __toESM(require("./IconItem"));
|
|
44
|
-
var import_SearchBox = __toESM(require("./SearchBox"));
|
|
45
|
-
var import_Separator = __toESM(require("./Separator"));
|
|
46
|
-
var import_ComboBox = __toESM(require("./ComboBox"));
|
|
47
|
-
const ICON_ITEM = "ds-icon-item";
|
|
48
|
-
const SEPARATOR = "ds-separator";
|
|
49
|
-
const BUTTON = "ds-button";
|
|
50
|
-
const SEARCH_BOX = "ds-search-box";
|
|
51
|
-
const COMBO_BOX = "ds-combo-box";
|
|
52
|
-
module.exports = __toCommonJS(outOfTheBox_exports);
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Button = require('./Button.js');
|
|
6
|
+
var IconItem = require('./IconItem.js');
|
|
7
|
+
var SearchBox = require('./SearchBox.js');
|
|
8
|
+
var Separator = require('./Separator.js');
|
|
9
|
+
var ComboBox = require('./ComboBox.js');
|
|
10
|
+
|
|
11
|
+
const ICON_ITEM = 'ds-icon-item';
|
|
12
|
+
const SEPARATOR = 'ds-separator';
|
|
13
|
+
const BUTTON = 'ds-button';
|
|
14
|
+
const SEARCH_BOX = 'ds-search-box';
|
|
15
|
+
const COMBO_BOX = 'ds-combo-box';
|
|
16
|
+
|
|
17
|
+
exports.MiniToolbarButton = Button.MiniToolbarButton;
|
|
18
|
+
exports.MiniToolbarIcon = IconItem.MiniToolbarIcon;
|
|
19
|
+
exports.MiniToolbarSearchBox = SearchBox.MiniToolbarSearchBox;
|
|
20
|
+
exports.MiniToolbarSeparator = Separator.MiniToolbarSeparator;
|
|
21
|
+
exports.MiniToolbarComboBox = ComboBox.MiniToolbarComboBox;
|
|
22
|
+
exports.BUTTON = BUTTON;
|
|
23
|
+
exports.COMBO_BOX = COMBO_BOX;
|
|
24
|
+
exports.ICON_ITEM = ICON_ITEM;
|
|
25
|
+
exports.SEARCH_BOX = SEARCH_BOX;
|
|
26
|
+
exports.SEPARATOR = SEPARATOR;
|
|
@@ -1,120 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
+
var react = require('react');
|
|
15
|
+
var uid = require('uid');
|
|
16
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
17
|
+
var index = require('../Components/outOfTheBox/index.js');
|
|
18
|
+
var ToolbarShortcut = require('../Components/ToolbarShortcut.js');
|
|
19
|
+
var SearchBox = require('../Components/outOfTheBox/SearchBox.js');
|
|
20
|
+
var Separator = require('../Components/outOfTheBox/Separator.js');
|
|
21
|
+
var Button = require('../Components/outOfTheBox/Button.js');
|
|
22
|
+
var IconItem = require('../Components/outOfTheBox/IconItem.js');
|
|
23
|
+
var ComboBox = require('../Components/outOfTheBox/ComboBox.js');
|
|
24
|
+
|
|
25
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
|
+
|
|
27
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
28
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
29
|
+
|
|
30
|
+
var _MiniToolbarSeparator;
|
|
31
|
+
|
|
32
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
+
|
|
34
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
|
+
|
|
36
|
+
const useGenerateItems = items => {
|
|
37
|
+
const instanceUID = react.useMemo(() => uid.uid(6), []);
|
|
38
|
+
const shortcutItems = react.useMemo(() => items.filter(item => item.hasShortcut || item.component === index.SEARCH_BOX || item.contextualRegion).map((item, index$1) => {
|
|
39
|
+
const {
|
|
40
|
+
component,
|
|
41
|
+
shortcutComponent,
|
|
42
|
+
shortcutProps,
|
|
43
|
+
sharedProps,
|
|
44
|
+
contextualRegion,
|
|
45
|
+
contextualRegionProps
|
|
46
|
+
} = item;
|
|
43
47
|
let Component;
|
|
44
48
|
let ContextualRegion;
|
|
45
|
-
if (component ===
|
|
46
|
-
|
|
47
|
-
if (component === import_outOfTheBox.BUTTON)
|
|
48
|
-
Component = import_outOfTheBox.MiniToolbarButton;
|
|
49
|
-
else if (component === import_outOfTheBox.ICON_ITEM)
|
|
50
|
-
Component = import_outOfTheBox.MiniToolbarIcon;
|
|
51
|
-
else if (component === import_outOfTheBox.COMBO_BOX)
|
|
52
|
-
Component = import_outOfTheBox.MiniToolbarComboBox;
|
|
53
|
-
else if (component === import_outOfTheBox.SEARCH_BOX) {
|
|
49
|
+
if (component === index.SEPARATOR) return _MiniToolbarSeparator || (_MiniToolbarSeparator = /*#__PURE__*/_jsx__default["default"](Separator.MiniToolbarSeparator, {}));
|
|
50
|
+
if (component === index.BUTTON) Component = Button.MiniToolbarButton;else if (component === index.ICON_ITEM) Component = IconItem.MiniToolbarIcon;else if (component === index.COMBO_BOX) Component = ComboBox.MiniToolbarComboBox;else if (component === index.SEARCH_BOX) {
|
|
54
51
|
if (item.hasShortcut) {
|
|
55
|
-
Component =
|
|
52
|
+
Component = SearchBox.MiniToolbarSearchButton;
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
|
|
55
|
+
ContextualRegion = SearchBox.MiniToolbarSearchBox;
|
|
58
56
|
}
|
|
57
|
+
|
|
59
58
|
if (!ContextualRegion) {
|
|
60
59
|
ContextualRegion = contextualRegion;
|
|
61
60
|
}
|
|
61
|
+
|
|
62
62
|
if (!Component) {
|
|
63
63
|
Component = shortcutComponent;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Component,
|
|
68
|
-
shortcutProps,
|
|
69
|
-
sharedProps,
|
|
70
|
-
ContextualRegion,
|
|
71
|
-
contextualRegionProps
|
|
72
|
-
});
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/_jsx__default["default"](ToolbarShortcut.ToolbarShortcut, {
|
|
67
|
+
Component: Component,
|
|
68
|
+
shortcutProps: shortcutProps,
|
|
69
|
+
sharedProps: sharedProps,
|
|
70
|
+
ContextualRegion: ContextualRegion,
|
|
71
|
+
contextualRegionProps: contextualRegionProps
|
|
72
|
+
}, "".concat(instanceUID, "-shortcut-").concat(index$1));
|
|
73
73
|
}), [instanceUID, items]);
|
|
74
|
-
const dropdownMenuItems =
|
|
75
|
-
const {
|
|
74
|
+
const dropdownMenuItems = react.useMemo(() => items.map((item, index$1) => {
|
|
75
|
+
const {
|
|
76
|
+
component,
|
|
77
|
+
sharedProps,
|
|
78
|
+
dropdownComponentProps
|
|
79
|
+
} = item;
|
|
76
80
|
const dropdownItem = {};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
|
|
82
|
+
const {
|
|
83
|
+
Icon,
|
|
84
|
+
color,
|
|
85
|
+
label,
|
|
86
|
+
onClick
|
|
87
|
+
} = _objectSpread(_objectSpread({}, sharedProps), dropdownComponentProps);
|
|
88
|
+
|
|
89
|
+
if (component === index.SEPARATOR) dropdownItem.type = 'separator';else {
|
|
90
|
+
dropdownItem.id = "".concat(instanceUID, "-dropdown-").concat(index$1);
|
|
91
|
+
|
|
85
92
|
dropdownItem.onClick = () => onClick(item);
|
|
93
|
+
|
|
86
94
|
dropdownItem.label = label;
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
|
|
96
|
+
dropdownItem.onKeyDown = e => {
|
|
97
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
89
98
|
onClick(item);
|
|
90
99
|
}
|
|
91
100
|
};
|
|
92
101
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
|
|
103
|
+
if (component === index.ICON_ITEM) {
|
|
104
|
+
dropdownItem.leftAddon = /*#__PURE__*/_jsx__default["default"](Icon, {
|
|
105
|
+
color: color
|
|
96
106
|
});
|
|
97
|
-
} else if (component ===
|
|
98
|
-
dropdownItem.leftAddon =
|
|
99
|
-
color
|
|
107
|
+
} else if (component === index.SEARCH_BOX) {
|
|
108
|
+
dropdownItem.leftAddon = /*#__PURE__*/_jsx__default["default"](dsIcons.Search, {
|
|
109
|
+
color: color
|
|
100
110
|
});
|
|
101
|
-
} else if (component ===
|
|
102
|
-
dropdownItem.type =
|
|
111
|
+
} else if (component === index.COMBO_BOX) {
|
|
112
|
+
dropdownItem.type = 'subMenu';
|
|
103
113
|
dropdownItem.label = label;
|
|
104
|
-
dropdownItem.subItems = sharedProps.options.map((option,
|
|
105
|
-
option.id =
|
|
114
|
+
dropdownItem.subItems = sharedProps.options.map((option, index) => {
|
|
115
|
+
option.id = "".concat(instanceUID, "-option-").concat(index);
|
|
116
|
+
|
|
106
117
|
option.onClick = () => dropdownComponentProps.onSelectMenuItem(option);
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
|
|
119
|
+
option.onKeyDown = e => {
|
|
120
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
109
121
|
dropdownComponentProps.onSelectMenuItem(option);
|
|
110
122
|
}
|
|
111
123
|
};
|
|
124
|
+
|
|
112
125
|
return option;
|
|
113
126
|
});
|
|
114
127
|
}
|
|
128
|
+
|
|
115
129
|
return dropdownItem;
|
|
116
130
|
}), [instanceUID, items]);
|
|
117
131
|
return [shortcutItems, dropdownMenuItems];
|
|
118
132
|
};
|
|
119
|
-
|
|
120
|
-
|
|
133
|
+
|
|
134
|
+
exports.useGenerateItems = useGenerateItems;
|
package/cjs/index.d.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var index_d_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(index_d_exports);
|
|
27
|
-
//# sourceMappingURL=index.d.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
package/cjs/index.js
CHANGED
|
@@ -1,38 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
MiniToolbar: () => import_MiniToolbar.MiniToolbar,
|
|
31
|
-
MiniToolbarWithSchema: () => import_MiniToolbar.MiniToolbarWithSchema,
|
|
32
|
-
ToolbarItemWithSchema: () => import_propTypes.ToolbarItemWithSchema
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_MiniToolbar = __toESM(require("./Components/MiniToolbar"));
|
|
36
|
-
var import_propTypes = __toESM(require("./propTypes"));
|
|
37
|
-
module.exports = __toCommonJS(src_exports);
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var MiniToolbar = require('./Components/MiniToolbar.js');
|
|
6
|
+
var propTypes = require('./propTypes.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.MiniToolbar = MiniToolbar.MiniToolbar;
|
|
11
|
+
exports.MiniToolbarWithSchema = MiniToolbar.MiniToolbarWithSchema;
|
|
12
|
+
exports.ToolbarItemWithSchema = propTypes.ToolbarItemWithSchema;
|
package/cjs/propTypes.js
CHANGED
|
@@ -1,69 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var propTypes_exports = {};
|
|
29
|
-
__export(propTypes_exports, {
|
|
30
|
-
ToolbarItemWithSchema: () => ToolbarItemWithSchema,
|
|
31
|
-
miniToolbarProps: () => miniToolbarProps
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
35
|
-
const outOfTheBoxType = import_react_desc.PropTypes.oneOf([
|
|
36
|
-
"ds-button",
|
|
37
|
-
"ds-icon-item",
|
|
38
|
-
"ds-separator",
|
|
39
|
-
"ds-search-box",
|
|
40
|
-
"ds-combo-box"
|
|
41
|
-
]).description("out-of-the-box toolbar components");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
|
|
7
|
+
const outOfTheBoxType = reactDesc.PropTypes.oneOf(['ds-button', 'ds-icon-item', 'ds-separator', 'ds-search-box', 'ds-combo-box']).description('out-of-the-box toolbar components');
|
|
42
8
|
const toolbarItemProps = {
|
|
43
|
-
component:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
sharedProps: import_react_desc.PropTypes.object.description("Props shared by shortcut component and dropdown component"),
|
|
52
|
-
contextualRegion: import_react_desc.PropTypes.element.description("Component that can be rendered as an adjacent region to the shortcut component"),
|
|
53
|
-
contextualRegionProps: import_react_desc.PropTypes.object.description("Contextual region component props")
|
|
9
|
+
component: reactDesc.PropTypes.oneOfType([outOfTheBoxType, reactDesc.PropTypes.element]).description('Main component').isRequired,
|
|
10
|
+
hasShortcut: reactDesc.PropTypes.bool.description('Whether to include the component as a shortcut in the toolbar or not').defaultValue(false),
|
|
11
|
+
shortcutComponent: reactDesc.PropTypes.element.description('Component to render as a shortcut in the toolbar'),
|
|
12
|
+
shortcutProps: reactDesc.PropTypes.object.description('Shortcut component props'),
|
|
13
|
+
dropdownComponentProps: reactDesc.PropTypes.object.description('Dropdown component props'),
|
|
14
|
+
sharedProps: reactDesc.PropTypes.object.description('Props shared by shortcut component and dropdown component'),
|
|
15
|
+
contextualRegion: reactDesc.PropTypes.element.description('Component that can be rendered as an adjacent region to the shortcut component'),
|
|
16
|
+
contextualRegionProps: reactDesc.PropTypes.object.description('Contextual region component props')
|
|
54
17
|
};
|
|
55
|
-
const itemPropTypes =
|
|
18
|
+
const itemPropTypes = reactDesc.PropTypes.shape(toolbarItemProps).description('Items props');
|
|
56
19
|
const overflowButtonPropTypes = {
|
|
57
|
-
ariaLabel:
|
|
58
|
-
buttonType:
|
|
59
|
-
style:
|
|
20
|
+
ariaLabel: reactDesc.PropTypes.string,
|
|
21
|
+
buttonType: reactDesc.PropTypes.oneOf(['secondary', 'text']),
|
|
22
|
+
style: reactDesc.PropTypes.object
|
|
60
23
|
};
|
|
61
24
|
const miniToolbarProps = {
|
|
62
|
-
items:
|
|
63
|
-
overflowButtonProps:
|
|
25
|
+
items: reactDesc.PropTypes.arrayOf(itemPropTypes).description('Array of items').isRequired,
|
|
26
|
+
overflowButtonProps: reactDesc.PropTypes.shape(overflowButtonPropTypes).description('Overflow button props')
|
|
64
27
|
};
|
|
28
|
+
|
|
65
29
|
const ToolbarItem = () => null;
|
|
66
|
-
|
|
30
|
+
|
|
31
|
+
const ToolbarItemWithSchema = reactDesc.describe(ToolbarItem);
|
|
67
32
|
ToolbarItemWithSchema.propTypes = toolbarItemProps;
|
|
68
|
-
|
|
69
|
-
|
|
33
|
+
|
|
34
|
+
exports.ToolbarItemWithSchema = ToolbarItemWithSchema;
|
|
35
|
+
exports.miniToolbarProps = miniToolbarProps;
|