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

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.
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AddColumns = AddColumns;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
- const builders_1 = require("@headless-adminapp/app/builders");
7
6
  const datagrid_1 = require("@headless-adminapp/app/datagrid");
8
7
  const hooks_1 = require("@headless-adminapp/app/datagrid/hooks");
9
8
  const locale_1 = require("@headless-adminapp/app/locale");
9
+ const utils_1 = require("@headless-adminapp/app/locale/utils");
10
10
  const hooks_2 = require("@headless-adminapp/app/metadata/hooks");
11
11
  const icons_1 = require("@headless-adminapp/icons");
12
12
  const react_1 = require("react");
@@ -26,7 +26,7 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
26
26
  }))
27
27
  .filter(({ attribute }) => attribute.type === 'lookup');
28
28
  const columnGroups = Object.assign({ root: {
29
- label: (0, builders_1.localizedLabel)(language, schema),
29
+ label: (0, utils_1.localizedLabel)(language, schema),
30
30
  columns: (0, datagrid_1.transformViewColumns)(schema.logicalName, Object.keys(schema.attributes).map((key) => ({
31
31
  name: key,
32
32
  })), schemaStore, language),
@@ -37,9 +37,9 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
37
37
  expandedKey: nestedKey,
38
38
  })), schemaStore, language);
39
39
  acc[key] = {
40
- label: (0, builders_1.localizedLabel)(language, attribute) +
40
+ label: (0, utils_1.localizedLabel)(language, attribute) +
41
41
  ' (' +
42
- (0, builders_1.localizedLabel)(language, lookupSchema) +
42
+ (0, utils_1.localizedLabel)(language, lookupSchema) +
43
43
  ')',
44
44
  columns,
45
45
  };
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PageEntityFormDesktopContainer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_components_1 = require("@fluentui/react-components");
6
- const builders_1 = require("@headless-adminapp/app/builders");
7
6
  const dataform_1 = require("@headless-adminapp/app/dataform");
8
7
  const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
9
8
  const locale_1 = require("@headless-adminapp/app/locale");
9
+ const utils_1 = require("@headless-adminapp/app/locale/utils");
10
10
  const mutable_1 = require("@headless-adminapp/app/mutable");
11
- const utils_1 = require("@headless-adminapp/app/utils");
11
+ const utils_2 = require("@headless-adminapp/app/utils");
12
12
  const react_1 = require("react");
13
13
  const react_hook_form_1 = require("react-hook-form");
14
14
  const PageBroken_1 = require("../components/PageBroken");
@@ -92,15 +92,15 @@ const PageEntityFormDesktopContainer = () => {
92
92
  ? `- ${strings.unsaved}`
93
93
  : !!record
94
94
  ? `- ${strings.saved}`
95
- : '' })] }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground3 }, children: (0, builders_1.localizedLabel)(language, schema) })] }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row' }, children: formConfig.experience.headerControls.map((controlName, index) => {
95
+ : '' })] }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground3 }, children: (0, utils_1.localizedLabel)(language, schema) })] }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row' }, children: formConfig.experience.headerControls.map((controlName, index) => {
96
96
  const attribute = schema.attributes[controlName];
97
97
  return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index > 0 && ((0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: true, style: {
98
98
  width: react_components_1.tokens.spacingHorizontalXXL,
99
99
  opacity: 0.5,
100
100
  } })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: attribute.label }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: formInstance.control, name: controlName, render: ({ field }) => {
101
- return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0, utils_1.getAttributeFormattedValue)(attribute, field.value) }));
101
+ return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0, utils_2.getAttributeFormattedValue)(attribute, field.value) }));
102
102
  } })] })] }, controlName));
103
- }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', paddingBottom: react_components_1.tokens.spacingVerticalS }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.TabList, { selectedValue: activeTab, onTabSelect: (e, value) => setActiveTab(value.value), children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: tab.name, children: (0, builders_1.localizedLabel)(language, tab) }, tab.name))), !!selectedRelatedItem && ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: "related", children: (_b = (_a = selectedRelatedItem.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : selectedRelatedItem.pluralLabel }))] }), (0, jsx_runtime_1.jsx)(RelatedViewSelector_1.RelatedViewSelector, { onSelect: (item) => {
103
+ }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', paddingBottom: react_components_1.tokens.spacingVerticalS }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.TabList, { selectedValue: activeTab, onTabSelect: (e, value) => setActiveTab(value.value), children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: tab.name, children: (0, utils_1.localizedLabel)(language, tab) }, tab.name))), !!selectedRelatedItem && ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: "related", children: (_b = (_a = selectedRelatedItem.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : selectedRelatedItem.pluralLabel }))] }), (0, jsx_runtime_1.jsx)(RelatedViewSelector_1.RelatedViewSelector, { onSelect: (item) => {
104
104
  setSelectedRelatedItem(item);
105
105
  setActiveTab('related');
106
106
  } })] })] })] }), (0, jsx_runtime_1.jsxs)(FormBody_1.FormBody, { children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab, { value: tab.name, columnCount: tab.columnCount, columnWidths: tab.columnWidths, children: tab.tabColumns.map((tabColumn, index) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab.Column, { children: tabColumn.sections.map((section) => ((0, jsx_runtime_1.jsx)(SectionContainer_1.SectionContainer, { section: section, readOnly: false }, section.name))) }, index))) }, tab.name))), (0, jsx_runtime_1.jsx)(FormTabRelated_1.FormTabRelated, { selectedRelatedItem: selectedRelatedItem })] })] }));
@@ -2,9 +2,9 @@
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
9
  const SectionControl_1 = require("../DataForm/SectionControl");
10
10
  const layout_1 = require("../form/layout");
@@ -16,7 +16,7 @@ function SectionContainer({ section }) {
16
16
  const recordId = (0, hooks_1.useRecordId)();
17
17
  const readonly = (0, hooks_1.useFormIsReadonly)();
18
18
  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) => {
19
+ 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
20
  var _a;
21
21
  switch (control.type) {
22
22
  case 'standard':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/fluent",
3
- "version": "0.0.17-alpha.7",
3
+ "version": "0.0.17-alpha.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -43,5 +43,5 @@
43
43
  "react-hook-form": "7.52.2",
44
44
  "yup": "^1.4.0"
45
45
  },
46
- "gitHead": "5b53560e1c0b20e0bb0e74e820a96c7c75e2c43b"
46
+ "gitHead": "0c369830a0ba4aa5744cc307f8947ae9660980c4"
47
47
  }