@headless-adminapp/fluent 0.0.17-alpha.3 → 0.0.17-alpha.7

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 (35) hide show
  1. package/CommandBar/MenuButton.js +1 -1
  2. package/CommandBar/MenuItem.js +2 -2
  3. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +3 -3
  4. package/DataGrid/GridHeaderDesktop.js +0 -1
  5. package/DataGrid/GridTableContainer.js +5 -15
  6. package/DataGrid/useTableColumns.js +9 -21
  7. package/PageEntityForm/CommandContainer.js +9 -1
  8. package/PageEntityForm/FormTabRelated.js +1 -2
  9. package/PageEntityForm/RecordSetNavigatorContainer.js +4 -7
  10. package/components/PageLogin.js +0 -1
  11. package/form/FormControl.js +1 -1
  12. package/form/controls/DateControl.d.ts +1 -1
  13. package/form/controls/DateControl.js +1 -1
  14. package/form/controls/DateTimeControl.d.ts +1 -1
  15. package/form/controls/DateTimeControl.js +1 -1
  16. package/form/controls/EmailControl.d.ts +1 -1
  17. package/form/controls/EmailControl.js +1 -1
  18. package/form/controls/MultiSelectControl.d.ts +1 -1
  19. package/form/controls/MultiSelectControl.js +1 -1
  20. package/form/controls/NumberControl.js +1 -0
  21. package/form/controls/PasswordControl.d.ts +1 -1
  22. package/form/controls/PasswordControl.js +1 -1
  23. package/form/controls/SelectControl.d.ts +1 -1
  24. package/form/controls/SelectControl.js +1 -1
  25. package/form/controls/SwitchControl.d.ts +1 -1
  26. package/form/controls/SwitchControl.js +1 -1
  27. package/form/controls/TelephoneControl.d.ts +1 -1
  28. package/form/controls/TelephoneControl.js +1 -1
  29. package/form/controls/TextAreaControl.d.ts +1 -1
  30. package/form/controls/TextAreaControl.js +1 -1
  31. package/form/layout/FormSection/FormSection.js +1 -1
  32. package/form/layout/FormSection/FormSectionColumn.js +1 -1
  33. package/form/layout/FormSection/FormSectionLoading.js +1 -1
  34. package/form/layout/FormTab/FormTab.js +2 -1
  35. package/package.json +19 -2
@@ -36,7 +36,7 @@ exports.CommandMenuButton = (0, react_1.forwardRef)(function CommandMenuButton({
36
36
  const styles = useStyles();
37
37
  return (
38
38
  // <div ref={ref}>
39
- (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, positioning: "below-end", children: [onClick ? ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (triggerProps) => ((0, jsx_runtime_1.jsx)(react_components_1.SplitButton, { ref: ref, icon: (0, jsx_runtime_1.jsx)(Icon, {}), appearance: "subtle", className: (0, react_components_1.mergeClasses)(styles.splitButton, danger && styles.splitButtonDanger), menuButton: triggerProps, children: text })) })) : ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuButton, { ref: ref, appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(Icon, {}), className: (0, react_components_1.mergeClasses)(styles.menuButton), children: text }) })), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] })
39
+ (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, positioning: "below-end", children: [onClick ? ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (triggerProps) => ((0, jsx_runtime_1.jsx)(react_components_1.SplitButton, { ref: ref, icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), appearance: "subtle", className: (0, react_components_1.mergeClasses)(styles.splitButton, danger && styles.splitButtonDanger), menuButton: triggerProps, disabled: disabled, children: text })) })) : ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuButton, { ref: ref, appearance: "subtle", icon: (0, jsx_runtime_1.jsx)(Icon, {}), className: (0, react_components_1.mergeClasses)(styles.menuButton), children: text }) })), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] })
40
40
  // </div>
41
41
  );
42
42
  });
@@ -30,8 +30,8 @@ const useStyles = (0, react_components_1.makeStyles)({
30
30
  const MenuItem = ({ Icon, text, disabled, danger, onClick, items, }) => {
31
31
  const styles = useStyles();
32
32
  if (!(items === null || items === void 0 ? void 0 : items.length)) {
33
- return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { disabled: disabled, onClick: onClick, icon: (0, jsx_runtime_1.jsx)(Icon, {}), className: (0, react_components_1.mergeClasses)(danger && styles.danger), children: text }));
33
+ return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { disabled: disabled, onClick: onClick, icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), className: (0, react_components_1.mergeClasses)(danger && styles.danger), children: text }));
34
34
  }
35
- return ((0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, children: [onClick ? ((0, jsx_runtime_1.jsxs)(react_components_1.MenuSplitGroup, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, {}), className: (0, react_components_1.mergeClasses)(danger && styles.danger), children: text }), (0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { className: (0, react_components_1.mergeClasses)(styles.splitMenuRight) }) })] })) : ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, {}), children: text }) })), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] }));
35
+ return ((0, jsx_runtime_1.jsxs)(react_components_1.Menu, { hasIcons: true, children: [onClick ? ((0, jsx_runtime_1.jsxs)(react_components_1.MenuSplitGroup, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), className: (0, react_components_1.mergeClasses)(danger && styles.danger), children: text }), (0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { className: (0, react_components_1.mergeClasses)(styles.splitMenuRight) }) })] })) : ((0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { disableButtonEnhancement: true, children: (0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(Icon, { size: 20 }), children: text }) })), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(MenuList_1.MenuList, { items: items }) })] }));
36
36
  };
37
37
  exports.MenuItem = MenuItem;
@@ -61,7 +61,7 @@ minWidth,
61
61
  column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) => {
62
62
  const [visible, setVisible] = (0, react_1.useState)(false);
63
63
  const schema = (0, hooks_1.useDataGridSchema)();
64
- const { getSchema } = (0, hooks_2.useMetadata)();
64
+ const { schemaStore } = (0, hooks_2.useMetadata)();
65
65
  const strings = (0, PageEntityViewStringContext_1.usePageEntityViewStrings)();
66
66
  const attribute = (0, react_1.useMemo)(() => {
67
67
  const _attribute = schema.attributes[column.name];
@@ -71,9 +71,9 @@ column, onResetSize, resizeHandler, resizable, disableFilter, disableSort, }) =>
71
71
  if (_attribute.type !== 'lookup') {
72
72
  throw new Error('Invalid attribute type');
73
73
  }
74
- const lookupSchema = getSchema(_attribute.entity);
74
+ const lookupSchema = schemaStore.getSchema(_attribute.entity);
75
75
  return lookupSchema.attributes[column.expandedKey];
76
- }, [column.expandedKey, column.name, getSchema, schema.attributes]);
76
+ }, [column.expandedKey, column.name, schemaStore, schema.attributes]);
77
77
  const align = (0, react_1.useMemo)(() => {
78
78
  switch (attribute.type) {
79
79
  case 'money':
@@ -24,7 +24,6 @@ const GridHeaderDesktop = (props) => {
24
24
  alignItems: 'center',
25
25
  paddingInline: 8,
26
26
  gap: 16,
27
- width: '100%',
28
27
  display: 'flex',
29
28
  }, children: [(0, jsx_runtime_1.jsx)(CustomizeColumns_1.CustomizeColumns, { opened: isColumnCustomizationOpen, onClose: () => setIsColumnCustomizationOpen(false) }), (0, jsx_runtime_1.jsx)("div", { style: {
30
29
  flex: 1,
@@ -7,9 +7,8 @@ const datagrid_1 = require("@headless-adminapp/app/datagrid");
7
7
  const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
8
8
  const locale_1 = require("@headless-adminapp/app/locale");
9
9
  const mutable_1 = require("@headless-adminapp/app/mutable");
10
+ const navigation_1 = require("@headless-adminapp/app/navigation");
10
11
  const hooks_2 = require("@headless-adminapp/app/recordset/hooks");
11
- const hooks_3 = require("@headless-adminapp/app/route/hooks");
12
- const app_1 = require("@headless-adminapp/core/experience/app");
13
12
  const react_table_1 = require("@tanstack/react-table");
14
13
  const react_virtual_1 = require("@tanstack/react-virtual");
15
14
  const react_1 = require("react");
@@ -73,25 +72,16 @@ const GridTableContainer = ({ noPadding, disableColumnFilter, disableColumnSort,
73
72
  }));
74
73
  }, [sorting]);
75
74
  const tableWrapperRef = (0, react_1.useRef)(null);
76
- const routeResolver = (0, hooks_3.useRouteResolver)();
77
- const router = (0, hooks_3.useRouter)();
78
75
  const recordSetSetter = (0, hooks_2.useRecordSetSetter)();
76
+ const openFormInternal = (0, navigation_1.useOpenForm)();
79
77
  const openRecord = (0, react_1.useCallback)((id) => {
80
78
  var _a, _b;
81
- const path = routeResolver({
79
+ recordSetSetter(schema.logicalName, (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.records.map((x) => x[schema.idAttribute])) !== null && _b !== void 0 ? _b : []);
80
+ openFormInternal({
82
81
  logicalName: schema.logicalName,
83
- type: app_1.PageType.EntityForm,
84
82
  id,
85
83
  });
86
- recordSetSetter(schema.logicalName, (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.records.map((x) => x[schema.idAttribute])) !== null && _b !== void 0 ? _b : []);
87
- router.push(path);
88
- }, [
89
- recordSetSetter,
90
- routeResolver,
91
- router,
92
- schema.idAttribute,
93
- schema.logicalName,
94
- ]);
84
+ }, [openFormInternal, recordSetSetter, schema.idAttribute, schema.logicalName]);
95
85
  const { direction } = (0, locale_1.useLocale)();
96
86
  const dataRef = (0, react_1.useRef)(data);
97
87
  dataRef.current = data;
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const datagrid_1 = require("@headless-adminapp/app/datagrid");
7
7
  const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
8
+ const useOpenRecord_1 = require("@headless-adminapp/app/datagrid/hooks/useOpenRecord");
8
9
  const hooks_2 = require("@headless-adminapp/app/hooks");
9
10
  const locale_1 = require("@headless-adminapp/app/locale");
10
11
  const hooks_3 = require("@headless-adminapp/app/metadata/hooks");
@@ -36,14 +37,16 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
36
37
  const columns = (0, hooks_1.useGridColumns)();
37
38
  const [, setSorting] = (0, hooks_1.useGridSorting)();
38
39
  const schema = (0, hooks_1.useDataGridSchema)();
39
- const { getSchema } = (0, hooks_3.useMetadata)();
40
+ const { schemaStore } = (0, hooks_3.useMetadata)();
40
41
  const [, setSelectedIds] = (0, hooks_1.useGridSelection)();
41
42
  const setSelectedIdsRef = (0, react_1.useRef)(setSelectedIds);
42
43
  setSelectedIdsRef.current = setSelectedIds;
43
44
  const isSubgrid = (0, mutable_1.useContextSelector)(datagrid_1.GridContext, (state) => state.isSubGrid);
44
45
  const contextCommands = isSubgrid
45
- ? (0, hooks_1.useSubGridCommands)()
46
- : (0, hooks_1.useMainGridContextCommands)();
46
+ ? // eslint-disable-next-line react-hooks/rules-of-hooks
47
+ (0, hooks_1.useSubGridCommands)()
48
+ : // eslint-disable-next-line react-hooks/rules-of-hooks
49
+ (0, hooks_1.useMainGridContextCommands)();
47
50
  const mutableContextCommandState = (0, mutable_1.useMutableState)(contextCommands, true);
48
51
  (0, react_1.useEffect)(() => {
49
52
  mutableContextCommandState.setValue(contextCommands);
@@ -69,22 +72,7 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
69
72
  const routeResolver = (0, hooks_5.useRouteResolver)();
70
73
  const router = (0, hooks_5.useRouter)();
71
74
  const recordSetSetter = (0, hooks_4.useRecordSetSetter)();
72
- const openRecord = (0, react_1.useCallback)((id) => {
73
- var _a, _b;
74
- const path = routeResolver({
75
- logicalName: schema.logicalName,
76
- type: app_1.PageType.EntityForm,
77
- id,
78
- });
79
- recordSetSetter(schema.logicalName, (_b = (_a = dataRef.current) === null || _a === void 0 ? void 0 : _a.records.map((x) => x[schema.idAttribute])) !== null && _b !== void 0 ? _b : []);
80
- router.push(path);
81
- }, [
82
- recordSetSetter,
83
- routeResolver,
84
- router,
85
- schema.idAttribute,
86
- schema.logicalName,
87
- ]);
75
+ const openRecord = (0, useOpenRecord_1.useOpenRecord)();
88
76
  const { currency, dateFormats } = (0, locale_1.useLocale)();
89
77
  const dataRef = (0, react_1.useRef)(data);
90
78
  dataRef.current = data;
@@ -149,7 +137,7 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
149
137
  const field = column.expandedKey;
150
138
  const entity = schema.attributes[lookup]
151
139
  .entity;
152
- const lookupSchema = getSchema(entity);
140
+ const lookupSchema = schemaStore.getSchema(entity);
153
141
  attribute = lookupSchema.attributes[field];
154
142
  value = (_b = (_a = info.row.original.$expand) === null || _a === void 0 ? void 0 : _a[lookup]) === null || _b === void 0 ? void 0 : _b[field];
155
143
  }
@@ -241,7 +229,7 @@ function useTableColumns({ disableSelection, disableContextMenu, disableColumnRe
241
229
  setSorting,
242
230
  currency.currency,
243
231
  dateFormats.short,
244
- getSchema,
232
+ schemaStore,
245
233
  routeResolver,
246
234
  openRecord,
247
235
  recordSetSetter,
@@ -43,7 +43,15 @@ const CommandContainer = () => {
43
43
  : []),
44
44
  ...gridCommands,
45
45
  ];
46
- }, [gridCommands, recordSetContext, recordSetVisible, schema.logicalName]);
46
+ }, [
47
+ gridCommands,
48
+ recordSetContext.ids.length,
49
+ recordSetContext.logicalName,
50
+ recordSetVisible,
51
+ router,
52
+ schema.logicalName,
53
+ setRecordSetVisible,
54
+ ]);
47
55
  return (0, jsx_runtime_1.jsx)(OverflowCommandBar_1.OverflowCommandBar, { commands: extendedCommands });
48
56
  };
49
57
  exports.CommandContainer = CommandContainer;
@@ -4,11 +4,10 @@ exports.FormTabRelated = FormTabRelated;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
7
- const hooks_2 = require("@headless-adminapp/app/dataform/hooks");
8
7
  const FormTab_1 = require("../form/layout/FormTab");
9
8
  const SubgridControl_1 = require("./SubgridControl");
10
9
  function FormTabRelated({ selectedRelatedItem }) {
11
- const recordId = (0, hooks_2.useRecordId)();
10
+ const recordId = (0, hooks_1.useRecordId)();
12
11
  const schema = (0, hooks_1.useDataFormSchema)();
13
12
  return ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab, { value: "related", noWrapper: true, children: (0, jsx_runtime_1.jsx)("div", { style: {
14
13
  display: 'flex',
@@ -6,9 +6,8 @@ const react_components_1 = require("@fluentui/react-components");
6
6
  const ScrollView_1 = require("@headless-adminapp/app/components/ScrollView");
7
7
  const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
8
8
  const locale_1 = require("@headless-adminapp/app/locale");
9
+ const navigation_1 = require("@headless-adminapp/app/navigation");
9
10
  const hooks_2 = require("@headless-adminapp/app/recordset/hooks");
10
- const hooks_3 = require("@headless-adminapp/app/route/hooks");
11
- const app_1 = require("@headless-adminapp/core/experience/app");
12
11
  const react_1 = require("react");
13
12
  const RecordCard_1 = require("./RecordCard");
14
13
  const useStyles = (0, react_components_1.makeStyles)({
@@ -31,8 +30,7 @@ const RecordSetNavigatorContainer = () => {
31
30
  const [visible] = (0, hooks_2.useRecordSetVisibility)();
32
31
  const recordId = (0, hooks_1.useRecordId)();
33
32
  const styles = useStyles();
34
- const routeResolver = (0, hooks_3.useRouteResolver)();
35
- const router = (0, hooks_3.useRouter)();
33
+ const openForm = (0, navigation_1.useOpenForm)();
36
34
  const { language, direction } = (0, locale_1.useLocale)();
37
35
  if (!schema) {
38
36
  return null;
@@ -60,12 +58,11 @@ const RecordSetNavigatorContainer = () => {
60
58
  }, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (_b = (_a = schema.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : schema === null || schema === void 0 ? void 0 : schema.pluralLabel }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: false, style: { opacity: 0.2 } }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(ScrollView_1.ScrollView, { autoHide: true, rtl: direction === 'rtl', children: data === null || data === void 0 ? void 0 : data.map((record) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { role: "button", className: (0, react_components_1.mergeClasses)(styles.item, recordId ===
61
59
  record[schema.idAttribute] &&
62
60
  styles.selected), onClick: () => {
63
- const path = routeResolver({
64
- type: app_1.PageType.EntityForm,
61
+ openForm({
65
62
  logicalName: schema.logicalName,
66
63
  id: record[schema.idAttribute],
64
+ replace: true,
67
65
  });
68
- router.replace(path);
69
66
  }, children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: cardView, record: record, schema: schema, selected: recordId ===
70
67
  record[schema.idAttribute] }) }), (0, jsx_runtime_1.jsx)("div", { style: { paddingInline: react_components_1.tokens.spacingHorizontalL }, children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: false, style: { opacity: 0.2 } }) })] }, record[schema.idAttribute]))) }) })] }) }));
71
68
  };
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageLogin = PageLogin;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- /* eslint-disable @next/next/no-img-element */
6
5
  const react_components_1 = require("@fluentui/react-components");
7
6
  const LoginForm_1 = require("./LoginForm");
8
7
  function PageLogin(props) {
@@ -86,7 +86,7 @@ function randomUUID() {
86
86
  return Math.random().toString(36).substring(2, 15);
87
87
  }
88
88
  function FormControl(props) {
89
- const { label, id, onChange, error, helperText, required } = props;
89
+ const { label, id, onChange } = props;
90
90
  const _id = (0, react_1.useMemo)(() => id || randomUUID(), [id]);
91
91
  const noop = (0, react_1.useCallback)(() => { }, []);
92
92
  return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Label, { style: { width: 160, marginTop: 4 }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(Control, Object.assign({ id: _id, onChange: onChange || noop }, props)) })] }));
@@ -3,4 +3,4 @@ export interface DateControlProps extends ControlProps<string> {
3
3
  maxDate?: Date;
4
4
  minDate?: Date;
5
5
  }
6
- export declare function DateControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, maxDate, minDate, borderOnFocusOnly, readOnly, }: DateControlProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }: DateControlProps): import("react/jsx-runtime").JSX.Element;
@@ -9,7 +9,7 @@ const react_datepicker_compat_1 = require("@fluentui/react-datepicker-compat");
9
9
  const locale_1 = require("@headless-adminapp/app/locale");
10
10
  const dayjs_1 = __importDefault(require("dayjs"));
11
11
  const AppStringContext_1 = require("../../App/AppStringContext");
12
- function DateControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, maxDate, minDate, borderOnFocusOnly, readOnly, }) {
12
+ function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
13
13
  const { dateFormats } = (0, locale_1.useLocale)();
14
14
  const { datePickerStrings } = (0, AppStringContext_1.useAppStrings)();
15
15
  return ((0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), placeholder: placeholder, appearance: "filled-darker",
@@ -3,4 +3,4 @@ export interface DateTimeControlProps extends ControlProps<string> {
3
3
  maxDate?: Date;
4
4
  minDate?: Date;
5
5
  }
6
- export declare function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, maxDate, minDate, borderOnFocusOnly, readOnly, }: DateTimeControlProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }: DateTimeControlProps): import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,7 @@ exports.DateTimeControl = DateTimeControl;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_datepicker_compat_1 = require("@fluentui/react-datepicker-compat");
9
9
  const dayjs_1 = __importDefault(require("dayjs"));
10
- function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, maxDate, minDate, borderOnFocusOnly, readOnly, }) {
10
+ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
11
11
  // const { shortDate: dateFormat } = useLocale();
12
12
  // return (
13
13
  // <TimePicker
@@ -3,4 +3,4 @@ export interface EmailControlProps extends ControlProps<string> {
3
3
  autoComplete?: string;
4
4
  textTransform?: 'capitalize' | 'uppercase' | 'lowercase' | 'none';
5
5
  }
6
- export declare function EmailControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, autoComplete, textTransform, borderOnFocusOnly, readOnly, }: EmailControlProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function EmailControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, textTransform, readOnly, }: EmailControlProps): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ exports.EmailControl = EmailControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const icons_1 = require("@headless-adminapp/icons");
7
- function EmailControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, autoComplete, textTransform, borderOnFocusOnly, readOnly, }) {
7
+ function EmailControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, textTransform, readOnly, }) {
8
8
  return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "email", placeholder: placeholder, id: id, appearance: "filled-darker", name: name,
9
9
  // size="sm"
10
10
  value: value || '', onChange: (e) => {
@@ -3,4 +3,4 @@ import { ControlProps } from './types';
3
3
  export interface MultiSelectControlProps<T> extends ControlProps<T[]> {
4
4
  options: Lookup<T>[];
5
5
  }
6
- export default function MultiSelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, error, onBlur, onFocus, placeholder, }: MultiSelectControlProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export default function MultiSelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, }: MultiSelectControlProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ exports.default = MultiSelectControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const react_1 = require("react");
7
- function MultiSelectControl({ value, onChange, options, id, name, disabled, error, onBlur, onFocus, placeholder, }) {
7
+ function MultiSelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, }) {
8
8
  const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
9
9
  const handleChange = (value) => {
10
10
  const selectedOptions = options.filter((x) => value.includes(String(x.value)));
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NumberControl = NumberControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /* eslint-disable unused-imports/no-unused-vars */
5
6
  const react_components_1 = require("@fluentui/react-components");
6
7
  function NumberControl({ value, onChange, id, name, onBlur, onFocus, error, disabled, placeholder, borderOnFocusOnly, readOnly, }) {
7
8
  return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "number", placeholder: placeholder, id: id, appearance: "filled-darker", name: name,
@@ -3,4 +3,4 @@ import { ControlProps } from './types';
3
3
  export interface PasswordControlProps extends ControlProps<string> {
4
4
  appearance?: InputProps['appearance'];
5
5
  }
6
- export declare function PasswordControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, autoFocus, appearance, }: PasswordControlProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function PasswordControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, appearance, }: PasswordControlProps): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const icons_1 = require("@headless-adminapp/icons");
7
7
  const react_1 = require("react");
8
- function PasswordControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, autoFocus, appearance = 'filled-darker', }) {
8
+ function PasswordControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, appearance = 'filled-darker', }) {
9
9
  const [showPassword, setShowPassword] = (0, react_1.useState)(false);
10
10
  return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, name: name, appearance: appearance, type: showPassword ? 'text' : 'password', autoFocus: autoFocus, value: value || '', onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
11
11
  // invalid={error}
@@ -6,4 +6,4 @@ export interface Lookup<T = string> {
6
6
  export interface SelectControlProps<T> extends ControlProps<T> {
7
7
  options: Lookup<T>[];
8
8
  }
9
- export default function SelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, error, onBlur, onFocus, placeholder, readOnly, }: SelectControlProps<T>): import("react/jsx-runtime").JSX.Element;
9
+ export default function SelectControl<T extends string | number>({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, }: SelectControlProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ exports.default = SelectControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const react_1 = require("react");
7
- function SelectControl({ value, onChange, options, id, name, disabled, error, onBlur, onFocus, placeholder, readOnly, }) {
7
+ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, }) {
8
8
  var _a;
9
9
  const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
10
10
  const handleChange = (value) => {
@@ -1,4 +1,4 @@
1
1
  import { ControlProps } from './types';
2
2
  export interface SwitchControlProps extends ControlProps<boolean> {
3
3
  }
4
- export declare function SwitchControl({ value, onChange, id, name, onBlur, onFocus, error, disabled, placeholder, readOnly, }: SwitchControlProps): null;
4
+ export declare function SwitchControl({}: SwitchControlProps): null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SwitchControl = SwitchControl;
4
- function SwitchControl({ value, onChange, id, name, onBlur, onFocus, error, disabled, placeholder, readOnly, }) {
4
+ function SwitchControl({}) {
5
5
  return null;
6
6
  }
@@ -2,4 +2,4 @@ import { ControlProps } from './types';
2
2
  export interface TelephoneControlProps extends ControlProps<string> {
3
3
  autoComplete?: string;
4
4
  }
5
- export declare function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, autoComplete, }: TelephoneControlProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, }: TelephoneControlProps): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ exports.TelephoneControl = TelephoneControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const icons_1 = require("@headless-adminapp/icons");
7
- function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, error, placeholder, disabled, autoComplete, }) {
7
+ function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, }) {
8
8
  return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { type: "tel", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value || '', onChange: (e) => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(), onFocus: () => onFocus === null || onFocus === void 0 ? void 0 : onFocus(),
9
9
  // invalid={error}
10
10
  disabled: disabled, autoComplete: autoComplete, style: {
@@ -3,4 +3,4 @@ export interface TextAreaControlProps extends ControlProps<string> {
3
3
  rows?: number;
4
4
  textTransform?: 'capitalize' | 'uppercase' | 'lowercase' | 'none';
5
5
  }
6
- export declare function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, error, disabled, rows, textTransform, }: TextAreaControlProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, rows, textTransform, }: TextAreaControlProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TextAreaControl = TextAreaControl;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
- function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, error, disabled, rows = 5, textTransform, }) {
6
+ function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, rows = 5, textTransform, }) {
7
7
  return ((0, jsx_runtime_1.jsx)(react_components_1.Textarea, { placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value || '', onChange: (e) => {
8
8
  textTransform === 'uppercase'
9
9
  ? onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value.toUpperCase())
@@ -11,7 +11,7 @@ const FormSectionLoading_1 = require("./FormSectionLoading");
11
11
  function determineItemCount(availableWidth, itemWidth, gap, padding) {
12
12
  return Math.floor((availableWidth + gap - 2 * padding) / (itemWidth + gap));
13
13
  }
14
- const FormSection = ({ title, children, columnCount, fullHeight, labelPosition, noPadding, hideLabel, }) => {
14
+ const FormSection = ({ title, children, columnCount, labelPosition, noPadding, hideLabel }) => {
15
15
  // const columnCount = 2;
16
16
  const divRef = (0, react_1.useRef)(null);
17
17
  const divSize = (0, hooks_1.useElementSize)(divRef, 100);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormSectionColumn = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const FormSectionColumn = ({ children, span }) => {
5
+ const FormSectionColumn = ({ children }) => {
6
6
  return ((0, jsx_runtime_1.jsx)("div", {
7
7
  // md={span}
8
8
  // xs={12}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormSectionLoading = void 0;
4
- const FormSectionLoading = ({ controlCount, }) => {
4
+ const FormSectionLoading = () => {
5
5
  return null;
6
6
  };
7
7
  exports.FormSectionLoading = FormSectionLoading;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormTab = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /* eslint-disable unused-imports/no-unused-vars */
5
6
  const dataform_1 = require("@headless-adminapp/app/dataform");
6
7
  const hooks_1 = require("@headless-adminapp/app/hooks");
7
8
  const mutable_1 = require("@headless-adminapp/app/mutable");
@@ -65,7 +66,7 @@ const FormTabInternal = ({ children, value, fullHeight, columnCount, columnWidth
65
66
  flexDirection: 'column',
66
67
  flex: 1,
67
68
  // marginTop: 12,
68
- // padding: 12,
69
+ padding: 12,
69
70
  }, children: (0, jsx_runtime_1.jsx)("div", { style: {
70
71
  // display: 'flex',
71
72
  // flexWrap: 'wrap',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "0.0.17-alpha.3",
3
+ "version": "0.0.17-alpha.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -26,5 +26,22 @@
26
26
  "keywords": [],
27
27
  "author": "",
28
28
  "license": "ISC",
29
- "gitHead": "f6ce162167fabc3cbac101038b157ddd22455a4f"
29
+ "dependencies": {
30
+ "@fluentui/react-components": "9.54.4",
31
+ "@fluentui/react-datepicker-compat": "^0.4.43",
32
+ "@fluentui/react-nav-preview": "^0.5.1",
33
+ "@hookform/resolvers": "^3.9.0",
34
+ "@tanstack/react-query": "5.51.1",
35
+ "@tanstack/react-table": "^8.20.1",
36
+ "@tanstack/react-virtual": "^3.8.6",
37
+ "dayjs": "^1.11.13",
38
+ "dnd-core": "^16.0.1",
39
+ "immutability-helper": "^3.1.1",
40
+ "lodash": "^4.17.21",
41
+ "react-dnd": "^16.0.1",
42
+ "react-dnd-html5-backend": "^16.0.1",
43
+ "react-hook-form": "7.52.2",
44
+ "yup": "^1.4.0"
45
+ },
46
+ "gitHead": "5b53560e1c0b20e0bb0e74e820a96c7c75e2c43b"
30
47
  }