ywana-core8 0.0.906 → 0.0.907

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.
@@ -3011,29 +3011,120 @@ var Viewer = function Viewer(_ref) {
3011
3011
  */
3012
3012
  var Kanban = function Kanban(_ref) {
3013
3013
  var children = _ref.children;
3014
+ useMemo(function () {
3015
+ var found = React.Children.map(children, function (child) {
3016
+ if (child.type.name === KanbanSwimlane.name) {
3017
+ return child;
3018
+ }
3019
+ });
3020
+ return found.length > 0;
3021
+ });
3014
3022
  return /*#__PURE__*/React.createElement("div", {
3015
- className: "kanban"
3023
+ className: "kanban with-swimlanes"
3016
3024
  }, children);
3017
3025
  };
3026
+ var KanbanHeader = function KanbanHeader(props) {
3027
+ var columns = props.columns;
3028
+ return /*#__PURE__*/React.createElement("div", {
3029
+ className: "kanban-header"
3030
+ }, columns.map(function (column, index) {
3031
+ var icon = column.icon,
3032
+ title = column.title,
3033
+ subtitle = column.subtitle,
3034
+ badge = column.badge;
3035
+ return /*#__PURE__*/React.createElement("div", {
3036
+ className: "kanban-column",
3037
+ key: index
3038
+ }, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
3039
+ icon: icon
3040
+ }), /*#__PURE__*/React.createElement("div", {
3041
+ className: "title"
3042
+ }, /*#__PURE__*/React.createElement(Text, {
3043
+ use: "headline6"
3044
+ }, title), /*#__PURE__*/React.createElement(Text, {
3045
+ className: "secondary-text",
3046
+ use: "body2"
3047
+ }, subtitle)), /*#__PURE__*/React.createElement("div", {
3048
+ className: "badge"
3049
+ }, badge)));
3050
+ }));
3051
+ };
3052
+ var KanbanSwimlane = function KanbanSwimlane(_ref2) {
3053
+ var icon = _ref2.icon,
3054
+ title = _ref2.title,
3055
+ subtitle = _ref2.subtitle,
3056
+ badge = _ref2.badge,
3057
+ children = _ref2.children;
3058
+ var _useState = useState(true),
3059
+ unfold = _useState[0],
3060
+ setUnfold = _useState[1];
3061
+
3062
+ // cahnge all children headless prop to true
3063
+ // if there is only one child
3064
+ if (children.length === 1) {
3065
+ children = React.cloneElement(children, {
3066
+ headless: true
3067
+ });
3068
+ } else {
3069
+ children = React.Children.map(children, function (child) {
3070
+ return React.cloneElement(child, {
3071
+ headless: true
3072
+ });
3073
+ });
3074
+ }
3075
+
3076
+ // log al children headless prop
3077
+ children.forEach(function (child) {
3078
+ console.log(child.props.headless);
3079
+ });
3080
+ function toggle() {
3081
+ setUnfold(!unfold);
3082
+ }
3083
+ var toggleIcon = unfold ? "unfold_less" : "unfold_more";
3084
+ var toggleStyle = unfold ? "unfold" : "fold";
3085
+ return /*#__PURE__*/React.createElement("div", {
3086
+ className: "kanban-swimlane"
3087
+ }, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
3088
+ icon: icon,
3089
+ size: "small"
3090
+ }), /*#__PURE__*/React.createElement("div", {
3091
+ className: "title"
3092
+ }, /*#__PURE__*/React.createElement(Text, {
3093
+ use: "headline6"
3094
+ }, title, ":"), /*#__PURE__*/React.createElement(Text, {
3095
+ className: "secondary-text",
3096
+ use: "body2"
3097
+ }, subtitle)), /*#__PURE__*/React.createElement("div", {
3098
+ className: "badge"
3099
+ }, badge), /*#__PURE__*/React.createElement(Icon, {
3100
+ icon: toggleIcon,
3101
+ clickable: true,
3102
+ action: toggle
3103
+ })), /*#__PURE__*/React.createElement("main", {
3104
+ className: toggleStyle
3105
+ }, children));
3106
+ };
3018
3107
 
3019
3108
  /**
3020
3109
  * Kanban Column
3021
3110
  */
3022
- var KanbanColumn = function KanbanColumn(_ref2) {
3023
- var id = _ref2.id,
3024
- actions = _ref2.actions,
3025
- icon = _ref2.icon,
3026
- title = _ref2.title,
3027
- subtitle = _ref2.subtitle,
3028
- badge = _ref2.badge,
3029
- children = _ref2.children,
3030
- _ref2$minified = _ref2.minified,
3031
- minified = _ref2$minified === void 0 ? false : _ref2$minified,
3032
- _ref2$disabled = _ref2.disabled,
3033
- disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;
3034
- var _useState = useState(minified),
3035
- min = _useState[0],
3036
- setMin = _useState[1];
3111
+ var KanbanColumn = function KanbanColumn(_ref3) {
3112
+ var id = _ref3.id,
3113
+ actions = _ref3.actions,
3114
+ _ref3$headless = _ref3.headless,
3115
+ headless = _ref3$headless === void 0 ? false : _ref3$headless,
3116
+ icon = _ref3.icon,
3117
+ title = _ref3.title,
3118
+ subtitle = _ref3.subtitle,
3119
+ badge = _ref3.badge,
3120
+ children = _ref3.children,
3121
+ _ref3$minified = _ref3.minified,
3122
+ minified = _ref3$minified === void 0 ? false : _ref3$minified,
3123
+ _ref3$disabled = _ref3.disabled,
3124
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
3125
+ var _useState2 = useState(minified),
3126
+ min = _useState2[0],
3127
+ setMin = _useState2[1];
3037
3128
  function toggle() {
3038
3129
  setMin(!min);
3039
3130
  }
@@ -3046,7 +3137,7 @@ var KanbanColumn = function KanbanColumn(_ref2) {
3046
3137
  action: toggle
3047
3138
  }))) : /*#__PURE__*/React.createElement("div", {
3048
3139
  className: "kanban-column " + id + " " + (disabled ? 'disabled' : '')
3049
- }, /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
3140
+ }, headless ? "" : /*#__PURE__*/React.createElement("header", null, /*#__PURE__*/React.createElement(Icon, {
3050
3141
  icon: icon
3051
3142
  }), /*#__PURE__*/React.createElement("div", {
3052
3143
  className: "title"
@@ -3068,10 +3159,10 @@ var KanbanColumn = function KanbanColumn(_ref2) {
3068
3159
  /**
3069
3160
  * Kanban Card
3070
3161
  */
3071
- var KanbanCard = function KanbanCard(_ref3) {
3072
- var className = _ref3.className,
3073
- color = _ref3.color,
3074
- children = _ref3.children;
3162
+ var KanbanCard = function KanbanCard(_ref4) {
3163
+ var className = _ref4.className,
3164
+ color = _ref4.color,
3165
+ children = _ref4.children;
3075
3166
  return /*#__PURE__*/React.createElement("div", {
3076
3167
  className: "kanban-card " + className + " " + color
3077
3168
  }, children);
@@ -11211,5 +11302,5 @@ var isFunction = function isFunction(value) {
11211
11302
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
11212
11303
  };
11213
11304
 
11214
- 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 };
11305
+ 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, KanbanHeader, KanbanSwimlane, 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 };
11215
11306
  //# sourceMappingURL=index.modern.js.map