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

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 (89) hide show
  1. package/App/AppHeaderContianer.js +1 -1
  2. package/App/NavigationContainer.js +2 -2
  3. package/App/QuickActionItem.js +1 -1
  4. package/CommandBar/Button.d.ts +2 -1
  5. package/CommandBar/Button.js +2 -2
  6. package/CommandBar/Divider.d.ts +2 -1
  7. package/CommandBar/Divider.js +2 -2
  8. package/CommandBar/IconButton.d.ts +2 -1
  9. package/CommandBar/IconButton.js +2 -2
  10. package/CommandBar/Label.d.ts +2 -1
  11. package/CommandBar/Label.js +2 -2
  12. package/CommandBar/MenuButton.d.ts +2 -1
  13. package/CommandBar/MenuButton.js +3 -3
  14. package/CommandBar/MenuItem.js +6 -5
  15. package/CommandBar/MenuItems.js +3 -3
  16. package/CommandBar/MenuList.js +4 -3
  17. package/CommandBar/Wrapper.d.ts +2 -2
  18. package/CommandBar/Wrapper.js +2 -2
  19. package/CommandBar/index.d.ts +6 -6
  20. package/DataGrid/ActionCell.d.ts +1 -1
  21. package/DataGrid/ActionCell.js +8 -4
  22. package/DataGrid/CustomizeColumns/AddColumns.js +4 -5
  23. package/DataGrid/CustomizeColumns/ColumnItem.js +3 -1
  24. package/DataGrid/GridColumnHeader/FilterForm.js +3 -1
  25. package/DataGrid/GridColumnHeader/OperatorSelect.js +9 -2
  26. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +8 -8
  27. package/DataGrid/GridHeaderDesktop.js +0 -1
  28. package/DataGrid/GridTableContainer.js +22 -23
  29. package/DataGrid/TableCell/TableCellCheckbox.js +4 -3
  30. package/DataGrid/TableCell/TableCellLink.js +4 -3
  31. package/DataGrid/TableCell/TableCellText.js +9 -4
  32. package/DataGrid/useTableColumns.d.ts +4 -1
  33. package/DataGrid/useTableColumns.js +184 -167
  34. package/DialogContainer/PromptDialog.d.ts +3 -2
  35. package/DialogContainer/PromptDialog.js +10 -6
  36. package/PageEntityForm/CommandContainer.js +9 -1
  37. package/PageEntityForm/FormTabRelated.js +1 -2
  38. package/PageEntityForm/PageEntityFormDesktopContainer.js +6 -6
  39. package/PageEntityForm/RecordSetNavigatorContainer.js +4 -7
  40. package/PageEntityForm/RelatedViewSelector.js +4 -2
  41. package/PageEntityForm/SectionContainer.js +18 -4
  42. package/PageEntityForm/StandardControl.d.ts +2 -2
  43. package/PageEntityForm/StandardControl.js +75 -112
  44. package/PageEntityForm/SubgridControl.js +1 -1
  45. package/componentStore.d.ts +2 -0
  46. package/componentStore.js +5 -0
  47. package/components/PageLogin.js +0 -1
  48. package/form/FormControl.js +1 -1
  49. package/form/controls/AttachmentControl.d.ts +17 -0
  50. package/form/controls/AttachmentControl.js +225 -0
  51. package/form/controls/AttachmentsControl.d.ts +6 -0
  52. package/form/controls/AttachmentsControl.js +45 -0
  53. package/form/controls/CurrencyControl.js +38 -6
  54. package/form/controls/DateControl.d.ts +1 -1
  55. package/form/controls/DateControl.js +7 -3
  56. package/form/controls/DateTimeControl.d.ts +1 -1
  57. package/form/controls/DateTimeControl.js +1 -1
  58. package/form/controls/EmailControl.d.ts +1 -1
  59. package/form/controls/EmailControl.js +1 -1
  60. package/form/controls/LookupControl.js +2 -2
  61. package/form/controls/MultiSelectControl.d.ts +1 -1
  62. package/form/controls/MultiSelectControl.js +1 -1
  63. package/form/controls/MultiSelectLookupControl.js +1 -1
  64. package/form/controls/NumberControl.js +1 -0
  65. package/form/controls/PasswordControl.d.ts +1 -1
  66. package/form/controls/PasswordControl.js +1 -1
  67. package/form/controls/RichTextControl.d.ts +5 -0
  68. package/form/controls/RichTextControl.js +33 -0
  69. package/form/controls/SelectControl.d.ts +1 -1
  70. package/form/controls/SelectControl.js +1 -1
  71. package/form/controls/SwitchControl.d.ts +1 -1
  72. package/form/controls/SwitchControl.js +4 -2
  73. package/form/controls/TelephoneControl.d.ts +1 -1
  74. package/form/controls/TelephoneControl.js +1 -1
  75. package/form/controls/TextAreaControl.d.ts +1 -1
  76. package/form/controls/TextAreaControl.js +1 -1
  77. package/form/controls/utils.d.ts +4 -0
  78. package/form/controls/utils.js +42 -0
  79. package/form/layout/FormSection/FormSection.js +1 -1
  80. package/form/layout/FormSection/FormSectionColumn.js +1 -1
  81. package/form/layout/FormSection/FormSectionLoading.js +1 -1
  82. package/form/layout/FormTab/FormTab.js +1 -0
  83. package/package.json +24 -3
  84. package/styles.css +100 -0
  85. package/types/index.d.ts +12 -0
  86. package/App/AppProvider.d.ts +0 -9
  87. package/App/AppProvider.js +0 -50
  88. package/DataGrid/getAttributeFormattedValue.d.ts +0 -16
  89. package/DataGrid/getAttributeFormattedValue.js +0 -92
@@ -28,6 +28,7 @@ function getRelatedItems(currentSchema, schemas) {
28
28
  })
29
29
  .filter(Boolean)
30
30
  .map((item) => {
31
+ var _a, _b;
31
32
  if (!item) {
32
33
  throw new Error('item is null');
33
34
  }
@@ -36,8 +37,8 @@ function getRelatedItems(currentSchema, schemas) {
36
37
  logicalName: s.logicalName,
37
38
  label: s.label,
38
39
  localizedLabels: s.localizedLabels,
39
- pluralLabel: s.pluralLabel,
40
- localizedPluralLabels: s.localizedPluralLabels,
40
+ pluralLabel: (_a = item.attribute.relatedLabel) !== null && _a !== void 0 ? _a : s.pluralLabel,
41
+ localizedPluralLabels: (_b = item.attribute.localizedRelatedLabel) !== null && _b !== void 0 ? _b : s.localizedPluralLabels,
41
42
  attributeName: item.key,
42
43
  };
43
44
  });
@@ -70,6 +71,7 @@ function RelatedViewSelector(props) {
70
71
  outlineStyle: 'none',
71
72
  textTransform: 'none',
72
73
  columnGap: react_components_1.tokens.spacingHorizontalSNudge,
74
+ color: react_components_1.tokens.colorNeutralForeground2,
73
75
  }, children: [strings.related, (0, jsx_runtime_1.jsx)(icons_1.Icons.ChevronDown, { size: 16 })] }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: data.map((item) => {
74
76
  var _a, _b;
75
77
  return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => props.onSelect(item), children: (_b = (_a = item.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : item.pluralLabel }, item.key));
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SectionContainer = SectionContainer;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const builders_1 = require("@headless-adminapp/app/builders");
6
5
  const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
7
6
  const locale_1 = require("@headless-adminapp/app/locale");
7
+ const utils_1 = require("@headless-adminapp/app/locale/utils");
8
8
  const react_hook_form_1 = require("react-hook-form");
9
+ const componentStore_1 = require("../componentStore");
9
10
  const SectionControl_1 = require("../DataForm/SectionControl");
10
11
  const layout_1 = require("../form/layout");
11
12
  const StandardControl_1 = require("./StandardControl");
@@ -16,11 +17,18 @@ function SectionContainer({ section }) {
16
17
  const recordId = (0, hooks_1.useRecordId)();
17
18
  const readonly = (0, hooks_1.useFormIsReadonly)();
18
19
  const { language } = (0, locale_1.useLocale)();
19
- return ((0, jsx_runtime_1.jsx)(layout_1.FormSection, { title: (0, builders_1.localizedLabel)(language, section), columnCount: section.columnCount, labelPosition: section.labelPosition, noPadding: section.noPadding, hideLabel: section.hideLabel, children: section.controls.map((control, index) => {
20
+ return ((0, jsx_runtime_1.jsx)(layout_1.FormSection, { title: (0, utils_1.localizedLabel)(language, section), columnCount: section.columnCount, labelPosition: section.labelPosition, noPadding: section.noPadding, hideLabel: section.hideLabel, children: section.controls.map((control, index) => {
20
21
  var _a;
21
22
  switch (control.type) {
22
- case 'standard':
23
+ case 'standard': {
23
24
  const attribute = schema.attributes[control.attributeName];
25
+ let Control = StandardControl_1.StandardControl;
26
+ if (control.component) {
27
+ const OverrideControl = componentStore_1.componentStore.getComponent(control.component);
28
+ if (OverrideControl) {
29
+ Control = OverrideControl;
30
+ }
31
+ }
24
32
  return ((0, jsx_runtime_1.jsx)("div", { style: {
25
33
  gridColumn: control.span
26
34
  ? `var(--section-item-span-${control.span})`
@@ -33,8 +41,14 @@ function SectionContainer({ section }) {
33
41
  ? (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message
34
42
  : '';
35
43
  const label = (_g = (_f = (_d = (_c = control.localizedLabels) === null || _c === void 0 ? void 0 : _c[language]) !== null && _d !== void 0 ? _d : (_e = attribute.localizedLabels) === null || _e === void 0 ? void 0 : _e[language]) !== null && _f !== void 0 ? _f : control.label) !== null && _g !== void 0 ? _g : attribute.label;
36
- return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: attribute.required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: control.attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError, disabled: readonly, label: label, placeholder: label, allowNavigation: true, allowNewRecord: true }) }));
44
+ return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: attribute.required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError, disabled: readonly, label: label, placeholder: label, allowNavigation: true, allowNewRecord: true, fileServiceContext: {
45
+ type: 'entity-form',
46
+ recordId,
47
+ attributeName: control.attributeName,
48
+ logicalName: schema.logicalName,
49
+ } }) }));
37
50
  } }, control.attributeName) }, control.attributeName));
51
+ }
38
52
  case 'editablegrid': {
39
53
  return null;
40
54
  }
@@ -1,6 +1,6 @@
1
1
  import type { Attribute } from '@headless-adminapp/core/attributes';
2
2
  import { FC } from 'react';
3
- interface StandardControlProps {
3
+ export interface StandardControlProps {
4
4
  attribute: Attribute;
5
5
  label?: string;
6
6
  isError: boolean;
@@ -10,6 +10,7 @@ interface StandardControlProps {
10
10
  placeholder?: string;
11
11
  onChange: (value: any) => void;
12
12
  onBlur: () => void;
13
+ fileServiceContext?: Record<string, unknown>;
13
14
  disabled?: boolean;
14
15
  borderOnFocusOnly?: boolean;
15
16
  hideLabel?: boolean;
@@ -21,4 +22,3 @@ interface StandardControlProps {
21
22
  allowNewRecord?: boolean;
22
23
  }
23
24
  export declare const StandardControl: FC<StandardControlProps>;
24
- export {};
@@ -8,6 +8,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const hooks_1 = require("@headless-adminapp/app/metadata/hooks");
9
9
  const transport_1 = require("@headless-adminapp/app/transport");
10
10
  const react_1 = require("react");
11
+ const componentStore_1 = require("../componentStore");
12
+ const AttachmentControl_1 = require("../form/controls/AttachmentControl");
13
+ const AttachmentsControl_1 = require("../form/controls/AttachmentsControl");
11
14
  const CurrencyControl_1 = require("../form/controls/CurrencyControl");
12
15
  const DateControl_1 = require("../form/controls/DateControl");
13
16
  const DateRangeControl_1 = require("../form/controls/DateRangeControl");
@@ -17,22 +20,24 @@ const LookupControl_1 = require("../form/controls/LookupControl");
17
20
  const MultiSelectControl_1 = __importDefault(require("../form/controls/MultiSelectControl"));
18
21
  const MultiSelectLookupControl_1 = require("../form/controls/MultiSelectLookupControl");
19
22
  const NumberControl_1 = require("../form/controls/NumberControl");
23
+ const RichTextControl_1 = require("../form/controls/RichTextControl");
20
24
  const SelectControl_1 = __importDefault(require("../form/controls/SelectControl"));
21
25
  const SwitchControl_1 = require("../form/controls/SwitchControl");
22
26
  const TelephoneControl_1 = require("../form/controls/TelephoneControl");
23
27
  const TextAreaControl_1 = require("../form/controls/TextAreaControl");
24
28
  const TextControl_1 = require("../form/controls/TextControl");
25
- const StandardControl = ({ attribute, label: _label, isError,
26
- // errorMessage,
27
- name, value, onBlur, onChange,
28
- // dataService,
29
- // fileService,
30
- disabled, borderOnFocusOnly, placeholder: _placeholder,
31
- // hideLabel,
32
- hidePlaceholder, readOnly,
33
- // quickViewControl,
34
- allowNavigation, allowNewRecord, }) => {
35
- var _a;
29
+ const StandardControl = (props) => {
30
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
31
+ const { attribute, label: _label, isError,
32
+ // errorMessage,
33
+ name, value, onBlur, onChange,
34
+ // dataService,
35
+ // fileService,
36
+ disabled, borderOnFocusOnly, placeholder: _placeholder,
37
+ // hideLabel,
38
+ hidePlaceholder, readOnly,
39
+ // quickViewControl,
40
+ allowNavigation, allowNewRecord, } = props;
36
41
  const isDisabled = attribute.readonly || disabled;
37
42
  // const label = hideLabel ? undefined : _label ?? attribute.label;
38
43
  const placeholder = hidePlaceholder
@@ -40,6 +45,7 @@ allowNavigation, allowNewRecord, }) => {
40
45
  : (_a = _placeholder !== null && _placeholder !== void 0 ? _placeholder : _label) !== null && _a !== void 0 ? _a : attribute.label;
41
46
  // const required = quickViewControl ? false : attribute.required;
42
47
  const dataService = (0, transport_1.useDataService)();
48
+ const fileService = (0, transport_1.useFileService)();
43
49
  const { schemaStore, experienceStore } = (0, hooks_1.useMetadata)();
44
50
  // const { openQuickCreate } = useQuickCreateForm();
45
51
  switch (attribute.type) {
@@ -55,21 +61,37 @@ allowNavigation, allowNewRecord, }) => {
55
61
  readOnly,
56
62
  };
57
63
  switch (attribute.format) {
58
- case 'text':
59
- return ((0, jsx_runtime_1.jsx)(TextControl_1.TextControl, Object.assign({}, controlProps, { textTransform: attribute.textTransform })));
60
- case 'email':
61
- return (0, jsx_runtime_1.jsx)(EmailControl_1.EmailControl, Object.assign({}, controlProps));
62
- case 'phone':
63
- return (0, jsx_runtime_1.jsx)(TelephoneControl_1.TelephoneControl, Object.assign({}, controlProps));
64
- case 'url':
65
- return (0, jsx_runtime_1.jsx)(TextControl_1.TextControl, Object.assign({}, controlProps));
66
- case 'textarea':
67
- return (0, jsx_runtime_1.jsx)(TextAreaControl_1.TextAreaControl, Object.assign({}, controlProps));
64
+ case 'text': {
65
+ const Control = (_b = componentStore_1.componentStore.getComponent('Form.TextControl')) !== null && _b !== void 0 ? _b : TextControl_1.TextControl;
66
+ return ((0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps, { textTransform: attribute.textTransform })));
67
+ }
68
+ case 'email': {
69
+ const Control = (_c = componentStore_1.componentStore.getComponent('Form.EmailControl')) !== null && _c !== void 0 ? _c : EmailControl_1.EmailControl;
70
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
71
+ }
72
+ case 'phone': {
73
+ const Control = (_d = componentStore_1.componentStore.getComponent('Form.TelephoneControl')) !== null && _d !== void 0 ? _d : TelephoneControl_1.TelephoneControl;
74
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
75
+ }
76
+ case 'url': {
77
+ const Control = (_e = componentStore_1.componentStore.getComponent('Form.UrlControl')) !== null && _e !== void 0 ? _e : TextControl_1.TextControl;
78
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
79
+ }
80
+ case 'textarea': {
81
+ const Control = (_f = componentStore_1.componentStore.getComponent('Form.TextAreaControl')) !== null && _f !== void 0 ? _f : TextAreaControl_1.TextAreaControl;
82
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
83
+ }
84
+ case 'richtext': {
85
+ const Control = (_g = componentStore_1.componentStore.getComponent('Form.RichTextControl')) !== null && _g !== void 0 ? _g : RichTextControl_1.RichTextControl;
86
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
87
+ }
68
88
  default:
69
89
  return (0, jsx_runtime_1.jsx)(react_1.Fragment, {});
70
90
  }
71
- case 'number':
72
- return ((0, jsx_runtime_1.jsx)(NumberControl_1.NumberControl, { name: name, placeholder: placeholder, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, readOnly: readOnly }));
91
+ case 'number': {
92
+ const Control = (_h = componentStore_1.componentStore.getComponent('Form.NumberControl')) !== null && _h !== void 0 ? _h : NumberControl_1.NumberControl;
93
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, placeholder: placeholder, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, readOnly: readOnly }));
94
+ }
73
95
  case 'date': {
74
96
  const controlProps = {
75
97
  name,
@@ -82,10 +104,12 @@ allowNavigation, allowNewRecord, }) => {
82
104
  readOnly,
83
105
  };
84
106
  if (attribute.format === 'datetime') {
85
- return (0, jsx_runtime_1.jsx)(DateTimeControl_1.DateTimeControl, Object.assign({}, controlProps));
107
+ const Control = (_j = componentStore_1.componentStore.getComponent('Form.DateTimeControl')) !== null && _j !== void 0 ? _j : DateTimeControl_1.DateTimeControl;
108
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
86
109
  }
87
110
  else {
88
- return (0, jsx_runtime_1.jsx)(DateControl_1.DateControl, Object.assign({}, controlProps));
111
+ const Control = (_k = componentStore_1.componentStore.getComponent('Form.DateControl')) !== null && _k !== void 0 ? _k : DateControl_1.DateControl;
112
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
89
113
  }
90
114
  }
91
115
  case 'daterange': {
@@ -99,105 +123,40 @@ allowNavigation, allowNewRecord, }) => {
99
123
  disabled: isDisabled,
100
124
  readOnly,
101
125
  };
102
- return (0, jsx_runtime_1.jsx)(DateRangeControl_1.DateRangeControl, Object.assign({}, controlProps));
126
+ const Control = (_l = componentStore_1.componentStore.getComponent('Form.DateRangeControl')) !== null && _l !== void 0 ? _l : DateRangeControl_1.DateRangeControl;
127
+ return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
103
128
  }
104
129
  case 'money': {
105
- return ((0, jsx_runtime_1.jsx)(CurrencyControl_1.CurrencyControl, { name: name, placeholder: placeholder, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
130
+ const Control = (_m = componentStore_1.componentStore.getComponent('Form.CurrencyControl')) !== null && _m !== void 0 ? _m : CurrencyControl_1.CurrencyControl;
131
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, placeholder: placeholder, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
106
132
  }
107
133
  case 'lookup': {
108
- // const experienceSchema = getExperienceSchema(attribute.entity);
109
- // const routes = getExperienceRoutes(attribute.entity);
110
- // const path = routes?.create?.();
111
- // let createButtonProps:
112
- // | {
113
- // label: string;
114
- // onClick: () => void;
115
- // }
116
- // | undefined;
117
- // if (allowQuickCreate && experienceSchema.defaultQuickCreateForm) {
118
- // createButtonProps = {
119
- // label: 'New record',
120
- // onClick: async () => {
121
- // try {
122
- // const result = await openQuickCreate({
123
- // logicalName: attribute.entity,
124
- // });
125
- // if (result) {
126
- // onChange(result);
127
- // }
128
- // } catch (error) {
129
- // console.error(error);
130
- // }
131
- // },
132
- // };
133
- // } else if (path) {
134
- // createButtonProps = {
135
- // label: 'New record',
136
- // onClick: () => {
137
- // router.push(path);
138
- // },
139
- // };
140
- // }
141
- // return (
142
- // <FormControl
143
- // type="lookup"
144
- // name={name}
145
- // label={label}
146
- // placeholder={placeholder}
147
- // required={required}
148
- // value={value}
149
- // onChange={onChange}
150
- // onBlur={onBlur}
151
- // error={isError}
152
- // helperText={errorMessage}
153
- // disabled={isDisabled}
154
- // borderOnFocusOnly={borderOnFocusOnly}
155
- // readOnly={readOnly}
156
- // createButton={createButtonProps}
157
- // openRecord={
158
- // routes?.edit
159
- // ? (id) => {
160
- // router.push(routes.edit!(id));
161
- // }
162
- // : undefined
163
- // }
164
- // async
165
- // dataResolver={async (options) => {
166
- // const lookupSchema = getSchema(attribute.entity);
167
- // const data = await dataService.retriveRecords({
168
- // logicalName: attribute.entity,
169
- // search: options?.search ?? '',
170
- // columnFilters: {},
171
- // pagination: {
172
- // pageIndex: 0,
173
- // rowsPerPage: 10,
174
- // sortBy: 'createdAt',
175
- // sortOrder: 'desc',
176
- // },
177
- // viewFilter: null,
178
- // columns: ['_id', lookupSchema.primaryAttribute ?? 'name'],
179
- // limit: options?.limit ?? 10,
180
- // });
181
- // return data.records.map((x: any) => ({
182
- // _id: x._id,
183
- // name: x[lookupSchema.primaryAttribute ?? 'name'],
184
- // }));
185
- // }}
186
- // />
187
- // );
188
- return ((0, jsx_runtime_1.jsx)(LookupControl_1.LookupControl, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
134
+ const Control = (_o = componentStore_1.componentStore.getComponent('Form.LookupControl')) !== null && _o !== void 0 ? _o : LookupControl_1.LookupControl;
135
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
189
136
  }
190
137
  case 'lookups': {
191
- return ((0, jsx_runtime_1.jsx)(MultiSelectLookupControl_1.MultiSelectLookupControl, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
138
+ const Control = (_p = componentStore_1.componentStore.getComponent('Form.MultiSelectLookupControl')) !== null && _p !== void 0 ? _p : MultiSelectLookupControl_1.MultiSelectLookupControl;
139
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
192
140
  }
193
141
  case 'boolean': {
194
- return ((0, jsx_runtime_1.jsx)(SwitchControl_1.SwitchControl, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, readOnly: readOnly }));
142
+ const Control = (_q = componentStore_1.componentStore.getComponent('Form.SwitchControl')) !== null && _q !== void 0 ? _q : SwitchControl_1.SwitchControl;
143
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, readOnly: readOnly }));
195
144
  }
196
145
  case 'choice': {
197
- return ((0, jsx_runtime_1.jsx)(SelectControl_1.default, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
146
+ const Control = (_r = componentStore_1.componentStore.getComponent('Form.SelectControl')) !== null && _r !== void 0 ? _r : SelectControl_1.default;
147
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
198
148
  }
199
149
  case 'choices': {
200
- return ((0, jsx_runtime_1.jsx)(MultiSelectControl_1.default, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
150
+ const Control = (_s = componentStore_1.componentStore.getComponent('Form.MultiSelectControl')) !== null && _s !== void 0 ? _s : MultiSelectControl_1.default;
151
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
152
+ }
153
+ case 'attachment': {
154
+ const Control = (_t = componentStore_1.componentStore.getComponent('Form.AttachmentControl')) !== null && _t !== void 0 ? _t : AttachmentControl_1.AttachmentControl;
155
+ return ((0, jsx_runtime_1.jsx)(Control, { fileService: fileService, format: attribute.format, location: attribute.location, name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly, fileServiceContext: props.fileServiceContext }));
156
+ }
157
+ case 'attachments': {
158
+ const Control = (_u = componentStore_1.componentStore.getComponent('Form.AttachmentsControl')) !== null && _u !== void 0 ? _u : AttachmentsControl_1.AttachmentsControl;
159
+ return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
201
160
  }
202
161
  // case 'attachment': {
203
162
  // return (
@@ -222,6 +181,10 @@ allowNavigation, allowNewRecord, }) => {
222
181
  // );
223
182
  // }
224
183
  }
184
+ const FallBackControl = componentStore_1.componentStore.getComponent('StandardControl.FallBack');
185
+ if (FallBackControl) {
186
+ return (0, jsx_runtime_1.jsx)(FallBackControl, Object.assign({}, props));
187
+ }
225
188
  return (0, jsx_runtime_1.jsx)(react_1.Fragment, {});
226
189
  };
227
190
  exports.StandardControl = StandardControl;
@@ -62,5 +62,5 @@ function SubgridControl(props) {
62
62
  }
63
63
  return brokenContent;
64
64
  }
65
- return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: viewLookup, onChangeView: setViewId, commands: (props.associated ? subgridCommands : commands), isSubGrid: props.associated ? true : false, extraFilter: extraFilter, allowViewSelection: (_a = props.allowViewSelection) !== null && _a !== void 0 ? _a : false, children: (0, jsx_runtime_1.jsx)(FormSubgridContainer_1.FormSubgridContainer, {}) }));
65
+ return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: viewLookup, onChangeView: setViewId, commands: (props.associated ? subgridCommands : commands), isSubGrid: props.associated ? true : false, associated: props.associated, extraFilter: extraFilter, allowViewSelection: (_a = props.allowViewSelection) !== null && _a !== void 0 ? _a : false, children: (0, jsx_runtime_1.jsx)(FormSubgridContainer_1.FormSubgridContainer, {}) }));
66
66
  }
@@ -0,0 +1,2 @@
1
+ import { ComponentStore } from '@headless-adminapp/app/store';
2
+ export declare const componentStore: ComponentStore;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.componentStore = void 0;
4
+ const store_1 = require("@headless-adminapp/app/store");
5
+ exports.componentStore = new store_1.ComponentStore();
@@ -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)) })] }));
@@ -0,0 +1,17 @@
1
+ import { AttachmentAttribute, FileObject } from '@headless-adminapp/core/attributes/AttachmentAttribute';
2
+ import { IFileService } from '@headless-adminapp/core/transport';
3
+ import { FC } from 'react';
4
+ import { ControlProps } from './types';
5
+ export interface AttachmentImageControlProps extends ControlProps<FileObject> {
6
+ fileService: IFileService;
7
+ fileServiceContext?: Record<string, unknown>;
8
+ location: AttachmentAttribute['location'];
9
+ }
10
+ interface AttachmentControlProps extends ControlProps<FileObject> {
11
+ fileService: IFileService;
12
+ fileServiceContext?: Record<string, unknown>;
13
+ location: AttachmentAttribute['location'];
14
+ format: AttachmentAttribute['format'];
15
+ }
16
+ export declare const AttachmentControl: FC<AttachmentControlProps>;
17
+ export {};