@sneat/ui 0.27.11 → 0.27.12

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.
@@ -18,11 +18,11 @@ export class SelectorBaseService {
18
18
  options = {
19
19
  ...options,
20
20
  onSelected: async (items) => {
21
+ result = items;
21
22
  if (onSelected) {
22
23
  await onSelected(items);
23
24
  }
24
25
  await this.modalController.dismiss(items);
25
- result = items;
26
26
  },
27
27
  };
28
28
  let componentProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"selector-base.service.js","sourceRoot":"","sources":["../../../../../../libs/ui/src/lib/selector/selector-base.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,MAAM,OAAgB,mBAAmB;IAIvC,YAAuC,SAAuB;QAAvB,cAAS,GAAT,SAAS,CAAc;QAH3C,gBAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QACpC,oBAAe,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IAEM,CAAC;IAE3D,KAAK,CAAC,mBAAmB,CAC9B,OAA4B;QAE5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,mFAAmF;IACzE,KAAK,CAAC,qBAAqB,CACnC,OAA4B;QAG5B,IAAI,MAAM,GAA6B,SAAS,CAAC;QAEjD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAEtC,OAAO,GAAG;YACR,GAAG,OAAO;YACV,UAAU,EAAE,KAAK,EAAE,KAAW,EAAiB,EAAE;gBAC/C,IAAI,UAAU,EAAE,CAAC;oBACf,MAAM,UAAU,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;gBACD,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,KAAK,CAAC;YACjB,CAAC;SACF,CAAC;QACF,IAAI,cAAc,GAA4B;YAC5C,GAAG,OAAO,CAAC,cAAc;YACzB,UAAU,EAAE,UAAU;YACtB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,IAAI,EAAE,OAAO;SACd,CAAC;QACF,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,cAAc,GAAG,EAAE,GAAG,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QAC/D,CAAC;QACD,MAAM,YAAY,GAAiB;YACjC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,cAAc,EAAE,cAAc;YAC9B,aAAa,EAAE,IAAI;SACpB,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9D,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QAEtB,uCAAuC;QACvC,MAAM,KAAK,CAAC,YAAY,EAAE,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { inject } from '@angular/core';\nimport { ModalController, ModalOptions } from '@ionic/angular';\nimport type { ComponentProps, ComponentRef } from '@ionic/core';\nimport { ErrorLogger } from '@sneat/core';\nimport { ISelectItem } from './selector-interfaces';\nimport { ISelectorOptions } from './selector-options';\n\nexport abstract class SelectorBaseService<T = ISelectItem> {\n protected readonly errorLogger = inject(ErrorLogger);\n private readonly modalController = inject(ModalController);\n\n protected constructor(private readonly component: ComponentRef) {}\n\n public async selectSingleInModal(\n options: ISelectorOptions<T>,\n ): Promise<T | null> {\n const result = await this.selectMultipleInModal(options);\n return result ? result[0] : null;\n }\n\n // We make it protected so each service must override it for easiness of navigation\n protected async selectMultipleInModal(\n options: ISelectorOptions<T>,\n ): Promise<T[] | undefined> {\n\n let result: readonly T[] | undefined = undefined;\n\n const onSelected = options.onSelected;\n\n options = {\n ...options,\n onSelected: async (items?: T[]): Promise<void> => {\n if (onSelected) {\n await onSelected(items);\n }\n await this.modalController.dismiss(items);\n result = items;\n },\n };\n let componentProps: ComponentProps<unknown> = {\n ...options.componentProps,\n selectMode: 'multiple',\n onSelected: options.onSelected,\n mode: 'modal',\n };\n if (options.title) {\n componentProps = { ...componentProps, title: options.title };\n }\n const modalOptions: ModalOptions = {\n component: this.component,\n componentProps: componentProps,\n keyboardClose: true,\n };\n const modal = await this.modalController.create(modalOptions);\n await modal.present();\n\n // 🔹 Track when the modal is dismissed\n await modal.onDidDismiss();\n\n return result;\n }\n}\n"]}
1
+ {"version":3,"file":"selector-base.service.js","sourceRoot":"","sources":["../../../../../../libs/ui/src/lib/selector/selector-base.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,MAAM,OAAgB,mBAAmB;IAIvC,YAAuC,SAAuB;QAAvB,cAAS,GAAT,SAAS,CAAc;QAH3C,gBAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QACpC,oBAAe,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IAEM,CAAC;IAE3D,KAAK,CAAC,mBAAmB,CAC9B,OAA4B;QAE5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnC,CAAC;IAED,mFAAmF;IACzE,KAAK,CAAC,qBAAqB,CACnC,OAA4B;QAG5B,IAAI,MAAM,GAA6B,SAAS,CAAC;QAEjD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAEtC,OAAO,GAAG;YACR,GAAG,OAAO;YACV,UAAU,EAAE,KAAK,EAAE,KAAW,EAAiB,EAAE;gBAC/C,MAAM,GAAG,KAAK,CAAC;gBACf,IAAI,UAAU,EAAE,CAAC;oBACf,MAAM,UAAU,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;gBACD,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;QACF,IAAI,cAAc,GAA4B;YAC5C,GAAG,OAAO,CAAC,cAAc;YACzB,UAAU,EAAE,UAAU;YACtB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,IAAI,EAAE,OAAO;SACd,CAAC;QACF,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,cAAc,GAAG,EAAE,GAAG,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QAC/D,CAAC;QACD,MAAM,YAAY,GAAiB;YACjC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,cAAc,EAAE,cAAc;YAC9B,aAAa,EAAE,IAAI;SACpB,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9D,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QAEtB,uCAAuC;QACvC,MAAM,KAAK,CAAC,YAAY,EAAE,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { inject } from '@angular/core';\nimport { ModalController, ModalOptions } from '@ionic/angular';\nimport type { ComponentProps, ComponentRef } from '@ionic/core';\nimport { ErrorLogger } from '@sneat/core';\nimport { ISelectItem } from './selector-interfaces';\nimport { ISelectorOptions } from './selector-options';\n\nexport abstract class SelectorBaseService<T = ISelectItem> {\n protected readonly errorLogger = inject(ErrorLogger);\n private readonly modalController = inject(ModalController);\n\n protected constructor(private readonly component: ComponentRef) {}\n\n public async selectSingleInModal(\n options: ISelectorOptions<T>,\n ): Promise<T | null> {\n const result = await this.selectMultipleInModal(options);\n return result ? result[0] : null;\n }\n\n // We make it protected so each service must override it for easiness of navigation\n protected async selectMultipleInModal(\n options: ISelectorOptions<T>,\n ): Promise<T[] | undefined> {\n\n let result: readonly T[] | undefined = undefined;\n\n const onSelected = options.onSelected;\n\n options = {\n ...options,\n onSelected: async (items?: T[]): Promise<void> => {\n result = items;\n if (onSelected) {\n await onSelected(items);\n }\n await this.modalController.dismiss(items);\n },\n };\n let componentProps: ComponentProps<unknown> = {\n ...options.componentProps,\n selectMode: 'multiple',\n onSelected: options.onSelected,\n mode: 'modal',\n };\n if (options.title) {\n componentProps = { ...componentProps, title: options.title };\n }\n const modalOptions: ModalOptions = {\n component: this.component,\n componentProps: componentProps,\n keyboardClose: true,\n };\n const modal = await this.modalController.create(modalOptions);\n await modal.present();\n\n // 🔹 Track when the modal is dismissed\n await modal.onDidDismiss();\n\n return result;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sneat/ui",
3
- "version": "0.27.11",
3
+ "version": "0.27.12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },