@headless-adminapp/fluent 1.0.1 → 1.0.3

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.
@@ -19,6 +19,16 @@ function TableCellChoice(props) {
19
19
  }
20
20
  return (0, color_1.isColorDark)(bgColor) ? '#FFFFFF' : '#000000';
21
21
  }, [bgColor]);
22
+ if (!props.formattedValue) {
23
+ return ((0, jsx_runtime_1.jsx)(TableCellBase_1.TableCellBase, { style: {
24
+ textOverflow: 'ellipsis',
25
+ overflow: 'hidden',
26
+ whiteSpace: 'nowrap',
27
+ width: props.width,
28
+ minWidth: props.width,
29
+ maxWidth: props.width,
30
+ } }));
31
+ }
22
32
  return ((0, jsx_runtime_1.jsx)(TableCellBase_1.TableCellBase, { style: {
23
33
  textOverflow: 'ellipsis',
24
34
  overflow: 'hidden',
@@ -27,8 +37,8 @@ function TableCellChoice(props) {
27
37
  minWidth: props.width,
28
38
  maxWidth: props.width,
29
39
  }, children: (0, jsx_runtime_1.jsx)(react_components_1.Badge, { style: {
30
- backgroundColor: bgColor,
31
- color,
40
+ backgroundColor: bgColor ?? react_components_1.tokens.colorNeutralBackground3,
41
+ color: color ?? react_components_1.tokens.colorNeutralForeground2,
32
42
  fontWeight: react_components_1.tokens.fontWeightRegular,
33
43
  }, children: props.formattedValue }) }));
34
44
  }
@@ -1,4 +1,4 @@
1
1
  import { DataGridWidgetExperience } from '@headless-adminapp/core/experience/insights';
2
- export declare function WidgetDataGridContainer({ content, }: {
2
+ export declare function WidgetDataGridContainer({ content, }: Readonly<{
3
3
  content: DataGridWidgetExperience;
4
- }): import("react/jsx-runtime").JSX.Element;
4
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -36,6 +36,7 @@ function WidgetDataGridContainer({ content, }) {
36
36
  const FormSubgridContainer = ({ content, }) => {
37
37
  const baseCommandHandleContext = (0, hooks_1.useBaseCommandHandlerContext)();
38
38
  const primaryControl = (0, hooks_2.useGridControlContext)();
39
+ const widgetState = (0, mutable_1.useContextSelector)(widget_1.WidgetContext, (state) => state);
39
40
  const widgetSetValue = (0, mutable_1.useContextSetValue)(widget_1.WidgetContext);
40
41
  const updateStateValue = (0, react_1.useCallback)(
41
42
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -60,7 +61,7 @@ const FormSubgridContainer = ({ content, }) => {
60
61
  // backgroundColor: tokens.colorNeutralBackground2,
61
62
  // padding: 2,
62
63
  overflow: 'hidden',
63
- }, children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: "Recent transactions", commands: transformedCommands }), (0, jsx_runtime_1.jsx)("div", { style: {
64
+ }, children: [(0, jsx_runtime_1.jsx)(WidgetTitleBar_1.WidgetTitleBar, { title: widgetState.widget.title, commands: transformedCommands }), (0, jsx_runtime_1.jsx)("div", { style: {
64
65
  // gap: 12,
65
66
  flex: 1,
66
67
  display: 'flex',
@@ -2,7 +2,6 @@ import { RetriveRecordFn } from '@headless-adminapp/app/dataform/DataFormProvide
2
2
  import { SaveRecordFn } from '@headless-adminapp/app/dataform/utils/saveRecord';
3
3
  import { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
4
4
  import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
5
- import { FC } from 'react';
6
5
  interface PageCustomEntityFormProps<SA extends SchemaAttributes = SchemaAttributes> {
7
6
  recordId?: string;
8
7
  schema: Schema<SA>;
@@ -11,5 +10,5 @@ interface PageCustomEntityFormProps<SA extends SchemaAttributes = SchemaAttribut
11
10
  retriveRecordFn?: RetriveRecordFn<SA>;
12
11
  saveRecordFn?: SaveRecordFn;
13
12
  }
14
- export declare const PageCustomEntityForm: FC<PageCustomEntityFormProps>;
13
+ export declare function PageCustomEntityForm<SA extends SchemaAttributes = SchemaAttributes>({ recordId, commands, form, schema, retriveRecordFn, saveRecordFn, }: Readonly<PageCustomEntityFormProps<SA>>): import("react/jsx-runtime").JSX.Element;
15
14
  export {};
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageCustomEntityForm = void 0;
3
+ exports.PageCustomEntityForm = PageCustomEntityForm;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
6
  const PageEntityFormProvider_1 = require("@headless-adminapp/app/providers/PageEntityFormProvider");
7
7
  const PageEntityFormDesktopContainer_1 = require("./PageEntityFormDesktopContainer");
8
- const PageCustomEntityForm = ({ recordId, commands, form, schema, retriveRecordFn, saveRecordFn, }) => {
9
- return ((0, jsx_runtime_1.jsx)(PageEntityFormProvider_1.PageEntityFormProvider, { schema: schema, form: form, recordId: recordId, commands: commands, retriveRecordFn: retriveRecordFn, saveRecordFn: saveRecordFn, children: (0, jsx_runtime_1.jsx)("div", { style: {
8
+ const RecordSetNavigatorContainer_1 = require("./RecordSetNavigatorContainer");
9
+ function PageCustomEntityForm({ recordId, commands, form, schema, retriveRecordFn, saveRecordFn, }) {
10
+ return ((0, jsx_runtime_1.jsx)(PageEntityFormProvider_1.PageEntityFormProvider, { schema: schema, form: form, recordId: recordId, commands: commands, retriveRecordFn: retriveRecordFn, saveRecordFn: saveRecordFn, children: (0, jsx_runtime_1.jsxs)("div", { style: {
10
11
  display: 'flex',
11
12
  flex: 1,
12
13
  flexDirection: 'row',
13
14
  backgroundColor: react_components_1.tokens.colorNeutralBackground2,
14
15
  overflow: 'hidden',
15
- }, children: (0, jsx_runtime_1.jsx)(PageEntityFormDesktopContainer_1.PageEntityFormDesktopContainer, {}) }) }));
16
- };
17
- exports.PageCustomEntityForm = PageCustomEntityForm;
16
+ }, children: [(0, jsx_runtime_1.jsx)(RecordSetNavigatorContainer_1.RecordSetNavigatorContainer, {}), (0, jsx_runtime_1.jsx)(PageEntityFormDesktopContainer_1.PageEntityFormDesktopContainer, {})] }) }));
17
+ }
@@ -56,8 +56,11 @@ const RecordAvatar = () => {
56
56
  hideProgressIndicator();
57
57
  }
58
58
  };
59
+ const experienceSchema = schemaMetadataDic[schema.logicalName];
60
+ if (!experienceSchema) {
61
+ return null;
62
+ }
59
63
  if (isPlaceholder && !value) {
60
- const experienceSchema = schemaMetadataDic[schema.logicalName];
61
64
  const Icon = experienceSchema.icon ?? icons_1.Icons.Entity ?? icons_1.IconPlaceholder;
62
65
  return ((0, jsx_runtime_1.jsx)("div", { style: {
63
66
  display: 'flex',
@@ -79,8 +79,9 @@ function SectionContainer({ section }) {
79
79
  control.label ??
80
80
  attribute.label;
81
81
  return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: (value) => {
82
+ const previousValue = field.value;
82
83
  field.onChange(value);
83
- eventManager.emit(constants_1.EVENT_KEY_ON_FIELD_CHANGE, control.attributeName, value);
84
+ eventManager.emit(constants_1.EVENT_KEY_ON_FIELD_CHANGE, control.attributeName, value, previousValue);
84
85
  }, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError, readOnly: disabled, label: label, placeholder: label, allowNavigation: true, allowNewRecord: true, fileServiceContext: {
85
86
  type: 'entity-form',
86
87
  recordId,
@@ -48,6 +48,8 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
48
48
  .tz(timezone)
49
49
  .set('hour', (0, dayjs_1.default)(value).tz(timezone).hour())
50
50
  .set('minute', (0, dayjs_1.default)(value).tz(timezone).minute())
51
+ .set('second', 0)
52
+ .set('millisecond', 0)
51
53
  .toISOString());
52
54
  }
53
55
  },
@@ -78,6 +80,8 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
78
80
  onChange?.(dateValue
79
81
  .set('hour', (0, dayjs_1.default)(data.selectedTime).tz(timezone, true).hour())
80
82
  .set('minute', (0, dayjs_1.default)(data.selectedTime).tz(timezone, true).minute())
83
+ .set('second', 0)
84
+ .set('millisecond', 0)
81
85
  .toISOString());
82
86
  }
83
87
  else if (data.selectedTimeText) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,19 +20,21 @@
20
20
  "keywords": [],
21
21
  "author": "",
22
22
  "license": "ISC",
23
+ "peerDependencies": {
24
+ "@fluentui/react-calendar-compat": "^0.1.20",
25
+ "@fluentui/react-components": "^9.54.4",
26
+ "@fluentui/react-datepicker-compat": "^0.4.43",
27
+ "@fluentui/react-nav-preview": "^0.5.1",
28
+ "@fluentui/react-timepicker-compat": "^0.2.46",
29
+ "@tanstack/react-query": "^5.51.1"
30
+ },
23
31
  "dependencies": {
24
- "@fluentui/react-calendar-compat": "0.1.20",
25
- "@fluentui/react-components": "9.54.4",
26
- "@fluentui/react-datepicker-compat": "0.4.43",
27
- "@fluentui/react-nav-preview": "0.5.1",
28
- "@fluentui/react-timepicker-compat": "0.2.46",
29
32
  "@fullcalendar/core": "6.1.15",
30
33
  "@fullcalendar/daygrid": "6.1.15",
31
34
  "@fullcalendar/interaction": "6.1.15",
32
35
  "@fullcalendar/react": "6.1.15",
33
36
  "@fullcalendar/timegrid": "6.1.15",
34
37
  "@hookform/resolvers": "^3.9.0",
35
- "@tanstack/react-query": "5.51.1",
36
38
  "@tanstack/react-table": "^8.20.1",
37
39
  "@tanstack/react-virtual": "^3.8.6",
38
40
  "dayjs": "^1.11.13",
@@ -48,5 +50,5 @@
48
50
  "uuid": "11.0.3",
49
51
  "yup": "^1.4.0"
50
52
  },
51
- "gitHead": "61978f1e2f0eac79069afa52511a5c8dde8b8ebc"
53
+ "gitHead": "45555f94b55424957cf6a0487c74d6a5f8856795"
52
54
  }