@koalarx/ui 20.0.32 → 20.0.34
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.
|
@@ -101,7 +101,7 @@ class SideWindowRef {
|
|
|
101
101
|
if (afterCloseTrigger) {
|
|
102
102
|
this.afterCloseTrigger(afterCloseTrigger);
|
|
103
103
|
}
|
|
104
|
-
},
|
|
104
|
+
}, 50);
|
|
105
105
|
}
|
|
106
106
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SideWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
107
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SideWindowRef });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-shared-components-side-window.mjs","sources":["../../projects/koala-ui/shared/components/side-window/side-window-content.ts","../../projects/koala-ui/shared/components/side-window/side-window-content.html","../../projects/koala-ui/shared/components/side-window/side-window.ts","../../projects/koala-ui/shared/components/side-window/side-window-ref.ts","../../projects/koala-ui/shared/components/side-window/koalarx-ui-shared-components-side-window.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'kl-side-window-content',\n templateUrl: './side-window-content.html',\n})\nexport class SideWindowContent {}\n","<div class=\"fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"w-auto h-full bg-base-300 rounded-xl shadow-2xl border border-neutral-700 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n","import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n Type,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SIDE_WINDOW_REF_TOKEN, SideWindowRef } from './side-window-ref';\n\nexport type SideWindowAfterCloseTrigger = string | Record<string, any>;\nexport type SideWindowAfterCloseTriggerFn = (\n trigger: SideWindowAfterCloseTrigger\n) => void;\nexport const SIDE_WINDOW_CONFIG = new InjectionToken('SideWindowConfig');\nexport const SIDE_WINDOW_DATA = new InjectionToken('SideWindowData');\nexport const SIDE_WINDOW_APP_REF = new InjectionToken('SideWindowAppRef');\nexport const SIDE_WINDOW_AFTER_CLOSE_TRIGGER =\n new InjectionToken<SideWindowAfterCloseTriggerFn>(\n 'SideWindowAfterCloseTrigger'\n );\n\nexport interface SideWindowConfig {\n data?: any;\n afterClosed?: {\n trigger: SideWindowAfterCloseTrigger;\n callback: (trigger: any) => void;\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SideWindow {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n open(component: Type<any>, config?: SideWindowConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-side-window-container .side-window-container'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n\n container.id = elementId;\n\n const componentRef = createComponent(component, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SIDE_WINDOW_CONFIG, useValue: config },\n { provide: SIDE_WINDOW_APP_REF, useValue: this.appRef },\n {\n provide: SIDE_WINDOW_REF_TOKEN,\n useValue: () => componentRef,\n },\n { provide: SIDE_WINDOW_DATA, useValue: config?.data },\n {\n provide: SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n useValue: (trigger: SideWindowAfterCloseTrigger) => {\n if (\n config?.afterClosed &&\n (config.afterClosed.trigger === trigger ||\n typeof trigger === 'object')\n ) {\n config.afterClosed.callback(trigger);\n }\n },\n },\n {\n provide: SideWindowRef,\n deps: [\n SIDE_WINDOW_CONFIG,\n SIDE_WINDOW_APP_REF,\n SIDE_WINDOW_REF_TOKEN,\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_DATA,\n ],\n },\n ],\n }),\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n\n document.body.style.overflowY = 'hidden';\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n Type,\n} from '@angular/core';\nimport {\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_APP_REF,\n SideWindowAfterCloseTrigger,\n SideWindowAfterCloseTriggerFn,\n} from './side-window';\n\nexport const SIDE_WINDOW_REF_TOKEN = new InjectionToken('SideWindowRefToken');\n\n@Injectable()\nexport class SideWindowRef {\n private readonly appRef = inject<ApplicationRef>(SIDE_WINDOW_APP_REF);\n private readonly componentRef = inject<() => ComponentRef<Type<any>>>(\n SIDE_WINDOW_REF_TOKEN\n );\n private readonly afterCloseTrigger = inject<SideWindowAfterCloseTriggerFn>(\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER\n );\n\n dismiss(afterCloseTrigger?: SideWindowAfterCloseTrigger) {\n const componentRef = this.componentRef();\n componentRef.location.nativeElement\n .querySelector('div div')\n .classList.add('animate-slide-out-right');\n\n document.body.style.overflowY = 'auto';\n\n setTimeout(() => {\n componentRef.destroy();\n this.appRef.detachView(componentRef.hostView);\n\n if (afterCloseTrigger) {\n this.afterCloseTrigger(afterCloseTrigger);\n }\n },
|
|
1
|
+
{"version":3,"file":"koalarx-ui-shared-components-side-window.mjs","sources":["../../projects/koala-ui/shared/components/side-window/side-window-content.ts","../../projects/koala-ui/shared/components/side-window/side-window-content.html","../../projects/koala-ui/shared/components/side-window/side-window.ts","../../projects/koala-ui/shared/components/side-window/side-window-ref.ts","../../projects/koala-ui/shared/components/side-window/koalarx-ui-shared-components-side-window.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'kl-side-window-content',\n templateUrl: './side-window-content.html',\n})\nexport class SideWindowContent {}\n","<div class=\"fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"w-auto h-full bg-base-300 rounded-xl shadow-2xl border border-neutral-700 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n","import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n Type,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SIDE_WINDOW_REF_TOKEN, SideWindowRef } from './side-window-ref';\n\nexport type SideWindowAfterCloseTrigger = string | Record<string, any>;\nexport type SideWindowAfterCloseTriggerFn = (\n trigger: SideWindowAfterCloseTrigger\n) => void;\nexport const SIDE_WINDOW_CONFIG = new InjectionToken('SideWindowConfig');\nexport const SIDE_WINDOW_DATA = new InjectionToken('SideWindowData');\nexport const SIDE_WINDOW_APP_REF = new InjectionToken('SideWindowAppRef');\nexport const SIDE_WINDOW_AFTER_CLOSE_TRIGGER =\n new InjectionToken<SideWindowAfterCloseTriggerFn>(\n 'SideWindowAfterCloseTrigger'\n );\n\nexport interface SideWindowConfig {\n data?: any;\n afterClosed?: {\n trigger: SideWindowAfterCloseTrigger;\n callback: (trigger: any) => void;\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SideWindow {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n open(component: Type<any>, config?: SideWindowConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-side-window-container .side-window-container'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n\n container.id = elementId;\n\n const componentRef = createComponent(component, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SIDE_WINDOW_CONFIG, useValue: config },\n { provide: SIDE_WINDOW_APP_REF, useValue: this.appRef },\n {\n provide: SIDE_WINDOW_REF_TOKEN,\n useValue: () => componentRef,\n },\n { provide: SIDE_WINDOW_DATA, useValue: config?.data },\n {\n provide: SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n useValue: (trigger: SideWindowAfterCloseTrigger) => {\n if (\n config?.afterClosed &&\n (config.afterClosed.trigger === trigger ||\n typeof trigger === 'object')\n ) {\n config.afterClosed.callback(trigger);\n }\n },\n },\n {\n provide: SideWindowRef,\n deps: [\n SIDE_WINDOW_CONFIG,\n SIDE_WINDOW_APP_REF,\n SIDE_WINDOW_REF_TOKEN,\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_DATA,\n ],\n },\n ],\n }),\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n\n document.body.style.overflowY = 'hidden';\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n Type,\n} from '@angular/core';\nimport {\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_APP_REF,\n SideWindowAfterCloseTrigger,\n SideWindowAfterCloseTriggerFn,\n} from './side-window';\n\nexport const SIDE_WINDOW_REF_TOKEN = new InjectionToken('SideWindowRefToken');\n\n@Injectable()\nexport class SideWindowRef {\n private readonly appRef = inject<ApplicationRef>(SIDE_WINDOW_APP_REF);\n private readonly componentRef = inject<() => ComponentRef<Type<any>>>(\n SIDE_WINDOW_REF_TOKEN\n );\n private readonly afterCloseTrigger = inject<SideWindowAfterCloseTriggerFn>(\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER\n );\n\n dismiss(afterCloseTrigger?: SideWindowAfterCloseTrigger) {\n const componentRef = this.componentRef();\n componentRef.location.nativeElement\n .querySelector('div div')\n .classList.add('animate-slide-out-right');\n\n document.body.style.overflowY = 'auto';\n\n setTimeout(() => {\n componentRef.destroy();\n this.appRef.detachView(componentRef.hostView);\n\n if (afterCloseTrigger) {\n this.afterCloseTrigger(afterCloseTrigger);\n }\n }, 50);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,kFCN9B,gPAKA,EAAA,CAAA;;2FDCa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;+BACE,wBAAwB,EAAA,QAAA,EAAA,gPAAA,EAAA;;;MEcvB,kBAAkB,GAAG,IAAI,cAAc,CAAC,kBAAkB;MAC1D,gBAAgB,GAAG,IAAI,cAAc,CAAC,gBAAgB;MACtD,mBAAmB,GAAG,IAAI,cAAc,CAAC,kBAAkB;MAC3D,+BAA+B,GAC1C,IAAI,cAAc,CAChB,6BAA6B;MAYpB,UAAU,CAAA;AACJ,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/B,IAAA,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAE/C,iBAAiB,GAAA;AACvB,QAAA,IAAI,SAAiB;AAErB,QAAA,GAAG;AACD,YAAA,SAAS,GAAG,YAAY,CAAC,EAAE,EAAE;AAC3B,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,iBAAiB,EAAE,KAAK;AACzB,aAAA,CAAC;AACJ,SAAC,QAAQ,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC;AAE3C,QAAA,OAAO,SAAS;;IAGlB,IAAI,CAAC,SAAoB,EAAE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C,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;YAE7C,IAAI,iBAAiB,EAAE;AACrB,gBAAA,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;;SAE5C,EAAE,EAAE,CAAC;;uGAxBG,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAb,aAAa,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB;;;ACjBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koalarx/ui",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.34",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=20.0.0",
|
|
6
6
|
"@angular/core": ">=20.0.0"
|
|
@@ -44,7 +44,9 @@
|
|
|
44
44
|
"ui",
|
|
45
45
|
"angular",
|
|
46
46
|
"components",
|
|
47
|
-
"library"
|
|
47
|
+
"library",
|
|
48
|
+
"tailwindcss",
|
|
49
|
+
"daisyui"
|
|
48
50
|
],
|
|
49
51
|
"module": "fesm2022/koalarx-ui.mjs",
|
|
50
52
|
"typings": "index.d.ts",
|
|
@@ -200,14 +202,14 @@
|
|
|
200
202
|
"types": "./shared/components/input-field/input-cpf/index.d.ts",
|
|
201
203
|
"default": "./fesm2022/koalarx-ui-shared-components-input-field-input-cpf.mjs"
|
|
202
204
|
},
|
|
203
|
-
"./shared/components/input-field/input-currency": {
|
|
204
|
-
"types": "./shared/components/input-field/input-currency/index.d.ts",
|
|
205
|
-
"default": "./fesm2022/koalarx-ui-shared-components-input-field-input-currency.mjs"
|
|
206
|
-
},
|
|
207
205
|
"./shared/components/input-field/input-date": {
|
|
208
206
|
"types": "./shared/components/input-field/input-date/index.d.ts",
|
|
209
207
|
"default": "./fesm2022/koalarx-ui-shared-components-input-field-input-date.mjs"
|
|
210
208
|
},
|
|
209
|
+
"./shared/components/input-field/input-currency": {
|
|
210
|
+
"types": "./shared/components/input-field/input-currency/index.d.ts",
|
|
211
|
+
"default": "./fesm2022/koalarx-ui-shared-components-input-field-input-currency.mjs"
|
|
212
|
+
},
|
|
211
213
|
"./shared/components/input-field/input-datetime": {
|
|
212
214
|
"types": "./shared/components/input-field/input-datetime/index.d.ts",
|
|
213
215
|
"default": "./fesm2022/koalarx-ui-shared-components-input-field-input-datetime.mjs"
|