awing-library 2.1.2-dev.87 → 2.1.2-dev.88

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.
@@ -1,5 +1,6 @@
1
1
  import { ConfigArrayEdit, ConfigResult, ParamConfiguration, WorkspaceSharingInputForm, type SharingWorkspace, type WorkspaceSharing, type Configuration, ObjectDataInputOfSharingWorkspaceConfigInput, ObjectDataInputOfSharingWorkspaceInput } from './Types';
2
2
  import { type WorkspaceOption } from './Atoms';
3
+ export declare const generateUniqueId: () => number;
3
4
  export declare const checkValid: (cws?: WorkspaceSharing) => boolean;
4
5
  /** Lấy tất cả param trong dấu {}:
5
6
  * VD any(o.MediaPlanApprovals, i.CustomerId = {CustomerId}) => return: ["CustomerId"]
package/dist/esm/index.js CHANGED
@@ -188666,6 +188666,12 @@ var SharingConfigParamType;
188666
188666
  SharingConfigParamType["Schema"] = "SCHEMA";
188667
188667
  })(SharingConfigParamType || (SharingConfigParamType = {}));
188668
188668
 
188669
+ // Utility function to generate unique IDs
188670
+ let uniqueIdCounter = 0;
188671
+ const generateUniqueId = () => {
188672
+ uniqueIdCounter += 1;
188673
+ return Date.now() + uniqueIdCounter;
188674
+ };
188669
188675
  /** Lấy tất cả param trong dấu {}:
188670
188676
  * VD any(o.MediaPlanApprovals, i.CustomerId = {CustomerId}) => return: ["CustomerId"]
188671
188677
  */
@@ -188854,7 +188860,7 @@ const getWorkspacesConfigByFilter = (workspaces, workspaceOptions, filterParams)
188854
188860
  });
188855
188861
  _$3.each(_$3.difference(getLowerCase(filterParams), getLowerCase(restFilter)), r => {
188856
188862
  nConfigs.push({
188857
- id: Date.now(),
188863
+ id: generateUniqueId(),
188858
188864
  paramName: filterParams[_$3.findIndex(getLowerCase(filterParams), f => f === r)],
188859
188865
  paramValue: getDefaultValues(r, currentWorkspace),
188860
188866
  paramType: SharingConfigParamType.Filter
@@ -189403,13 +189409,13 @@ function WorkspaceSharingConfig(props) {
189403
189409
  return false;
189404
189410
  });
189405
189411
  const restFilter = lodashExports.map(lodashExports.difference(filter, pushedFilter), i => ({
189406
- id: Date.now(),
189412
+ id: generateUniqueId(),
189407
189413
  paramName: i,
189408
189414
  paramValue: getDefaultValues(i, currentWorkspaceByOption),
189409
189415
  paramType: SharingConfigParamType.Filter
189410
189416
  }));
189411
189417
  const restSchema = lodashExports.map(lodashExports.difference(schema, pushedSchema), i => ({
189412
- id: Date.now(),
189418
+ id: generateUniqueId(),
189413
189419
  paramName: i,
189414
189420
  paramValue: undefined,
189415
189421
  paramType: SharingConfigParamType.Schema
@@ -189420,13 +189426,13 @@ function WorkspaceSharingConfig(props) {
189420
189426
  });
189421
189427
  } else {
189422
189428
  const crFilter = lodashExports.map(filter, i => ({
189423
- id: Date.now(),
189429
+ id: generateUniqueId(),
189424
189430
  paramName: i,
189425
189431
  paramValue: undefined,
189426
189432
  paramType: SharingConfigParamType.Filter
189427
189433
  }));
189428
189434
  const crSchema = lodashExports.map(schema, i => ({
189429
- id: Date.now(),
189435
+ id: generateUniqueId(),
189430
189436
  paramName: i,
189431
189437
  paramValue: undefined,
189432
189438
  paramType: SharingConfigParamType.Schema
@@ -189457,7 +189463,7 @@ function WorkspaceSharingConfig(props) {
189457
189463
  const handleSubmit = () => {
189458
189464
  if (isCreate) {
189459
189465
  workspaceSelected !== -1 && lodashExports.isFunction(onChangeConfigurations) && onChangeConfigurations({
189460
- id: Date.now(),
189466
+ id: generateUniqueId(),
189461
189467
  workspaceId: workspaceSelected,
189462
189468
  configurations: [...configuration.filter, ...configuration.schema.filter(s => s.paramValue !== undefined && s.paramValue !== '' && s.paramValue !== null)]
189463
189469
  });
@@ -189478,7 +189484,7 @@ function WorkspaceSharingConfig(props) {
189478
189484
  const currentWorkspace = lodashExports.find(workspaceOptions, w => w.id === workspaceSelected);
189479
189485
  if (isCreate && currentWorkspace) {
189480
189486
  const crFilter = lodashExports.map(lodashExports.cloneDeep(configuration.filter), i => ({
189481
- id: Date.now(),
189487
+ id: generateUniqueId(),
189482
189488
  paramName: i.paramName,
189483
189489
  paramValue: getDefaultValues(i.paramName, currentWorkspace),
189484
189490
  paramType: SharingConfigParamType.Filter
@@ -189587,13 +189593,13 @@ function AllWorkspaceConfig(props) {
189587
189593
  const currentWorkspace = lodashExports.find(workspaceOptions, w => w.id === id);
189588
189594
  if (currentWorkspace) {
189589
189595
  const crFilter = lodashExports.map(lodashExports.cloneDeep(filter), i => ({
189590
- id: Date.now(),
189596
+ id: generateUniqueId(),
189591
189597
  paramName: i,
189592
189598
  paramValue: getDefaultValues(i, currentWorkspace),
189593
189599
  paramType: SharingConfigParamType.Filter
189594
189600
  }));
189595
189601
  const crSchema = lodashExports.map(schema, i => ({
189596
- id: Date.now(),
189602
+ id: generateUniqueId(),
189597
189603
  paramName: i,
189598
189604
  paramValue: undefined,
189599
189605
  paramType: SharingConfigParamType.Schema
@@ -189733,7 +189739,7 @@ function TargetWorkspace(props) {
189733
189739
  if (newWorkspaceAdded) {
189734
189740
  newWorkspaces.push({
189735
189741
  __typename: 'SharingWorkspace',
189736
- id: 0 - Date.now(),
189742
+ id: 0 - generateUniqueId(),
189737
189743
  targetWorkspaceId: config.workspaceId,
189738
189744
  targetWorkspace: {
189739
189745
  id: newWorkspaceAdded.customerId,
@@ -189754,7 +189760,7 @@ function TargetWorkspace(props) {
189754
189760
  if (newWorkspaceAdded) {
189755
189761
  newWorkspaces.push({
189756
189762
  __typename: 'SharingWorkspace',
189757
- id: Date.now(),
189763
+ id: generateUniqueId(),
189758
189764
  targetWorkspaceId: c.workspaceId,
189759
189765
  targetWorkspace: {
189760
189766
  id: newWorkspaceAdded.customerId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.87",
3
+ "version": "2.1.2-dev.88",
4
4
  "main": "dist/esm/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",