ywana-core8 0.0.900 → 0.0.902

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.
@@ -434,6 +434,48 @@ var Button = function Button(_ref) {
434
434
  }) : null, /*#__PURE__*/React.createElement(Text, null, label));
435
435
  };
436
436
 
437
+ /**
438
+ * Action Button
439
+ */
440
+ var ActionButton = function ActionButton(props) {
441
+ var execute = function execute() {
442
+ try {
443
+ var _temp = function () {
444
+ if (states[_state]) {
445
+ return Promise.resolve(states[_state].action()).then(function (newState) {
446
+ if (newState) setState(newState);
447
+ });
448
+ }
449
+ }();
450
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
451
+ } catch (e) {
452
+ return Promise.reject(e);
453
+ }
454
+ };
455
+ var states = props.states,
456
+ state = props.state,
457
+ className = props.className;
458
+ var _useState = useState(),
459
+ _state = _useState[0],
460
+ setState = _useState[1];
461
+ useEffect(function () {
462
+ setState(state);
463
+ }, [state]);
464
+ useEffect(function () {
465
+ if (states[_state] && states[_state].autoexec) execute();
466
+ }, [_state]);
467
+ if (!_state) return null;
468
+ var _states$_state = states[_state],
469
+ icon = _states$_state.icon,
470
+ label = _states$_state.label;
471
+ return /*#__PURE__*/React.createElement(Button, _extends({}, props, {
472
+ icon: icon,
473
+ label: label,
474
+ action: execute,
475
+ className: className + " action-btn " + _state
476
+ }));
477
+ };
478
+
437
479
  /**
438
480
  * CheckBox
439
481
  */
@@ -11138,5 +11180,5 @@ var isFunction = function isFunction(value) {
11138
11180
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
11139
11181
  };
11140
11182
 
11141
- export { Accordion, Avatar, Button, Calendar, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DateRange, Dialog, DropDown, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, FoldersTreeView, Form, HTTPClient, Header, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MultiSelector, Page, PageContext, PageProvider, PasswordEditor, PasswordField, Planner, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextField, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction };
11183
+ export { Accordion, ActionButton, Avatar, Button, Calendar, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DateRange, Dialog, DropDown, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, FoldersTreeView, Form, HTTPClient, Header, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MultiSelector, Page, PageContext, PageProvider, PasswordEditor, PasswordField, Planner, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextField, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction };
11142
11184
  //# sourceMappingURL=index.modern.js.map