ywana-core8 0.0.900 → 0.0.901

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.
@@ -433,6 +433,43 @@ var Button = function Button(_ref) {
433
433
  action: click
434
434
  }) : null, /*#__PURE__*/React.createElement(Text, null, label));
435
435
  };
436
+ var ActionButton = function ActionButton(props) {
437
+ var icon = props.icon,
438
+ _props$state = props.state,
439
+ state = _props$state === void 0 ? "normal" : _props$state,
440
+ action = props.action,
441
+ className = props.className;
442
+ var _useState = useState("normal"),
443
+ _state = _useState[0],
444
+ setState = _useState[1];
445
+ useEffect(function () {
446
+ setState(state);
447
+ }, [state]);
448
+ function activate() {
449
+ setState("running");
450
+ if (action) action();
451
+ }
452
+ var actionIcon = icon;
453
+ switch (_state) {
454
+ case "normal":
455
+ actionIcon = icon;
456
+ break;
457
+ case "running":
458
+ actionIcon = "rotate_right";
459
+ break;
460
+ case "success":
461
+ actionIcon = "task_alt";
462
+ break;
463
+ case "error":
464
+ actionIcon = "error";
465
+ break;
466
+ }
467
+ return /*#__PURE__*/React.createElement(Button, _extends({}, props, {
468
+ icon: actionIcon,
469
+ action: activate,
470
+ className: className + " action-btn " + _state
471
+ }));
472
+ };
436
473
 
437
474
  /**
438
475
  * CheckBox
@@ -11138,5 +11175,5 @@ var isFunction = function isFunction(value) {
11138
11175
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
11139
11176
  };
11140
11177
 
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 };
11178
+ 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
11179
  //# sourceMappingURL=index.modern.js.map