@enigmatry/entry-components 17.0.0-preview.4 → 17.0.0-preview.5.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/README.md +32 -32
- package/assets/nswag-templates/Client.RequestBody.liquid +95 -95
- package/assets/nswag-templates/Client.RequestUrl.liquid +67 -67
- package/assets/nswag-templates/ConvertToClass.liquid +64 -64
- package/assets/nswag-templates/original/Client.RequestBody.liquid +89 -89
- package/assets/nswag-templates/original/Client.RequestUrl.liquid +59 -59
- package/assets/nswag-templates/original/ConvertToClass.liquid +65 -65
- package/assets/nswag-templates/original/File.FormatDate.liquid +4 -4
- package/assets/nswag-templates/original/File.ParseDateOnly.liquid +4 -4
- package/button/README.md +45 -45
- package/date-time-picker/README.md +69 -69
- package/dialog/README.md +73 -73
- package/esm2022/button/entry-button.directive.mjs +1 -1
- package/esm2022/button/entry-button.module.mjs +1 -1
- package/esm2022/button/public-api.mjs +1 -1
- package/esm2022/common/common.module.mjs +1 -1
- package/esm2022/common/date-time/entry-date-time-adapter.mjs +1 -1
- package/esm2022/common/date-time/entry-date-time-formats.mjs +1 -1
- package/esm2022/common/date-time/entry-time-adapter.mjs +1 -1
- package/esm2022/common/date-time/native-time-adapter.mjs +1 -1
- package/esm2022/common/directives/auto-disable-button.directive.mjs +1 -1
- package/esm2022/common/directives/ng-control-accessor.directive.mjs +1 -1
- package/esm2022/common/directives/noop-control-value-accessor.mjs +1 -1
- package/esm2022/common/interceptors/accept-language.interceptor.mjs +1 -1
- package/esm2022/common/public-api.mjs +1 -1
- package/esm2022/date-time-picker/date-time-picker.component.mjs +3 -3
- package/esm2022/date-time-picker/date-time-picker.module.mjs +1 -1
- package/esm2022/date-time-picker/public-api.mjs +1 -1
- package/esm2022/date-time-picker/time-picker.component.mjs +3 -3
- package/esm2022/dialog/dialogs/alert/entry-alert-dialog-data.interface.mjs +1 -1
- package/esm2022/dialog/dialogs/alert/entry-alert-dialog.component.mjs +3 -3
- package/esm2022/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.mjs +1 -1
- package/esm2022/dialog/dialogs/confirm/entry-confirm-dialog.component.mjs +3 -3
- package/esm2022/dialog/dialogs/entry-dialog.component.mjs +3 -3
- package/esm2022/dialog/dialogs/error/entry-error-dialog-data.interface.mjs +1 -1
- package/esm2022/dialog/dialogs/error/entry-error-dialog.component.mjs +3 -3
- package/esm2022/dialog/entry-dialog-buttons-alignment.type.mjs +1 -1
- package/esm2022/dialog/entry-dialog-config.model.mjs +1 -1
- package/esm2022/dialog/entry-dialog.module.mjs +1 -1
- package/esm2022/dialog/entry-dialog.service.mjs +1 -1
- package/esm2022/dialog/public-api.mjs +1 -1
- package/esm2022/file-input/entry-file-input.component.mjs +1 -1
- package/esm2022/file-input/entry-file-input.module.mjs +1 -1
- package/esm2022/file-input/public-api.mjs +1 -1
- package/esm2022/permissions/permission-type.mjs +1 -1
- package/esm2022/permissions/permission.directive.mjs +1 -1
- package/esm2022/permissions/permission.module.mjs +1 -1
- package/esm2022/permissions/permission.pipe.mjs +1 -1
- package/esm2022/permissions/public-api.mjs +1 -1
- package/esm2022/public-api.mjs +1 -1
- package/esm2022/search-filter/autocomplete/autocomplete-search-filter.component.mjs +3 -3
- package/esm2022/search-filter/autocomplete/autocomplete-search-filter.model.mjs +1 -1
- package/esm2022/search-filter/control-type.mjs +1 -1
- package/esm2022/search-filter/date/date-search-filter.component.mjs +3 -3
- package/esm2022/search-filter/date/date-search-filter.model.mjs +1 -1
- package/esm2022/search-filter/date-time/date-time-search-filter.component.mjs +3 -3
- package/esm2022/search-filter/date-time/date-time-search-filter.model.mjs +1 -1
- package/esm2022/search-filter/public-api.mjs +1 -1
- package/esm2022/search-filter/search-filter-base.model.mjs +1 -1
- package/esm2022/search-filter/search-filter-config.model.mjs +1 -1
- package/esm2022/search-filter/search-filter-params.type.mjs +1 -1
- package/esm2022/search-filter/select/select-search-filter.component.mjs +3 -3
- package/esm2022/search-filter/select/select-search-filter.model.mjs +1 -1
- package/esm2022/search-filter/select-option.model.mjs +1 -1
- package/esm2022/search-filter/text/text-search-filter.component.mjs +3 -3
- package/esm2022/search-filter/text/text-search-filter.model.mjs +1 -1
- package/esm2022/spinner/entry-spinner/spinner.component.mjs +1 -1
- package/esm2022/spinner/public-api.mjs +1 -1
- package/esm2022/spinner/spinner.module.mjs +1 -1
- package/esm2022/table/components/entry-cell/entry-cell.component.mjs +1 -1
- package/esm2022/table/components/entry-cell-context-menu/entry-cell-context-menu.component.mjs +3 -3
- package/esm2022/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.mjs +3 -3
- package/esm2022/table/components/entry-table/entry-table.component.mjs +3 -3
- package/esm2022/table/entry-table.module.mjs +1 -1
- package/esm2022/table/interfaces/entry-table-config.mjs +1 -1
- package/esm2022/table/interfaces/paged-query.mjs +1 -1
- package/esm2022/table/interfaces/pagination.mjs +1 -1
- package/esm2022/table/public-api.mjs +1 -1
- package/esm2022/validation/entry-display-control-validation.directive.mjs +1 -1
- package/esm2022/validation/entry-form-errors.component.mjs +13 -13
- package/esm2022/validation/entry-validation-config.model.mjs +1 -1
- package/esm2022/validation/entry-validation.mjs +1 -1
- package/esm2022/validation/entry-validation.module.mjs +1 -1
- package/esm2022/validation/public-api.mjs +1 -1
- package/esm2022/validation/validation-problem-details.interface.mjs +1 -1
- package/fesm2022/enigmatry-entry-components-button.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-common.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-date-time-picker.mjs +4 -4
- package/fesm2022/enigmatry-entry-components-date-time-picker.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-dialog.mjs +8 -8
- package/fesm2022/enigmatry-entry-components-dialog.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-permissions.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-search-filter.mjs +10 -10
- package/fesm2022/enigmatry-entry-components-search-filter.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-spinner.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-table.mjs +6 -6
- package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components-validation.mjs +12 -12
- package/fesm2022/enigmatry-entry-components-validation.mjs.map +1 -1
- package/fesm2022/enigmatry-entry-components.mjs.map +1 -1
- package/file-input/README.md +70 -70
- package/package.json +2 -2
- package/permissions/README.md +67 -67
- package/search-filter/README.md +132 -132
- package/styles/_generator.scss +25 -25
- package/styles/modules/_default-theme.scss +91 -91
- package/styles/modules/components/buttons/_generator.scss +10 -10
- package/styles/modules/components/buttons/_radio.scss +18 -18
- package/styles/modules/components/checkboxes/_generator.scss +31 -31
- package/styles/modules/components/dialogs/_generator.scss +13 -13
- package/styles/modules/components/forms/_generator.scss +14 -14
- package/styles/modules/components/inputs/_generator.scss +14 -14
- package/styles/modules/components/search-filter/_generator.scss +14 -14
- package/styles/modules/components/tables/_cells.scss +25 -25
- package/styles/modules/components/tables/_generator.scss +6 -6
- package/styles/modules/components/tables/_header.scss +10 -10
- package/styles/modules/components/tables/_no-result.scss +9 -9
- package/styles/modules/components/tables/_rows.scss +39 -39
- package/styles/modules/components/tables/_sorting.scss +10 -10
- package/styles/modules/components/tables/_table-body.scss +12 -12
- package/styles/modules/components/toggle/_generator.scss +47 -47
- package/styles/modules/typography/_fonts.scss +64 -64
- package/styles/modules/vendors/angular-material/_generator.scss +46 -46
- package/styles/modules/vendors/angular-material/_palette-generator.scss +32 -32
- package/styles/modules/vendors/angular-material/_typography-generator.scss +107 -107
- package/styles/partials/core/components/_index.scss +4 -4
- package/styles/partials/core/components/date-time-picker/_general.scss +64 -64
- package/styles/partials/core/components/dialogs/_general.scss +23 -23
- package/styles/partials/core/components/forms/_general.scss +21 -21
- package/styles/partials/core/components/search-filter/_general.scss +8 -8
- package/styles/partials/core/components/tables/_general.scss +17 -17
- package/styles/partials/generator-test.scss +41 -41
- package/styles/partials/theming.scss +1 -1
- package/table/README.md +76 -76
- package/validation/README.md +108 -108
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
{%- if operation.HasFormParameters -%}
|
|
2
|
-
{%- if operation.ConsumesFormUrlEncoded -%}
|
|
3
|
-
let content_ = "";
|
|
4
|
-
{%- for parameter in operation.FormParameters -%}
|
|
5
|
-
{%- if parameter.IsRequired -%}
|
|
6
|
-
{%- if parameter.IsNullable -%}
|
|
7
|
-
if ({{ parameter.VariableName }} === undefined)
|
|
8
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
|
|
9
|
-
else
|
|
10
|
-
{%- else -%}
|
|
11
|
-
if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
|
|
12
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
|
|
13
|
-
else
|
|
14
|
-
{%- endif -%}
|
|
15
|
-
{%- else -%}
|
|
16
|
-
{%- if parameter.IsNullable -%}
|
|
17
|
-
if ({{ parameter.VariableName }} !== undefined)
|
|
18
|
-
{%- else -%}
|
|
19
|
-
if ({{ parameter.VariableName }} === null)
|
|
20
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
|
|
21
|
-
else if ({{ parameter.VariableName }} !== undefined)
|
|
22
|
-
{%- endif -%}
|
|
23
|
-
{%- endif -%}
|
|
24
|
-
{%- if parameter.IsDateOrDateTimeArray -%}
|
|
25
|
-
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent(item_ ? "" + item_.toJSON() : "null") + "&"; });
|
|
26
|
-
{%- elsif parameter.IsObjectArray -%}
|
|
27
|
-
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item_, index_) => {
|
|
28
|
-
for (const attr_ in item_) {
|
|
29
|
-
if (item_.hasOwnProperty(attr_)) {
|
|
30
|
-
content_ += encodeURIComponent("{{ parameter.Name }}[" + index_ + "]." + attr_) + "=" + encodeURIComponent("" + (item_ as any)[attr_]) + "&";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
{%- elsif parameter.IsDateOrDateTime -%}
|
|
35
|
-
content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.toJSON() : "{{ QueryNullValue }}") + "&";
|
|
36
|
-
{%- elsif parameter.IsArray -%}
|
|
37
|
-
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + item) + "&"; });
|
|
38
|
-
{%- else -%}
|
|
39
|
-
content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
|
|
40
|
-
{%- endif -%}
|
|
41
|
-
{%- endfor -%}
|
|
42
|
-
content_ = content_.replace(/&$/, "");
|
|
43
|
-
|
|
44
|
-
{%- else -%}
|
|
45
|
-
const content_ = new FormData();
|
|
46
|
-
{% for parameter in operation.FormParameters -%}
|
|
47
|
-
{%- if parameter.IsNullable -%}
|
|
48
|
-
if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
|
|
49
|
-
{%- else -%}
|
|
50
|
-
if ({{ parameter.VariableName }} === null || {{ parameter.VariableName }} === undefined)
|
|
51
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
|
|
52
|
-
else
|
|
53
|
-
{%- endif -%}
|
|
54
|
-
{%- if parameter.IsFile -%}
|
|
55
|
-
{%- if parameter.IsArray -%}
|
|
56
|
-
{{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.data, item_.fileName ? item_.fileName : "{{ parameter.Name }}") );
|
|
57
|
-
{%- else -%}
|
|
58
|
-
content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.data, {{ parameter.VariableName }}.fileName ? {{ parameter.VariableName }}.fileName : "{{ parameter.Name }}");
|
|
59
|
-
{%- endif -%}
|
|
60
|
-
{%- elsif parameter.IsDateOrDateTime -%}
|
|
61
|
-
content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toJSON());
|
|
62
|
-
{%- elsif parameter.IsObject -%}
|
|
63
|
-
content_.append("{{ parameter.Name }}", JSON.stringify({{ parameter.VariableName }}));
|
|
64
|
-
{%- elsif parameter.IsArray -%}
|
|
65
|
-
{{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.toString()));
|
|
66
|
-
{%- else -%}
|
|
67
|
-
content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toString());
|
|
68
|
-
{%- endif -%}
|
|
69
|
-
{%- endfor -%}
|
|
70
|
-
{%- endif -%}
|
|
71
|
-
{%- else -%}
|
|
72
|
-
{%- if operation.HasContent -%}
|
|
73
|
-
{%- if operation.HasBinaryBodyParameter -%}
|
|
74
|
-
const content_ = {{ operation.ContentParameter.VariableName }};
|
|
75
|
-
{%- elsif operation.HasXmlBodyParameter -%}
|
|
76
|
-
const content_ = {{ operation.ContentParameter.VariableName }};
|
|
77
|
-
{% elsif operation.Consumes == "application/x-www-form-urlencoded" -%}
|
|
78
|
-
const content_ = Object.keys({{ operation.ContentParameter.VariableName }} as any).map((key) => {
|
|
79
|
-
return encodeURIComponent(key) + '=' + encodeURIComponent(({{ operation.ContentParameter.VariableName }} as any)[key]);
|
|
80
|
-
}).join('&')
|
|
81
|
-
{%- elsif operation.HasPlainTextBodyParameter -%}
|
|
82
|
-
const content_ = {{ operation.ContentParameter.VariableName }};
|
|
83
|
-
{%- else -%}
|
|
84
|
-
const content_ = JSON.stringify({{ operation.ContentParameter.VariableName }});
|
|
85
|
-
{%- endif -%}
|
|
86
|
-
{%- else -%}
|
|
87
|
-
const content_ = undefined;
|
|
88
|
-
{%- endif -%}
|
|
89
|
-
{%- endif -%}
|
|
1
|
+
{%- if operation.HasFormParameters -%}
|
|
2
|
+
{%- if operation.ConsumesFormUrlEncoded -%}
|
|
3
|
+
let content_ = "";
|
|
4
|
+
{%- for parameter in operation.FormParameters -%}
|
|
5
|
+
{%- if parameter.IsRequired -%}
|
|
6
|
+
{%- if parameter.IsNullable -%}
|
|
7
|
+
if ({{ parameter.VariableName }} === undefined)
|
|
8
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
|
|
9
|
+
else
|
|
10
|
+
{%- else -%}
|
|
11
|
+
if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
|
|
12
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
|
|
13
|
+
else
|
|
14
|
+
{%- endif -%}
|
|
15
|
+
{%- else -%}
|
|
16
|
+
{%- if parameter.IsNullable -%}
|
|
17
|
+
if ({{ parameter.VariableName }} !== undefined)
|
|
18
|
+
{%- else -%}
|
|
19
|
+
if ({{ parameter.VariableName }} === null)
|
|
20
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
|
|
21
|
+
else if ({{ parameter.VariableName }} !== undefined)
|
|
22
|
+
{%- endif -%}
|
|
23
|
+
{%- endif -%}
|
|
24
|
+
{%- if parameter.IsDateOrDateTimeArray -%}
|
|
25
|
+
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent(item_ ? "" + item_.toJSON() : "null") + "&"; });
|
|
26
|
+
{%- elsif parameter.IsObjectArray -%}
|
|
27
|
+
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item_, index_) => {
|
|
28
|
+
for (const attr_ in item_) {
|
|
29
|
+
if (item_.hasOwnProperty(attr_)) {
|
|
30
|
+
content_ += encodeURIComponent("{{ parameter.Name }}[" + index_ + "]." + attr_) + "=" + encodeURIComponent("" + (item_ as any)[attr_]) + "&";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
{%- elsif parameter.IsDateOrDateTime -%}
|
|
35
|
+
content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.toJSON() : "{{ QueryNullValue }}") + "&";
|
|
36
|
+
{%- elsif parameter.IsArray -%}
|
|
37
|
+
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + item) + "&"; });
|
|
38
|
+
{%- else -%}
|
|
39
|
+
content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
|
|
40
|
+
{%- endif -%}
|
|
41
|
+
{%- endfor -%}
|
|
42
|
+
content_ = content_.replace(/&$/, "");
|
|
43
|
+
|
|
44
|
+
{%- else -%}
|
|
45
|
+
const content_ = new FormData();
|
|
46
|
+
{% for parameter in operation.FormParameters -%}
|
|
47
|
+
{%- if parameter.IsNullable -%}
|
|
48
|
+
if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
|
|
49
|
+
{%- else -%}
|
|
50
|
+
if ({{ parameter.VariableName }} === null || {{ parameter.VariableName }} === undefined)
|
|
51
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
|
|
52
|
+
else
|
|
53
|
+
{%- endif -%}
|
|
54
|
+
{%- if parameter.IsFile -%}
|
|
55
|
+
{%- if parameter.IsArray -%}
|
|
56
|
+
{{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.data, item_.fileName ? item_.fileName : "{{ parameter.Name }}") );
|
|
57
|
+
{%- else -%}
|
|
58
|
+
content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.data, {{ parameter.VariableName }}.fileName ? {{ parameter.VariableName }}.fileName : "{{ parameter.Name }}");
|
|
59
|
+
{%- endif -%}
|
|
60
|
+
{%- elsif parameter.IsDateOrDateTime -%}
|
|
61
|
+
content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toJSON());
|
|
62
|
+
{%- elsif parameter.IsObject -%}
|
|
63
|
+
content_.append("{{ parameter.Name }}", JSON.stringify({{ parameter.VariableName }}));
|
|
64
|
+
{%- elsif parameter.IsArray -%}
|
|
65
|
+
{{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.toString()));
|
|
66
|
+
{%- else -%}
|
|
67
|
+
content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toString());
|
|
68
|
+
{%- endif -%}
|
|
69
|
+
{%- endfor -%}
|
|
70
|
+
{%- endif -%}
|
|
71
|
+
{%- else -%}
|
|
72
|
+
{%- if operation.HasContent -%}
|
|
73
|
+
{%- if operation.HasBinaryBodyParameter -%}
|
|
74
|
+
const content_ = {{ operation.ContentParameter.VariableName }};
|
|
75
|
+
{%- elsif operation.HasXmlBodyParameter -%}
|
|
76
|
+
const content_ = {{ operation.ContentParameter.VariableName }};
|
|
77
|
+
{% elsif operation.Consumes == "application/x-www-form-urlencoded" -%}
|
|
78
|
+
const content_ = Object.keys({{ operation.ContentParameter.VariableName }} as any).map((key) => {
|
|
79
|
+
return encodeURIComponent(key) + '=' + encodeURIComponent(({{ operation.ContentParameter.VariableName }} as any)[key]);
|
|
80
|
+
}).join('&')
|
|
81
|
+
{%- elsif operation.HasPlainTextBodyParameter -%}
|
|
82
|
+
const content_ = {{ operation.ContentParameter.VariableName }};
|
|
83
|
+
{%- else -%}
|
|
84
|
+
const content_ = JSON.stringify({{ operation.ContentParameter.VariableName }});
|
|
85
|
+
{%- endif -%}
|
|
86
|
+
{%- else -%}
|
|
87
|
+
const content_ = undefined;
|
|
88
|
+
{%- endif -%}
|
|
89
|
+
{%- endif -%}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
let url_ = this.baseUrl + "/{{ operation.Path }}{% if operation.HasQueryParameters %}?{% endif %}";
|
|
2
|
-
{% for parameter in operation.PathParameters -%}
|
|
3
|
-
{% if parameter.IsRequired -%}
|
|
4
|
-
if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
|
|
5
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
|
|
6
|
-
{% else -%}
|
|
7
|
-
if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
|
|
8
|
-
{% endif -%}
|
|
9
|
-
{% if parameter.IsDateOrDateTimeArray -%}
|
|
10
|
-
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.map(s_ => s_ ? s_.{{ parameter.GetDateTimeToString }} : "null").join()));
|
|
11
|
-
{% elsif parameter.IsDateOrDateTime -%}
|
|
12
|
-
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "null"));
|
|
13
|
-
{% elsif parameter.IsArray -%}
|
|
14
|
-
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.join()));
|
|
15
|
-
{% else -%}
|
|
16
|
-
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent("" + {{ parameter.VariableName }}));
|
|
17
|
-
{% endif -%}
|
|
18
|
-
{% if parameter.IsOptional -%}
|
|
19
|
-
else
|
|
20
|
-
url_ = url_.replace("/{{ "{" }}{{ parameter.Name }}}", "");
|
|
21
|
-
{% endif -%}
|
|
22
|
-
{% endfor -%}
|
|
23
|
-
{% for parameter in operation.QueryParameters -%}
|
|
24
|
-
{% if parameter.IsRequired -%}
|
|
25
|
-
{% if parameter.IsNullable -%}
|
|
26
|
-
if ({{ parameter.VariableName }} === undefined)
|
|
27
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
|
|
28
|
-
else if({{ parameter.VariableName }} !== null)
|
|
29
|
-
{% else -%}
|
|
30
|
-
if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
|
|
31
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
|
|
32
|
-
else
|
|
33
|
-
{% endif -%}
|
|
34
|
-
{% else -%}
|
|
35
|
-
{% if parameter.IsNullable -%}
|
|
36
|
-
if ({{ parameter.VariableName }} !== undefined && {{ parameter.VariableName }} !== null)
|
|
37
|
-
{% else -%}
|
|
38
|
-
if ({{ parameter.VariableName }} === null)
|
|
39
|
-
throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
|
|
40
|
-
else if ({{ parameter.VariableName }} !== undefined)
|
|
41
|
-
{% endif -%}
|
|
42
|
-
{% endif -%}
|
|
43
|
-
{% if parameter.IsDateOrDateTimeArray -%}
|
|
44
|
-
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + item_.{{ parameter.GetDateTimeToString }} : "null") + "&"; });
|
|
45
|
-
{% elsif parameter.IsObjectArray -%}
|
|
46
|
-
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item, index) => {
|
|
47
|
-
for (const attr in item)
|
|
48
|
-
if (item.hasOwnProperty(attr)) {
|
|
49
|
-
url_ += "{{ parameter.Name }}[" + index + "]." + attr + "=" + encodeURIComponent("" + (item as any)[attr]) + "&";
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
{% elsif parameter.IsDateOrDateTime -%}
|
|
53
|
-
url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "{{ QueryNullValue }}") + "&";
|
|
54
|
-
{% elsif parameter.IsArray -%}
|
|
55
|
-
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + item) + "&"; });
|
|
56
|
-
{% else -%}
|
|
57
|
-
url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
|
|
58
|
-
{% endif -%}
|
|
59
|
-
{% endfor -%}
|
|
1
|
+
let url_ = this.baseUrl + "/{{ operation.Path }}{% if operation.HasQueryParameters %}?{% endif %}";
|
|
2
|
+
{% for parameter in operation.PathParameters -%}
|
|
3
|
+
{% if parameter.IsRequired -%}
|
|
4
|
+
if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
|
|
5
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
|
|
6
|
+
{% else -%}
|
|
7
|
+
if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
|
|
8
|
+
{% endif -%}
|
|
9
|
+
{% if parameter.IsDateOrDateTimeArray -%}
|
|
10
|
+
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.map(s_ => s_ ? s_.{{ parameter.GetDateTimeToString }} : "null").join()));
|
|
11
|
+
{% elsif parameter.IsDateOrDateTime -%}
|
|
12
|
+
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "null"));
|
|
13
|
+
{% elsif parameter.IsArray -%}
|
|
14
|
+
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.join()));
|
|
15
|
+
{% else -%}
|
|
16
|
+
url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent("" + {{ parameter.VariableName }}));
|
|
17
|
+
{% endif -%}
|
|
18
|
+
{% if parameter.IsOptional -%}
|
|
19
|
+
else
|
|
20
|
+
url_ = url_.replace("/{{ "{" }}{{ parameter.Name }}}", "");
|
|
21
|
+
{% endif -%}
|
|
22
|
+
{% endfor -%}
|
|
23
|
+
{% for parameter in operation.QueryParameters -%}
|
|
24
|
+
{% if parameter.IsRequired -%}
|
|
25
|
+
{% if parameter.IsNullable -%}
|
|
26
|
+
if ({{ parameter.VariableName }} === undefined)
|
|
27
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
|
|
28
|
+
else if({{ parameter.VariableName }} !== null)
|
|
29
|
+
{% else -%}
|
|
30
|
+
if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
|
|
31
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
|
|
32
|
+
else
|
|
33
|
+
{% endif -%}
|
|
34
|
+
{% else -%}
|
|
35
|
+
{% if parameter.IsNullable -%}
|
|
36
|
+
if ({{ parameter.VariableName }} !== undefined && {{ parameter.VariableName }} !== null)
|
|
37
|
+
{% else -%}
|
|
38
|
+
if ({{ parameter.VariableName }} === null)
|
|
39
|
+
throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
|
|
40
|
+
else if ({{ parameter.VariableName }} !== undefined)
|
|
41
|
+
{% endif -%}
|
|
42
|
+
{% endif -%}
|
|
43
|
+
{% if parameter.IsDateOrDateTimeArray -%}
|
|
44
|
+
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + item_.{{ parameter.GetDateTimeToString }} : "null") + "&"; });
|
|
45
|
+
{% elsif parameter.IsObjectArray -%}
|
|
46
|
+
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item, index) => {
|
|
47
|
+
for (const attr in item)
|
|
48
|
+
if (item.hasOwnProperty(attr)) {
|
|
49
|
+
url_ += "{{ parameter.Name }}[" + index + "]." + attr + "=" + encodeURIComponent("" + (item as any)[attr]) + "&";
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
{% elsif parameter.IsDateOrDateTime -%}
|
|
53
|
+
url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "{{ QueryNullValue }}") + "&";
|
|
54
|
+
{% elsif parameter.IsArray -%}
|
|
55
|
+
{{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + item) + "&"; });
|
|
56
|
+
{% else -%}
|
|
57
|
+
url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
|
|
58
|
+
{% endif -%}
|
|
59
|
+
{% endfor -%}
|
|
60
60
|
url_ = url_.replace(/[?&]$/, "");
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{% if IsNewableObject -%}
|
|
2
|
-
{% if CheckNewableObject -%}
|
|
3
|
-
{{ Variable }} = {{ Value }} ? {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %}) : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
4
|
-
{% else -%}
|
|
5
|
-
{{ Variable }} = {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %});
|
|
6
|
-
{% endif -%}
|
|
7
|
-
{% elsif IsArray -%}
|
|
8
|
-
if (Array.isArray({{ Value }})) {
|
|
9
|
-
{{ Variable }} = [] as any;
|
|
10
|
-
for (let item of {{ Value }})
|
|
11
|
-
{% if IsArrayItemNewableObject -%}
|
|
12
|
-
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ ArrayItemType }}.fromJS(item{% if HandleReferences %}, _mappings{% endif %}));
|
|
13
|
-
{% else -%}
|
|
14
|
-
{% if IsArrayItemDate -%}
|
|
15
|
-
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ StringToDateOnlyCode }}(item));
|
|
16
|
-
{% elsif IsArrayItemDateTime -%}
|
|
17
|
-
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ StringToDateCode }}(item));
|
|
18
|
-
{% else -%}
|
|
19
|
-
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push(item);
|
|
20
|
-
{% endif -%}
|
|
21
|
-
{% endif -%}
|
|
22
|
-
}
|
|
23
|
-
{% if NullValue != "undefined" %}else {
|
|
24
|
-
{{ Variable }} = <any>{{ NullValue }};
|
|
25
|
-
}
|
|
26
|
-
{% endif -%}
|
|
27
|
-
{% elsif IsDictionary -%}
|
|
28
|
-
if ({{ Value }}) {
|
|
29
|
-
{{ Variable }} = {} as any;
|
|
30
|
-
for (let key in {{ Value }}) {
|
|
31
|
-
if ({{ Value }}.hasOwnProperty(key))
|
|
32
|
-
{% if IsDictionaryValueNewableObject -%}
|
|
33
|
-
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ DictionaryValueType }}.fromJS({{ Value }}[key]{% if HandleReferences %}, _mappings{% endif %}) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
34
|
-
{% elsif IsDictionaryValueNewableArray -%}
|
|
35
|
-
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ Value }}[key].map((i: any) => {{ DictionaryValueArrayItemType }}.fromJS(i{% if HandleReferences %}, _mappings{% endif %})) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
36
|
-
{% elsif IsDictionaryValueDate -%}
|
|
37
|
-
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ StringToDateOnlyCode }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
38
|
-
{% elsif IsDictionaryValueDateTime -%}
|
|
39
|
-
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ StringToDateCode }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
40
|
-
{% else -%}
|
|
41
|
-
{% if HasDictionaryValueDefaultValue or NullValue != "undefined" -%}
|
|
42
|
-
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] !== undefined ? {{ Value }}[key] : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
43
|
-
{% else -%}
|
|
44
|
-
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key];
|
|
45
|
-
{% endif -%}
|
|
46
|
-
{% endif -%}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
{% if NullValue != "undefined" %}else {
|
|
50
|
-
{{ Variable }} = <any>{{ NullValue }};
|
|
51
|
-
}
|
|
52
|
-
{% endif -%}
|
|
53
|
-
{% else -%}
|
|
54
|
-
{% if IsDate -%}
|
|
55
|
-
{{ Variable }} = {{ Value }} ? {{ StringToDateOnlyCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateOnlyCode }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
|
|
56
|
-
{% elsif IsDateTime -%}
|
|
57
|
-
{{ Variable }} = {{ Value }} ? {{ StringToDateCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateCode }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
|
|
58
|
-
{% else -%}
|
|
59
|
-
{% if HasDefaultValue or NullValue != "undefined" -%}
|
|
60
|
-
{{ Variable }} = {{ Value }} !== undefined ? {{ Value }} : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
61
|
-
{% else -%}
|
|
62
|
-
{{ Variable }} = {{ Value }};
|
|
63
|
-
{% endif -%}
|
|
64
|
-
{% endif -%}
|
|
65
|
-
{% endif -%}
|
|
1
|
+
{% if IsNewableObject -%}
|
|
2
|
+
{% if CheckNewableObject -%}
|
|
3
|
+
{{ Variable }} = {{ Value }} ? {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %}) : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
4
|
+
{% else -%}
|
|
5
|
+
{{ Variable }} = {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %});
|
|
6
|
+
{% endif -%}
|
|
7
|
+
{% elsif IsArray -%}
|
|
8
|
+
if (Array.isArray({{ Value }})) {
|
|
9
|
+
{{ Variable }} = [] as any;
|
|
10
|
+
for (let item of {{ Value }})
|
|
11
|
+
{% if IsArrayItemNewableObject -%}
|
|
12
|
+
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ ArrayItemType }}.fromJS(item{% if HandleReferences %}, _mappings{% endif %}));
|
|
13
|
+
{% else -%}
|
|
14
|
+
{% if IsArrayItemDate -%}
|
|
15
|
+
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ StringToDateOnlyCode }}(item));
|
|
16
|
+
{% elsif IsArrayItemDateTime -%}
|
|
17
|
+
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ StringToDateCode }}(item));
|
|
18
|
+
{% else -%}
|
|
19
|
+
{{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push(item);
|
|
20
|
+
{% endif -%}
|
|
21
|
+
{% endif -%}
|
|
22
|
+
}
|
|
23
|
+
{% if NullValue != "undefined" %}else {
|
|
24
|
+
{{ Variable }} = <any>{{ NullValue }};
|
|
25
|
+
}
|
|
26
|
+
{% endif -%}
|
|
27
|
+
{% elsif IsDictionary -%}
|
|
28
|
+
if ({{ Value }}) {
|
|
29
|
+
{{ Variable }} = {} as any;
|
|
30
|
+
for (let key in {{ Value }}) {
|
|
31
|
+
if ({{ Value }}.hasOwnProperty(key))
|
|
32
|
+
{% if IsDictionaryValueNewableObject -%}
|
|
33
|
+
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ DictionaryValueType }}.fromJS({{ Value }}[key]{% if HandleReferences %}, _mappings{% endif %}) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
34
|
+
{% elsif IsDictionaryValueNewableArray -%}
|
|
35
|
+
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ Value }}[key].map((i: any) => {{ DictionaryValueArrayItemType }}.fromJS(i{% if HandleReferences %}, _mappings{% endif %})) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
36
|
+
{% elsif IsDictionaryValueDate -%}
|
|
37
|
+
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ StringToDateOnlyCode }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
38
|
+
{% elsif IsDictionaryValueDateTime -%}
|
|
39
|
+
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ StringToDateCode }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
40
|
+
{% else -%}
|
|
41
|
+
{% if HasDictionaryValueDefaultValue or NullValue != "undefined" -%}
|
|
42
|
+
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] !== undefined ? {{ Value }}[key] : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
43
|
+
{% else -%}
|
|
44
|
+
(<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key];
|
|
45
|
+
{% endif -%}
|
|
46
|
+
{% endif -%}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
{% if NullValue != "undefined" %}else {
|
|
50
|
+
{{ Variable }} = <any>{{ NullValue }};
|
|
51
|
+
}
|
|
52
|
+
{% endif -%}
|
|
53
|
+
{% else -%}
|
|
54
|
+
{% if IsDate -%}
|
|
55
|
+
{{ Variable }} = {{ Value }} ? {{ StringToDateOnlyCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateOnlyCode }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
|
|
56
|
+
{% elsif IsDateTime -%}
|
|
57
|
+
{{ Variable }} = {{ Value }} ? {{ StringToDateCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateCode }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
|
|
58
|
+
{% else -%}
|
|
59
|
+
{% if HasDefaultValue or NullValue != "undefined" -%}
|
|
60
|
+
{{ Variable }} = {{ Value }} !== undefined ? {{ Value }} : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
|
|
61
|
+
{% else -%}
|
|
62
|
+
{{ Variable }} = {{ Value }};
|
|
63
|
+
{% endif -%}
|
|
64
|
+
{% endif -%}
|
|
65
|
+
{% endif -%}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function formatDate(d: Date) {
|
|
2
|
-
return d.getFullYear() + '-' +
|
|
3
|
-
(d.getMonth() < 9 ? ('0' + (d.getMonth()+1)) : (d.getMonth()+1)) + '-' +
|
|
4
|
-
(d.getDate() < 10 ? ('0' + d.getDate()) : d.getDate());
|
|
1
|
+
function formatDate(d: Date) {
|
|
2
|
+
return d.getFullYear() + '-' +
|
|
3
|
+
(d.getMonth() < 9 ? ('0' + (d.getMonth()+1)) : (d.getMonth()+1)) + '-' +
|
|
4
|
+
(d.getDate() < 10 ? ('0' + d.getDate()) : d.getDate());
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function parseDateOnly(s: string) {
|
|
2
|
-
const date = new Date(s);
|
|
3
|
-
return new Date(date.getTime() +
|
|
4
|
-
date.getTimezoneOffset() * 60000);
|
|
1
|
+
function parseDateOnly(s: string) {
|
|
2
|
+
const date = new Date(s);
|
|
3
|
+
return new Date(date.getTime() +
|
|
4
|
+
date.getTimezoneOffset() * 60000);
|
|
5
5
|
}
|
package/button/README.md
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
# Entry Button
|
|
2
|
-
|
|
3
|
-
Simple way of providing mat button type and color for material buttons that are used in other entry components e.g. dialog or form.
|
|
4
|
-
|
|
5
|
-
Allows projects to specify which type: flat, raised or basic, to use for a submit or cancel button.
|
|
6
|
-
|
|
7
|
-
## Integration
|
|
8
|
-
|
|
9
|
-
```npm
|
|
10
|
-
npm i @enigmatry/entry-components
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Import component module:
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Basic usage
|
|
21
|
-
|
|
22
|
-
Provide configuration for submit or cancel button in feature or shared module.
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { EntryButtonModule, provideEntryButtonConfig } from '@enigmatry/entry-components/button';
|
|
26
|
-
|
|
27
|
-
@NgModule({
|
|
28
|
-
declarations: [],
|
|
29
|
-
imports: [],
|
|
30
|
-
exports: [],
|
|
31
|
-
providers: [
|
|
32
|
-
provideEntryButtonConfig({
|
|
33
|
-
submit: { type: 'raised', color: 'primary' },
|
|
34
|
-
cancel: { type: 'basic' }
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
})
|
|
38
|
-
export class SharedModule { }
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Apply the directive entry-submit-button or entry-cancel-button on a button instead of mat-flat-button or mat-raised-button.
|
|
42
|
-
|
|
43
|
-
```html
|
|
44
|
-
<button mat-button entry-submit-button>Submit</button>
|
|
45
|
-
<button mat-button entry-cancel-button>Cancel</button>
|
|
1
|
+
# Entry Button
|
|
2
|
+
|
|
3
|
+
Simple way of providing mat button type and color for material buttons that are used in other entry components e.g. dialog or form.
|
|
4
|
+
|
|
5
|
+
Allows projects to specify which type: flat, raised or basic, to use for a submit or cancel button.
|
|
6
|
+
|
|
7
|
+
## Integration
|
|
8
|
+
|
|
9
|
+
```npm
|
|
10
|
+
npm i @enigmatry/entry-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import component module:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Basic usage
|
|
21
|
+
|
|
22
|
+
Provide configuration for submit or cancel button in feature or shared module.
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { EntryButtonModule, provideEntryButtonConfig } from '@enigmatry/entry-components/button';
|
|
26
|
+
|
|
27
|
+
@NgModule({
|
|
28
|
+
declarations: [],
|
|
29
|
+
imports: [],
|
|
30
|
+
exports: [],
|
|
31
|
+
providers: [
|
|
32
|
+
provideEntryButtonConfig({
|
|
33
|
+
submit: { type: 'raised', color: 'primary' },
|
|
34
|
+
cancel: { type: 'basic' }
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
export class SharedModule { }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Apply the directive entry-submit-button or entry-cancel-button on a button instead of mat-flat-button or mat-raised-button.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<button mat-button entry-submit-button>Submit</button>
|
|
45
|
+
<button mat-button entry-cancel-button>Cancel</button>
|
|
46
46
|
```
|