@code0-tech/pictor 0.2.3 → 0.4.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/dist/_virtual/compiler-runtime.js +5 -0
- package/dist/_virtual/compiler-runtime2.js +4 -0
- package/dist/_virtual/react-compiler-runtime.development.js +4 -0
- package/dist/_virtual/react-compiler-runtime.production.js +4 -0
- package/dist/assets/components/alert/Alert.style.css +1 -0
- package/dist/assets/components/aurora/Aurora.style.css +1 -0
- package/dist/assets/components/avatar/Avatar.style.css +1 -0
- package/dist/assets/components/badge/Badge.style.css +1 -0
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -0
- package/dist/assets/components/button/Button.style.css +1 -0
- package/dist/assets/components/button-group/ButtonGroup.style.css +1 -0
- package/dist/assets/components/card/Card.style.css +1 -0
- package/dist/assets/components/col/Col.style.css +1 -0
- package/dist/assets/components/command/Command.style.css +1 -0
- package/dist/assets/components/container/Container.style.css +1 -0
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -0
- package/dist/assets/components/data-table/DataTable.style.css +1 -0
- package/dist/assets/components/dialog/Dialog.style.css +1 -0
- package/dist/assets/components/editor/Editor.styles.css +1 -0
- package/dist/assets/components/file-tabs/FileTabs.style.css +1 -0
- package/dist/assets/components/flex/Flex.style.css +1 -0
- package/dist/assets/components/form/Input.style.css +1 -0
- package/dist/assets/components/fullscreen/FullScreen.style.css +1 -0
- package/dist/assets/components/layout/Layout.style.css +1 -0
- package/dist/assets/components/menu/Menu.style.css +1 -0
- package/dist/assets/components/quote/Quote.style.css +1 -0
- package/dist/assets/components/resizable/Resizable.style.css +1 -0
- package/dist/assets/components/row/Row.style.css +1 -0
- package/dist/assets/components/scroll-area/ScrollArea.style.css +1 -0
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -0
- package/dist/assets/components/spacing/Spacing.style.css +1 -0
- package/dist/assets/components/tab/Tab.style.css +1 -0
- package/dist/assets/components/text/Text.style.css +1 -0
- package/dist/assets/components/toast/Toast.style.css +1 -0
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -0
- package/dist/components/alert/Alert.d.ts +7 -0
- package/dist/components/alert/Alert.js +39 -0
- package/dist/components/aurora/Aurora.d.ts +5 -0
- package/dist/components/aurora/Aurora.js +23 -0
- package/dist/components/avatar/Avatar.d.ts +10 -0
- package/dist/components/avatar/Avatar.js +53 -0
- package/dist/components/badge/Badge.d.ts +8 -0
- package/dist/components/badge/Badge.js +63 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +7 -0
- package/dist/components/breadcrumb/Breadcrumb.js +19 -0
- package/dist/components/button/Button.d.ts +11 -0
- package/dist/components/button/Button.js +31 -0
- package/dist/components/button-group/ButtonGroup.d.ts +8 -0
- package/dist/components/button-group/ButtonGroup.js +28 -0
- package/dist/components/card/Card.d.ts +15 -0
- package/dist/components/card/Card.js +42 -0
- package/dist/components/card/CardSection.d.ts +10 -0
- package/dist/components/card/CardSection.js +28 -0
- package/dist/{esm/components → components}/col/Col.d.ts +3 -5
- package/dist/components/col/Col.js +27 -0
- package/dist/components/command/Command.d.ts +30 -0
- package/dist/components/command/Command.js +103 -0
- package/dist/components/container/Container.d.ts +6 -0
- package/dist/components/container/Container.js +21 -0
- package/dist/components/context-menu/ContextMenu.d.ts +31 -0
- package/dist/components/context-menu/ContextMenu.js +106 -0
- package/dist/components/data-table/DataTable.d.ts +23 -0
- package/dist/components/data-table/DataTable.js +41 -0
- package/dist/components/data-table/DataTableColumn.d.ts +6 -0
- package/dist/components/data-table/DataTableColumn.js +22 -0
- package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
- package/dist/components/data-table/DataTableFilterInput.js +212 -0
- package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +11 -0
- package/dist/components/dialog/Dialog.d.ts +29 -0
- package/dist/components/dialog/Dialog.js +102 -0
- package/dist/components/editor/Editor.d.ts +29 -0
- package/dist/components/editor/Editor.js +337 -0
- package/dist/components/file-tabs/FileTabs.d.ts +17 -0
- package/dist/components/file-tabs/FileTabs.js +71 -0
- package/dist/components/file-tabs/FileTabs.service.d.ts +17 -0
- package/dist/components/file-tabs/FileTabs.service.js +88 -0
- package/dist/components/file-tabs/FileTabs.view.d.ts +10 -0
- package/dist/components/file-tabs/FileTabs.view.js +1 -0
- package/dist/components/file-tabs/index.d.ts +3 -0
- package/dist/components/file-tabs/index.js +9 -0
- package/dist/components/flex/Flex.d.ts +7 -0
- package/dist/components/flex/Flex.js +21 -0
- package/dist/components/form/CheckboxInput.d.ts +5 -0
- package/dist/components/form/CheckboxInput.js +76 -0
- package/dist/components/form/EmailInput.d.ts +8 -0
- package/dist/components/form/EmailInput.js +21 -0
- package/dist/components/form/Input.d.ts +35 -0
- package/dist/components/form/Input.js +434 -0
- package/dist/components/form/Input.syntax.hook.d.ts +10 -0
- package/dist/components/form/Input.syntax.hook.js +14 -0
- package/dist/components/form/Input.utils.d.ts +10 -0
- package/dist/components/form/Input.utils.js +38 -0
- package/dist/components/form/InputContentEditable.hook.d.ts +52 -0
- package/dist/components/form/InputContentEditable.hook.js +449 -0
- package/dist/components/form/InputDescription.d.ts +5 -0
- package/dist/components/form/InputDescription.js +12 -0
- package/dist/components/form/InputLabel.d.ts +5 -0
- package/dist/components/form/InputLabel.js +12 -0
- package/dist/components/form/InputMessage.d.ts +5 -0
- package/dist/components/form/InputMessage.js +18 -0
- package/dist/components/form/InputSuggestion.d.ts +27 -0
- package/dist/components/form/InputSuggestion.js +218 -0
- package/dist/components/form/NumberInput.d.ts +6 -0
- package/dist/components/form/NumberInput.js +20 -0
- package/dist/components/form/PasswordInput.d.ts +8 -0
- package/dist/components/form/PasswordInput.js +19 -0
- package/dist/components/form/PinInput.d.ts +11 -0
- package/dist/components/form/PinInput.js +66 -0
- package/dist/components/form/RadioGroup.d.ts +5 -0
- package/dist/components/form/RadioGroup.js +48 -0
- package/dist/components/form/RadioInput.d.ts +7 -0
- package/dist/components/form/RadioInput.js +27 -0
- package/dist/components/form/SwitchInput.d.ts +6 -0
- package/dist/components/form/SwitchInput.js +19 -0
- package/dist/components/form/TextAreaInput.d.ts +7 -0
- package/dist/components/form/TextAreaInput.js +20 -0
- package/dist/components/form/TextInput.d.ts +7 -0
- package/dist/components/form/TextInput.js +20 -0
- package/dist/components/form/index.d.ts +17 -0
- package/dist/components/form/index.js +40 -0
- package/dist/components/form/useForm.d.ts +30 -0
- package/dist/components/form/useForm.js +78 -0
- package/dist/components/fullscreen/FullScreen.d.ts +6 -0
- package/dist/components/fullscreen/FullScreen.js +26 -0
- package/dist/components/layout/Layout.d.ts +12 -0
- package/dist/components/layout/Layout.js +75 -0
- package/dist/components/menu/Menu.d.ts +35 -0
- package/dist/components/menu/Menu.js +120 -0
- package/dist/components/quote/Quote.d.ts +10 -0
- package/dist/components/quote/Quote.js +44 -0
- package/dist/components/resizable/Resizable.d.ts +12 -0
- package/dist/components/resizable/Resizable.js +34 -0
- package/dist/components/row/Row.d.ts +6 -0
- package/dist/components/row/Row.js +21 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +13 -0
- package/dist/components/scroll-area/ScrollArea.js +43 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +10 -0
- package/dist/components/segmented-control/SegmentedControl.js +26 -0
- package/dist/components/spacing/Spacing.d.ts +6 -0
- package/dist/components/spacing/Spacing.js +23 -0
- package/dist/components/tab/Tab.d.ts +11 -0
- package/dist/components/tab/Tab.js +40 -0
- package/dist/components/text/Text.d.ts +8 -0
- package/dist/components/text/Text.js +23 -0
- package/dist/components/toast/Toast.d.ts +13 -0
- package/dist/components/toast/Toast.js +66 -0
- package/dist/components/tooltip/Tooltip.d.ts +17 -0
- package/dist/components/tooltip/Tooltip.js +48 -0
- package/dist/index.d.ts +33 -300
- package/dist/index.js +191 -0
- package/dist/node_modules/@lezer/common/dist/index.js +146 -0
- package/dist/node_modules/@lezer/highlight/dist/index.js +543 -0
- package/dist/node_modules/prettier/plugins/babel.js +7157 -0
- package/dist/node_modules/prettier/plugins/estree.js +4453 -0
- package/dist/node_modules/prettier/standalone.js +2429 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
- package/dist/node_modules/react/compiler-runtime.js +10 -0
- package/dist/utils/arrayService.d.ts +10 -0
- package/dist/utils/arrayService.js +1 -0
- package/dist/utils/contextStore.d.ts +62 -0
- package/dist/utils/contextStore.js +60 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +25 -0
- package/dist/utils/inspection.d.ts +15 -0
- package/dist/utils/inspection.js +29 -0
- package/dist/utils/nonReactiveArrayService.d.ts +19 -0
- package/dist/utils/nonReactiveArrayService.js +54 -0
- package/dist/utils/objectStore.d.ts +12 -0
- package/dist/utils/objectStore.js +34 -0
- package/dist/utils/reactiveArrayService.d.ts +23 -0
- package/dist/utils/reactiveArrayService.js +90 -0
- package/dist/{cjs/utils → utils}/types.d.ts +4 -4
- package/dist/utils/types.js +4 -0
- package/dist/utils/utils.d.ts +55 -0
- package/dist/utils/utils.js +159 -0
- package/dist/utils/view.d.ts +8 -0
- package/dist/utils/view.js +28 -0
- package/package.json +130 -54
- package/dist/cjs/components/Text/Text.d.ts +0 -10
- package/dist/cjs/components/alert/Alert.d.ts +0 -16
- package/dist/cjs/components/badge/Badge.d.ts +0 -9
- package/dist/cjs/components/button/Button.d.ts +0 -17
- package/dist/cjs/components/button-group/ButtonGroup.d.ts +0 -9
- package/dist/cjs/components/card/Card.d.ts +0 -20
- package/dist/cjs/components/col/Col.d.ts +0 -15
- package/dist/cjs/components/container/Container.d.ts +0 -8
- package/dist/cjs/components/dropdown/Dropdown.d.ts +0 -24
- package/dist/cjs/components/dropdown/DropdownFooter.d.ts +0 -13
- package/dist/cjs/components/dropdown/DropdownHeader.d.ts +0 -13
- package/dist/cjs/components/dropdown/DropdownItem.d.ts +0 -12
- package/dist/cjs/components/dropdown/DropdownItemGroup.d.ts +0 -12
- package/dist/cjs/components/input/Input.d.ts +0 -37
- package/dist/cjs/components/list-group/ListGroup.d.ts +0 -12
- package/dist/cjs/components/menu/InternalMenu.d.ts +0 -4
- package/dist/cjs/components/menu/Menu.d.ts +0 -41
- package/dist/cjs/components/popover/InternalPopover.d.ts +0 -10
- package/dist/cjs/components/popover/Popover.d.ts +0 -16
- package/dist/cjs/components/quote/Quote.d.ts +0 -12
- package/dist/cjs/components/row/Row.d.ts +0 -8
- package/dist/cjs/components/tooltip/Tooltip.d.ts +0 -18
- package/dist/cjs/index.d.ts +0 -16
- package/dist/cjs/index.js +0 -9275
- package/dist/cjs/utils/utils.d.ts +0 -18
- package/dist/esm/components/Text/Text.d.ts +0 -10
- package/dist/esm/components/alert/Alert.d.ts +0 -16
- package/dist/esm/components/badge/Badge.d.ts +0 -9
- package/dist/esm/components/button/Button.d.ts +0 -17
- package/dist/esm/components/button-group/ButtonGroup.d.ts +0 -9
- package/dist/esm/components/card/Card.d.ts +0 -20
- package/dist/esm/components/container/Container.d.ts +0 -8
- package/dist/esm/components/dropdown/Dropdown.d.ts +0 -24
- package/dist/esm/components/dropdown/DropdownFooter.d.ts +0 -13
- package/dist/esm/components/dropdown/DropdownHeader.d.ts +0 -13
- package/dist/esm/components/dropdown/DropdownItem.d.ts +0 -12
- package/dist/esm/components/dropdown/DropdownItemGroup.d.ts +0 -12
- package/dist/esm/components/input/Input.d.ts +0 -37
- package/dist/esm/components/list-group/ListGroup.d.ts +0 -12
- package/dist/esm/components/menu/InternalMenu.d.ts +0 -4
- package/dist/esm/components/menu/Menu.d.ts +0 -41
- package/dist/esm/components/popover/InternalPopover.d.ts +0 -10
- package/dist/esm/components/popover/Popover.d.ts +0 -16
- package/dist/esm/components/quote/Quote.d.ts +0 -12
- package/dist/esm/components/row/Row.d.ts +0 -8
- package/dist/esm/components/tooltip/Tooltip.d.ts +0 -18
- package/dist/esm/index.d.ts +0 -16
- package/dist/esm/index.js +0 -9251
- package/dist/esm/utils/types.d.ts +0 -57
- package/dist/esm/utils/utils.d.ts +0 -18
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as p, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { c as E } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import '../../assets/components/card/Card.style.css';/* empty css */
|
|
4
|
+
import { mergeCode0Props as F } from "../../utils/utils.js";
|
|
5
|
+
const A = (e) => {
|
|
6
|
+
const o = E.c(6);
|
|
7
|
+
let r, d;
|
|
8
|
+
if (o[0] !== e) {
|
|
9
|
+
const {
|
|
10
|
+
children: C,
|
|
11
|
+
color: i,
|
|
12
|
+
variant: n,
|
|
13
|
+
gradient: a,
|
|
14
|
+
gradientColor: c,
|
|
15
|
+
borderColor: l,
|
|
16
|
+
outlineColor: s,
|
|
17
|
+
outline: m,
|
|
18
|
+
dashed: g,
|
|
19
|
+
paddingSize: v,
|
|
20
|
+
...u
|
|
21
|
+
} = e;
|
|
22
|
+
r = C;
|
|
23
|
+
const h = i === void 0 ? "primary" : i, b = n === void 0 ? "normal" : n, $ = a === void 0 ? !1 : a, x = c === void 0 ? "secondary" : c, f = l === void 0 ? "secondary" : l, y = s === void 0 ? "secondary" : s, z = m === void 0 ? !1 : m, S = g === void 0 ? !1 : g;
|
|
24
|
+
d = F(`
|
|
25
|
+
card
|
|
26
|
+
card--${h} card--${b}
|
|
27
|
+
card--${v === void 0 ? "xl" : v}
|
|
28
|
+
${z ? `card--outline-${y}` : ""}
|
|
29
|
+
${$ ? "card--gradient" : ""}
|
|
30
|
+
${f ? `card--border-${f}` : ""}
|
|
31
|
+
${S ? "card--border--dashed" : ""}
|
|
32
|
+
${$ ? `card--gradient-${x}` : ""}
|
|
33
|
+
|
|
34
|
+
`, u), o[0] = e, o[1] = r, o[2] = d;
|
|
35
|
+
} else
|
|
36
|
+
r = o[1], d = o[2];
|
|
37
|
+
let t;
|
|
38
|
+
return o[3] !== r || o[4] !== d ? (t = /* @__PURE__ */ p(j, { children: /* @__PURE__ */ p("div", { ...d, children: r }) }), o[3] = r, o[4] = d, o[5] = t) : t = o[5], t;
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
A as Card
|
|
42
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Code0Component } from '../../utils/types';
|
|
2
|
+
import { default as React, ReactNode } from 'react';
|
|
3
|
+
export interface SectionType extends Code0Component<HTMLDivElement> {
|
|
4
|
+
children: ReactNode | ReactNode[];
|
|
5
|
+
image?: boolean;
|
|
6
|
+
border?: boolean;
|
|
7
|
+
hover?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const CardSection: React.FC<SectionType>;
|
|
10
|
+
export default CardSection;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as a, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as f } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { mergeCode0Props as v } from "../../utils/utils.js";
|
|
4
|
+
const u = (i) => {
|
|
5
|
+
const e = f.c(6);
|
|
6
|
+
let r, o;
|
|
7
|
+
if (e[0] !== i) {
|
|
8
|
+
const {
|
|
9
|
+
image: c,
|
|
10
|
+
border: s,
|
|
11
|
+
hover: d,
|
|
12
|
+
children: n,
|
|
13
|
+
...m
|
|
14
|
+
} = i;
|
|
15
|
+
r = n, o = v(`
|
|
16
|
+
card__section
|
|
17
|
+
${(s === void 0 ? !1 : s) ? "card__section--border" : ""}
|
|
18
|
+
${(c === void 0 ? !1 : c) ? "card__section--image" : ""}
|
|
19
|
+
${(d === void 0 ? !1 : d) ? "card__section--hover" : ""}
|
|
20
|
+
`, m), e[0] = i, e[1] = r, e[2] = o;
|
|
21
|
+
} else
|
|
22
|
+
r = e[1], o = e[2];
|
|
23
|
+
let t;
|
|
24
|
+
return e[3] !== r || e[4] !== o ? (t = /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a("div", { ...o, children: r }) }), e[3] = r, e[4] = o, e[5] = t) : t = e[5], t;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
u as default
|
|
28
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React,
|
|
2
|
-
import
|
|
3
|
-
import { Code0Component } from "../../utils/types";
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils/types';
|
|
4
3
|
export type ColBreakPointRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
4
|
export interface ColType extends Code0Component<HTMLDivElement> {
|
|
6
5
|
children: ReactNode | ReactNode[];
|
|
@@ -11,5 +10,4 @@ export interface ColType extends Code0Component<HTMLDivElement> {
|
|
|
11
10
|
xl?: ColBreakPointRange;
|
|
12
11
|
xxl?: ColBreakPointRange;
|
|
13
12
|
}
|
|
14
|
-
declare const Col: React.FC<ColType>;
|
|
15
|
-
export default Col;
|
|
13
|
+
export declare const Col: React.FC<ColType>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as g } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import '../../assets/components/col/Col.style.css';/* empty css */
|
|
4
|
+
import { mergeCode0Props as p } from "../../utils/utils.js";
|
|
5
|
+
const j = (c) => {
|
|
6
|
+
const l = g.c(6);
|
|
7
|
+
let o, t;
|
|
8
|
+
if (l[0] !== c) {
|
|
9
|
+
const {
|
|
10
|
+
children: n,
|
|
11
|
+
xs: r,
|
|
12
|
+
sm: m,
|
|
13
|
+
md: $,
|
|
14
|
+
lg: s,
|
|
15
|
+
xl: i,
|
|
16
|
+
xxl: x,
|
|
17
|
+
...d
|
|
18
|
+
} = c;
|
|
19
|
+
o = n, t = p(`col ${r ? `col-xs-${r}` : ""} ${m ? `col-sm-${m}` : ""} ${$ ? `col-md-${$}` : ""} ${s ? `col-lg-${s}` : ""} ${i ? `col-lg-${i}` : ""} ${x ? `col-xxl-${x}` : ""}`, d), l[0] = c, l[1] = o, l[2] = t;
|
|
20
|
+
} else
|
|
21
|
+
o = l[1], t = l[2];
|
|
22
|
+
let e;
|
|
23
|
+
return l[3] !== o || l[4] !== t ? (e = /* @__PURE__ */ f("div", { ...t, children: o }), l[3] = o, l[4] = t, l[5] = e) : e = l[5], e;
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
j as Col
|
|
27
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
3
|
+
import { Code0ComponentProps } from '../../utils/types';
|
|
4
|
+
import { Dialog, DialogContent } from '../dialog/Dialog';
|
|
5
|
+
import { Badge } from '../badge/Badge';
|
|
6
|
+
import { TextInputProps } from '../form/TextInput';
|
|
7
|
+
export type CommandProps = Code0ComponentProps & React.ComponentProps<typeof CommandPrimitive>;
|
|
8
|
+
export type CommandDialogProps = {
|
|
9
|
+
dialogProps?: Code0ComponentProps & React.ComponentProps<typeof Dialog>;
|
|
10
|
+
contentProps?: Code0ComponentProps & React.ComponentProps<typeof DialogContent>;
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onOpenChange?: () => void;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export type CommandListProps = Code0ComponentProps & React.ComponentProps<typeof CommandPrimitive.List>;
|
|
16
|
+
export type CommandInputProps = Code0ComponentProps & TextInputProps;
|
|
17
|
+
export type CommandEmptyProps = Code0ComponentProps & React.ComponentProps<typeof CommandPrimitive.Empty>;
|
|
18
|
+
export type CommandGroupProps = Code0ComponentProps & React.ComponentProps<typeof CommandPrimitive.Group>;
|
|
19
|
+
export type CommandItemProps = Code0ComponentProps & React.ComponentProps<typeof CommandPrimitive.Item>;
|
|
20
|
+
export type CommandSeparatorProps = Code0ComponentProps & React.ComponentProps<typeof CommandPrimitive.Separator>;
|
|
21
|
+
export type CommandShortcutProps = Code0ComponentProps & React.ComponentProps<typeof Badge>;
|
|
22
|
+
export declare const Command: React.FC<CommandProps>;
|
|
23
|
+
export declare const CommandDialog: React.FC<CommandDialogProps>;
|
|
24
|
+
export declare const CommandList: React.FC<CommandListProps>;
|
|
25
|
+
export declare const CommandInput: React.FC<CommandInputProps>;
|
|
26
|
+
export declare const CommandEmpty: React.FC<CommandEmptyProps>;
|
|
27
|
+
export declare const CommandGroup: React.FC<CommandGroupProps>;
|
|
28
|
+
export declare const CommandItem: React.FC<CommandItemProps>;
|
|
29
|
+
export declare const CommandSeparator: React.FC<CommandSeparatorProps>;
|
|
30
|
+
export declare const CommandShortcut: React.FC<CommandShortcutProps>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import { Command as s } from "cmdk";
|
|
4
|
+
import { mergeCode0Props as d } from "../../utils/utils.js";
|
|
5
|
+
import { DialogContent as g, Dialog as h } from "../dialog/Dialog.js";
|
|
6
|
+
import '../../assets/components/command/Command.style.css';/* empty css */
|
|
7
|
+
import { Badge as _ } from "../badge/Badge.js";
|
|
8
|
+
import { TextInput as $ } from "../form/TextInput.js";
|
|
9
|
+
const P = (e) => {
|
|
10
|
+
const t = a.c(4);
|
|
11
|
+
let n;
|
|
12
|
+
t[0] !== e ? (n = d("command", e), t[0] = e, t[1] = n) : n = t[1];
|
|
13
|
+
const o = n;
|
|
14
|
+
let l;
|
|
15
|
+
return t[2] !== o ? (l = /* @__PURE__ */ m(s, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
|
|
16
|
+
}, G = (e) => {
|
|
17
|
+
const t = a.c(14), n = e.dialogProps, o = e.open, l = e.onOpenChange;
|
|
18
|
+
let c;
|
|
19
|
+
t[0] !== e.contentProps ? (c = e.contentProps ?? {}, t[0] = e.contentProps, t[1] = c) : c = t[1];
|
|
20
|
+
let i;
|
|
21
|
+
t[2] !== c ? (i = d("command__dialog", c), t[2] = c, t[3] = i) : i = t[3];
|
|
22
|
+
const u = i;
|
|
23
|
+
let f;
|
|
24
|
+
t[4] !== e ? (f = /* @__PURE__ */ m(P, { ...e, children: e.children }), t[4] = e, t[5] = f) : f = t[5];
|
|
25
|
+
let r;
|
|
26
|
+
t[6] !== u || t[7] !== f ? (r = /* @__PURE__ */ m(g, { ...u, children: f }), t[6] = u, t[7] = f, t[8] = r) : r = t[8];
|
|
27
|
+
let C;
|
|
28
|
+
return t[9] !== e.dialogProps || t[10] !== e.onOpenChange || t[11] !== e.open || t[12] !== r ? (C = /* @__PURE__ */ m(h, { ...n, open: o, onOpenChange: l, children: r }), t[9] = e.dialogProps, t[10] = e.onOpenChange, t[11] = e.open, t[12] = r, t[13] = C) : C = t[13], C;
|
|
29
|
+
}, L = (e) => {
|
|
30
|
+
const t = a.c(4);
|
|
31
|
+
let n;
|
|
32
|
+
t[0] !== e ? (n = d("command__list", e), t[0] = e, t[1] = n) : n = t[1];
|
|
33
|
+
const o = n;
|
|
34
|
+
let l;
|
|
35
|
+
return t[2] !== o ? (l = /* @__PURE__ */ m(s.List, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
|
|
36
|
+
}, j = (e) => {
|
|
37
|
+
const t = a.c(12);
|
|
38
|
+
let n;
|
|
39
|
+
t[0] !== e.value ? (n = e.value?.toString(), t[0] = e.value, t[1] = n) : n = t[1];
|
|
40
|
+
let o;
|
|
41
|
+
t[2] !== e ? (o = (u) => {
|
|
42
|
+
if (e.onChange) {
|
|
43
|
+
const f = {
|
|
44
|
+
target: {
|
|
45
|
+
value: u
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
e.onChange(f);
|
|
49
|
+
}
|
|
50
|
+
}, t[2] = e, t[3] = o) : o = t[3];
|
|
51
|
+
let l;
|
|
52
|
+
t[4] !== e ? (l = d("command__input", e), t[4] = e, t[5] = l) : l = t[5];
|
|
53
|
+
let c;
|
|
54
|
+
t[6] !== l ? (c = /* @__PURE__ */ m($, { ...l }), t[6] = l, t[7] = c) : c = t[7];
|
|
55
|
+
let i;
|
|
56
|
+
return t[8] !== n || t[9] !== o || t[10] !== c ? (i = /* @__PURE__ */ m(s.Input, { value: n, onValueChange: o, asChild: !0, children: c }), t[8] = n, t[9] = o, t[10] = c, t[11] = i) : i = t[11], i;
|
|
57
|
+
}, B = (e) => {
|
|
58
|
+
const t = a.c(4);
|
|
59
|
+
let n;
|
|
60
|
+
t[0] !== e ? (n = d("command__empty", e), t[0] = e, t[1] = n) : n = t[1];
|
|
61
|
+
const o = n;
|
|
62
|
+
let l;
|
|
63
|
+
return t[2] !== o ? (l = /* @__PURE__ */ m(s.Empty, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
|
|
64
|
+
}, R = (e) => {
|
|
65
|
+
const t = a.c(4);
|
|
66
|
+
let n;
|
|
67
|
+
t[0] !== e ? (n = d("command__group", e), t[0] = e, t[1] = n) : n = t[1];
|
|
68
|
+
const o = n;
|
|
69
|
+
let l;
|
|
70
|
+
return t[2] !== o ? (l = /* @__PURE__ */ m(s.Group, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
|
|
71
|
+
}, T = (e) => {
|
|
72
|
+
const t = a.c(4);
|
|
73
|
+
let n;
|
|
74
|
+
t[0] !== e ? (n = d("command__item", e), t[0] = e, t[1] = n) : n = t[1];
|
|
75
|
+
const o = n;
|
|
76
|
+
let l;
|
|
77
|
+
return t[2] !== o ? (l = /* @__PURE__ */ m(s.Item, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
|
|
78
|
+
}, V = (e) => {
|
|
79
|
+
const t = a.c(4);
|
|
80
|
+
let n;
|
|
81
|
+
t[0] !== e ? (n = d("command__separator", e), t[0] = e, t[1] = n) : n = t[1];
|
|
82
|
+
const o = n;
|
|
83
|
+
let l;
|
|
84
|
+
return t[2] !== o ? (l = /* @__PURE__ */ m(s.Separator, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
|
|
85
|
+
}, b = (e) => {
|
|
86
|
+
const t = a.c(5);
|
|
87
|
+
let n;
|
|
88
|
+
t[0] !== e ? (n = d("command__shortcut", e), t[0] = e, t[1] = n) : n = t[1];
|
|
89
|
+
const o = n;
|
|
90
|
+
let l;
|
|
91
|
+
return t[2] !== e.children || t[3] !== o ? (l = /* @__PURE__ */ m(_, { ...o, children: e.children }), t[2] = e.children, t[3] = o, t[4] = l) : l = t[4], l;
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
P as Command,
|
|
95
|
+
G as CommandDialog,
|
|
96
|
+
B as CommandEmpty,
|
|
97
|
+
R as CommandGroup,
|
|
98
|
+
j as CommandInput,
|
|
99
|
+
T as CommandItem,
|
|
100
|
+
L as CommandList,
|
|
101
|
+
V as CommandSeparator,
|
|
102
|
+
b as CommandShortcut
|
|
103
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils/types';
|
|
3
|
+
export interface ContainerType extends Code0Component<HTMLDivElement> {
|
|
4
|
+
children: ReactNode | ReactNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare const Container: React.FC<ContainerType>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import '../../assets/components/container/Container.style.css';/* empty css */
|
|
4
|
+
import { mergeCode0Props as s } from "../../utils/utils.js";
|
|
5
|
+
const x = (i) => {
|
|
6
|
+
const t = l.c(6);
|
|
7
|
+
let e, r;
|
|
8
|
+
if (t[0] !== i) {
|
|
9
|
+
const {
|
|
10
|
+
children: n,
|
|
11
|
+
...m
|
|
12
|
+
} = i;
|
|
13
|
+
e = n, r = s("container", m), t[0] = i, t[1] = e, t[2] = r;
|
|
14
|
+
} else
|
|
15
|
+
e = t[1], r = t[2];
|
|
16
|
+
let o;
|
|
17
|
+
return t[3] !== e || t[4] !== r ? (o = /* @__PURE__ */ c("div", { ...r, children: e }), t[3] = e, t[4] = r, t[5] = o) : o = t[5], o;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
x as Container
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0ComponentProps, Color } from '../../utils';
|
|
3
|
+
import * as Radix from "@radix-ui/react-context-menu";
|
|
4
|
+
export type ContextMenuProps = Code0ComponentProps & Radix.ContextMenuProps;
|
|
5
|
+
export type ContextMenuTriggerProps = Code0ComponentProps & Radix.ContextMenuTriggerProps;
|
|
6
|
+
export type ContextMenuPortalProps = Code0ComponentProps & Radix.ContextMenuPortalProps;
|
|
7
|
+
export type ContextMenuContentProps = Code0ComponentProps & Radix.ContextMenuContentProps & {
|
|
8
|
+
color?: Color;
|
|
9
|
+
};
|
|
10
|
+
export type ContextMenuLabelProps = Code0ComponentProps & Radix.ContextMenuLabelProps;
|
|
11
|
+
export type ContextMenuItemProps = Code0ComponentProps & Radix.ContextMenuItemProps;
|
|
12
|
+
export type ContextMenuGroupProps = Code0ComponentProps & Radix.ContextMenuGroupProps;
|
|
13
|
+
export type ContextMenuSubProps = Code0ComponentProps & Radix.ContextMenuSubProps;
|
|
14
|
+
export type ContextMenuSubTriggerProps = Code0ComponentProps & Radix.ContextMenuSubTriggerProps;
|
|
15
|
+
export type ContextMenuSubContentProps = Code0ComponentProps & Radix.ContextMenuSubContentProps & {
|
|
16
|
+
color?: Color;
|
|
17
|
+
};
|
|
18
|
+
export type ContextMenuSeparatorProps = Code0ComponentProps & Radix.ContextMenuSeparatorProps;
|
|
19
|
+
export type ContextMenuArrowProps = Code0ComponentProps & Radix.ContextMenuArrowProps;
|
|
20
|
+
export declare const ContextMenu: React.FC<ContextMenuProps>;
|
|
21
|
+
export declare const ContextMenuTrigger: React.FC<ContextMenuTriggerProps>;
|
|
22
|
+
export declare const ContextMenuPortal: React.FC<ContextMenuPortalProps>;
|
|
23
|
+
export declare const ContextMenuContent: React.FC<ContextMenuContentProps>;
|
|
24
|
+
export declare const ContextMenuLabel: React.FC<ContextMenuLabelProps>;
|
|
25
|
+
export declare const ContextMenuItem: React.FC<ContextMenuItemProps>;
|
|
26
|
+
export declare const ContextMenuGroup: React.FC<ContextMenuGroupProps>;
|
|
27
|
+
export declare const ContextMenuSub: React.FC<ContextMenuSubProps>;
|
|
28
|
+
export declare const ContextMenuSubTrigger: React.FC<ContextMenuSubTriggerProps>;
|
|
29
|
+
export declare const ContextMenuSubContent: React.FC<ContextMenuSubContentProps>;
|
|
30
|
+
export declare const ContextMenuSeparator: React.FC<ContextMenuSeparatorProps>;
|
|
31
|
+
export declare const ContextMenuArrow: React.FC<ContextMenuArrowProps>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import "../../utils/contextStore.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { mergeCode0Props as i } from "../../utils/utils.js";
|
|
6
|
+
import * as r from "@radix-ui/react-context-menu";
|
|
7
|
+
import '../../assets/components/context-menu/ContextMenu.style.css';/* empty css */
|
|
8
|
+
const g = (n) => {
|
|
9
|
+
const t = u.c(4);
|
|
10
|
+
let o;
|
|
11
|
+
t[0] !== n ? (o = i("context-menu", n), t[0] = n, t[1] = o) : o = t[1];
|
|
12
|
+
const c = o;
|
|
13
|
+
let e;
|
|
14
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenu, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
15
|
+
}, $ = (n) => {
|
|
16
|
+
const t = u.c(4);
|
|
17
|
+
let o;
|
|
18
|
+
t[0] !== n ? (o = i("context-menu__trigger", n), t[0] = n, t[1] = o) : o = t[1];
|
|
19
|
+
const c = o;
|
|
20
|
+
let e;
|
|
21
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuTrigger, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
22
|
+
}, b = (n) => {
|
|
23
|
+
const t = u.c(4);
|
|
24
|
+
let o;
|
|
25
|
+
t[0] !== n ? (o = i("context-menu__portal", n), t[0] = n, t[1] = o) : o = t[1];
|
|
26
|
+
const c = o;
|
|
27
|
+
let e;
|
|
28
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuPortal, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
29
|
+
}, S = (n) => {
|
|
30
|
+
const t = u.c(6), o = n.align, c = `context-menu__content context-menu__content--${n.color ?? "primary"}`;
|
|
31
|
+
let e;
|
|
32
|
+
t[0] !== n || t[1] !== c ? (e = i(c, n), t[0] = n, t[1] = c, t[2] = e) : e = t[2];
|
|
33
|
+
const x = e;
|
|
34
|
+
let s;
|
|
35
|
+
return t[3] !== n.align || t[4] !== x ? (s = /* @__PURE__ */ l(r.ContextMenuContent, { align: o, ...x }), t[3] = n.align, t[4] = x, t[5] = s) : s = t[5], s;
|
|
36
|
+
}, T = (n) => {
|
|
37
|
+
const t = u.c(4);
|
|
38
|
+
let o;
|
|
39
|
+
t[0] !== n ? (o = i("context-menu__label", n), t[0] = n, t[1] = o) : o = t[1];
|
|
40
|
+
const c = o;
|
|
41
|
+
let e;
|
|
42
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuLabel, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
43
|
+
}, w = (n) => {
|
|
44
|
+
const t = u.c(4);
|
|
45
|
+
let o;
|
|
46
|
+
t[0] !== n ? (o = i("context-menu__item", n), t[0] = n, t[1] = o) : o = t[1];
|
|
47
|
+
const c = o;
|
|
48
|
+
let e;
|
|
49
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuItem, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
50
|
+
}, P = (n) => {
|
|
51
|
+
const t = u.c(4);
|
|
52
|
+
let o;
|
|
53
|
+
t[0] !== n ? (o = i("context-menu__group", n), t[0] = n, t[1] = o) : o = t[1];
|
|
54
|
+
const c = o;
|
|
55
|
+
let e;
|
|
56
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuGroup, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
57
|
+
}, d = (n) => {
|
|
58
|
+
const t = u.c(4);
|
|
59
|
+
let o;
|
|
60
|
+
t[0] !== n ? (o = i("context-menu__sub", n), t[0] = n, t[1] = o) : o = t[1];
|
|
61
|
+
const c = o;
|
|
62
|
+
let e;
|
|
63
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuSub, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
64
|
+
}, y = (n) => {
|
|
65
|
+
const t = u.c(4);
|
|
66
|
+
let o;
|
|
67
|
+
t[0] !== n ? (o = i("context-menu__sub-trigger", n), t[0] = n, t[1] = o) : o = t[1];
|
|
68
|
+
const c = o;
|
|
69
|
+
let e;
|
|
70
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuSubTrigger, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
71
|
+
}, A = (n) => {
|
|
72
|
+
const t = u.c(6), o = n.align, c = `context-menu__sub-content context-menu__sub-content--${n.color ?? "primary"}`;
|
|
73
|
+
let e;
|
|
74
|
+
t[0] !== n || t[1] !== c ? (e = i(c, n), t[0] = n, t[1] = c, t[2] = e) : e = t[2];
|
|
75
|
+
const x = e;
|
|
76
|
+
let s;
|
|
77
|
+
return t[3] !== n.align || t[4] !== x ? (s = /* @__PURE__ */ l(r.ContextMenuSubContent, { align: o, ...x }), t[3] = n.align, t[4] = x, t[5] = s) : s = t[5], s;
|
|
78
|
+
}, G = (n) => {
|
|
79
|
+
const t = u.c(4);
|
|
80
|
+
let o;
|
|
81
|
+
t[0] !== n ? (o = i("context-menu__separator", n), t[0] = n, t[1] = o) : o = t[1];
|
|
82
|
+
const c = o;
|
|
83
|
+
let e;
|
|
84
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuSeparator, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
85
|
+
}, I = (n) => {
|
|
86
|
+
const t = u.c(4);
|
|
87
|
+
let o;
|
|
88
|
+
t[0] !== n ? (o = i("context-menu__arrow", n), t[0] = n, t[1] = o) : o = t[1];
|
|
89
|
+
const c = o;
|
|
90
|
+
let e;
|
|
91
|
+
return t[2] !== c ? (e = /* @__PURE__ */ l(r.ContextMenuArrow, { ...c }), t[2] = c, t[3] = e) : e = t[3], e;
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
g as ContextMenu,
|
|
95
|
+
I as ContextMenuArrow,
|
|
96
|
+
S as ContextMenuContent,
|
|
97
|
+
P as ContextMenuGroup,
|
|
98
|
+
w as ContextMenuItem,
|
|
99
|
+
T as ContextMenuLabel,
|
|
100
|
+
b as ContextMenuPortal,
|
|
101
|
+
G as ContextMenuSeparator,
|
|
102
|
+
d as ContextMenuSub,
|
|
103
|
+
A as ContextMenuSubContent,
|
|
104
|
+
y as ContextMenuSubTrigger,
|
|
105
|
+
$ as ContextMenuTrigger
|
|
106
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils';
|
|
3
|
+
export type DataTableFilterOperator = "isOneOf" | "isNotOneOf";
|
|
4
|
+
export interface DataTableFilterProps {
|
|
5
|
+
[key: string]: {
|
|
6
|
+
operator: DataTableFilterOperator;
|
|
7
|
+
value: string | string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface DataTableSortProps {
|
|
11
|
+
[key: string]: 'asc' | 'desc' | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface DataTableProps<T> extends Omit<Code0Component<HTMLTableElement>, 'data' | 'children' | 'onSelect'> {
|
|
14
|
+
data: Array<T>;
|
|
15
|
+
sort?: DataTableSortProps;
|
|
16
|
+
filter?: DataTableFilterProps;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
loadingComponent?: React.ReactNode;
|
|
19
|
+
emptyComponent?: React.ReactNode;
|
|
20
|
+
onSelect?: (item: T | undefined) => void;
|
|
21
|
+
children?: (item: T, index: number) => React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare const DataTable: <T>(props: DataTableProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as g, jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
|
+
import '../../assets/components/data-table/DataTable.style.css';/* empty css */
|
|
4
|
+
import "../../utils/contextStore.js";
|
|
5
|
+
import { mergeCode0Props as C } from "../../utils/utils.js";
|
|
6
|
+
const d = (l, y) => y.split(".").reduce((t, f) => {
|
|
7
|
+
if (t != null)
|
|
8
|
+
return Array.isArray(t) ? t.map((a) => a?.[f]).filter((a) => a !== void 0) : t[f];
|
|
9
|
+
}, l), N = (l) => {
|
|
10
|
+
const {
|
|
11
|
+
data: y,
|
|
12
|
+
sort: t,
|
|
13
|
+
filter: f,
|
|
14
|
+
loading: a,
|
|
15
|
+
loadingComponent: j,
|
|
16
|
+
emptyComponent: A,
|
|
17
|
+
onSelect: u,
|
|
18
|
+
children: p,
|
|
19
|
+
...b
|
|
20
|
+
} = l, m = y.filter((i) => Object.entries(f || {}).every(([o, {
|
|
21
|
+
operator: n,
|
|
22
|
+
value: r
|
|
23
|
+
}]) => {
|
|
24
|
+
const e = d(i, o);
|
|
25
|
+
return n === "isOneOf" && !Array.isArray(r) && !Array.isArray(e) ? e === r : n === "isOneOf" && !Array.isArray(r) && Array.isArray(e) ? Array.from(e).includes(r) : n === "isOneOf" && Array.isArray(r) && !Array.isArray(e) ? Array.from(r).some((s) => s === e) : n === "isOneOf" && Array.isArray(r) && Array.isArray(e) ? Array.from(r).some((s) => Array.from(e).includes(s)) : !1;
|
|
26
|
+
})), c = h.useMemo(() => t ? [...m].sort((i, o) => {
|
|
27
|
+
for (const [n, r] of Object.entries(t)) {
|
|
28
|
+
const e = d(i, n), s = d(o, n);
|
|
29
|
+
if (e < s) return r === "asc" ? -1 : 1;
|
|
30
|
+
if (e > s) return r === "asc" ? 1 : -1;
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
}) : m, [m, t]);
|
|
34
|
+
return /* @__PURE__ */ g("table", { ...C("data-table", b), children: [
|
|
35
|
+
c.map((i, o) => /* @__PURE__ */ O("tr", { className: "data-table__row", onClick: () => u?.(i), children: p?.(i, o) })),
|
|
36
|
+
c.length === 0 && !a && A ? /* @__PURE__ */ O("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: A }) : null
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
N as DataTable
|
|
41
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Code0Component } from '../../utils';
|
|
3
|
+
export interface DataTableColumnProps extends Code0Component<HTMLTableCellElement> {
|
|
4
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
5
|
+
}
|
|
6
|
+
export declare const DataTableColumn: React.FC<DataTableColumnProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../_virtual/compiler-runtime.js";
|
|
3
|
+
import "../../utils/contextStore.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { mergeCode0Props as s } from "../../utils/utils.js";
|
|
6
|
+
const x = (m) => {
|
|
7
|
+
const t = n.c(6);
|
|
8
|
+
let e, r;
|
|
9
|
+
if (t[0] !== m) {
|
|
10
|
+
const {
|
|
11
|
+
children: i,
|
|
12
|
+
...l
|
|
13
|
+
} = m;
|
|
14
|
+
e = i, r = s("", l), t[0] = m, t[1] = e, t[2] = r;
|
|
15
|
+
} else
|
|
16
|
+
e = t[1], r = t[2];
|
|
17
|
+
let o;
|
|
18
|
+
return t[3] !== e || t[4] !== r ? (o = /* @__PURE__ */ c("td", { ...r, children: e }), t[3] = e, t[4] = r, t[5] = o) : o = t[5], o;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
x as DataTableColumn
|
|
22
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StreamLanguage } from '@codemirror/language';
|
|
3
|
+
import { CompletionContext } from '@codemirror/autocomplete';
|
|
4
|
+
import { DataTableFilterOperator, DataTableFilterProps } from './DataTable';
|
|
5
|
+
export interface DataTableFilterTokens {
|
|
6
|
+
token: string;
|
|
7
|
+
key: string;
|
|
8
|
+
operators: DataTableFilterOperator[];
|
|
9
|
+
suggestion?: (context: CompletionContext, operator: DataTableFilterOperator, currentValue: string, applySuggestion: (value: string, silently?: boolean) => void) => React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface DataTableFilterInputProps {
|
|
12
|
+
filterTokens?: DataTableFilterTokens[];
|
|
13
|
+
onChange?: (filter: DataTableFilterProps) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const createFilterQueryLanguage: (validTokens: string[]) => StreamLanguage<{
|
|
16
|
+
tokens: string[];
|
|
17
|
+
}>;
|
|
18
|
+
export declare const DataTableFilterInput: React.FC<DataTableFilterInputProps>;
|