aio-card 1.0.0 → 2.0.1

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.
Files changed (4) hide show
  1. package/index.css +5 -1
  2. package/index.d.ts +71 -112
  3. package/index.js +43 -169
  4. package/package.json +5 -3
package/index.css CHANGED
@@ -3,6 +3,7 @@
3
3
  overflow: hidden;
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ flex-shrink:0;
6
7
  }
7
8
 
8
9
  .aio-cards-horizontal{
@@ -17,7 +18,9 @@
17
18
  .aio-card-text{
18
19
  height:100%;
19
20
  }
20
-
21
+ .aio-card-drag-icon{
22
+ width:12px;
23
+ }
21
24
  .aio-card-footer{
22
25
  overflow:hidden;
23
26
  }
@@ -135,6 +138,7 @@
135
138
  position: relative;
136
139
  display:flex;
137
140
  flex-direction: column;
141
+ gap:0.2em;
138
142
  }
139
143
  .aio-card-text-justify{
140
144
  justify-content: center;
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type FC, ReactNode } from "react";
1
+ import { type FC, type ReactNode } from "react";
2
2
  import './index.css';
3
3
  export type I_CardPopoverRef = React.RefObject<{
4
4
  open: () => void;
@@ -16,100 +16,116 @@ export type I_Cards<T> = {
16
16
  disabled?: boolean;
17
17
  placeholder?: ReactNode;
18
18
  option: {
19
- text?: (p: {
20
- row: T;
19
+ value?: (row: T, p: {
21
20
  index: number;
21
+ value: any;
22
+ disabled: boolean;
23
+ row: any;
22
24
  }) => ReactNode;
23
- value?: (p: {
24
- row: T;
25
+ text?: (row: T, p: {
25
26
  index: number;
27
+ value: any;
28
+ disabled: boolean;
29
+ row: any;
26
30
  }) => ReactNode;
27
- show?: (p: {
28
- row: T;
31
+ show?: (row: T, p: {
29
32
  index: number;
33
+ value: any;
34
+ disabled: boolean;
35
+ row: any;
30
36
  }) => boolean | undefined;
31
- before?: (p: {
32
- row: T;
37
+ before?: (row: T, p: {
33
38
  index: number;
39
+ value: any;
40
+ disabled: boolean;
41
+ row: any;
34
42
  }) => ReactNode[] | undefined;
35
- after?: (p: {
36
- row: T;
43
+ after?: (row: T, p: {
37
44
  index: number;
45
+ value: any;
46
+ disabled: boolean;
47
+ row: any;
38
48
  }) => ReactNode[] | undefined;
39
- disabled?: (p: {
40
- row: T;
49
+ disabled?: (row: T, p: {
41
50
  index: number;
51
+ value: any;
52
+ disabled: boolean;
53
+ row: any;
42
54
  }) => boolean | undefined;
43
- header?: (p: {
44
- row: T;
55
+ header?: (row: T, p: {
45
56
  index: number;
57
+ value: any;
58
+ disabled: boolean;
59
+ row: any;
46
60
  }) => ReactNode | undefined;
47
- footer?: (p: {
48
- row: T;
61
+ footer?: (row: T, p: {
49
62
  index: number;
63
+ value: any;
64
+ disabled: boolean;
65
+ row: any;
50
66
  }) => ReactNode | undefined;
51
- layoutAttrs?: (p: {
52
- row: T;
67
+ layoutAttrs?: (row: T, p: {
53
68
  index: number;
69
+ value: any;
70
+ disabled: boolean;
71
+ row: any;
54
72
  }) => any;
55
- attrs?: (p: {
56
- row: T;
73
+ attrs?: (row: T, p: {
57
74
  index: number;
75
+ value: any;
76
+ disabled: boolean;
77
+ row: any;
58
78
  }) => any;
59
- footerAttrs?: (p: {
60
- row: T;
79
+ footerAttrs?: (row: T, p: {
61
80
  index: number;
81
+ value: any;
82
+ disabled: boolean;
83
+ row: any;
62
84
  }) => any;
63
- className?: (p: {
64
- row: T;
85
+ className?: (row: T, p: {
65
86
  index: number;
87
+ value: any;
88
+ disabled: boolean;
89
+ row: any;
66
90
  }) => (string | undefined)[] | undefined;
67
- style?: (p: {
68
- row: T;
91
+ style?: (row: T, p: {
69
92
  index: number;
93
+ value: any;
94
+ disabled: boolean;
95
+ row: any;
70
96
  }) => any;
71
- onClick?: (p: {
72
- row: T;
73
- index: number;
74
- e?: React.MouseEvent<HTMLDivElement>;
75
- }) => void;
76
- actions?: (p: {
77
- row: T;
78
- index: number;
79
- }) => {
80
- text: ReactNode;
81
- before?: ReactNode;
82
- onClick?: () => void;
83
- }[];
84
- html?: (p: {
85
- row: T;
97
+ html?: (row: T, p: {
86
98
  index: number;
99
+ value: any;
100
+ disabled: boolean;
101
+ row: any;
87
102
  }) => ReactNode;
88
- showFooter?: (p: {
89
- row: T;
103
+ showFooter?: (row: T, p: {
90
104
  index: number;
105
+ value: any;
106
+ disabled: boolean;
107
+ row: any;
91
108
  }) => boolean | undefined;
92
- close?: (p: {
93
- row: T;
109
+ close?: (row: T, p: {
94
110
  index: number;
111
+ value: any;
112
+ disabled: boolean;
113
+ row: any;
95
114
  }) => boolean;
96
- justify?: (p: {
97
- row: T;
115
+ justify?: (row: T, p: {
98
116
  index: number;
117
+ value: any;
118
+ disabled: boolean;
119
+ row: any;
99
120
  }) => boolean;
100
121
  };
101
122
  };
102
123
  export type I_Card = {
124
+ showCard?: boolean;
103
125
  before?: ReactNode[];
104
126
  after?: ReactNode[];
105
127
  text: ReactNode;
106
- onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
107
128
  rtl?: boolean;
108
- actions?: {
109
- text: ReactNode;
110
- before?: ReactNode;
111
- onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
112
- }[];
113
129
  layoutAttrs?: any;
114
130
  disabled?: boolean;
115
131
  attrs?: any;
@@ -137,6 +153,7 @@ export type I_Card = {
137
153
  required?: boolean;
138
154
  footerAttrs?: any;
139
155
  justify?: boolean;
156
+ close?: boolean;
140
157
  popover?: {
141
158
  focus?: boolean | string;
142
159
  portal?: boolean;
@@ -175,61 +192,3 @@ export type I_CardPopoverActions = {
175
192
  isOpen: () => boolean;
176
193
  };
177
194
  export declare const Card: FC<I_Card>;
178
- export declare class GetSvg {
179
- private unit;
180
- constructor(unit?: 'rem' | 'em');
181
- private getStyle;
182
- private getSvgStyle;
183
- private fixSvgContent;
184
- getIcon: (path: string, size?: number, p?: {
185
- spin?: number;
186
- color?: string;
187
- }) => import("react/jsx-runtime").JSX.Element;
188
- private getFileIconName;
189
- getFileIcon: (file: File, size?: number, p?: {
190
- spin?: number;
191
- color?: string;
192
- }) => import("react/jsx-runtime").JSX.Element;
193
- mdiArrowDown: (color?: string) => import("react/jsx-runtime").JSX.Element;
194
- mdiArrowUp: (color?: string) => import("react/jsx-runtime").JSX.Element;
195
- mdiAttachment: (color?: string) => import("react/jsx-runtime").JSX.Element;
196
- mdiChevronDown: (color?: string) => import("react/jsx-runtime").JSX.Element;
197
- mdiChevronUp: (color?: string) => import("react/jsx-runtime").JSX.Element;
198
- mdiChevronRight: (color?: string) => import("react/jsx-runtime").JSX.Element;
199
- mdiCircleSmall: (color?: string) => import("react/jsx-runtime").JSX.Element;
200
- mdiCheckBold: (color?: string) => import("react/jsx-runtime").JSX.Element;
201
- mdiCheckboxMarked: (color?: string) => import("react/jsx-runtime").JSX.Element;
202
- mdiChevronLeft: (color?: string) => import("react/jsx-runtime").JSX.Element;
203
- mdiCircleMedium: (color?: string) => import("react/jsx-runtime").JSX.Element;
204
- mdiClose: (color?: string) => import("react/jsx-runtime").JSX.Element;
205
- mdiDelete: (color?: string) => import("react/jsx-runtime").JSX.Element;
206
- mdiDotsHorizontal: (color?: string) => import("react/jsx-runtime").JSX.Element;
207
- mdiEye: (color?: string) => import("react/jsx-runtime").JSX.Element;
208
- mdiEyeOff: (color?: string) => import("react/jsx-runtime").JSX.Element;
209
- mdiFile: (color?: string) => import("react/jsx-runtime").JSX.Element;
210
- mdiFileExcel: (color?: string) => import("react/jsx-runtime").JSX.Element;
211
- mdiFilter: (color?: string) => import("react/jsx-runtime").JSX.Element;
212
- mdiImage: (color?: string) => import("react/jsx-runtime").JSX.Element;
213
- mdiLoading: (color?: string) => import("react/jsx-runtime").JSX.Element;
214
- mdiListBox: (color?: string) => import("react/jsx-runtime").JSX.Element;
215
- mdiMagnify: (color?: string) => import("react/jsx-runtime").JSX.Element;
216
- mdiMenu: (color?: string) => import("react/jsx-runtime").JSX.Element;
217
- mdiMicrophoneOutline: (color?: string) => import("react/jsx-runtime").JSX.Element;
218
- mdiPlusThick: (color?: string) => import("react/jsx-runtime").JSX.Element;
219
- mdiSaveContent: (color?: string) => import("react/jsx-runtime").JSX.Element;
220
- mdiSelect: (color?: string) => import("react/jsx-runtime").JSX.Element;
221
- mdiSort: (color?: string) => import("react/jsx-runtime").JSX.Element;
222
- mdiMusic: (color?: string) => import("react/jsx-runtime").JSX.Element;
223
- mdiFilePdfBox: (color?: string) => import("react/jsx-runtime").JSX.Element;
224
- mdiFileWordBox: (color?: string) => import("react/jsx-runtime").JSX.Element;
225
- mdiFileExcelBox: (color?: string) => import("react/jsx-runtime").JSX.Element;
226
- mdiFilePowerPointBox: (color?: string) => import("react/jsx-runtime").JSX.Element;
227
- mdiZipBox: (color?: string) => import("react/jsx-runtime").JSX.Element;
228
- mdiCamera: (color?: string) => import("react/jsx-runtime").JSX.Element;
229
- mdiArrowUpDownBold: (color?: string) => import("react/jsx-runtime").JSX.Element;
230
- mdiSortVariantOff: (color?: string) => import("react/jsx-runtime").JSX.Element;
231
- mdiDownload: (color?: string) => import("react/jsx-runtime").JSX.Element;
232
- mdiCalculator: (color?: string) => import("react/jsx-runtime").JSX.Element;
233
- mdiPencil: (color?: string) => import("react/jsx-runtime").JSX.Element;
234
- mdiUpload: (color?: string) => import("react/jsx-runtime").JSX.Element;
235
- }
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { createContext, createRef, useContext, useRef } from "react";
3
- import * as UT from './../aio-utils';
4
- import usePopup from './../aio-popup';
5
- import { AISelect } from "../aio-input";
6
- import $ from 'jquery';
3
+ import usePopup from 'aio-popup';
4
+ import { DragAndDrop } from "aio-utils";
5
+ import { AddToAttrs } from "aio-class";
6
+ import { Mdie, $ } from "aio-deps";
7
7
  import './index.css';
8
8
  export const Cards = ({ items, attrs, option, direction, className = [], style, onSwap, rtl = false, placeholder, disabled }) => {
9
9
  const ref = useRef(createRef());
@@ -11,23 +11,26 @@ export const Cards = ({ items, attrs, option, direction, className = [], style,
11
11
  getContainer: () => ref.current,
12
12
  rtl,
13
13
  isActive: (index) => {
14
- const disabled = getByOption({ option, field: 'disabled', row: items[index], index });
15
- const show = getByOption({ option, field: 'show', row: items[index], index, def: true });
14
+ const row = items[index];
15
+ const disabled = getByOption({ option, field: 'disabled', row, index });
16
+ const show = getByOption({ option, field: 'show', row, index, def: true });
16
17
  return !disabled && !!show;
17
18
  },
18
19
  itemClassName: 'aio-card',
19
20
  getLength: () => items.length,
20
21
  onEnter: (e, index) => {
21
22
  const row = items[index];
22
- if (option.onClick) {
23
- option.onClick({ e, row, index });
23
+ const value = getByOption({ field: 'value', row, index, option });
24
+ const attrs = getByOption({ field: 'attrs', row, index, option });
25
+ if (attrs === null || attrs === void 0 ? void 0 : attrs.onClick) {
26
+ attrs.onClick(e, value);
24
27
  }
25
28
  else if (typeof row === 'object' && row.onClick) {
26
- row.onClick({ e, row, index });
29
+ row.onClick(e, value);
27
30
  }
28
31
  }
29
32
  });
30
- const Attrs = UT.AddToAttrs(Object.assign(Object.assign({ tabIndex: 0 }, attrs), { onKeyDown: kn.keyDown, ref }), {
33
+ const Attrs = AddToAttrs(Object.assign(Object.assign({ tabIndex: 0 }, attrs), { onKeyDown: kn.keyDown, ref }), {
31
34
  className: ['aio-cards', direction === 'horizontal' ? 'aio-cards-horizontal' : undefined, ...className],
32
35
  style
33
36
  });
@@ -35,9 +38,9 @@ export const Cards = ({ items, attrs, option, direction, className = [], style,
35
38
  return (_jsx("div", { className: "aio-cards-placeholder", children: placeholder }));
36
39
  }
37
40
  if (onSwap) {
38
- return (_jsx("div", Object.assign({}, Attrs, { children: _jsx(UT.DragAndDrop, { handle: '.aio-card-drag-icon', data: items, getId: (row, { index }) => getByOption({ field: 'value', row, option, index, def: '' }), getContent: (row, { id, index }) => {
39
- return _jsx(CardsItem, { row: row, option: option, index: index, direction: direction, value: id, draggable: !!onSwap, disabled: disabled }, id);
40
- }, onChange: (newOptions, fromIndex, toIndex) => onSwap(newOptions, fromIndex, toIndex) }) })));
41
+ return (_jsx(DragAndDrop, { attrs: Attrs, handle: '.aio-card-drag-icon', data: items, getId: (row, { index }) => getByOption({ field: 'value', row, option, index, def: '' }), getContent: (row, { id, index }) => {
42
+ return _jsx(CardsItem, { row: row, option: option, index: index, direction: direction, value: id, draggable: !!onSwap, disabled: disabled }, id);
43
+ }, onChange: (newOptions, fromIndex, toIndex) => onSwap(newOptions, fromIndex, toIndex) }));
41
44
  }
42
45
  return (_jsx("div", Object.assign({}, Attrs, { children: items.map((item, i) => {
43
46
  const value = getByOption({ field: 'value', row: item, option, index: i, def: '' });
@@ -45,8 +48,15 @@ export const Cards = ({ items, attrs, option, direction, className = [], style,
45
48
  }) })));
46
49
  };
47
50
  const getByOption = (p) => {
51
+ let value, disabled;
52
+ if (p.field !== "value") {
53
+ value = getByOption(Object.assign(Object.assign({}, p), { def: undefined, field: 'value' }));
54
+ if (p.field !== 'disabled') {
55
+ disabled = getByOption(Object.assign(Object.assign({}, p), { def: undefined, field: 'disabled' }));
56
+ }
57
+ }
48
58
  const { field, option, row, index, def } = p;
49
- const res = option[field] ? option[field]({ row, index }) : undefined;
59
+ const res = option[field] ? option[field](row, { index, value, disabled: !!disabled, row }) : undefined;
50
60
  if (res !== undefined) {
51
61
  return res;
52
62
  }
@@ -65,23 +75,7 @@ const CardsItem = ({ row, option, index, direction, draggable, disabled }) => {
65
75
  if (!show) {
66
76
  return null;
67
77
  }
68
- return (_jsx(Card, { popoverActions: popoverActions, index: index, direction: direction, draggable: draggable, showFooter: getByOption({ field: 'showFooter', row, option, index, def: true }), disabled: !!disabled ? true : getByOption({ field: 'disabled', row, option, index, def: false }), attrs: getByOption({ field: 'attrs', row, option, index, def: {} }), footerAttrs: getByOption({ field: 'footerAttrs', row, option, index }), className: getByOption({ field: 'className', row, option, index, def: [] }), style: getByOption({ field: 'style', row, option, index, def: {} }), before: getByOption({ field: 'before', row, option, index, def: [] }), after: getByOption({ field: 'after', row, option, index, def: [] }), text: getByOption({ field: 'text', row, option, index, def: '' }), header: getByOption({ field: 'header', row, option, index }), justify: getByOption({ field: 'justify', row, option, index }), footer: getByOption({ field: 'footer', row, option, index }), layoutAttrs: getByOption({ field: 'layoutAttrs', row, option, index }), actions: getByOption({ field: 'actions', row, option, index, def: [] }), onClick: (e) => {
69
- if (option.onClick) {
70
- option.onClick({ row, index, e });
71
- }
72
- else {
73
- const attrs = getByOption({ field: 'attrs', row, option, index });
74
- if (attrs === null || attrs === void 0 ? void 0 : attrs.onClick) {
75
- attrs.onClick(e);
76
- }
77
- else if (typeof row === 'object' && row.onClick) {
78
- row.onClick(e);
79
- }
80
- }
81
- if (getByOption({ field: 'close', row, option, index })) {
82
- popoverActions.close();
83
- }
84
- } }, index));
78
+ return (_jsx(Card, { popoverActions: popoverActions, index: index, direction: direction, draggable: draggable, showFooter: getByOption({ field: 'showFooter', row, option, index, def: true }), disabled: !!disabled ? true : getByOption({ field: 'disabled', row, option, index, def: false }), close: getByOption({ field: 'close', row, option, index }), footerAttrs: getByOption({ field: 'footerAttrs', row, option, index }), className: getByOption({ field: 'className', row, option, index, def: [] }), style: getByOption({ field: 'style', row, option, index, def: {} }), before: getByOption({ field: 'before', row, option, index, def: [] }), after: getByOption({ field: 'after', row, option, index, def: [] }), text: getByOption({ field: 'text', row, option, index, def: '' }), header: getByOption({ field: 'header', row, option, index }), justify: getByOption({ field: 'justify', row, option, index }), footer: getByOption({ field: 'footer', row, option, index }), layoutAttrs: getByOption({ field: 'layoutAttrs', row, option, index }), attrs: getByOption({ field: 'attrs', row, option, index, def: {} }) }, index));
85
79
  };
86
80
  const Context = createContext({});
87
81
  const Provider = ({ value, children }) => {
@@ -89,7 +83,7 @@ const Provider = ({ value, children }) => {
89
83
  };
90
84
  const useProvider = () => useContext(Context);
91
85
  export const Card = (props) => {
92
- const { text, footer, header, layoutAttrs, showFooter, show = true, placeholder, popoverActions, errorMessage, label, required, footerAttrs, justify } = props;
86
+ const { text, footer, header, layoutAttrs, showFooter, show = true, placeholder, popoverActions, errorMessage, label, required, footerAttrs, showCard = true } = props;
93
87
  const mainRef = useRef(null);
94
88
  const popup = usePopup();
95
89
  const cardClass = CardClass(mainRef, popup);
@@ -102,12 +96,12 @@ export const Card = (props) => {
102
96
  popoverActions.isOpen = () => !!popup.getModals().length;
103
97
  }
104
98
  const { beforeNodes, afterNodes } = cardClass.getSideNodes(props);
105
- const card = (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({}, cardClass.getCardAttrs(props), { children: [_jsx(CardBefore, { befores: beforeNodes }), _jsx(CardText, { text: text, placeholder: placeholder, justify: props.justify }), _jsx(CardAfter, { afters: afterNodes })] })), popup.render()] }));
99
+ const card = !showCard ? null : (_jsxs(_Fragment, { children: [_jsxs("div", Object.assign({}, cardClass.getCardAttrs(props), { children: [_jsx(CardBefore, { befores: beforeNodes }), _jsx(CardText, { text: text, placeholder: placeholder, justify: props.justify }), _jsx(CardAfter, { afters: afterNodes })] })), popup.render()] }));
106
100
  let result = card;
107
101
  if (errorMessage || label || header || footer || layoutAttrs) {
108
- const attrs = UT.AddToAttrs(layoutAttrs, { className: ["aio-card-layout"] });
102
+ const attrs = AddToAttrs(layoutAttrs, { className: ["aio-card-layout"] });
109
103
  result = (_jsxs("div", Object.assign({}, attrs, { children: [!!label && _jsx(CardLabel, { required: required, label: label, error: errorMessage }), header !== undefined && _jsx("div", { className: "aio-card-header", children: header }), _jsx("div", { className: "aio-card-body", children: card }), footer !== undefined && showFooter !== false &&
110
- _jsx("div", Object.assign({}, UT.AddToAttrs(footerAttrs, { className: ['aio-card-footer'] }), { children: footer })), !!errorMessage && _jsx("div", { className: "aio-card-error", children: errorMessage })] })));
104
+ _jsx("div", Object.assign({}, AddToAttrs(footerAttrs, { className: ['aio-card-footer', !showCard ? 'without-card' : undefined] }), { children: footer })), !!errorMessage && _jsx("div", { className: "aio-card-error", children: errorMessage })] })));
111
105
  }
112
106
  return (_jsx(Provider, { value: { rootProps: props, cardClass }, children: result }));
113
107
  };
@@ -115,7 +109,7 @@ const CardLabel = ({ label, required, error }) => {
115
109
  if (!label === undefined || !(label === null || label === void 0 ? void 0 : label.text)) {
116
110
  return null;
117
111
  }
118
- let labelContent = (_jsxs("label", Object.assign({}, UT.AddToAttrs(label.attrs, { className: ['aio-card-label', !!error ? 'has-error' : undefined], attrs: { title: error } }), { children: [required ? _jsx("div", { className: "aio-card-required", children: "*" }) : null, label.text] })));
112
+ let labelContent = (_jsxs("label", Object.assign({}, AddToAttrs(label.attrs, { className: ['aio-card-label', !!error ? 'has-error' : undefined], attrs: { title: error } }), { children: [required ? _jsx("div", { className: "aio-card-required", children: "*" }) : null, label.text] })));
119
113
  if (label.online) {
120
114
  return _jsx("div", { className: "aio-card-online-label", children: labelContent });
121
115
  }
@@ -141,7 +135,7 @@ const CardCaret = () => {
141
135
  const { caret = true, openByCaret } = rootProps;
142
136
  const getContnet = () => {
143
137
  if (caret === true) {
144
- return new UT.GetSvg('em').getIcon('mdiChevronDown', .8);
138
+ return Mdie('mdiChevronDown', .8);
145
139
  }
146
140
  if (typeof caret === 'function') {
147
141
  return caret(cardClass.isPopoverOpen());
@@ -152,23 +146,12 @@ const CardCaret = () => {
152
146
  };
153
147
  return (_jsx("div", { className: "aio-card-caret", onClick: openByCaret ? () => cardClass.openPopover(rootProps) : undefined, children: getContnet() }));
154
148
  };
155
- const CardActions = ({ actions }) => {
156
- return (_jsx(AISelect, { className: 'aio-card-actions', text: new GetSvg().getIcon('mdiDotsHorizontal', 0.7), options: actions || [], option: {
157
- text: (o) => o.text,
158
- before: (o) => o.before,
159
- onClick: (o) => o.onClick
160
- }, popover: { portal: true }, caret: false }));
161
- };
162
149
  function CardClass(mainRef, popup) {
163
150
  const isPopoverOpen = () => !!popup.getModals().length;
164
151
  const _getSideNodes = (mainProps, type) => {
165
- var _a;
166
152
  const Nodes = mainProps[type] || [];
167
153
  const nodes = Nodes.filter((o) => !!o && o !== null);
168
154
  const hasCaret = !!mainProps.popover && mainProps.caret !== false && type === 'after';
169
- if (((_a = mainProps.actions) === null || _a === void 0 ? void 0 : _a.length) && type === 'after') {
170
- nodes.splice(0, 0, _jsx(CardActions, { actions: mainProps.actions }));
171
- }
172
155
  if (hasCaret) {
173
156
  nodes.push(_jsx(CardCaret, {}));
174
157
  }
@@ -183,28 +166,31 @@ function CardClass(mainRef, popup) {
183
166
  return { beforeNodes, afterNodes };
184
167
  };
185
168
  const hasCardClick = (mainProps) => {
186
- const { disabled, onClick, popover, openByCaret } = mainProps;
169
+ const { disabled, attrs, popover, openByCaret } = mainProps;
187
170
  if (disabled) {
188
171
  return false;
189
172
  }
190
173
  if (popover && !openByCaret) {
191
174
  return true;
192
175
  }
193
- else if (onClick) {
194
- true;
176
+ else if (attrs === null || attrs === void 0 ? void 0 : attrs.onClick) {
177
+ return true;
195
178
  }
196
179
  return false;
197
180
  };
198
181
  const cardClick = (mainProps, e) => {
199
- const { disabled, onClick, popover, openByCaret } = mainProps;
182
+ const { disabled, attrs, popover, openByCaret, close, popoverActions } = mainProps;
200
183
  if (disabled) {
201
184
  return;
202
185
  }
203
186
  if (popover && !openByCaret) {
204
187
  openPopover(mainProps);
205
188
  }
206
- else if (onClick) {
207
- onClick(e);
189
+ else if (attrs === null || attrs === void 0 ? void 0 : attrs.onClick) {
190
+ attrs.onClick(e);
191
+ if (close) {
192
+ popoverActions === null || popoverActions === void 0 ? void 0 : popoverActions.close();
193
+ }
208
194
  }
209
195
  };
210
196
  const getCardAttrs = (mainProps) => {
@@ -216,7 +202,7 @@ function CardClass(mainRef, popup) {
216
202
  }
217
203
  };
218
204
  const defAttrs = Object.assign(Object.assign({ "data-index": index, onKeyDown }, attrs), { ref: mainRef, onClick: (e) => cardClick(mainProps, e) });
219
- const Attrs = UT.AddToAttrs(defAttrs, { className: [...className, "aio-card"], style });
205
+ const Attrs = AddToAttrs(defAttrs, { className: [...className, "aio-card"], style });
220
206
  if (hasCardClick(mainProps)) {
221
207
  Attrs.className += ' aio-card-pointer';
222
208
  }
@@ -233,10 +219,7 @@ function CardClass(mainRef, popup) {
233
219
  if (!popover) {
234
220
  return;
235
221
  }
236
- let obj = Object.assign(Object.assign({}, popover), { body: popover.body || null, isPopover: true, rtl: !!mainProps.rtl, position: popover.position || 'popover', getTarget: () => {
237
- const res = $(mainRef.current);
238
- return res;
239
- } });
222
+ let obj = Object.assign(Object.assign({}, popover), { body: popover.body || null, isPopover: true, rtl: !!mainProps.rtl, position: popover.position || 'popover', getTarget: () => mainRef.current });
240
223
  return obj;
241
224
  };
242
225
  const openPopover = (mainProps) => {
@@ -259,117 +242,8 @@ function CardClass(mainRef, popup) {
259
242
  }
260
243
  const DragIcon = () => {
261
244
  const d = "M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z";
262
- return _jsx("svg", { className: 'aio-card-drag-icon', viewBox: "8 4 10 13", role: "presentation", style: { width: 12, height: '1.8rem' }, children: _jsx("path", { d: d, style: { fill: 'currentcolor' } }) });
245
+ return _jsx("svg", { className: 'aio-card-drag-icon', viewBox: "8 4 10 13", role: "presentation", children: _jsx("path", { d: d, style: { fill: 'currentcolor' } }) });
263
246
  };
264
- export class GetSvg {
265
- constructor(unit) {
266
- this.getStyle = (color) => ({ fill: color || "currentcolor" });
267
- this.getSvgStyle = (size) => {
268
- size = size || 1;
269
- return { width: `${size * 1.5}${this.unit}`, height: `${size * 1.5}${this.unit}` };
270
- };
271
- this.fixSvgContent = (content, size, p) => {
272
- const { spin } = p || {};
273
- let res = null;
274
- if (spin) {
275
- res = (_jsxs(_Fragment, { children: [_jsx("style", { children: `@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }` }), _jsx("g", { style: { animation: `${spin}s linear 0s infinite normal none running spin`, transformOrigin: 'center center' }, children: content })] }));
276
- }
277
- else {
278
- res = content;
279
- }
280
- return (_jsx("svg", { viewBox: "0 0 24 24", role: "presentation", style: this.getSvgStyle(size), children: res }));
281
- };
282
- this.getIcon = (path, size, p) => {
283
- const { color } = p || {};
284
- const fn = this[path];
285
- if (!fn) {
286
- alert(`${path} is not valid`);
287
- return null;
288
- }
289
- const content = fn(color);
290
- return this.fixSvgContent(content, size, p);
291
- };
292
- this.getFileIconName = (file) => {
293
- var _a;
294
- const ext = (_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
295
- switch (ext) {
296
- case "png":
297
- case "jpg":
298
- case "jpeg":
299
- case "gif":
300
- case "webp": return "mdiImage";
301
- case "mp4":
302
- case "webm":
303
- case "mov":
304
- case "avi": return "video";
305
- case "mp3":
306
- case "wav":
307
- case "ogg":
308
- case "m4a": return "mdiMusic";
309
- case "pdf": return "mdiFilePdfBox";
310
- case "doc":
311
- case "docx": return "mdiFileWordBox";
312
- case "xls":
313
- case "xlsx":
314
- case "csv": return "mdiFileExcelBox";
315
- case "ppt":
316
- case "pptx": return "mdiFilePowerPointBox";
317
- case "zip":
318
- case "rar":
319
- case "7z":
320
- case "tar": return "mdiZipBox";
321
- default: return "mdiFile";
322
- }
323
- };
324
- this.getFileIcon = (file, size, p) => {
325
- const path = this.getFileIconName(file);
326
- return this.getIcon(path, size, p);
327
- };
328
- this.mdiArrowDown = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z", style: this.getStyle(color) }) }));
329
- this.mdiArrowUp = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z", style: this.getStyle(color) }) }));
330
- this.mdiAttachment = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M7.5,18A5.5,5.5 0 0,1 2,12.5A5.5,5.5 0 0,1 7.5,7H18A4,4 0 0,1 22,11A4,4 0 0,1 18,15H9.5A2.5,2.5 0 0,1 7,12.5A2.5,2.5 0 0,1 9.5,10H17V11.5H9.5A1,1 0 0,0 8.5,12.5A1,1 0 0,0 9.5,13.5H18A2.5,2.5 0 0,0 20.5,11A2.5,2.5 0 0,0 18,8.5H7.5A4,4 0 0,0 3.5,12.5A4,4 0 0,0 7.5,16.5H17V18H7.5Z", style: this.getStyle(color) }) }));
331
- this.mdiChevronDown = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z", style: this.getStyle(color) }) }));
332
- this.mdiChevronUp = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z", style: this.getStyle(color) }) }));
333
- this.mdiChevronRight = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z", style: this.getStyle(color) }) }));
334
- this.mdiCircleSmall = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M12,10A2,2 0 0,0 10,12C10,13.11 10.9,14 12,14C13.11,14 14,13.11 14,12A2,2 0 0,0 12,10Z", style: this.getStyle(color) }) }));
335
- this.mdiCheckBold = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z", style: this.getStyle(color) }) }));
336
- this.mdiCheckboxMarked = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z", style: this.getStyle(color) }) }));
337
- this.mdiChevronLeft = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z", style: this.getStyle(color) }) }));
338
- this.mdiCircleMedium = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8Z", style: this.getStyle(color) }) }));
339
- this.mdiClose = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", style: this.getStyle(color) }) }));
340
- this.mdiDelete = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", style: this.getStyle(color) }) }));
341
- this.mdiDotsHorizontal = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z", style: this.getStyle(color) }) }));
342
- this.mdiEye = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z", style: this.getStyle(color) }) }));
343
- this.mdiEyeOff = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z", style: this.getStyle(color) }) }));
344
- this.mdiFile = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z", style: this.getStyle(color) }) }));
345
- this.mdiFileExcel = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M15.8,20H14L12,16.6L10,20H8.2L11.1,15.5L8.2,11H10L12,14.4L14,11H15.8L12.9,15.5L15.8,20M13,9V3.5L18.5,9H13Z", style: this.getStyle(color) }) }));
346
- this.mdiFilter = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z", style: this.getStyle(color) }) }));
347
- this.mdiImage = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z", style: this.getStyle(color) }) }));
348
- this.mdiLoading = (color) => _jsxs(_Fragment, { children: [_jsx("path", { d: "M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z", style: this.getStyle(color) }), _jsx("rect", { width: "24", height: "24", fill: "transparent" })] });
349
- this.mdiListBox = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 7H9V9H7V7M7 11H9V13H7V11M7 15H9V17H7V15M17 17H11V15H17V17M17 13H11V11H17V13M17 9H11V7H17V9Z", style: this.getStyle(color) }) }));
350
- this.mdiMagnify = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z", style: this.getStyle(color) }) }));
351
- this.mdiMenu = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z", style: this.getStyle(color) }) }));
352
- this.mdiMicrophoneOutline = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M17.3,11C17.3,14 14.76,16.1 12,16.1C9.24,16.1 6.7,14 6.7,11H5C5,14.41 7.72,17.23 11,17.72V21H13V17.72C16.28,17.23 19,14.41 19,11M10.8,4.9C10.8,4.24 11.34,3.7 12,3.7C12.66,3.7 13.2,4.24 13.2,4.9L13.19,11.1C13.19,11.76 12.66,12.3 12,12.3C11.34,12.3 10.8,11.76 10.8,11.1M12,14A3,3 0 0,0 15,11V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V11A3,3 0 0,0 12,14Z", style: this.getStyle(color) }) }));
353
- this.mdiPlusThick = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z", style: this.getStyle(color) }) }));
354
- this.mdiSaveContent = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z", style: this.getStyle(color) }) }));
355
- this.mdiSelect = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M4,3H5V5H3V4A1,1 0 0,1 4,3M20,3A1,1 0 0,1 21,4V5H19V3H20M15,5V3H17V5H15M11,5V3H13V5H11M7,5V3H9V5H7M21,20A1,1 0 0,1 20,21H19V19H21V20M15,21V19H17V21H15M11,21V19H13V21H11M7,21V19H9V21H7M4,21A1,1 0 0,1 3,20V19H5V21H4M3,15H5V17H3V15M21,15V17H19V15H21M3,11H5V13H3V11M21,11V13H19V11H21M3,7H5V9H3V7M21,7V9H19V7H21Z", style: this.getStyle(color) }) }));
356
- this.mdiSort = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M18 21L14 17H17V7H14L18 3L22 7H19V17H22M2 19V17H12V19M2 13V11H9V13M2 7V5H6V7H2Z", style: this.getStyle(color) }) }));
357
- this.mdiMusic = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z", style: this.getStyle(color) }) }));
358
- this.mdiFilePdfBox = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M9.5 11.5C9.5 12.3 8.8 13 8 13H7V15H5.5V9H8C8.8 9 9.5 9.7 9.5 10.5V11.5M14.5 13.5C14.5 14.3 13.8 15 13 15H10.5V9H13C13.8 9 14.5 9.7 14.5 10.5V13.5M18.5 10.5H17V11.5H18.5V13H17V15H15.5V9H18.5V10.5M12 10.5H13V13.5H12V10.5M7 10.5H8V11.5H7V10.5Z", style: this.getStyle(color) }) }));
359
- this.mdiFileWordBox = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M15.5,17H14L12,9.5L10,17H8.5L6.1,7H7.8L9.34,14.5L11.3,7H12.7L14.67,14.5L16.2,7H17.9M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z", style: this.getStyle(color) }) }));
360
- this.mdiFileExcelBox = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M16.2,17H14.2L12,13.2L9.8,17H7.8L11,12L7.8,7H9.8L12,10.8L14.2,7H16.2L13,12M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z", style: this.getStyle(color) }) }));
361
- this.mdiFilePowerPointBox = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M9.8,13.4H12.3C13.8,13.4 14.46,13.12 15.1,12.58C15.74,12.03 16,11.25 16,10.23C16,9.26 15.75,8.5 15.1,7.88C14.45,7.29 13.83,7 12.3,7H8V17H9.8V13.4M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5C3,3.89 3.9,3 5,3H19M9.8,12V8.4H12.1C12.76,8.4 13.27,8.65 13.6,9C13.93,9.35 14.1,9.72 14.1,10.24C14.1,10.8 13.92,11.19 13.6,11.5C13.28,11.81 12.9,12 12.22,12H9.8Z", style: this.getStyle(color) }) }));
362
- this.mdiZipBox = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M14,17H12V15H10V13H12V15H14M14,9H12V11H14V13H12V11H10V9H12V7H10V5H12V7H14M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z", style: this.getStyle(color) }) }));
363
- this.mdiCamera = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z", style: this.getStyle(color) }) }));
364
- this.mdiArrowUpDownBold = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M10,8H6L12,2L18,8H14V16H18L12,22L6,16H10V8Z", style: this.getStyle(color) }) }));
365
- this.mdiSortVariantOff = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M20.84 22.73L11.11 13H3V11H9.11L6.11 8H3V6H4.11L1.11 3L2.39 1.73L22.11 21.46L20.84 22.73M15 11H14.2L15 11.8V11M21 8V6H9.2L11.2 8H21M3 18H9V16H3V18Z", style: this.getStyle(color) }) }));
366
- this.mdiDownload = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z", style: this.getStyle(color) }) }));
367
- this.mdiCalculator = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M7,2H17A2,2 0 0,1 19,4V20A2,2 0 0,1 17,22H7A2,2 0 0,1 5,20V4A2,2 0 0,1 7,2M7,4V8H17V4H7M7,10V12H9V10H7M11,10V12H13V10H11M15,10V12H17V10H15M7,14V16H9V14H7M11,14V16H13V14H11M15,14V16H17V14H15M7,18V20H9V18H7M11,18V20H13V18H11M15,18V20H17V18H15Z", style: this.getStyle(color) }) }));
368
- this.mdiPencil = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z", style: this.getStyle(color) }) }));
369
- this.mdiUpload = (color) => (_jsx(_Fragment, { children: _jsx("path", { d: "M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z", style: this.getStyle(color) }) }));
370
- this.unit = unit || 'rem';
371
- }
372
- }
373
247
  const useKeyboardNav = (p) => {
374
248
  function getDomByIndex(index) {
375
249
  const container = p.getContainer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aio-card",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "all in one card",
5
5
  "types": "index.d.ts",
6
6
  "keywords": [
@@ -11,8 +11,10 @@
11
11
  "url": "https://github.com/mohammadFeiz/aio-card/issues"
12
12
  },
13
13
  "dependencies": {
14
- "aio-input": "latest",
15
- "aio-date":"latest"
14
+ "aio-deps":"latest",
15
+ "aio-utils":"latest",
16
+ "aio-popup":"latest",
17
+ "aio-class":"latest"
16
18
  },
17
19
  "repository": {
18
20
  "type": "git",