@headless-adminapp/fluent 0.0.17-alpha.2 → 0.0.17-alpha.20

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 (63) 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/MenuButton.js +1 -1
  5. package/CommandBar/MenuItem.js +2 -2
  6. package/DataGrid/CustomizeColumns/AddColumns.js +4 -5
  7. package/DataGrid/CustomizeColumns/ColumnItem.js +3 -1
  8. package/DataGrid/GridColumnHeader/OperatorSelect.js +9 -2
  9. package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +3 -3
  10. package/DataGrid/GridHeaderDesktop.js +0 -1
  11. package/DataGrid/GridTableContainer.js +5 -15
  12. package/DataGrid/useTableColumns.js +9 -21
  13. package/DialogContainer/PromptDialog.d.ts +3 -2
  14. package/DialogContainer/PromptDialog.js +9 -6
  15. package/PageEntityForm/CommandContainer.js +9 -1
  16. package/PageEntityForm/FormTabRelated.js +1 -2
  17. package/PageEntityForm/PageEntityFormDesktopContainer.js +6 -7
  18. package/PageEntityForm/RecordSetNavigatorContainer.js +4 -7
  19. package/PageEntityForm/RelatedViewSelector.js +0 -1
  20. package/PageEntityForm/SectionContainer.js +13 -4
  21. package/PageEntityForm/StandardControl.d.ts +1 -2
  22. package/PageEntityForm/StandardControl.js +64 -112
  23. package/PageEntityForm/SubgridControl.js +2 -2
  24. package/componentStore.d.ts +2 -0
  25. package/componentStore.js +5 -0
  26. package/components/PageLogin.js +0 -1
  27. package/form/FormControl.js +1 -1
  28. package/form/controls/AttachmentsControl.d.ts +8 -0
  29. package/form/controls/AttachmentsControl.js +75 -0
  30. package/form/controls/CurrencyControl.d.ts +1 -1
  31. package/form/controls/CurrencyControl.js +8 -3
  32. package/form/controls/DateControl.d.ts +1 -1
  33. package/form/controls/DateControl.js +1 -1
  34. package/form/controls/DateTimeControl.d.ts +1 -1
  35. package/form/controls/DateTimeControl.js +1 -1
  36. package/form/controls/EmailControl.d.ts +1 -1
  37. package/form/controls/EmailControl.js +1 -1
  38. package/form/controls/LookupControl.js +1 -2
  39. package/form/controls/MultiSelectControl.d.ts +1 -1
  40. package/form/controls/MultiSelectControl.js +1 -1
  41. package/form/controls/MultiSelectLookupControl.js +1 -2
  42. package/form/controls/NumberControl.js +1 -0
  43. package/form/controls/PasswordControl.d.ts +1 -1
  44. package/form/controls/PasswordControl.js +1 -1
  45. package/form/controls/SelectControl.d.ts +1 -1
  46. package/form/controls/SelectControl.js +1 -1
  47. package/form/controls/SwitchControl.d.ts +1 -1
  48. package/form/controls/SwitchControl.js +1 -1
  49. package/form/controls/TelephoneControl.d.ts +1 -1
  50. package/form/controls/TelephoneControl.js +1 -1
  51. package/form/controls/TextAreaControl.d.ts +1 -1
  52. package/form/controls/TextAreaControl.js +1 -1
  53. package/form/layout/FormSection/FormSection.js +1 -2
  54. package/form/layout/FormSection/FormSectionColumn.js +1 -1
  55. package/form/layout/FormSection/FormSectionLoading.js +1 -1
  56. package/form/layout/FormTab/FormTab.js +1 -1
  57. package/index.css +27 -0
  58. package/package.json +21 -3
  59. package/types/index.d.ts +5 -0
  60. package/App/AppProvider.d.ts +0 -9
  61. package/App/AppProvider.js +0 -50
  62. package/DataGrid/getAttributeFormattedValue.d.ts +0 -16
  63. package/DataGrid/getAttributeFormattedValue.js +0 -92
@@ -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);
@@ -60,7 +60,6 @@ const FormSection = ({ title, children, columnCount, fullHeight, labelPosition,
60
60
  spanTemplates['--section-item-spacer-1'] = 'none';
61
61
  spanTemplates['--section-item-spacer-2'] = 'none';
62
62
  }
63
- // console.log('fsmm', divSize.width, minWidthRequired);
64
63
  return ((0, jsx_runtime_1.jsx)("div", { ref: divRef, style: {
65
64
  boxShadow: react_components_1.tokens.shadow2,
66
65
  borderRadius: react_components_1.tokens.borderRadiusMedium,
@@ -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");
@@ -27,7 +28,6 @@ exports.FormTab = FormTab;
27
28
  const FormTabInternal = ({ children, value, fullHeight, columnCount, columnWidths, }) => {
28
29
  const divRef = (0, react_1.useRef)(null);
29
30
  const divSize = (0, hooks_1.useElementSize)(divRef);
30
- // console.log('dd', divSize.width);
31
31
  const padding = 0;
32
32
  // const columnCount = 2;
33
33
  const minSectionWidth = 392;
package/index.css ADDED
@@ -0,0 +1,27 @@
1
+ html,
2
+ body {
3
+ padding: 0;
4
+ margin: 0;
5
+ }
6
+
7
+ .TextControl_readonly:after {
8
+ border-bottom-color: var(--colorNeutralStrokeDisabled) !important;
9
+ }
10
+
11
+ .FormBody_scrollview > div {
12
+ display: flex;
13
+ flex-direction: column;
14
+ padding: var(--spacingVerticalM);
15
+ }
16
+
17
+ * {
18
+ box-sizing: border-box;
19
+ padding: 0;
20
+ margin: 0;
21
+ }
22
+
23
+ .fui-MenuItem__icon > svg,
24
+ .fui-Button__icon > svg {
25
+ width: inherit;
26
+ height: inherit;
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "0.0.17-alpha.2",
3
+ "version": "0.0.17-alpha.20",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,13 +18,31 @@
18
18
  },
19
19
  "scripts": {
20
20
  "build": "tsc",
21
+ "clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo",
21
22
  "ts-check": "tsc --noEmit",
22
- "copy-files": "cp package.json dist",
23
+ "copy-files": "cp package.json dist && cp src/index.css dist",
23
24
  "prepublishOnly": "pnpm run build && pnpm run copy-files",
24
25
  "test": "echo \"Error: no test specified\" && exit 1"
25
26
  },
26
27
  "keywords": [],
27
28
  "author": "",
28
29
  "license": "ISC",
29
- "gitHead": "bd2148cdeaf1e9f0e03336539ab02f5c9edf95c9"
30
+ "dependencies": {
31
+ "@fluentui/react-components": "9.54.4",
32
+ "@fluentui/react-datepicker-compat": "^0.4.43",
33
+ "@fluentui/react-nav-preview": "^0.5.1",
34
+ "@hookform/resolvers": "^3.9.0",
35
+ "@tanstack/react-query": "5.51.1",
36
+ "@tanstack/react-table": "^8.20.1",
37
+ "@tanstack/react-virtual": "^3.8.6",
38
+ "dayjs": "^1.11.13",
39
+ "dnd-core": "^16.0.1",
40
+ "immutability-helper": "^3.1.1",
41
+ "lodash": "^4.17.21",
42
+ "react-dnd": "^16.0.1",
43
+ "react-dnd-html5-backend": "^16.0.1",
44
+ "react-hook-form": "7.52.2",
45
+ "yup": "^1.4.0"
46
+ },
47
+ "gitHead": "bcc1bcddef884731f72e5e4fedb0d78ad64afbd0"
30
48
  }
package/types/index.d.ts CHANGED
@@ -16,6 +16,7 @@ declare module '@headless-adminapp/icons/types' {
16
16
  Add: Icon;
17
17
  Edit: Icon;
18
18
  Delete: Icon;
19
+ Save: Icon;
19
20
  Refresh: Icon;
20
21
  MoreVertical: Icon;
21
22
  MoreHorizontal: Icon;
@@ -27,6 +28,10 @@ declare module '@headless-adminapp/icons/types' {
27
28
  FilterDismiss: Icon;
28
29
  ListLtr: Icon;
29
30
  ListRtl: Icon;
31
+ Export: Icon;
32
+ ExportCsv: Icon;
33
+ ExportExcel: Icon;
34
+ Entity: Icon;
30
35
  }
31
36
  }
32
37
  export {};
@@ -1,9 +0,0 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface AppProviderProps {
3
- appId: string;
4
- loadingComponent: React.ReactNode;
5
- notFoundComponent: React.ReactNode;
6
- }
7
- /*** @todo: move to app */
8
- export declare const AppProvider: FC<PropsWithChildren<AppProviderProps>>;
9
- export {};
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AppProvider = void 0;
13
- const jsx_runtime_1 = require("react/jsx-runtime");
14
- const app_1 = require("@headless-adminapp/app/app");
15
- const hooks_1 = require("@headless-adminapp/app/metadata/hooks");
16
- const react_query_1 = require("@tanstack/react-query");
17
- const react_1 = require("react");
18
- /*** @todo: move to app */
19
- const AppProvider = ({ children, appId, loadingComponent, notFoundComponent, }) => {
20
- const experienceStore = (0, hooks_1.useExperienceStore)();
21
- const appStore = (0, hooks_1.useAppStore)();
22
- const { data: schemaMetadataList } = (0, react_query_1.useQuery)({
23
- queryKey: ['experience-schema-metadata-list'],
24
- queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
25
- return experienceStore.getExperienceSchemaMetadatList();
26
- }),
27
- initialData: [],
28
- });
29
- const { data: app, isLoading } = (0, react_query_1.useQuery)({
30
- queryKey: ['experience-app', appId],
31
- queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
32
- return appStore.getApp(appId);
33
- }),
34
- });
35
- const schemaMetadataDic = (0, react_1.useMemo)(() => {
36
- var _a;
37
- return (_a = schemaMetadataList === null || schemaMetadataList === void 0 ? void 0 : schemaMetadataList.reduce((acc, item) => {
38
- acc[item.logicalName] = item;
39
- return acc;
40
- }, {})) !== null && _a !== void 0 ? _a : {};
41
- }, [schemaMetadataList]);
42
- if (isLoading) {
43
- return loadingComponent;
44
- }
45
- if (!app) {
46
- return notFoundComponent;
47
- }
48
- return ((0, jsx_runtime_1.jsx)(app_1.AppContext.Provider, { value: { app, schemaMetadataDic, schemaMetadataList }, children: children }));
49
- };
50
- exports.AppProvider = AppProvider;
@@ -1,16 +0,0 @@
1
- import { Attribute, InferredAttributeType } from '@headless-adminapp/core/attributes';
2
- interface AttributeFormattedValueStringsSet {
3
- yes: string;
4
- no: string;
5
- }
6
- /*** @todo move to app */
7
- export declare function getAttributeFormattedValue<A extends Attribute = Attribute>(attribute: Attribute, value: InferredAttributeType<A> | null | undefined, options?: {
8
- maxCount?: number;
9
- strings?: AttributeFormattedValueStringsSet;
10
- dateFormat?: string;
11
- locale?: string;
12
- currency?: string;
13
- currencySign?: 'accounting' | 'standard';
14
- currencyDisplay?: 'symbol' | 'narrowSymbol' | 'code';
15
- }): string | null | undefined;
16
- export {};
@@ -1,92 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getAttributeFormattedValue = getAttributeFormattedValue;
7
- const dayjs_1 = __importDefault(require("dayjs"));
8
- const defaultAttributeFormattedValueStrings = {
9
- yes: 'Yes',
10
- no: 'No',
11
- };
12
- const defaultDateFormat = 'YYYY-MM-DD';
13
- const defaultLocale = 'en-US';
14
- const defaultCurrency = 'USD';
15
- const defaultCurrencySign = 'accounting';
16
- const defaultCurrencyDisplay = 'symbol';
17
- /*** @todo move to app */
18
- function getAttributeFormattedValue(attribute, value, options) {
19
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
20
- if (value === null || value === undefined) {
21
- return null;
22
- }
23
- const strings = (_a = options === null || options === void 0 ? void 0 : options.strings) !== null && _a !== void 0 ? _a : defaultAttributeFormattedValueStrings;
24
- const dateFormat = (_b = options === null || options === void 0 ? void 0 : options.dateFormat) !== null && _b !== void 0 ? _b : defaultDateFormat;
25
- const locale = (_c = options === null || options === void 0 ? void 0 : options.locale) !== null && _c !== void 0 ? _c : defaultLocale;
26
- const currency = (_d = options === null || options === void 0 ? void 0 : options.currency) !== null && _d !== void 0 ? _d : defaultCurrency;
27
- const currencySign = (_e = options === null || options === void 0 ? void 0 : options.currencySign) !== null && _e !== void 0 ? _e : defaultCurrencySign;
28
- const currencyDisplay = (_f = options === null || options === void 0 ? void 0 : options.currencyDisplay) !== null && _f !== void 0 ? _f : defaultCurrencyDisplay;
29
- switch (attribute.type) {
30
- case 'boolean':
31
- return value
32
- ? (_g = attribute.trueLabel) !== null && _g !== void 0 ? _g : strings.yes
33
- : (_h = attribute.falseLabel) !== null && _h !== void 0 ? _h : strings.no;
34
- case 'choice':
35
- return ((_j = attribute.options.find((option) => option.value === value)) !== null && _j !== void 0 ? _j : {
36
- label: '',
37
- }).label;
38
- case 'choices':
39
- return value
40
- .map((v) => {
41
- var _a;
42
- return ((_a = attribute.options.find((option) => option.value === v)) !== null && _a !== void 0 ? _a : {
43
- label: '',
44
- }).label;
45
- })
46
- .join(', ');
47
- case 'date':
48
- return (0, dayjs_1.default)(value).format(dateFormat);
49
- case 'daterange':
50
- if (!value)
51
- return null;
52
- const from = value[0];
53
- const to = value[1];
54
- if (!from && !to) {
55
- return null;
56
- }
57
- if (from && to) {
58
- return ((0, dayjs_1.default)(from).format(dateFormat) + ' - ' + (0, dayjs_1.default)(to).format(dateFormat));
59
- }
60
- if (from) {
61
- return 'After ' + (0, dayjs_1.default)(from).format(dateFormat);
62
- }
63
- if (to) {
64
- return 'Before ' + (0, dayjs_1.default)(to).format(dateFormat);
65
- }
66
- return null;
67
- case 'lookup':
68
- return value === null || value === void 0 ? void 0 : value.name;
69
- case 'lookups':
70
- const items = value === null || value === void 0 ? void 0 : value.map((v) => v.name);
71
- if ((options === null || options === void 0 ? void 0 : options.maxCount) && (items === null || items === void 0 ? void 0 : items.length) > options.maxCount) {
72
- return (items.slice(0, options.maxCount).join(', ') +
73
- ` (+${items.length - options.maxCount})`);
74
- }
75
- else {
76
- return items === null || items === void 0 ? void 0 : items.join(', ');
77
- }
78
- case 'money':
79
- return new Intl.NumberFormat(locale, {
80
- style: 'currency',
81
- currency,
82
- currencySign,
83
- currencyDisplay,
84
- }).format(value);
85
- case 'number':
86
- return new Intl.NumberFormat(locale).format(value);
87
- default:
88
- return typeof value === 'object'
89
- ? JSON.stringify(value)
90
- : value;
91
- }
92
- }