@omnia/fx-models 8.0.26-dev → 8.0.27-dev

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.
package/Dictionary.d.ts CHANGED
@@ -1,28 +1,27 @@
1
+ export type DictionarySupportedKeys = string | number | symbol;
1
2
  export interface IDictionary<TValue> {
2
3
  /**
3
- * Returns the value of the key, or null if it does not exist.
4
- * */
5
- getValue: (key: string) => TValue;
4
+ * Returns the value of the key, or null if it does not exist.
5
+ */
6
+ getValue(key: DictionarySupportedKeys): TValue | null;
6
7
  /**
7
- * Get the value of the specified key if the value does not exists, it uses the supplied factory to create and set the value
8
- * */
9
- getOrSetInitialValue: (key: string, initialValueFactory: () => TValue) => TValue;
8
+ * Get the value of the specified key, or use the supplied factory to create and set the value if it doesn't exist.
9
+ */
10
+ getOrSetInitialValue(key: DictionarySupportedKeys, initialValueFactory: () => TValue): TValue;
10
11
  /**
11
- * Changes the value of the key
12
- * */
13
- setValue: (key: string, value: TValue) => void;
12
+ * Changes the value of the key.
13
+ */
14
+ setValue(key: DictionarySupportedKeys, value: TValue): void;
14
15
  /**
15
- * All keys
16
- * */
17
- readonly keys: Array<string>;
16
+ * All keys.
17
+ */
18
+ keys: DictionarySupportedKeys[];
18
19
  }
19
20
  export declare class Dictionary<TValue> implements IDictionary<TValue> {
20
21
  private _bagData;
21
- constructor(_bagData: {
22
- [key: string]: TValue;
23
- });
24
- getValue: (key: string) => TValue;
25
- setValue: (key: string, value: TValue) => void;
26
- getOrSetInitialValue: (key: string, initialValueFactory: () => TValue) => TValue;
27
- get keys(): Array<string>;
22
+ constructor(initialData?: Record<DictionarySupportedKeys, TValue>);
23
+ getValue: (key: DictionarySupportedKeys) => TValue | null;
24
+ setValue: (key: DictionarySupportedKeys, value: TValue) => void;
25
+ getOrSetInitialValue: (key: DictionarySupportedKeys, initialValueFactory: () => TValue) => TValue;
26
+ get keys(): DictionarySupportedKeys[];
28
27
  }
package/Dictionary.js CHANGED
@@ -2,41 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Dictionary = void 0;
4
4
  class Dictionary {
5
- constructor(_bagData) {
6
- this._bagData = _bagData;
5
+ constructor(initialData = {}) {
7
6
  this.getValue = (key) => {
8
- let result = null;
9
- if (key && this._bagData) {
10
- result = this._bagData[key.toLowerCase()];
11
- }
12
- return result;
7
+ // Normalize the key to lowercase for consistency.
8
+ const lowerKey = String(key).toLowerCase();
9
+ return this._bagData[lowerKey] || null;
13
10
  };
14
11
  this.setValue = (key, value) => {
15
- if (!this._bagData) {
16
- this._bagData = {};
17
- }
18
- const lowerKey = key.toLowerCase();
19
- this._bagData[lowerKey] = value;
12
+ // Normalize the key to lowercase for consistency.
13
+ this._bagData[String(key).toLowerCase()] = value;
20
14
  };
21
15
  this.getOrSetInitialValue = (key, initialValueFactory) => {
22
- let value = this.getValue(key);
23
- if (!value &&
24
- initialValueFactory) {
25
- if (!this._bagData) {
26
- this._bagData = {};
27
- }
16
+ // Normalize the key to lowercase for consistency.
17
+ const lowerKey = String(key).toLowerCase();
18
+ let value = this._bagData[lowerKey];
19
+ if (value === undefined && initialValueFactory) {
20
+ // If the key doesn't exist and there's an initialValueFactory, create and set the value.
28
21
  value = initialValueFactory();
29
- this.setValue(key, value);
22
+ this.setValue(lowerKey, value);
30
23
  }
31
24
  return value;
32
25
  };
26
+ // Initialize the _bagData property with a copy of the initial data.
27
+ this._bagData = Object.assign({}, initialData);
33
28
  }
34
29
  get keys() {
35
- let result = [];
36
- if (this._bagData) {
37
- result = Object.keys(this._bagData);
38
- }
39
- return result;
30
+ // Get an array of keys from the _bagData object.
31
+ return Object.keys(this._bagData);
40
32
  }
41
33
  }
42
34
  exports.Dictionary = Dictionary;
package/Layout.d.ts CHANGED
@@ -278,7 +278,7 @@ export interface BlockLayoutSettings extends LayoutItemSettings, HeaderItemSetti
278
278
  }
279
279
  export interface DisplayBreakPoint {
280
280
  id: string;
281
- icon: string;
281
+ icon: IIcon;
282
282
  label: string;
283
283
  rangedescription: string;
284
284
  minWidth: number;
@@ -4,6 +4,7 @@ export interface UserTypeFormProperties {
4
4
  new: FormProperties;
5
5
  edit: FormProperties;
6
6
  request: FormProperties;
7
+ orderProperties: FormProperties;
7
8
  [key: string]: FormProperties;
8
9
  }
9
10
  export interface FormProperties {
@@ -25,6 +25,9 @@ exports.UserTypeSettingsFactory = {
25
25
  },
26
26
  request: {
27
27
  propertyBindingIds: buitinUserPropertiesBindingIdList
28
+ },
29
+ orderProperties: {
30
+ propertyBindingIds: buitinUserPropertiesBindingIdList
28
31
  }
29
32
  }
30
33
  }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.26-dev",
4
+ "version": "8.0.27-dev",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"