aio-card 1.0.0 → 2.0.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/index.css +1 -0
- package/index.d.ts +2 -59
- package/index.js +16 -124
- package/package.json +5 -2
package/index.css
CHANGED
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;
|
|
@@ -100,6 +100,7 @@ export type I_Cards<T> = {
|
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
102
|
export type I_Card = {
|
|
103
|
+
showCard?: boolean;
|
|
103
104
|
before?: ReactNode[];
|
|
104
105
|
after?: ReactNode[];
|
|
105
106
|
text: ReactNode;
|
|
@@ -175,61 +176,3 @@ export type I_CardPopoverActions = {
|
|
|
175
176
|
isOpen: () => boolean;
|
|
176
177
|
};
|
|
177
178
|
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,10 @@
|
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
3
|
+
import usePopup from 'aio-popup';
|
|
4
|
+
import { AISelect } from "aio-input";
|
|
5
|
+
import { DragAndDrop } from "aio-utils";
|
|
6
|
+
import { AddToAttrs } from "aio-class";
|
|
7
|
+
import { Mdie, $ } from "aio-deps";
|
|
7
8
|
import './index.css';
|
|
8
9
|
export const Cards = ({ items, attrs, option, direction, className = [], style, onSwap, rtl = false, placeholder, disabled }) => {
|
|
9
10
|
const ref = useRef(createRef());
|
|
@@ -27,7 +28,7 @@ export const Cards = ({ items, attrs, option, direction, className = [], style,
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
|
-
const Attrs =
|
|
31
|
+
const Attrs = AddToAttrs(Object.assign(Object.assign({ tabIndex: 0 }, attrs), { onKeyDown: kn.keyDown, ref }), {
|
|
31
32
|
className: ['aio-cards', direction === 'horizontal' ? 'aio-cards-horizontal' : undefined, ...className],
|
|
32
33
|
style
|
|
33
34
|
});
|
|
@@ -35,7 +36,7 @@ export const Cards = ({ items, attrs, option, direction, className = [], style,
|
|
|
35
36
|
return (_jsx("div", { className: "aio-cards-placeholder", children: placeholder }));
|
|
36
37
|
}
|
|
37
38
|
if (onSwap) {
|
|
38
|
-
return (_jsx("div", Object.assign({}, Attrs, { children: _jsx(
|
|
39
|
+
return (_jsx("div", Object.assign({}, Attrs, { children: _jsx(DragAndDrop, { handle: '.aio-card-drag-icon', data: items, getId: (row, { index }) => getByOption({ field: 'value', row, option, index, def: '' }), getContent: (row, { id, index }) => {
|
|
39
40
|
return _jsx(CardsItem, { row: row, option: option, index: index, direction: direction, value: id, draggable: !!onSwap, disabled: disabled }, id);
|
|
40
41
|
}, onChange: (newOptions, fromIndex, toIndex) => onSwap(newOptions, fromIndex, toIndex) }) })));
|
|
41
42
|
}
|
|
@@ -89,7 +90,7 @@ const Provider = ({ value, children }) => {
|
|
|
89
90
|
};
|
|
90
91
|
const useProvider = () => useContext(Context);
|
|
91
92
|
export const Card = (props) => {
|
|
92
|
-
const { text, footer, header, layoutAttrs, showFooter, show = true, placeholder, popoverActions, errorMessage, label, required, footerAttrs,
|
|
93
|
+
const { text, footer, header, layoutAttrs, showFooter, show = true, placeholder, popoverActions, errorMessage, label, required, footerAttrs, showCard = true } = props;
|
|
93
94
|
const mainRef = useRef(null);
|
|
94
95
|
const popup = usePopup();
|
|
95
96
|
const cardClass = CardClass(mainRef, popup);
|
|
@@ -102,12 +103,12 @@ export const Card = (props) => {
|
|
|
102
103
|
popoverActions.isOpen = () => !!popup.getModals().length;
|
|
103
104
|
}
|
|
104
105
|
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()] }));
|
|
106
|
+
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
107
|
let result = card;
|
|
107
108
|
if (errorMessage || label || header || footer || layoutAttrs) {
|
|
108
|
-
const attrs =
|
|
109
|
+
const attrs = AddToAttrs(layoutAttrs, { className: ["aio-card-layout"] });
|
|
109
110
|
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({},
|
|
111
|
+
_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
112
|
}
|
|
112
113
|
return (_jsx(Provider, { value: { rootProps: props, cardClass }, children: result }));
|
|
113
114
|
};
|
|
@@ -115,7 +116,7 @@ const CardLabel = ({ label, required, error }) => {
|
|
|
115
116
|
if (!label === undefined || !(label === null || label === void 0 ? void 0 : label.text)) {
|
|
116
117
|
return null;
|
|
117
118
|
}
|
|
118
|
-
let labelContent = (_jsxs("label", Object.assign({},
|
|
119
|
+
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
120
|
if (label.online) {
|
|
120
121
|
return _jsx("div", { className: "aio-card-online-label", children: labelContent });
|
|
121
122
|
}
|
|
@@ -141,7 +142,7 @@ const CardCaret = () => {
|
|
|
141
142
|
const { caret = true, openByCaret } = rootProps;
|
|
142
143
|
const getContnet = () => {
|
|
143
144
|
if (caret === true) {
|
|
144
|
-
return
|
|
145
|
+
return Mdie('mdiChevronDown', .8);
|
|
145
146
|
}
|
|
146
147
|
if (typeof caret === 'function') {
|
|
147
148
|
return caret(cardClass.isPopoverOpen());
|
|
@@ -153,7 +154,7 @@ const CardCaret = () => {
|
|
|
153
154
|
return (_jsx("div", { className: "aio-card-caret", onClick: openByCaret ? () => cardClass.openPopover(rootProps) : undefined, children: getContnet() }));
|
|
154
155
|
};
|
|
155
156
|
const CardActions = ({ actions }) => {
|
|
156
|
-
return (_jsx(AISelect, { className: 'aio-card-actions', text:
|
|
157
|
+
return (_jsx(AISelect, { className: 'aio-card-actions', text: Mdie('mdiDotsHorizontal', 0.7), options: actions || [], option: {
|
|
157
158
|
text: (o) => o.text,
|
|
158
159
|
before: (o) => o.before,
|
|
159
160
|
onClick: (o) => o.onClick
|
|
@@ -216,7 +217,7 @@ function CardClass(mainRef, popup) {
|
|
|
216
217
|
}
|
|
217
218
|
};
|
|
218
219
|
const defAttrs = Object.assign(Object.assign({ "data-index": index, onKeyDown }, attrs), { ref: mainRef, onClick: (e) => cardClick(mainProps, e) });
|
|
219
|
-
const Attrs =
|
|
220
|
+
const Attrs = AddToAttrs(defAttrs, { className: [...className, "aio-card"], style });
|
|
220
221
|
if (hasCardClick(mainProps)) {
|
|
221
222
|
Attrs.className += ' aio-card-pointer';
|
|
222
223
|
}
|
|
@@ -259,117 +260,8 @@ function CardClass(mainRef, popup) {
|
|
|
259
260
|
}
|
|
260
261
|
const DragIcon = () => {
|
|
261
262
|
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",
|
|
263
|
+
return _jsx("svg", { className: 'aio-card-drag-icon', viewBox: "8 4 10 13", role: "presentation", children: _jsx("path", { d: d, style: { fill: 'currentcolor' } }) });
|
|
263
264
|
};
|
|
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
265
|
const useKeyboardNav = (p) => {
|
|
374
266
|
function getDomByIndex(index) {
|
|
375
267
|
const container = p.getContainer();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aio-card",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "all in one card",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"keywords": [
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"aio-input": "latest",
|
|
15
|
-
"aio-
|
|
15
|
+
"aio-deps":"latest",
|
|
16
|
+
"aio-utils":"latest",
|
|
17
|
+
"aio-popup":"latest",
|
|
18
|
+
"aio-class":"latest"
|
|
16
19
|
},
|
|
17
20
|
"repository": {
|
|
18
21
|
"type": "git",
|