@osovitny/anatoly 2.15.12 → 2.16.1
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/esm2022/lib/anatoly.module.mjs +55 -0
- package/{esm2020 → esm2022}/lib/core/browser.mjs +23 -23
- package/{esm2020 → esm2022}/lib/core/consts/settings.mjs +16 -16
- package/{esm2020 → esm2022}/lib/core/consts/urls.mjs +18 -18
- package/{esm2020 → esm2022}/lib/core/converts/convert.mjs +104 -104
- package/{esm2020 → esm2022}/lib/core/converts/xmlFormatter.mjs +33 -33
- package/esm2022/lib/core/core.module.mjs +89 -0
- package/{esm2020 → esm2022}/lib/core/dom.mjs +152 -152
- package/esm2022/lib/core/go/base-go.service.mjs +50 -0
- package/{esm2020 → esm2022}/lib/core/guards/once-import.guard.mjs +20 -20
- package/{esm2020 → esm2022}/lib/core/guid.mjs +21 -21
- package/{esm2020 → esm2022}/lib/core/index.mjs +50 -50
- package/esm2022/lib/core/interceptors/httpInterceptor.mjs +107 -0
- package/esm2022/lib/core/localization/localization.module.mjs +44 -0
- package/esm2022/lib/core/localization/localization.service.mjs +184 -0
- package/esm2022/lib/core/localization/localizationSettings.module.mjs +90 -0
- package/esm2022/lib/core/localization/localize.pipe.mjs +76 -0
- package/{esm2020 → esm2022}/lib/core/localization/utils.mjs +41 -41
- package/esm2022/lib/core/logging/globalErrorHandler.mjs +42 -0
- package/esm2022/lib/core/logging/logging.service.mjs +36 -0
- package/{esm2020 → esm2022}/lib/core/notifications/alerts.mjs +105 -105
- package/{esm2020 → esm2022}/lib/core/notifications/interfaces/notification.mjs +16 -16
- package/esm2022/lib/core/notifications/services/notification-service.mjs +226 -0
- package/esm2022/lib/core/performance/stopwatch.mjs +55 -0
- package/esm2022/lib/core/services/appcontext.service.mjs +152 -0
- package/esm2022/lib/core/services/dm.service.mjs +72 -0
- package/esm2022/lib/core/services/google-analytics.service.mjs +55 -0
- package/esm2022/lib/core/services/idle.service.mjs +82 -0
- package/esm2022/lib/core/services/loading.service.mjs +68 -0
- package/esm2022/lib/core/services/web-storage.service.mjs +67 -0
- package/esm2022/lib/core/subs.mjs +30 -0
- package/{esm2020 → esm2022}/lib/core/utils.mjs +93 -93
- package/esm2022/lib/data/base/base-api.service.mjs +99 -0
- package/esm2022/lib/data/base/grid/base-grid-edit.service.mjs +83 -0
- package/esm2022/lib/data/base/grid/base-grid-read.service.mjs +65 -0
- package/{esm2020 → esm2022}/lib/data/consts.mjs +23 -23
- package/esm2022/lib/data/data.module.mjs +42 -0
- package/{esm2020 → esm2022}/lib/data/index.mjs +21 -21
- package/esm2022/lib/data/services/core-api.service.mjs +60 -0
- package/esm2022/lib/data/services/emails-api.service.mjs +48 -0
- package/esm2022/lib/data/services/notifications/notifications-api-service.mjs +41 -0
- package/esm2022/lib/ui/components/base/base-edit.component.mjs +135 -0
- package/esm2022/lib/ui/components/base/base.component.mjs +61 -0
- package/esm2022/lib/ui/components/base/base.dialog.mjs +67 -0
- package/esm2022/lib/ui/components/base/base.list.mjs +69 -0
- package/esm2022/lib/ui/components/base/base.page.mjs +31 -0
- package/esm2022/lib/ui/components/base/base.paged.page.mjs +66 -0
- package/esm2022/lib/ui/components/billing/buyaccess-button.component.mjs +64 -0
- package/esm2022/lib/ui/components/billing/subscribe-plan-button.component.mjs +68 -0
- package/esm2022/lib/ui/components/card/card-body.component.mjs +30 -0
- package/esm2022/lib/ui/components/card/card-footer.component.mjs +30 -0
- package/esm2022/lib/ui/components/card/card-header.component.mjs +34 -0
- package/esm2022/lib/ui/components/card/card.component.mjs +30 -0
- package/esm2022/lib/ui/components/check-icon/check-icon.component.mjs +33 -0
- package/esm2022/lib/ui/components/copy-2-clipboard/copy-2-clipboard.component.mjs +44 -0
- package/esm2022/lib/ui/components/datapager/datapager.component.mjs +85 -0
- package/esm2022/lib/ui/components/html-editor/base-html-editor.component.mjs +96 -0
- package/esm2022/lib/ui/components/html-editor/forms-html-editor.component.mjs +45 -0
- package/esm2022/lib/ui/components/html-editor/html-editor.component.mjs +49 -0
- package/{esm2020 → esm2022}/lib/ui/components/html-editor/html-editor.defaultoptions.mjs +85 -85
- package/esm2022/lib/ui/components/identity/signin-button.component.mjs +31 -0
- package/esm2022/lib/ui/components/identity/signout-button.component.mjs +31 -0
- package/esm2022/lib/ui/components/identity/signup-button.component.mjs +30 -0
- package/{esm2020 → esm2022}/lib/ui/components/index.mjs +43 -43
- package/esm2022/lib/ui/components/nodata/nodata.component.mjs +46 -0
- package/esm2022/lib/ui/components/spinners/loading/loading.component.mjs +49 -0
- package/esm2022/lib/ui/components/spinners/pagespinner/pagespinner.component.mjs +62 -0
- package/{esm2020 → esm2022}/lib/ui/components/spinners/pagespinner/spinkits.mjs +11 -11
- package/esm2022/lib/ui/dialogs/contact-us/contact-us.dialog.mjs +49 -0
- package/{esm2020 → esm2022}/lib/ui/dialogs/index.mjs +16 -16
- package/esm2022/lib/ui/directives/hover.directive.mjs +45 -0
- package/{esm2020 → esm2022}/lib/ui/directives/index.mjs +17 -17
- package/esm2022/lib/ui/directives/native-element.directive.mjs +40 -0
- package/esm2022/lib/ui/external/fa.module.mjs +45 -0
- package/esm2022/lib/ui/external/kendo.module.mjs +90 -0
- package/esm2022/lib/ui/forms/components/address/address.component.mjs +141 -0
- package/esm2022/lib/ui/forms/components/company/company.component.mjs +94 -0
- package/esm2022/lib/ui/forms/components/dropdownlists/timezone/timezone.dropdownlist.mjs +74 -0
- package/esm2022/lib/ui/forms/components/urlslug/urlslug.component.mjs +98 -0
- package/esm2022/lib/ui/forms/contact-us/contact-us.mjs +124 -0
- package/{esm2020 → esm2022}/lib/ui/forms/index.mjs +23 -23
- package/esm2022/lib/ui/pipes/filesize.pipe.mjs +40 -0
- package/{esm2020 → esm2022}/lib/ui/pipes/index.mjs +18 -18
- package/esm2022/lib/ui/pipes/replace-text.pipe.mjs +37 -0
- package/esm2022/lib/ui/pipes/safeHtml.pipe.mjs +35 -0
- package/esm2022/lib/ui/ui.module.mjs +192 -0
- package/esm2022/lib/ui/validation/form-validation-summary.component.mjs +64 -0
- package/{esm2020 → esm2022}/lib/ui/validation/index.mjs +18 -18
- package/esm2022/lib/ui/validation/item-validation-summary.component.mjs +39 -0
- package/{esm2020 → esm2022}/lib/ui/validation/validation-summary.component.mjs +125 -125
- package/{esm2020 → esm2022}/osovitny-anatoly.mjs +4 -4
- package/{esm2020 → esm2022}/public-api.mjs +24 -24
- package/{fesm2015 → fesm2022}/osovitny-anatoly.mjs +5119 -5974
- package/fesm2022/osovitny-anatoly.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/anatoly.module.d.ts +10 -10
- package/lib/core/browser.d.ts +4 -4
- package/lib/core/consts/settings.d.ts +1 -1
- package/lib/core/consts/urls.d.ts +3 -3
- package/lib/core/converts/convert.d.ts +16 -16
- package/lib/core/converts/xmlFormatter.d.ts +4 -4
- package/lib/core/core.module.d.ts +14 -14
- package/lib/core/dom.d.ts +17 -17
- package/lib/core/go/base-go.service.d.ts +12 -12
- package/lib/core/guards/once-import.guard.d.ts +1 -1
- package/lib/core/guid.d.ts +3 -3
- package/lib/core/index.d.ts +28 -28
- package/lib/core/interceptors/httpInterceptor.d.ts +18 -18
- package/lib/core/localization/localization.module.d.ts +8 -8
- package/lib/core/localization/localization.service.d.ts +25 -25
- package/lib/core/localization/localizationSettings.module.d.ts +18 -18
- package/lib/core/localization/localize.pipe.d.ts +10 -10
- package/lib/core/localization/utils.d.ts +5 -5
- package/lib/core/logging/globalErrorHandler.d.ts +9 -9
- package/lib/core/logging/logging.service.d.ts +8 -8
- package/lib/core/notifications/alerts.d.ts +9 -9
- package/lib/core/notifications/interfaces/notification.d.ts +10 -10
- package/lib/core/notifications/services/notification-service.d.ts +25 -25
- package/lib/core/performance/stopwatch.d.ts +14 -14
- package/lib/core/services/appcontext.service.d.ts +31 -31
- package/lib/core/services/dm.service.d.ts +16 -16
- package/lib/core/services/google-analytics.service.d.ts +11 -11
- package/lib/core/services/idle.service.d.ts +19 -19
- package/lib/core/services/loading.service.d.ts +13 -13
- package/lib/core/services/web-storage.service.d.ts +22 -22
- package/lib/core/subs.d.ts +8 -8
- package/lib/core/utils.d.ts +11 -11
- package/lib/data/base/base-api.service.d.ts +18 -18
- package/lib/data/base/grid/base-grid-edit.service.d.ts +16 -16
- package/lib/data/base/grid/base-grid-read.service.d.ts +14 -14
- package/lib/data/consts.d.ts +5 -5
- package/lib/data/data.module.d.ts +7 -7
- package/lib/data/index.d.ts +6 -6
- package/lib/data/services/core-api.service.d.ts +12 -12
- package/lib/data/services/emails-api.service.d.ts +10 -10
- package/lib/data/services/notifications/notifications-api-service.d.ts +12 -12
- package/lib/ui/components/base/base-edit.component.d.ts +57 -57
- package/lib/ui/components/base/base.component.d.ts +17 -17
- package/lib/ui/components/base/base.dialog.d.ts +17 -17
- package/lib/ui/components/base/base.list.d.ts +19 -19
- package/lib/ui/components/base/base.page.d.ts +6 -6
- package/lib/ui/components/base/base.paged.page.d.ts +18 -18
- package/lib/ui/components/billing/buyaccess-button.component.d.ts +19 -19
- package/lib/ui/components/billing/subscribe-plan-button.component.d.ts +21 -21
- package/lib/ui/components/card/card-body.component.d.ts +6 -6
- package/lib/ui/components/card/card-footer.component.d.ts +6 -6
- package/lib/ui/components/card/card-header.component.d.ts +7 -7
- package/lib/ui/components/card/card.component.d.ts +6 -6
- package/lib/ui/components/check-icon/check-icon.component.d.ts +6 -6
- package/lib/ui/components/copy-2-clipboard/copy-2-clipboard.component.d.ts +8 -8
- package/lib/ui/components/datapager/datapager.component.d.ts +21 -21
- package/lib/ui/components/html-editor/base-html-editor.component.d.ts +21 -21
- package/lib/ui/components/html-editor/forms-html-editor.component.d.ts +9 -9
- package/lib/ui/components/html-editor/html-editor.component.d.ts +9 -9
- package/lib/ui/components/html-editor/html-editor.defaultoptions.d.ts +1 -1
- package/lib/ui/components/identity/signin-button.component.d.ts +7 -7
- package/lib/ui/components/identity/signout-button.component.d.ts +7 -7
- package/lib/ui/components/identity/signup-button.component.d.ts +6 -6
- package/lib/ui/components/index.d.ts +25 -25
- package/lib/ui/components/nodata/nodata.component.d.ts +11 -11
- package/lib/ui/components/spinners/loading/loading.component.d.ts +13 -13
- package/lib/ui/components/spinners/pagespinner/pagespinner.component.d.ts +25 -25
- package/lib/ui/components/spinners/pagespinner/spinkits.d.ts +11 -11
- package/lib/ui/dialogs/contact-us/contact-us.dialog.d.ts +12 -12
- package/lib/ui/dialogs/index.d.ts +1 -1
- package/lib/ui/directives/hover.directive.d.ts +8 -8
- package/lib/ui/directives/index.d.ts +2 -2
- package/lib/ui/directives/native-element.directive.d.ts +11 -11
- package/lib/ui/external/fa.module.d.ts +10 -10
- package/lib/ui/external/kendo.module.d.ts +15 -15
- package/lib/ui/forms/components/address/address.component.d.ts +35 -35
- package/lib/ui/forms/components/company/company.component.d.ts +20 -20
- package/lib/ui/forms/components/dropdownlists/timezone/timezone.dropdownlist.d.ts +26 -26
- package/lib/ui/forms/components/urlslug/urlslug.component.d.ts +23 -23
- package/lib/ui/forms/contact-us/contact-us.d.ts +33 -33
- package/lib/ui/forms/index.d.ts +5 -5
- package/lib/ui/pipes/filesize.pipe.d.ts +8 -8
- package/lib/ui/pipes/index.d.ts +3 -3
- package/lib/ui/pipes/replace-text.pipe.d.ts +7 -7
- package/lib/ui/pipes/safeHtml.pipe.d.ts +10 -10
- package/lib/ui/ui.module.d.ts +43 -46
- package/lib/ui/validation/form-validation-summary.component.d.ts +11 -11
- package/lib/ui/validation/index.d.ts +3 -3
- package/lib/ui/validation/item-validation-summary.component.d.ts +9 -9
- package/lib/ui/validation/validation-summary.component.d.ts +24 -24
- package/package.json +11 -17
- package/public-api.d.ts +12 -12
- package/esm2020/lib/anatoly.module.mjs +0 -56
- package/esm2020/lib/core/core.module.mjs +0 -89
- package/esm2020/lib/core/go/base-go.service.mjs +0 -48
- package/esm2020/lib/core/interceptors/httpInterceptor.mjs +0 -105
- package/esm2020/lib/core/localization/localization.module.mjs +0 -45
- package/esm2020/lib/core/localization/localization.service.mjs +0 -182
- package/esm2020/lib/core/localization/localizationSettings.module.mjs +0 -90
- package/esm2020/lib/core/localization/localize.pipe.mjs +0 -75
- package/esm2020/lib/core/logging/globalErrorHandler.mjs +0 -41
- package/esm2020/lib/core/logging/logging.service.mjs +0 -36
- package/esm2020/lib/core/notifications/services/notification-service.mjs +0 -225
- package/esm2020/lib/core/performance/stopwatch.mjs +0 -50
- package/esm2020/lib/core/services/appcontext.service.mjs +0 -149
- package/esm2020/lib/core/services/dm.service.mjs +0 -69
- package/esm2020/lib/core/services/google-analytics.service.mjs +0 -53
- package/esm2020/lib/core/services/idle.service.mjs +0 -77
- package/esm2020/lib/core/services/loading.service.mjs +0 -68
- package/esm2020/lib/core/services/web-storage.service.mjs +0 -66
- package/esm2020/lib/core/subs.mjs +0 -31
- package/esm2020/lib/data/base/base-api.service.mjs +0 -97
- package/esm2020/lib/data/base/grid/base-grid-edit.service.mjs +0 -81
- package/esm2020/lib/data/base/grid/base-grid-read.service.mjs +0 -62
- package/esm2020/lib/data/data.module.mjs +0 -43
- package/esm2020/lib/data/services/core-api.service.mjs +0 -59
- package/esm2020/lib/data/services/emails-api.service.mjs +0 -47
- package/esm2020/lib/data/services/notifications/notifications-api-service.mjs +0 -40
- package/esm2020/lib/ui/components/base/base-edit.component.mjs +0 -134
- package/esm2020/lib/ui/components/base/base.component.mjs +0 -63
- package/esm2020/lib/ui/components/base/base.dialog.mjs +0 -67
- package/esm2020/lib/ui/components/base/base.list.mjs +0 -70
- package/esm2020/lib/ui/components/base/base.page.mjs +0 -31
- package/esm2020/lib/ui/components/base/base.paged.page.mjs +0 -67
- package/esm2020/lib/ui/components/billing/buyaccess-button.component.mjs +0 -106
- package/esm2020/lib/ui/components/billing/subscribe-plan-button.component.mjs +0 -118
- package/esm2020/lib/ui/components/card/card-body.component.mjs +0 -37
- package/esm2020/lib/ui/components/card/card-footer.component.mjs +0 -37
- package/esm2020/lib/ui/components/card/card-header.component.mjs +0 -52
- package/esm2020/lib/ui/components/card/card.component.mjs +0 -41
- package/esm2020/lib/ui/components/check-icon/check-icon.component.mjs +0 -42
- package/esm2020/lib/ui/components/copy-2-clipboard/copy-2-clipboard.component.mjs +0 -51
- package/esm2020/lib/ui/components/datapager/datapager.component.mjs +0 -89
- package/esm2020/lib/ui/components/html-editor/base-html-editor.component.mjs +0 -108
- package/esm2020/lib/ui/components/html-editor/forms-html-editor.component.mjs +0 -63
- package/esm2020/lib/ui/components/html-editor/html-editor.component.mjs +0 -61
- package/esm2020/lib/ui/components/identity/signin-button.component.mjs +0 -36
- package/esm2020/lib/ui/components/identity/signout-button.component.mjs +0 -36
- package/esm2020/lib/ui/components/identity/signup-button.component.mjs +0 -35
- package/esm2020/lib/ui/components/nodata/nodata.component.mjs +0 -67
- package/esm2020/lib/ui/components/spinners/loading/loading.component.mjs +0 -57
- package/esm2020/lib/ui/components/spinners/pagespinner/pagespinner.component.mjs +0 -84
- package/esm2020/lib/ui/dialogs/contact-us/contact-us.dialog.mjs +0 -78
- package/esm2020/lib/ui/directives/hover.directive.mjs +0 -51
- package/esm2020/lib/ui/directives/native-element.directive.mjs +0 -38
- package/esm2020/lib/ui/external/fa.module.mjs +0 -46
- package/esm2020/lib/ui/external/kendo.module.mjs +0 -91
- package/esm2020/lib/ui/forms/components/address/address.component.mjs +0 -242
- package/esm2020/lib/ui/forms/components/company/company.component.mjs +0 -142
- package/esm2020/lib/ui/forms/components/dropdownlists/timezone/timezone.dropdownlist.mjs +0 -99
- package/esm2020/lib/ui/forms/components/urlslug/urlslug.component.mjs +0 -136
- package/esm2020/lib/ui/forms/contact-us/contact-us.mjs +0 -212
- package/esm2020/lib/ui/pipes/filesize.pipe.mjs +0 -42
- package/esm2020/lib/ui/pipes/replace-text.pipe.mjs +0 -37
- package/esm2020/lib/ui/pipes/safeHtml.pipe.mjs +0 -34
- package/esm2020/lib/ui/ui.module.mjs +0 -197
- package/esm2020/lib/ui/validation/form-validation-summary.component.mjs +0 -89
- package/esm2020/lib/ui/validation/item-validation-summary.component.mjs +0 -59
- package/fesm2015/osovitny-anatoly.mjs.map +0 -1
- package/fesm2020/osovitny-anatoly.mjs +0 -5760
- package/fesm2020/osovitny-anatoly.mjs.map +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<file>
|
|
3
|
+
Project:
|
|
4
|
+
@osovitny/anatoly
|
|
5
|
+
|
|
6
|
+
Authors:
|
|
7
|
+
Vadim Osovitny vadim@osovitny.com
|
|
8
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
9
|
+
|
|
10
|
+
Created:
|
|
11
|
+
02 Aug 2022
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2017-2022 Osovitny Inc. All rights reserved.
|
|
14
|
+
</file>
|
|
15
|
+
*/
|
|
16
|
+
//Node
|
|
17
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
18
|
+
import { Validators } from '@angular/forms';
|
|
19
|
+
import { Convert } from '../../../../core';
|
|
20
|
+
import { BaseEditComponent } from '../../../components';
|
|
21
|
+
import * as i0 from "@angular/core";
|
|
22
|
+
import * as i1 from "@angular/forms";
|
|
23
|
+
import * as i2 from "../../../../data";
|
|
24
|
+
import * as i3 from "@angular/common";
|
|
25
|
+
import * as i4 from "../../../components/card/card.component";
|
|
26
|
+
import * as i5 from "../../../components/card/card-header.component";
|
|
27
|
+
import * as i6 from "../../../components/card/card-body.component";
|
|
28
|
+
import * as i7 from "../../../directives/native-element.directive";
|
|
29
|
+
import * as i8 from "../../../validation/item-validation-summary.component";
|
|
30
|
+
export class AddressComponent extends BaseEditComponent {
|
|
31
|
+
fb;
|
|
32
|
+
api;
|
|
33
|
+
//Private
|
|
34
|
+
_address;
|
|
35
|
+
formGroupGenerated = false;
|
|
36
|
+
countryData = [];
|
|
37
|
+
usStateData = [];
|
|
38
|
+
currentCountry = 'US';
|
|
39
|
+
currentUSState = 'NY';
|
|
40
|
+
//Inputs
|
|
41
|
+
title = 'Address';
|
|
42
|
+
isTitleVisible = true;
|
|
43
|
+
isRequired;
|
|
44
|
+
get address() {
|
|
45
|
+
return this._address;
|
|
46
|
+
}
|
|
47
|
+
set address(value) {
|
|
48
|
+
this._address = value;
|
|
49
|
+
if (value) {
|
|
50
|
+
this.init();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//Outputs
|
|
54
|
+
change = new EventEmitter();
|
|
55
|
+
constructor(fb, api) {
|
|
56
|
+
super();
|
|
57
|
+
this.fb = fb;
|
|
58
|
+
this.api = api;
|
|
59
|
+
}
|
|
60
|
+
ngOnInit() {
|
|
61
|
+
this.api.getCountriesJsonFile(data => {
|
|
62
|
+
this.countryData = data;
|
|
63
|
+
});
|
|
64
|
+
this.api.getUSStatesJsonFile(data => {
|
|
65
|
+
this.usStateData = data;
|
|
66
|
+
});
|
|
67
|
+
this.createFormGroup();
|
|
68
|
+
this.init();
|
|
69
|
+
}
|
|
70
|
+
createFormGroup() {
|
|
71
|
+
let isRequired = Convert.stringToBoolean(this.isRequired);
|
|
72
|
+
if (isRequired) {
|
|
73
|
+
this.formGroup.addControl('address_street', this.fb.control('', [Validators.required]));
|
|
74
|
+
this.formGroup.addControl('address_street2', this.fb.control('', []));
|
|
75
|
+
this.formGroup.addControl('address_city', this.fb.control('', [Validators.required]));
|
|
76
|
+
this.formGroup.addControl('address_stateOrRegion', this.fb.control(this.currentUSState, [Validators.required]));
|
|
77
|
+
this.formGroup.addControl('address_country', this.fb.control(this.currentCountry, [Validators.required]));
|
|
78
|
+
this.formGroup.addControl('address_zipcode', this.fb.control('', [Validators.required]));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.formGroup.addControl('address_street', this.fb.control('', []));
|
|
82
|
+
this.formGroup.addControl('address_street2', this.fb.control('', []));
|
|
83
|
+
this.formGroup.addControl('address_city', this.fb.control('', []));
|
|
84
|
+
this.formGroup.addControl('address_stateOrRegion', this.fb.control(this.currentUSState, []));
|
|
85
|
+
this.formGroup.addControl('address_country', this.fb.control(this.currentCountry, []));
|
|
86
|
+
this.formGroup.addControl('address_zipcode', this.fb.control('', []));
|
|
87
|
+
}
|
|
88
|
+
this.formGroupGenerated = true;
|
|
89
|
+
}
|
|
90
|
+
init() {
|
|
91
|
+
if (!this.formGroupGenerated) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (this._address !== undefined) {
|
|
95
|
+
let address = JSON.parse(this._address);
|
|
96
|
+
this.setFormValue('address_street', address.street);
|
|
97
|
+
this.setFormValue('address_street2', address.street2);
|
|
98
|
+
this.setFormValue('address_city', address.city);
|
|
99
|
+
this.setFormValue('address_stateOrRegion', address.stateOrRegion);
|
|
100
|
+
this.setFormValue('address_zipcode', address.zipcode);
|
|
101
|
+
this.setFormValue('address_country', address.country);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
getAddress() {
|
|
105
|
+
const data = {
|
|
106
|
+
street: this.getFormValue('address_street') || null,
|
|
107
|
+
street2: this.getFormValue('address_street2') || null,
|
|
108
|
+
city: this.getFormValue('address_city') || null,
|
|
109
|
+
stateOrRegion: this.getFormValue('address_stateOrRegion') || null,
|
|
110
|
+
zipcode: this.getFormValue('address_zipcode') || null,
|
|
111
|
+
country: this.getFormValue('address_country') || null
|
|
112
|
+
};
|
|
113
|
+
return JSON.stringify(data);
|
|
114
|
+
}
|
|
115
|
+
//Events
|
|
116
|
+
onCountryChange(event) {
|
|
117
|
+
let country = event.target.value;
|
|
118
|
+
this.change.emit(country);
|
|
119
|
+
}
|
|
120
|
+
onUSStateChange(event) {
|
|
121
|
+
let usState = event.target.value;
|
|
122
|
+
this.change.emit(usState);
|
|
123
|
+
}
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: AddressComponent, deps: [{ token: i1.FormBuilder }, { token: i2.CoreApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: AddressComponent, selector: "anatoly-forms-address", inputs: { title: "title", isTitleVisible: "isTitleVisible", isRequired: "isRequired", address: "address" }, outputs: { change: "change" }, usesInheritance: true, ngImport: i0, template: "<anatoly-card classes='card-primary card-outline'>\r\n <anatoly-card-header *ngIf='isTitleVisible' [title]='title'></anatoly-card-header>\r\n <anatoly-card-body>\r\n <div class='row' [formGroup]='formGroup'>\r\n <div class='form-group col-12' [ngClass]=\"{'has-error': isControlInvalid('address_street')}\" >\r\n <label class='col-form-label required'>Street Address</label>\r\n <input type='text' class='form-control' formControlName='address_street' placeholder='Street Address'>\r\n <anatoly-item-validation-summary controlName='address_street'\r\n controlTitle='Street'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-12' [ngClass]=\"{'has-error': isControlInvalid('address_street2')}\" >\r\n <input type='text' class='form-control' formControlName='address_street2' placeholder='Apartment, suite, unit, building, floor, etc.'>\r\n <anatoly-item-validation-summary controlName='address_street2'\r\n controlTitle='Street2'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' [ngClass]=\"{'has-error': isControlInvalid('address_city')}\">\r\n <label class='col-form-label required'>City</label>\r\n <input type='text' class='form-control' formControlName='address_city' placeholder='City'>\r\n <anatoly-item-validation-summary controlName='address_city'\r\n controlTitle='City'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' *ngIf=\"formGroup.value.address_country == 'US'\" [ngClass]=\"{'has-error': isControlInvalid('address_stateOrRegion')}\">\r\n <label class='col-form-label required'>State</label>\r\n <select class='form-control' (change)='onUSStateChange($event)' formControlName='address_stateOrRegion'>\r\n <option *ngFor='let state of usStateData' [value]='state.code'>{{state.name}}</option>\r\n </select>\r\n <anatoly-item-validation-summary controlName='address_stateOrRegion'\r\n controlTitle='State'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' [ngClass]=\"{'has-error': isControlInvalid('address_zipcode')}\" >\r\n <label class='col-form-label required'>zipcode</label>\r\n <input type='text' class='form-control' formControlName='address_zipcode' placeholder='zipcode'>\r\n <anatoly-item-validation-summary controlName='address_zipcode'\r\n controlTitle='zipcode'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' [ngClass]=\"{'has-error': isControlInvalid('address_country')}\">\r\n <label class='col-form-label required'>Country</label>\r\n <select class='form-control' (change)='onCountryChange($event)' formControlName='address_country' data-placeholder='Select a Country'>\r\n <option *ngFor='let country of countryData' [value]='country.code'>{{country.name}}</option>\r\n </select>\r\n <anatoly-item-validation-summary controlName='address_country'\r\n controlTitle='Country'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </anatoly-card-body>\r\n</anatoly-card>\r\n", dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.CardComponent, selector: "anatoly-card", inputs: ["classes"] }, { kind: "component", type: i5.CardHeaderComponent, selector: "anatoly-card-header", inputs: ["classes", "title"] }, { kind: "component", type: i6.CardBodyComponent, selector: "anatoly-card-body", inputs: ["classes"] }, { kind: "directive", type: i7.NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: i8.ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
|
|
126
|
+
}
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: AddressComponent, decorators: [{
|
|
128
|
+
type: Component,
|
|
129
|
+
args: [{ selector: 'anatoly-forms-address', template: "<anatoly-card classes='card-primary card-outline'>\r\n <anatoly-card-header *ngIf='isTitleVisible' [title]='title'></anatoly-card-header>\r\n <anatoly-card-body>\r\n <div class='row' [formGroup]='formGroup'>\r\n <div class='form-group col-12' [ngClass]=\"{'has-error': isControlInvalid('address_street')}\" >\r\n <label class='col-form-label required'>Street Address</label>\r\n <input type='text' class='form-control' formControlName='address_street' placeholder='Street Address'>\r\n <anatoly-item-validation-summary controlName='address_street'\r\n controlTitle='Street'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-12' [ngClass]=\"{'has-error': isControlInvalid('address_street2')}\" >\r\n <input type='text' class='form-control' formControlName='address_street2' placeholder='Apartment, suite, unit, building, floor, etc.'>\r\n <anatoly-item-validation-summary controlName='address_street2'\r\n controlTitle='Street2'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' [ngClass]=\"{'has-error': isControlInvalid('address_city')}\">\r\n <label class='col-form-label required'>City</label>\r\n <input type='text' class='form-control' formControlName='address_city' placeholder='City'>\r\n <anatoly-item-validation-summary controlName='address_city'\r\n controlTitle='City'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' *ngIf=\"formGroup.value.address_country == 'US'\" [ngClass]=\"{'has-error': isControlInvalid('address_stateOrRegion')}\">\r\n <label class='col-form-label required'>State</label>\r\n <select class='form-control' (change)='onUSStateChange($event)' formControlName='address_stateOrRegion'>\r\n <option *ngFor='let state of usStateData' [value]='state.code'>{{state.name}}</option>\r\n </select>\r\n <anatoly-item-validation-summary controlName='address_stateOrRegion'\r\n controlTitle='State'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' [ngClass]=\"{'has-error': isControlInvalid('address_zipcode')}\" >\r\n <label class='col-form-label required'>zipcode</label>\r\n <input type='text' class='form-control' formControlName='address_zipcode' placeholder='zipcode'>\r\n <anatoly-item-validation-summary controlName='address_zipcode'\r\n controlTitle='zipcode'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n <div class='form-group col-3' [ngClass]=\"{'has-error': isControlInvalid('address_country')}\">\r\n <label class='col-form-label required'>Country</label>\r\n <select class='form-control' (change)='onCountryChange($event)' formControlName='address_country' data-placeholder='Select a Country'>\r\n <option *ngFor='let country of countryData' [value]='country.code'>{{country.name}}</option>\r\n </select>\r\n <anatoly-item-validation-summary controlName='address_country'\r\n controlTitle='Country'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </anatoly-card-body>\r\n</anatoly-card>\r\n" }]
|
|
130
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.CoreApiService }]; }, propDecorators: { title: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], isTitleVisible: [{
|
|
133
|
+
type: Input
|
|
134
|
+
}], isRequired: [{
|
|
135
|
+
type: Input
|
|
136
|
+
}], address: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}], change: [{
|
|
139
|
+
type: Output
|
|
140
|
+
}] } });
|
|
141
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmF0b2x5L3NyYy9saWIvdWkvZm9ybXMvY29tcG9uZW50cy9hZGRyZXNzL2FkZHJlc3MuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5hdG9seS9zcmMvbGliL3VpL2Zvcm1zL2NvbXBvbmVudHMvYWRkcmVzcy9hZGRyZXNzLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7OztFQWNFO0FBRUYsTUFBTTtBQUNOLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBVSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDL0UsT0FBTyxFQUFlLFVBQVUsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBSXpELE9BQU8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AgICBjb250cm9sVGl0bGU9J1N0YXRlJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtmb3JtR3JvdXBdPSdmb3JtR3JvdXAnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW2Zvcm1TdWJtaXR0ZWRdPSdmb3JtU3VibWl0dGVkJz5cclxuICAgICAgICA8L2FuYXRvbHktaXRlbS12YWxpZGF0aW9uLXN1bW1hcnk+XHJcbiAgICAgIDwvZGl2PlxyXG5cclxuICAgICAgPGRpdiBjbGFzcz0nZm9ybS1ncm91cCBjb2wtMycgW25nQ2xhc3NdPVwieydoYXMtZXJyb3InOiBpc0NvbnRyb2xJbnZhbGlkKCdhZGRyZXNzX3ppcGNvZGUnKX1cIiA+XHJcbiAgICAgICAgPGxhYmVsIGNsYXNzPSdjb2wtZm9ybS1sYWJlbCByZXF1aXJlZCc+emlwY29kZTwvbGFiZWw+XHJcbiAgICAgICAgPGlucHV0IHR5cGU9J3RleHQnIGNsYXNzPSdmb3JtLWNvbnRyb2wnIGZvcm1Db250cm9sTmFtZT0nYWRkcmVzc196aXBjb2RlJyBwbGFjZWhvbGRlcj0nemlwY29kZSc+XHJcbiAgICAgICAgPGFuYXRvbHktaXRlbS12YWxpZGF0aW9uLXN1bW1hcnkgY29udHJvbE5hbWU9J2FkZHJlc3NfemlwY29kZSdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sVGl0bGU9J3ppcGNvZGUnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW2Zvcm1Hcm91cF09J2Zvcm1Hcm91cCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbZm9ybVN1Ym1pdHRlZF09J2Zvcm1TdWJtaXR0ZWQnPlxyXG4gICAgICAgIDwvYW5hdG9seS1pdGVtLXZhbGlkYXRpb24tc3VtbWFyeT5cclxuICA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F0b2x5LWNhcmQtYm9keT5cclxuPC9hbmF0b2x5LWNhcmQ+XHJcbiJdfQ==
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<file>
|
|
3
|
+
Project:
|
|
4
|
+
@osovitny/anatoly
|
|
5
|
+
|
|
6
|
+
Authors:
|
|
7
|
+
Vadim Osovitny vadim@osovitny.com
|
|
8
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
9
|
+
|
|
10
|
+
Created:
|
|
11
|
+
02 Aug 2022
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2017-2022 Osovitny Inc. All rights reserved.
|
|
14
|
+
</file>
|
|
15
|
+
*/
|
|
16
|
+
//Node
|
|
17
|
+
import { Component, Input } from '@angular/core';
|
|
18
|
+
//App
|
|
19
|
+
import { BaseEditComponent } from '../../../components';
|
|
20
|
+
import * as i0 from "@angular/core";
|
|
21
|
+
import * as i1 from "@angular/forms";
|
|
22
|
+
import * as i2 from "@angular/common";
|
|
23
|
+
import * as i3 from "../../../components/card/card.component";
|
|
24
|
+
import * as i4 from "../../../components/card/card-header.component";
|
|
25
|
+
import * as i5 from "../../../components/card/card-body.component";
|
|
26
|
+
import * as i6 from "../../../directives/native-element.directive";
|
|
27
|
+
import * as i7 from "../../../validation/item-validation-summary.component";
|
|
28
|
+
export class CompanyComponent extends BaseEditComponent {
|
|
29
|
+
fb;
|
|
30
|
+
//Private
|
|
31
|
+
_company;
|
|
32
|
+
formGroupGenerated = false;
|
|
33
|
+
//Inputs
|
|
34
|
+
title = 'Company / Organization';
|
|
35
|
+
isTitleVisible = true;
|
|
36
|
+
get company() {
|
|
37
|
+
return this._company;
|
|
38
|
+
}
|
|
39
|
+
set company(value) {
|
|
40
|
+
this._company = value;
|
|
41
|
+
if (value) {
|
|
42
|
+
this.init();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
constructor(fb) {
|
|
46
|
+
super();
|
|
47
|
+
this.fb = fb;
|
|
48
|
+
}
|
|
49
|
+
ngOnInit() {
|
|
50
|
+
this.createFormGroup();
|
|
51
|
+
this.init();
|
|
52
|
+
}
|
|
53
|
+
createFormGroup() {
|
|
54
|
+
this.formGroup.addControl('company_name', this.fb.control('', []));
|
|
55
|
+
this.formGroup.addControl('company_phone', this.fb.control('', []));
|
|
56
|
+
this.formGroup.addControl('company_email', this.fb.control('', []));
|
|
57
|
+
this.formGroup.addControl('company_websiteUrl', this.fb.control('', []));
|
|
58
|
+
this.formGroupGenerated = true;
|
|
59
|
+
}
|
|
60
|
+
init() {
|
|
61
|
+
if (!this.formGroupGenerated) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (this._company !== undefined) {
|
|
65
|
+
let company = JSON.parse(this._company);
|
|
66
|
+
this.setFormValue('company_name', company.name);
|
|
67
|
+
this.setFormValue('company_phone', company.phone);
|
|
68
|
+
this.setFormValue('company_email', company.email);
|
|
69
|
+
this.setFormValue('company_websiteUrl', company.websiteUrl);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
getCompany() {
|
|
73
|
+
const data = {
|
|
74
|
+
name: this.getFormValue('company_name') || null,
|
|
75
|
+
phone: this.getFormValue('company_phone') || null,
|
|
76
|
+
email: this.getFormValue('company_email') || null,
|
|
77
|
+
websiteUrl: this.getFormValue('company_websiteUrl') || null
|
|
78
|
+
};
|
|
79
|
+
return JSON.stringify(data);
|
|
80
|
+
}
|
|
81
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: CompanyComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: CompanyComponent, selector: "anatoly-forms-company", inputs: { title: "title", isTitleVisible: "isTitleVisible", company: "company" }, usesInheritance: true, ngImport: i0, template: "<anatoly-card classes='card-primary card-outline'>\r\n <anatoly-card-header *ngIf='isTitleVisible' [title]='title'></anatoly-card-header>\r\n <anatoly-card-body>\r\n <div [formGroup]='formGroup' class='row'>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_name') }\">\r\n <label class='col-form-label'>Name</label>\r\n <input type='text' class='form-control' formControlName='company_name' placeholder='Company Name'>\r\n <anatoly-item-validation-summary controlName='company_name'\r\n controlTitle='Company Name'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_phone') }\">\r\n <label class='col-form-label'>Phone</label>\r\n <input type='tel' class='form-control' formControlName='company_phone' placeholder='Company Phone'>\r\n <anatoly-item-validation-summary controlName='company_phone'\r\n controlTitle='Company Phone'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_email') }\">\r\n <label class='col-form-label'>Email</label>\r\n <input type='email' class='form-control' formControlName='company_email' placeholder='Company Email'>\r\n <anatoly-item-validation-summary controlName='company_email'\r\n controlTitle='Company Email'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_websiteUrl') }\">\r\n <label class='col-form-label'>Website Url</label>\r\n <input type='url' placeholder='https://example.com' pattern='https://.*' size='30'\r\n class='form-control' formControlName='company_websiteUrl'>\r\n <anatoly-item-validation-summary controlName='company_websiteUrl'\r\n controlTitle='Company website url'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n </div>\r\n </anatoly-card-body>\r\n</anatoly-card>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.CardComponent, selector: "anatoly-card", inputs: ["classes"] }, { kind: "component", type: i4.CardHeaderComponent, selector: "anatoly-card-header", inputs: ["classes", "title"] }, { kind: "component", type: i5.CardBodyComponent, selector: "anatoly-card-body", inputs: ["classes"] }, { kind: "directive", type: i6.NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: i7.ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: CompanyComponent, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{ selector: 'anatoly-forms-company', template: "<anatoly-card classes='card-primary card-outline'>\r\n <anatoly-card-header *ngIf='isTitleVisible' [title]='title'></anatoly-card-header>\r\n <anatoly-card-body>\r\n <div [formGroup]='formGroup' class='row'>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_name') }\">\r\n <label class='col-form-label'>Name</label>\r\n <input type='text' class='form-control' formControlName='company_name' placeholder='Company Name'>\r\n <anatoly-item-validation-summary controlName='company_name'\r\n controlTitle='Company Name'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_phone') }\">\r\n <label class='col-form-label'>Phone</label>\r\n <input type='tel' class='form-control' formControlName='company_phone' placeholder='Company Phone'>\r\n <anatoly-item-validation-summary controlName='company_phone'\r\n controlTitle='Company Phone'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_email') }\">\r\n <label class='col-form-label'>Email</label>\r\n <input type='email' class='form-control' formControlName='company_email' placeholder='Company Email'>\r\n <anatoly-item-validation-summary controlName='company_email'\r\n controlTitle='Company Email'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div class='form-group col-6' [ngClass]=\"{'has-error': isControlInvalid('company_websiteUrl') }\">\r\n <label class='col-form-label'>Website Url</label>\r\n <input type='url' placeholder='https://example.com' pattern='https://.*' size='30'\r\n class='form-control' formControlName='company_websiteUrl'>\r\n <anatoly-item-validation-summary controlName='company_websiteUrl'\r\n controlTitle='Company website url'\r\n [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n </div>\r\n </anatoly-card-body>\r\n</anatoly-card>\r\n" }]
|
|
87
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { title: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], isTitleVisible: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}], company: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}] } });
|
|
94
|
+
//# sourceMappingURL=data:application/json;base64,e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JbnZhbGlkKCdjb21wYW55X3Bob25lJykgfVwiPlxyXG4gICAgICAgIDxsYWJlbCBjbGFzcz0nY29sLWZvcm0tbGFiZWwnPlBob25lPC9sYWJlbD5cclxuICAgICAgICA8aW5wdXQgdHlwZT0ndGVsJyBjbGFzcz0nZm9ybS1jb250cm9sJyBmb3JtQ29udHJvbE5hbWU9J2NvbXBhbnlfcGhvbmUnIHBsYWNlaG9sZGVyPSdDb21wYW55IFBob25lJz5cclxuICAgICAgICA8YW5hdG9seS1pdGVtLXZhbGlkYXRpb24tc3VtbWFyeSBjb250cm9sTmFtZT0nY29tcGFueV9waG9uZSdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sVGl0bGU9J0NvbXBhbnkgUGhvbmUnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW2Zvcm1Hcm91cF09J2Zvcm1Hcm91cCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbZm9ybVN1Ym1pdHRlZF09J2Zvcm1TdWJtaXR0ZWQnPlxyXG4gICAgICAgIDwvYW5hdG9seS1pdGVtLXZhbGlkYXRpb24tc3VtbWFyeT5cclxuICAgICAgPC9kaXY+XHJcbiAgICAgIDxkaXYgY2xhc3M9J2Zvcm0tZ3JvdXAgY29sLTYnIFtuZ0NsYXNzXT1cInsnaGFzLWVycm9yJzogaXNDb250cm9sSW52YWxpZCgnY29tcGFueV9lbWFpbCcpIH1cIj5cclxuICAgICAgICA8bGFiZWwgY2xhc3M9J2NvbC1mb3JtLWxhYmVsJz5FbWFpbDwvbGFiZWw+XHJcbiAgICAgICAgPGlucHV0IHR5cGU9J2VtYWlsJyBjbGFzcz0nZm9ybS1jb250cm9sJyBmb3JtQ29udHJvbE5hbWU9J2NvbXBhbnlfZW1haWwnIHBsYWNlaG9sZGVyPSdDb21wYW55IEVtYWlsJz5cclxuICAgICAgICA8YW5hdG9seS1pdGVtLXZhbGlkYXRpb24tc3VtbWFyeSBjb250cm9sTmFtZT0nY29tcGFueV9lbWFpbCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sVGl0bGU9J0NvbXBhbnkgRW1haWwnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW2Zvcm1Hcm91cF09J2Zvcm1Hcm91cCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbZm9ybVN1Ym1pdHRlZF09J2Zvcm1TdWJtaXR0ZWQnPlxyXG4gICAgICAgIDwvYW5hdG9seS1pdGVtLXZhbGlkYXRpb24tc3VtbWFyeT5cclxuICAgICAgPC9kaXY+XHJcbiAgICAgIDxkaXYgY2xhc3M9J2Zvcm0tZ3JvdXAgY29sLTYnIFtuZ0NsYXNzXT1cInsnaGFzLWVycm9yJzogaXNDb250cm9sSW52YWxpZCgnY29tcGFueV93ZWJzaXRlVXJsJykgfVwiPlxyXG4gICAgICAgIDxsYWJlbCBjbGFzcz0nY29sLWZvcm0tbGFiZWwnPldlYnNpdGUgVXJsPC9sYWJlbD5cclxuICAgICAgICA8aW5wdXQgdHlwZT0ndXJsJyBwbGFjZWhvbGRlcj0naHR0cHM6Ly9leGFtcGxlLmNvbScgcGF0dGVybj0naHR0cHM6Ly8uKicgc2l6ZT0nMzAnXHJcbiAgICAgICAgICAgICAgIGNsYXNzPSdmb3JtLWNvbnRyb2wnIGZvcm1Db250cm9sTmFtZT0nY29tcGFueV93ZWJzaXRlVXJsJz5cclxuICAgICAgICA8YW5hdG9seS1pdGVtLXZhbGlkYXRpb24tc3VtbWFyeSBjb250cm9sTmFtZT0nY29tcGFueV93ZWJzaXRlVXJsJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xUaXRsZT0nQ29tcGFueSB3ZWJzaXRlIHVybCdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbZm9ybUdyb3VwXT0nZm9ybUdyb3VwJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFtmb3JtU3VibWl0dGVkXT0nZm9ybVN1Ym1pdHRlZCc+XHJcbiAgICAgICAgPC9hbmF0b2x5LWl0ZW0tdmFsaWRhdGlvbi1zdW1tYXJ5PlxyXG4gICAgICA8L2Rpdj5cclxuXHJcbiAgICA8L2Rpdj5cclxuICA8L2FuYXRvbHktY2FyZC1ib2R5PlxyXG48L2FuYXRvbHktY2FyZD5cclxuIl19
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<file>
|
|
3
|
+
Project:
|
|
4
|
+
@osovitny/anatoly
|
|
5
|
+
|
|
6
|
+
Authors:
|
|
7
|
+
Vadim Osovitny vadim@osovitny.com
|
|
8
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
9
|
+
|
|
10
|
+
Created:
|
|
11
|
+
02 Aug 2022
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2017-2022 Osovitny Inc. All rights reserved.
|
|
14
|
+
</file>
|
|
15
|
+
*/
|
|
16
|
+
//Node
|
|
17
|
+
import { Component, Input } from '@angular/core';
|
|
18
|
+
//App
|
|
19
|
+
import { BaseEditComponent } from '../../../../components/base/base-edit.component';
|
|
20
|
+
import * as i0 from "@angular/core";
|
|
21
|
+
import * as i1 from "../../../../../data/services/core-api.service";
|
|
22
|
+
import * as i2 from "../../../../../core/services/appcontext.service";
|
|
23
|
+
import * as i3 from "@angular/common";
|
|
24
|
+
import * as i4 from "@angular/forms";
|
|
25
|
+
import * as i5 from "../../../../directives/native-element.directive";
|
|
26
|
+
export class TimezoneDropdownlist extends BaseEditComponent {
|
|
27
|
+
api;
|
|
28
|
+
appContext;
|
|
29
|
+
timezoneListItems;
|
|
30
|
+
//Inputs
|
|
31
|
+
title = 'Timezone';
|
|
32
|
+
isTitleVisible = true;
|
|
33
|
+
controlName = 'timezone';
|
|
34
|
+
controlTitle;
|
|
35
|
+
constructor(api, appContext) {
|
|
36
|
+
super();
|
|
37
|
+
this.api = api;
|
|
38
|
+
this.appContext = appContext;
|
|
39
|
+
}
|
|
40
|
+
ngOnInit() {
|
|
41
|
+
this.setValues();
|
|
42
|
+
}
|
|
43
|
+
setValues() {
|
|
44
|
+
this.api.getTimezonesJsonFile(data => {
|
|
45
|
+
this.timezoneListItems = data.reverse();
|
|
46
|
+
});
|
|
47
|
+
try {
|
|
48
|
+
let timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
49
|
+
this.setFormValue(this.controlName, timeZone);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
}
|
|
53
|
+
let context = this.appContext.current;
|
|
54
|
+
let timeZone = context?.account?.timezone;
|
|
55
|
+
if (timeZone) {
|
|
56
|
+
this.setFormValue(this.controlName, timeZone);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: TimezoneDropdownlist, deps: [{ token: i1.CoreApiService }, { token: i2.AppContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
60
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: TimezoneDropdownlist, selector: "anatoly-forms-timezone-dropdownlist", inputs: { title: "title", isTitleVisible: "isTitleVisible", controlName: "controlName", controlTitle: "controlTitle" }, usesInheritance: true, ngImport: i0, template: "<div [formGroup]='formGroup' class='form-group'>\r\n <label *ngIf='isTitleVisible' class='col-form-label'>Timezone</label>\r\n <select [formControlName]='controlName' class='form-control'>\r\n <option *ngFor='let timezone of timezoneListItems'\r\n [value]='timezone.code'>\r\n ({{timezone.offset}}) {{timezone.name}}\r\n </option>\r\n </select>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i5.NativeElementDirective, selector: "[formControl], [formControlName]" }] });
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: TimezoneDropdownlist, decorators: [{
|
|
63
|
+
type: Component,
|
|
64
|
+
args: [{ selector: 'anatoly-forms-timezone-dropdownlist', template: "<div [formGroup]='formGroup' class='form-group'>\r\n <label *ngIf='isTitleVisible' class='col-form-label'>Timezone</label>\r\n <select [formControlName]='controlName' class='form-control'>\r\n <option *ngFor='let timezone of timezoneListItems'\r\n [value]='timezone.code'>\r\n ({{timezone.offset}}) {{timezone.name}}\r\n </option>\r\n </select>\r\n</div>\r\n" }]
|
|
65
|
+
}], ctorParameters: function () { return [{ type: i1.CoreApiService }, { type: i2.AppContextService }]; }, propDecorators: { title: [{
|
|
66
|
+
type: Input
|
|
67
|
+
}], isTitleVisible: [{
|
|
68
|
+
type: Input
|
|
69
|
+
}], controlName: [{
|
|
70
|
+
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GNhdGNoIHtcclxuICAgIH1cclxuXHJcbiAgICBsZXQgY29udGV4dCA9IHRoaXMuYXBwQ29udGV4dC5jdXJyZW50O1xyXG4gICAgbGV0IHRpbWVab25lID0gY29udGV4dD8uYWNjb3VudD8udGltZXpvbmU7XHJcblxyXG4gICAgaWYgKHRpbWVab25lKSB7XHJcbiAgICAgIHRoaXMuc2V0Rm9ybVZhbHVlKHRoaXMuY29udHJvbE5hbWUsIHRpbWVab25lKTtcclxuICAgIH1cclxuICB9XHJcbn1cclxuIiwiPGRpdiBbZm9ybUdyb3VwXT0nZm9ybUdyb3VwJyBjbGFzcz0nZm9ybS1ncm91cCc+XHJcbiAgPGxhYmVsICpuZ0lmPSdpc1RpdGxlVmlzaWJsZScgY2xhc3M9J2NvbC1mb3JtLWxhYmVsJz5UaW1lem9uZTwvbGFiZWw+XHJcbiAgPHNlbGVjdCBbZm9ybUNvbnRyb2xOYW1lXT0nY29udHJvbE5hbWUnIGNsYXNzPSdmb3JtLWNvbnRyb2wnPlxyXG4gICAgPG9wdGlvbiAqbmdGb3I9J2xldCB0aW1lem9uZSBvZiB0aW1lem9uZUxpc3RJdGVtcydcclxuICAgICAgICAgICAgW3ZhbHVlXT0ndGltZXpvbmUuY29kZSc+XHJcbiAgICAgICh7e3RpbWV6b25lLm9mZnNldH19KSAge3t0aW1lem9uZS5uYW1lfX1cclxuICAgIDwvb3B0aW9uPlxyXG4gIDwvc2VsZWN0PlxyXG48L2Rpdj5cclxuIl19
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<file>
|
|
3
|
+
Project:
|
|
4
|
+
@osovitny/anatoly
|
|
5
|
+
|
|
6
|
+
Authors:
|
|
7
|
+
Vadim Osovitny vadim@osovitny.com
|
|
8
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
9
|
+
|
|
10
|
+
Created:
|
|
11
|
+
02 Aug 2022
|
|
12
|
+
|
|
13
|
+
Copyright (c) 2017-2022 Osovitny Inc. All rights reserved.
|
|
14
|
+
</file>
|
|
15
|
+
*/
|
|
16
|
+
//Node
|
|
17
|
+
import { Component, Input, EventEmitter, Output } from '@angular/core';
|
|
18
|
+
//App
|
|
19
|
+
import { BaseEditComponent } from '../../../components/base/base-edit.component';
|
|
20
|
+
import { Utils } from '../../../../core/utils';
|
|
21
|
+
import * as i0 from "@angular/core";
|
|
22
|
+
import * as i1 from "@angular/common";
|
|
23
|
+
import * as i2 from "@angular/forms";
|
|
24
|
+
import * as i3 from "../../../directives/native-element.directive";
|
|
25
|
+
import * as i4 from "../../../validation/item-validation-summary.component";
|
|
26
|
+
export class UrlSlugComponent extends BaseEditComponent {
|
|
27
|
+
firstValue = true;
|
|
28
|
+
hrefGo;
|
|
29
|
+
//Inputs
|
|
30
|
+
title = 'Permalink:';
|
|
31
|
+
isTitleVisible = true;
|
|
32
|
+
controlName;
|
|
33
|
+
controlTitle;
|
|
34
|
+
class;
|
|
35
|
+
watchedControlName;
|
|
36
|
+
urlPrefix;
|
|
37
|
+
isGoButtonVisible = true;
|
|
38
|
+
//Outputs
|
|
39
|
+
generating = new EventEmitter();
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
}
|
|
43
|
+
ngOnInit() {
|
|
44
|
+
this.startWatching();
|
|
45
|
+
}
|
|
46
|
+
generateUrlSlug(text) {
|
|
47
|
+
let slugedText = Utils.slugify(text);
|
|
48
|
+
let event = { urlSlug: slugedText };
|
|
49
|
+
this.generating.emit(event);
|
|
50
|
+
this.setFormValue(this.controlName, event.urlSlug);
|
|
51
|
+
}
|
|
52
|
+
startWatching() {
|
|
53
|
+
this.subs.sink = this.formGroup.get(this.watchedControlName).valueChanges.subscribe({
|
|
54
|
+
next: (value) => {
|
|
55
|
+
if (this.firstValue) {
|
|
56
|
+
this.firstValue = false;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.generateUrlSlug(value);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.subs.sink = this.formGroup.get(this.controlName).valueChanges.subscribe({
|
|
63
|
+
next: (value) => {
|
|
64
|
+
this.hrefGo = value;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//Events
|
|
69
|
+
onUrlSlugChange() {
|
|
70
|
+
let text = this.getFormValue(this.controlName);
|
|
71
|
+
this.generateUrlSlug(text);
|
|
72
|
+
}
|
|
73
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: UrlSlugComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
74
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.7", type: UrlSlugComponent, selector: "anatoly-forms-urlslug", inputs: { title: "title", isTitleVisible: "isTitleVisible", controlName: "controlName", controlTitle: "controlTitle", class: "class", watchedControlName: "watchedControlName", urlPrefix: "urlPrefix", isGoButtonVisible: "isGoButtonVisible" }, outputs: { generating: "generating" }, usesInheritance: true, ngImport: i0, template: "<div [formGroup]='formGroup' [ngClass]=\"{'has-error': isControlInvalid(controlName)}\"\r\n class=\"permalink form-group {{class}}\">\r\n <div class=\"d-flex align-items-end\">\r\n <anatoly-item-validation-summary [formGroup]='formGroup' [formSubmitted]='formSubmitted' [controlName]='controlName'\r\n [controlTitle]='controlTitle'>\r\n </anatoly-item-validation-summary>\r\n <div class=\"form-group\">\r\n <label *ngIf='isTitleVisible' class='col-form-label'>\r\n {{ title }}\r\n <span class=\"urlPrefix\">{{ urlPrefix }}</span>\r\n </label>\r\n <input type='text' class='form-control' [formControlName]='controlName' placeholder='Type url slug here'\r\n (focusout)='onUrlSlugChange()' />\r\n </div>\r\n\r\n <div class=\"form-group flex-shrink-1\" *ngIf=\"isGoButtonVisible\">\r\n <a href=\"{{urlPrefix}}{{hrefGo}}\" target=\"_blank\" class=\"btn btn-primary\">Go</a>\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3.NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: i4.ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
|
|
75
|
+
}
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.7", ngImport: i0, type: UrlSlugComponent, decorators: [{
|
|
77
|
+
type: Component,
|
|
78
|
+
args: [{ selector: 'anatoly-forms-urlslug', template: "<div [formGroup]='formGroup' [ngClass]=\"{'has-error': isControlInvalid(controlName)}\"\r\n class=\"permalink form-group {{class}}\">\r\n <div class=\"d-flex align-items-end\">\r\n <anatoly-item-validation-summary [formGroup]='formGroup' [formSubmitted]='formSubmitted' [controlName]='controlName'\r\n [controlTitle]='controlTitle'>\r\n </anatoly-item-validation-summary>\r\n <div class=\"form-group\">\r\n <label *ngIf='isTitleVisible' class='col-form-label'>\r\n {{ title }}\r\n <span class=\"urlPrefix\">{{ urlPrefix }}</span>\r\n </label>\r\n <input type='text' class='form-control' [formControlName]='controlName' placeholder='Type url slug here'\r\n (focusout)='onUrlSlugChange()' />\r\n </div>\r\n\r\n <div class=\"form-group flex-shrink-1\" *ngIf=\"isGoButtonVisible\">\r\n <a href=\"{{urlPrefix}}{{hrefGo}}\" target=\"_blank\" class=\"btn btn-primary\">Go</a>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
79
|
+
}], ctorParameters: function () { return []; }, propDecorators: { title: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], isTitleVisible: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], controlName: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], controlTitle: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], class: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], watchedControlName: [{
|
|
90
|
+
type: Input
|
|
91
|
+
}], urlPrefix: [{
|
|
92
|
+
type: Input
|
|
93
|
+
}], isGoButtonVisible: [{
|
|
94
|
+
type: Input
|
|
95
|
+
}], generating: [{
|
|
96
|
+
type: Output
|
|
97
|
+
}] } });
|
|
98
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXJsc2x1Zy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmF0b2x5L3NyYy9saWIvdWkvZm9ybXMvY29tcG9uZW50cy91cmxzbHVnL3VybHNsdWcuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5hdG9seS9zcmMvbGliL3VpL2Zvcm1zL2NvbXBvbmVudHMvdXJsc2x1Zy91cmxzbHVnLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7OztFQWNFO0FBRUYsTUFBTTtBQUNOLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLFlBQVksRU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