@seniorsistemas/angular-components 14.9.14 → 14.10.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/angular-components.module.d.ts +2 -1
- package/bundles/seniorsistemas-angular-components.umd.js +1516 -23
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/code-editor/core/facades/core-facade.d.ts +32 -0
- package/components/code-editor/core/facades/linter-facade.d.ts +4 -0
- package/components/code-editor/core/models/enums/marker-severity.d.ts +5 -0
- package/components/code-editor/core/models/index.d.ts +2 -0
- package/components/code-editor/core/models/interfaces/marker.d.ts +7 -0
- package/components/code-editor/core/use-cases/core-linters.d.ts +6 -0
- package/components/code-editor/index.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.d.ts +26 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-empty-state.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-loading-state.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper.d.ts +15 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/index.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.service.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/base-configs.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/grammar.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/completion-types.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/enum-type-order.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/keywords.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/meta-type.d.ts +17 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/request-types.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/index.d.ts +19 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/completion-Item.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/facade-metadata-name.d.ts +5 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/fields-order-by.d.ts +5 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/get-facade-metadata-by-path.d.ts +9 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-context-metadata-by-id.d.ts +9 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-expression-metadata.d.ts +11 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-facade-metadata-names.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-expression-metadata.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-context-metadata.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-facade-metadata.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-field-metadata.d.ts +7 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-page-request.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/safe-http-communication.d.ts +12 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/tax-calculation-configs.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation-language-configs.d.ts +7 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation.language.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-language-configs.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-safe-response.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/index.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/models/index.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/models/types/diagnostic-severity.d.ts +1 -0
- package/components/code-editor/infra/cores/codemirror-6/models/types/editor-theme.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/editor-themes.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/autocomplete-tooltip.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/font-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/line-counter.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/scrollbars.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-highlight-style.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-theme.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/utils/convert-markers-to-diagnostics.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/utils/index.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/utils/is-current-position-inside-string.d.ts +1 -0
- package/components/code-editor/infra/utils/custom-http-client/custom-http-client.d.ts +34 -0
- package/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-blob-response.d.ts +6 -0
- package/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-json-response.d.ts +6 -0
- package/components/code-editor/infra/utils/custom-http-client/json-response-formatters/index.d.ts +2 -0
- package/components/code-editor/infra/utils/custom-translations/custom-translations-service.d.ts +25 -0
- package/components/code-editor/infra/utils/custom-translations/custom-translations.module.d.ts +12 -0
- package/components/code-editor/infra/utils/custom-translations/index.d.ts +2 -0
- package/components/code-editor/infra/utils/custom-translations/models/index.d.ts +1 -0
- package/components/code-editor/infra/utils/custom-translations/models/interfaces/translations.d.ts +5 -0
- package/components/code-editor/infra/utils/index.d.ts +2 -0
- package/components/code-editor/models/enums/languages.d.ts +3 -0
- package/components/code-editor/models/enums/themes.d.ts +3 -0
- package/components/code-editor/models/index.d.ts +3 -0
- package/components/code-editor/models/interfaces/editor-options.d.ts +5 -0
- package/components/code-editor/presentation/code-editor-component.d.ts +21 -0
- package/components/code-editor/presentation/code-editor-module.d.ts +2 -0
- package/esm2015/angular-components.module.js +4 -3
- package/esm2015/components/code-editor/core/facades/core-facade.js +85 -0
- package/esm2015/components/code-editor/core/facades/linter-facade.js +1 -0
- package/esm2015/components/code-editor/core/models/enums/marker-severity.js +7 -0
- package/esm2015/components/code-editor/core/models/index.js +3 -0
- package/esm2015/components/code-editor/core/models/interfaces/marker.js +1 -0
- package/esm2015/components/code-editor/core/use-cases/core-linters.js +9 -0
- package/esm2015/components/code-editor/index.js +5 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.js +97 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.js +15 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-empty-state.js +29 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-loading-state.js +29 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper-style.js +17 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper.js +75 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/index.js +4 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-style.js +35 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.js +341 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.service.js +34 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/base-configs.js +18 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/grammar.js +37 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/completion-types.js +10 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/enum-type-order.js +8 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/keywords.js +12 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/meta-type.js +34 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/request-types.js +8 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/index.js +7 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/completion-Item.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/facade-metadata-name.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/fields-order-by.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/get-facade-metadata-by-path.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-context-metadata-by-id.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-expression-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-facade-metadata-names.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-expression-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-context-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-facade-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-field-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-page-request.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/safe-http-communication.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/tax-calculation-configs.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation-language-configs.js +10 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation.language.js +9 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-language-configs.js +15 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-safe-response.js +16 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/index.js +3 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/models/types/diagnostic-severity.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/models/types/editor-theme.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/editor-themes.js +15 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/autocomplete-tooltip.js +61 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/font-style.js +29 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/line-counter.js +25 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/scrollbars.js +18 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-highlight-style.js +16 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.js +13 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-theme.js +22 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/utils/convert-markers-to-diagnostics.js +18 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/utils/index.js +3 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/utils/is-current-position-inside-string.js +6 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/custom-http-client.js +80 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-blob-response.js +13 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-json-response.js +12 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/json-response-formatters/index.js +3 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/custom-translations-service.js +37 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/custom-translations.module.js +30 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/index.js +3 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/models/interfaces/translations.js +1 -0
- package/esm2015/components/code-editor/infra/utils/index.js +3 -0
- package/esm2015/components/code-editor/models/enums/languages.js +5 -0
- package/esm2015/components/code-editor/models/enums/themes.js +5 -0
- package/esm2015/components/code-editor/models/index.js +4 -0
- package/esm2015/components/code-editor/models/interfaces/editor-options.js +1 -0
- package/esm2015/components/code-editor/presentation/code-editor-component.js +91 -0
- package/esm2015/components/code-editor/presentation/code-editor-module.js +27 -0
- package/esm2015/components/table/table-column/table-columns.component.js +4 -3
- package/esm2015/public-api.js +2 -1
- package/esm2015/seniorsistemas-angular-components.js +5 -1
- package/esm5/angular-components.module.js +4 -3
- package/esm5/components/code-editor/core/facades/core-facade.js +96 -0
- package/esm5/components/code-editor/core/facades/linter-facade.js +1 -0
- package/esm5/components/code-editor/core/models/enums/marker-severity.js +7 -0
- package/esm5/components/code-editor/core/models/index.js +3 -0
- package/esm5/components/code-editor/core/models/interfaces/marker.js +1 -0
- package/esm5/components/code-editor/core/use-cases/core-linters.js +13 -0
- package/esm5/components/code-editor/index.js +5 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.js +109 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.js +19 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-empty-state.js +29 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-loading-state.js +29 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper-style.js +17 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper.js +68 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/index.js +4 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-style.js +35 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.js +355 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.service.js +46 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/base-configs.js +19 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/grammar.js +2 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/completion-types.js +10 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/enum-type-order.js +8 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/keywords.js +12 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/meta-type.js +34 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/request-types.js +8 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/index.js +7 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/completion-Item.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/facade-metadata-name.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/fields-order-by.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/get-facade-metadata-by-path.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-context-metadata-by-id.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-expression-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-facade-metadata-names.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-expression-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-context-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-facade-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-field-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-page-request.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/safe-http-communication.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/tax-calculation-configs.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation-language-configs.js +14 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation.language.js +9 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-language-configs.js +15 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-safe-response.js +27 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/index.js +3 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/models/index.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/models/types/diagnostic-severity.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/models/types/editor-theme.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/editor-themes.js +19 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/autocomplete-tooltip.js +61 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/font-style.js +30 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/line-counter.js +25 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/scrollbars.js +18 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-highlight-style.js +16 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.js +13 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-theme.js +22 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/utils/convert-markers-to-diagnostics.js +18 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/utils/index.js +3 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/utils/is-current-position-inside-string.js +6 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/custom-http-client.js +126 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-blob-response.js +21 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-json-response.js +14 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/json-response-formatters/index.js +3 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/custom-translations-service.js +41 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/custom-translations.module.js +31 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/index.js +3 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/models/index.js +1 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/models/interfaces/translations.js +1 -0
- package/esm5/components/code-editor/infra/utils/index.js +3 -0
- package/esm5/components/code-editor/models/enums/languages.js +5 -0
- package/esm5/components/code-editor/models/enums/themes.js +5 -0
- package/esm5/components/code-editor/models/index.js +4 -0
- package/esm5/components/code-editor/models/interfaces/editor-options.js +1 -0
- package/esm5/components/code-editor/presentation/code-editor-component.js +101 -0
- package/esm5/components/code-editor/presentation/code-editor-module.js +30 -0
- package/esm5/components/table/table-column/table-columns.component.js +4 -3
- package/esm5/public-api.js +2 -1
- package/esm5/seniorsistemas-angular-components.js +5 -1
- package/fesm2015/seniorsistemas-angular-components.js +1437 -41
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +1537 -42
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +11 -2
- package/public-api.d.ts +1 -0
- package/seniorsistemas-angular-components.d.ts +4 -0
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/dom'), require('primeng/calendar'), require('@angular/animations'), require('@angular/forms'), require('@angular/common/http'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('@seniorsistemas/ng2-currency-mask'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('@angular/platform-browser'), require('primeng/progressbar'), require('@ngx-translate/core'), require('cropperjs'), require('element-resize-detector'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/dom', 'primeng/calendar', '@angular/animations', '@angular/forms', '@angular/common/http', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', '@seniorsistemas/ng2-currency-mask', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', '@angular/platform-browser', 'primeng/progressbar', '@ngx-translate/core', 'cropperjs', 'element-resize-detector', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar'], factory) :
|
|
4
|
-
(global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.tieredmenu, global.tooltip, global.dom, global.calendar, global.ng.animations, global.ng.forms, global.ng.common.http, global.angular2Hotkeys, global.BigNumber, global.autocomplete, global.dialog, global.table, global.ng2CurrencyMask, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.ng.platformBrowser, global.progressbar, global.core$1, global.Cropper, global.elementResizeDetectorMaker_, global.ng.cdk.a11y, global.scrollpanel, global.sidebar));
|
|
5
|
-
}(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, tieredmenu, tooltip, dom, calendar, animations, forms, http, angular2Hotkeys, BigNumber, autocomplete, dialog, table, ng2CurrencyMask, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, platformBrowser, progressbar, core$1, Cropper, elementResizeDetectorMaker_, a11y, scrollpanel, sidebar) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('primeng/breadcrumb'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('primeng/tieredmenu'), require('primeng/tooltip'), require('primeng/dom'), require('primeng/calendar'), require('@angular/animations'), require('@angular/forms'), require('@angular/common/http'), require('angular2-hotkeys'), require('bignumber.js'), require('primeng/autocomplete'), require('primeng/dialog'), require('primeng/table'), require('@seniorsistemas/ng2-currency-mask'), require('@seniorsistemas/senior-platform-data'), require('moment'), require('ngx-cookie-service'), require('ng2-currency-mask'), require('primeng/button'), require('primeng/checkbox'), require('primeng/chips'), require('primeng/dropdown'), require('primeng/fieldset'), require('primeng/inputmask'), require('primeng/inputtext'), require('primeng/inputtextarea'), require('primeng/keyfilter'), require('primeng/multiselect'), require('primeng/panel'), require('primeng/radiobutton'), require('@angular/platform-browser'), require('primeng/progressbar'), require('@ngx-translate/core'), require('cropperjs'), require('element-resize-detector'), require('@angular/cdk/a11y'), require('primeng/scrollpanel'), require('primeng/sidebar'), require('@codemirror/view'), require('@codemirror/state'), require('@codemirror/lint'), require('@codemirror/language'), require('@lezer/generator'), require('@codemirror/highlight'), require('@codemirror/autocomplete'), require('@codemirror/tooltip'), require('@codemirror/gutter')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@seniorsistemas/angular-components', ['exports', '@angular/core', '@angular/common', 'primeng/breadcrumb', '@angular/router', 'rxjs', 'rxjs/operators', 'primeng/tieredmenu', 'primeng/tooltip', 'primeng/dom', 'primeng/calendar', '@angular/animations', '@angular/forms', '@angular/common/http', 'angular2-hotkeys', 'bignumber.js', 'primeng/autocomplete', 'primeng/dialog', 'primeng/table', '@seniorsistemas/ng2-currency-mask', '@seniorsistemas/senior-platform-data', 'moment', 'ngx-cookie-service', 'ng2-currency-mask', 'primeng/button', 'primeng/checkbox', 'primeng/chips', 'primeng/dropdown', 'primeng/fieldset', 'primeng/inputmask', 'primeng/inputtext', 'primeng/inputtextarea', 'primeng/keyfilter', 'primeng/multiselect', 'primeng/panel', 'primeng/radiobutton', '@angular/platform-browser', 'primeng/progressbar', '@ngx-translate/core', 'cropperjs', 'element-resize-detector', '@angular/cdk/a11y', 'primeng/scrollpanel', 'primeng/sidebar', '@codemirror/view', '@codemirror/state', '@codemirror/lint', '@codemirror/language', '@lezer/generator', '@codemirror/highlight', '@codemirror/autocomplete', '@codemirror/tooltip', '@codemirror/gutter'], factory) :
|
|
4
|
+
(global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['angular-components'] = {}), global.ng.core, global.ng.common, global.breadcrumb, global.ng.router, global.rxjs, global.rxjs.operators, global.tieredmenu, global.tooltip, global.dom, global.calendar, global.ng.animations, global.ng.forms, global.ng.common.http, global.angular2Hotkeys, global.BigNumber, global.autocomplete$1, global.dialog, global.table, global.ng2CurrencyMask, global.seniorPlatformData, global.moment_, global.ngxCookieService, global.ng2CurrencyMask$1, global.button, global.checkbox, global.chips, global.dropdown, global.fieldset, global.inputmask, global.inputtext, global.inputtextarea, global.keyfilter, global.multiselect, global.panel, global.radiobutton, global.ng.platformBrowser, global.progressbar, global.core$1, global.Cropper, global.elementResizeDetectorMaker_, global.ng.cdk.a11y, global.scrollpanel, global.sidebar, global.view, global.state, global.lint, global.language, global.generator, global.highlight, global.autocomplete$2, global.tooltip$1, global.gutter));
|
|
5
|
+
}(this, (function (exports, core, common, breadcrumb, router, rxjs, operators, tieredmenu, tooltip, dom, calendar, animations, forms, http, angular2Hotkeys, BigNumber, autocomplete$1, dialog, table, ng2CurrencyMask, seniorPlatformData, moment_, ngxCookieService, ng2CurrencyMask$1, button, checkbox, chips, dropdown, fieldset, inputmask, inputtext, inputtextarea, keyfilter, multiselect, panel, radiobutton, platformBrowser, progressbar, core$1, Cropper, elementResizeDetectorMaker_, a11y, scrollpanel, sidebar, view, state, lint, language, generator, highlight, autocomplete$2, tooltip$1, gutter) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var BigNumber__default = 'default' in BigNumber ? BigNumber['default'] : BigNumber;
|
|
8
8
|
Cropper = Cropper && Object.prototype.hasOwnProperty.call(Cropper, 'default') ? Cropper['default'] : Cropper;
|
|
@@ -2505,7 +2505,7 @@
|
|
|
2505
2505
|
core.ViewChild(dialog.Dialog, { static: false })
|
|
2506
2506
|
], LookupComponent.prototype, "dialog", void 0);
|
|
2507
2507
|
__decorate([
|
|
2508
|
-
core.ViewChild(autocomplete.AutoComplete, { static: false })
|
|
2508
|
+
core.ViewChild(autocomplete$1.AutoComplete, { static: false })
|
|
2509
2509
|
], LookupComponent.prototype, "autocomplete", void 0);
|
|
2510
2510
|
LookupComponent = LookupComponent_1 = __decorate([
|
|
2511
2511
|
core.Component({
|
|
@@ -3877,6 +3877,29 @@
|
|
|
3877
3877
|
EnumBadgeColors["BLUE"] = "sds-semantic-blue";
|
|
3878
3878
|
})(exports.EnumBadgeColors || (exports.EnumBadgeColors = {}));
|
|
3879
3879
|
|
|
3880
|
+
var HostProjectConfigsInjectionToken = new core.InjectionToken("hostProjectConfigs");
|
|
3881
|
+
var AngularComponentsModule = /** @class */ (function () {
|
|
3882
|
+
function AngularComponentsModule() {
|
|
3883
|
+
}
|
|
3884
|
+
AngularComponentsModule_1 = AngularComponentsModule;
|
|
3885
|
+
AngularComponentsModule.forRoot = function (config) {
|
|
3886
|
+
return {
|
|
3887
|
+
ngModule: AngularComponentsModule_1,
|
|
3888
|
+
providers: [
|
|
3889
|
+
{
|
|
3890
|
+
provide: HostProjectConfigsInjectionToken,
|
|
3891
|
+
useValue: config
|
|
3892
|
+
}
|
|
3893
|
+
]
|
|
3894
|
+
};
|
|
3895
|
+
};
|
|
3896
|
+
var AngularComponentsModule_1;
|
|
3897
|
+
AngularComponentsModule = AngularComponentsModule_1 = __decorate([
|
|
3898
|
+
core.NgModule({})
|
|
3899
|
+
], AngularComponentsModule);
|
|
3900
|
+
return AngularComponentsModule;
|
|
3901
|
+
}());
|
|
3902
|
+
|
|
3880
3903
|
var TableColumnsComponent = /** @class */ (function () {
|
|
3881
3904
|
function TableColumnsComponent(viewContainerRef, translate, hostProjectConfigs) {
|
|
3882
3905
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -4068,7 +4091,7 @@
|
|
|
4068
4091
|
TableColumnsComponent.ctorParameters = function () { return [
|
|
4069
4092
|
{ type: core.ViewContainerRef },
|
|
4070
4093
|
{ type: core$1.TranslateService },
|
|
4071
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [
|
|
4094
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
4072
4095
|
]; };
|
|
4073
4096
|
__decorate([
|
|
4074
4097
|
core.ViewChild("columnsTemplate", { static: true })
|
|
@@ -4088,7 +4111,7 @@
|
|
|
4088
4111
|
selector: "s-table-columns",
|
|
4089
4112
|
styles: [":host{display:none}"]
|
|
4090
4113
|
}),
|
|
4091
|
-
__param(2, core.Inject(
|
|
4114
|
+
__param(2, core.Inject(HostProjectConfigsInjectionToken))
|
|
4092
4115
|
], TableColumnsComponent);
|
|
4093
4116
|
return TableColumnsComponent;
|
|
4094
4117
|
}());
|
|
@@ -4948,7 +4971,7 @@
|
|
|
4948
4971
|
LocalizedNumberInputModule,
|
|
4949
4972
|
ControlErrorsModule,
|
|
4950
4973
|
LocaleModule,
|
|
4951
|
-
autocomplete.AutoCompleteModule,
|
|
4974
|
+
autocomplete$1.AutoCompleteModule,
|
|
4952
4975
|
multiselect.MultiSelectModule,
|
|
4953
4976
|
button.ButtonModule,
|
|
4954
4977
|
ButtonModule,
|
|
@@ -7227,26 +7250,1489 @@
|
|
|
7227
7250
|
return GlobalSearchModule;
|
|
7228
7251
|
}());
|
|
7229
7252
|
|
|
7230
|
-
|
|
7231
|
-
|
|
7253
|
+
|
|
7254
|
+
(function (Languages) {
|
|
7255
|
+
Languages["TaxCalculation"] = "TaxCalculation";
|
|
7256
|
+
})(exports.Languages || (exports.Languages = {}));
|
|
7257
|
+
|
|
7258
|
+
|
|
7259
|
+
(function (Themes) {
|
|
7260
|
+
Themes["SDSLight"] = "SDSLight";
|
|
7261
|
+
})(exports.Themes || (exports.Themes = {}));
|
|
7262
|
+
|
|
7263
|
+
/* Enums */
|
|
7264
|
+
|
|
7265
|
+
var CoreLinters = /** @class */ (function () {
|
|
7266
|
+
function CoreLinters() {
|
|
7232
7267
|
}
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7268
|
+
CoreLinters.getLinter = function (language) {
|
|
7269
|
+
var languageLinterFactory = CoreLinters._LINTERS.get(language);
|
|
7270
|
+
if (languageLinterFactory)
|
|
7271
|
+
return languageLinterFactory();
|
|
7272
|
+
};
|
|
7273
|
+
CoreLinters._LINTERS = new Map([]);
|
|
7274
|
+
return CoreLinters;
|
|
7275
|
+
}());
|
|
7276
|
+
|
|
7277
|
+
var CoreFacade = /** @class */ (function () {
|
|
7278
|
+
function CoreFacade() {
|
|
7279
|
+
this.$onCoreFinishLoad = new rxjs.ReplaySubject(1);
|
|
7280
|
+
this.$onCodeChange = new rxjs.Subject();
|
|
7281
|
+
this.$onCodeValidityChange = new rxjs.Subject();
|
|
7282
|
+
this._completionItems = [];
|
|
7283
|
+
this._lastCodeEmitted = "";
|
|
7284
|
+
}
|
|
7285
|
+
CoreFacade.prototype.changeEditorOptions = function (options) {
|
|
7286
|
+
if (options) {
|
|
7287
|
+
if (typeof options !== "object")
|
|
7288
|
+
throw new Error("Editor's options must be an EditorOptions object");
|
|
7289
|
+
this.validateLanguage(options.language);
|
|
7290
|
+
this.validateTheme(options.theme);
|
|
7291
|
+
this.setLinter(options.language);
|
|
7292
|
+
this.setCoreEditorOptions(options);
|
|
7293
|
+
}
|
|
7294
|
+
};
|
|
7295
|
+
CoreFacade.prototype.changeCode = function (code) {
|
|
7296
|
+
var safeCode = this.getSafeCode(code);
|
|
7297
|
+
if (safeCode !== this._lastCodeEmitted) {
|
|
7298
|
+
this.setCode(safeCode);
|
|
7299
|
+
}
|
|
7300
|
+
};
|
|
7301
|
+
CoreFacade.prototype.getOnCoreFinishLoadObservable = function () {
|
|
7302
|
+
return this.$onCoreFinishLoad.asObservable();
|
|
7303
|
+
};
|
|
7304
|
+
CoreFacade.prototype.getOnCodeChangeObservable = function () {
|
|
7305
|
+
return this.$onCodeChange.asObservable();
|
|
7306
|
+
};
|
|
7307
|
+
CoreFacade.prototype.getOnCodeValidityChangeObservable = function () {
|
|
7308
|
+
return this.$onCodeValidityChange.asObservable();
|
|
7309
|
+
};
|
|
7310
|
+
CoreFacade.prototype.notifyCoreFinishLoad = function () {
|
|
7311
|
+
this.$onCoreFinishLoad.next();
|
|
7312
|
+
};
|
|
7313
|
+
CoreFacade.prototype.notifyCodeChange = function (code) {
|
|
7314
|
+
var safeCode = this.getSafeCode(code);
|
|
7315
|
+
if (safeCode !== this._lastCodeEmitted) {
|
|
7316
|
+
this._lastCodeEmitted = safeCode;
|
|
7317
|
+
this.$onCodeChange.next(safeCode);
|
|
7318
|
+
this.validateCode(safeCode);
|
|
7319
|
+
}
|
|
7320
|
+
};
|
|
7321
|
+
CoreFacade.prototype.updateCompletionItems = function (items) {
|
|
7322
|
+
this._completionItems = items || [];
|
|
7323
|
+
this.validateCode(this._lastCodeEmitted);
|
|
7324
|
+
};
|
|
7325
|
+
CoreFacade.prototype.setLinter = function (language) {
|
|
7326
|
+
this._linter = CoreLinters.getLinter(language);
|
|
7327
|
+
};
|
|
7328
|
+
CoreFacade.prototype.validateCode = function (code) {
|
|
7329
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7330
|
+
var markers;
|
|
7331
|
+
return __generator(this, function (_a) {
|
|
7332
|
+
switch (_a.label) {
|
|
7333
|
+
case 0:
|
|
7334
|
+
if (!this._linter) return [3 /*break*/, 2];
|
|
7335
|
+
return [4 /*yield*/, this._linter.lint(code, this._completionItems)];
|
|
7336
|
+
case 1:
|
|
7337
|
+
markers = _a.sent();
|
|
7338
|
+
this.highlightCode(markers);
|
|
7339
|
+
this.notifyCodeValidityChange(!markers.length);
|
|
7340
|
+
_a.label = 2;
|
|
7341
|
+
case 2: return [2 /*return*/];
|
|
7342
|
+
}
|
|
7343
|
+
});
|
|
7344
|
+
});
|
|
7345
|
+
};
|
|
7346
|
+
CoreFacade.prototype.notifyCodeValidityChange = function (validity) {
|
|
7347
|
+
if (validity !== this._lastCodeValidityEmitted) {
|
|
7348
|
+
this._lastCodeValidityEmitted = validity;
|
|
7349
|
+
this.$onCodeValidityChange.next(validity);
|
|
7350
|
+
}
|
|
7351
|
+
};
|
|
7352
|
+
CoreFacade.prototype.validateLanguage = function (language) {
|
|
7353
|
+
var languages = Object.values(exports.Languages);
|
|
7354
|
+
if (language && !languages.includes(language))
|
|
7355
|
+
throw new Error("The informed language \"" + language + "\" is not supported");
|
|
7356
|
+
};
|
|
7357
|
+
CoreFacade.prototype.validateTheme = function (theme) {
|
|
7358
|
+
var themes = Object.values(exports.Themes);
|
|
7359
|
+
if (theme && !themes.includes(theme))
|
|
7360
|
+
throw new Error("The informed theme \"" + theme + "\" is not supported");
|
|
7361
|
+
};
|
|
7362
|
+
CoreFacade.prototype.getSafeCode = function (code) {
|
|
7363
|
+
return typeof code === "string" ? code : "";
|
|
7364
|
+
};
|
|
7365
|
+
return CoreFacade;
|
|
7366
|
+
}());
|
|
7367
|
+
|
|
7368
|
+
var CodeEditorComponent = /** @class */ (function () {
|
|
7369
|
+
function CodeEditorComponent(coreFacade) {
|
|
7370
|
+
this.coreFacade = coreFacade;
|
|
7371
|
+
this._ngUnsubscribe = new rxjs.Subject();
|
|
7372
|
+
this.codeChange = new core.EventEmitter();
|
|
7373
|
+
this.isCodeValidChange = new core.EventEmitter();
|
|
7374
|
+
this.onCodeChange = new core.EventEmitter();
|
|
7375
|
+
this.onComponentFinishLoad = new core.EventEmitter();
|
|
7376
|
+
}
|
|
7377
|
+
Object.defineProperty(CodeEditorComponent.prototype, "editorOptions", {
|
|
7378
|
+
set: function (options) {
|
|
7379
|
+
this.coreFacade.changeEditorOptions(options);
|
|
7380
|
+
},
|
|
7381
|
+
enumerable: true,
|
|
7382
|
+
configurable: true
|
|
7383
|
+
});
|
|
7384
|
+
Object.defineProperty(CodeEditorComponent.prototype, "code", {
|
|
7385
|
+
set: function (code) {
|
|
7386
|
+
this.coreFacade.changeCode(code);
|
|
7387
|
+
},
|
|
7388
|
+
enumerable: true,
|
|
7389
|
+
configurable: true
|
|
7390
|
+
});
|
|
7391
|
+
CodeEditorComponent.prototype.ngOnInit = function () {
|
|
7392
|
+
this.coreFacade.initCore();
|
|
7393
|
+
this.setupCoreListeners();
|
|
7394
|
+
};
|
|
7395
|
+
CodeEditorComponent.prototype.ngAfterViewInit = function () {
|
|
7396
|
+
this.setCoreWrapperElement();
|
|
7397
|
+
};
|
|
7398
|
+
CodeEditorComponent.prototype.ngOnDestroy = function () {
|
|
7399
|
+
this.coreFacade.destroyCore();
|
|
7400
|
+
this._ngUnsubscribe.next();
|
|
7401
|
+
this._ngUnsubscribe.complete();
|
|
7402
|
+
};
|
|
7403
|
+
CodeEditorComponent.prototype.setCoreWrapperElement = function () {
|
|
7404
|
+
this.coreFacade.setCoreWrapperElement(this.coreWrapperElement.nativeElement);
|
|
7405
|
+
};
|
|
7406
|
+
CodeEditorComponent.prototype.setupCoreListeners = function () {
|
|
7407
|
+
var _this = this;
|
|
7408
|
+
this.coreFacade
|
|
7409
|
+
.getOnCoreFinishLoadObservable()
|
|
7410
|
+
.pipe(operators.take(1))
|
|
7411
|
+
.subscribe(function () { return _this.onComponentFinishLoad.emit(); });
|
|
7412
|
+
this.coreFacade
|
|
7413
|
+
.getOnCodeChangeObservable()
|
|
7414
|
+
.pipe(operators.takeUntil(this._ngUnsubscribe))
|
|
7415
|
+
.subscribe(function (code) {
|
|
7416
|
+
_this.codeChange.emit(code);
|
|
7417
|
+
_this.onCodeChange.emit(code);
|
|
7418
|
+
});
|
|
7419
|
+
this.coreFacade
|
|
7420
|
+
.getOnCodeValidityChangeObservable()
|
|
7421
|
+
.pipe(operators.takeUntil(this._ngUnsubscribe))
|
|
7422
|
+
.subscribe(function (validity) {
|
|
7423
|
+
_this.isCodeValidChange.emit(validity);
|
|
7424
|
+
});
|
|
7425
|
+
};
|
|
7426
|
+
CodeEditorComponent.ctorParameters = function () { return [
|
|
7427
|
+
{ type: CoreFacade }
|
|
7428
|
+
]; };
|
|
7429
|
+
__decorate([
|
|
7430
|
+
core.ViewChild("coreWrapper")
|
|
7431
|
+
], CodeEditorComponent.prototype, "coreWrapperElement", void 0);
|
|
7432
|
+
__decorate([
|
|
7433
|
+
core.Input()
|
|
7434
|
+
], CodeEditorComponent.prototype, "editorOptions", null);
|
|
7435
|
+
__decorate([
|
|
7436
|
+
core.Input()
|
|
7437
|
+
], CodeEditorComponent.prototype, "code", null);
|
|
7438
|
+
__decorate([
|
|
7439
|
+
core.Output()
|
|
7440
|
+
], CodeEditorComponent.prototype, "codeChange", void 0);
|
|
7441
|
+
__decorate([
|
|
7442
|
+
core.Input()
|
|
7443
|
+
], CodeEditorComponent.prototype, "isCodeValid", void 0);
|
|
7444
|
+
__decorate([
|
|
7445
|
+
core.Output()
|
|
7446
|
+
], CodeEditorComponent.prototype, "isCodeValidChange", void 0);
|
|
7447
|
+
__decorate([
|
|
7448
|
+
core.Output()
|
|
7449
|
+
], CodeEditorComponent.prototype, "onCodeChange", void 0);
|
|
7450
|
+
__decorate([
|
|
7451
|
+
core.Output()
|
|
7452
|
+
], CodeEditorComponent.prototype, "onComponentFinishLoad", void 0);
|
|
7453
|
+
CodeEditorComponent = __decorate([
|
|
7454
|
+
core.Component({
|
|
7455
|
+
selector: "s-code-editor",
|
|
7456
|
+
template: "<div #coreWrapper class=\"core-wrapper\"></div>",
|
|
7457
|
+
styles: [".core-wrapper{height:100%}"]
|
|
7458
|
+
})
|
|
7459
|
+
], CodeEditorComponent);
|
|
7460
|
+
return CodeEditorComponent;
|
|
7461
|
+
}());
|
|
7462
|
+
|
|
7463
|
+
var parserGrammar = "\n@top Script { statement+ }\n\nstatement[@isGroup=Statement] {\n Keyword |\n String |\n Number\n}\n\n@tokens {\n String { '\"' (![\\n\"])* '\"'? }\n\n Number { std.digit+ }\n\n identifierChar { std.asciiLetter | $[_$\u00A1-\uDBFF\uDFFF] }\n\n word { identifierChar (identifierChar | std.digit)* }\n\n identifier { word }\n}\n\nKeyword {\n kw<\"SE\">\n kw<\"ENTAO\">\n kw<\"FIM_SE\">\n kw<\"SENAO\">\n kw<\"NAO\">\n kw<\"CONTENHA\">\n kw<\"OU\">\n kw<\"E\">\n}\n\nkw<term> { @specialize[@name={term}]<identifier, term> }\n\n@detectDelim\n";
|
|
7464
|
+
|
|
7465
|
+
var EnumTypeOrder;
|
|
7466
|
+
(function (EnumTypeOrder) {
|
|
7467
|
+
// Tipo de ordenação - Crescente
|
|
7468
|
+
EnumTypeOrder["ASC"] = "ASC";
|
|
7469
|
+
// Tipo de ordenação - Decrescente
|
|
7470
|
+
EnumTypeOrder["DESC"] = "DESC";
|
|
7471
|
+
})(EnumTypeOrder || (EnumTypeOrder = {}));
|
|
7472
|
+
|
|
7473
|
+
var MetaType;
|
|
7474
|
+
(function (MetaType) {
|
|
7475
|
+
// Entity
|
|
7476
|
+
MetaType["ENTITY"] = "ENTITY";
|
|
7477
|
+
// String
|
|
7478
|
+
MetaType["STRING"] = "STRING";
|
|
7479
|
+
// Integer
|
|
7480
|
+
MetaType["INTEGER"] = "INTEGER";
|
|
7481
|
+
// Double
|
|
7482
|
+
MetaType["DOUBLE"] = "DOUBLE";
|
|
7483
|
+
// Long
|
|
7484
|
+
MetaType["LONG"] = "LONG";
|
|
7485
|
+
// BigDecimal
|
|
7486
|
+
MetaType["BIGDECIMAL"] = "BIGDECIMAL";
|
|
7487
|
+
// UUID
|
|
7488
|
+
MetaType["UUID"] = "UUID";
|
|
7489
|
+
// Date
|
|
7490
|
+
MetaType["DATE"] = "DATE";
|
|
7491
|
+
// DateTime
|
|
7492
|
+
MetaType["DATETIME"] = "DATETIME";
|
|
7493
|
+
// Time
|
|
7494
|
+
MetaType["TIME"] = "TIME";
|
|
7495
|
+
// Boolean
|
|
7496
|
+
MetaType["BOOLEAN"] = "BOOLEAN";
|
|
7497
|
+
// List
|
|
7498
|
+
MetaType["LIST"] = "LIST";
|
|
7499
|
+
// Enum
|
|
7500
|
+
MetaType["ENUM"] = "ENUM";
|
|
7501
|
+
// CustomExpression
|
|
7502
|
+
MetaType["CUSTOM_EXPRESSION"] = "CUSTOM_EXPRESSION";
|
|
7503
|
+
// PublicExpression
|
|
7504
|
+
MetaType["PUBLIC_EXPRESSION"] = "PUBLIC_EXPRESSION";
|
|
7505
|
+
})(MetaType || (MetaType = {}));
|
|
7506
|
+
|
|
7507
|
+
var RequestTypes;
|
|
7508
|
+
(function (RequestTypes) {
|
|
7509
|
+
RequestTypes[RequestTypes["ListContextMetadataById"] = 0] = "ListContextMetadataById";
|
|
7510
|
+
RequestTypes[RequestTypes["ListExpressionMetadata"] = 1] = "ListExpressionMetadata";
|
|
7511
|
+
RequestTypes[RequestTypes["ListFacadeMetadataNames"] = 2] = "ListFacadeMetadataNames";
|
|
7512
|
+
RequestTypes[RequestTypes["GetFacadeMetadataByPath"] = 3] = "GetFacadeMetadataByPath";
|
|
7513
|
+
})(RequestTypes || (RequestTypes = {}));
|
|
7514
|
+
|
|
7515
|
+
var CompletionTypes;
|
|
7516
|
+
(function (CompletionTypes) {
|
|
7517
|
+
CompletionTypes["Keyword"] = "keyword";
|
|
7518
|
+
CompletionTypes["Context"] = "context";
|
|
7519
|
+
CompletionTypes["Expression"] = "expression";
|
|
7520
|
+
CompletionTypes["UserExpression"] = "userExpression";
|
|
7521
|
+
CompletionTypes["Entity"] = "entity";
|
|
7522
|
+
CompletionTypes["FinalValue"] = "finalValue";
|
|
7523
|
+
})(CompletionTypes || (CompletionTypes = {}));
|
|
7524
|
+
|
|
7525
|
+
var Keywords;
|
|
7526
|
+
(function (Keywords) {
|
|
7527
|
+
Keywords["SE"] = "SE";
|
|
7528
|
+
Keywords["SENAO"] = "SENAO";
|
|
7529
|
+
Keywords["CONTENHA"] = "CONTENHA";
|
|
7530
|
+
Keywords["ENTAO"] = "ENTAO";
|
|
7531
|
+
Keywords["FIM_SE"] = "FIM_SE";
|
|
7532
|
+
Keywords["NAO"] = "NAO";
|
|
7533
|
+
Keywords["E"] = "E";
|
|
7534
|
+
Keywords["OU"] = "OU";
|
|
7535
|
+
})(Keywords || (Keywords = {}));
|
|
7536
|
+
|
|
7537
|
+
/* Enums */
|
|
7538
|
+
|
|
7539
|
+
var _a;
|
|
7540
|
+
var baseConfigs = language.LRLanguage.define({
|
|
7541
|
+
parser: generator.buildParser(parserGrammar)
|
|
7542
|
+
.configure({
|
|
7543
|
+
props: [
|
|
7544
|
+
highlight.styleTags((_a = {},
|
|
7545
|
+
_a[Object.values(Keywords).join(" ")] = highlight.tags.keyword,
|
|
7546
|
+
_a["String"] = highlight.tags.string,
|
|
7547
|
+
_a["Number"] = highlight.tags.number,
|
|
7548
|
+
_a))
|
|
7549
|
+
]
|
|
7550
|
+
})
|
|
7551
|
+
});
|
|
7552
|
+
|
|
7553
|
+
/**
|
|
7554
|
+
* Formats a JSON response to a JS object
|
|
7555
|
+
* @param response The response to format
|
|
7556
|
+
* @returns A JS object based on the response's body
|
|
7557
|
+
*/
|
|
7558
|
+
function formatJsonResponse(response) {
|
|
7559
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7560
|
+
return __generator(this, function (_a) {
|
|
7561
|
+
return [2 /*return*/, response.json()];
|
|
7562
|
+
});
|
|
7563
|
+
});
|
|
7564
|
+
}
|
|
7565
|
+
|
|
7566
|
+
/**
|
|
7567
|
+
* Formats a Blob response to a JS object
|
|
7568
|
+
* @param response The response to format
|
|
7569
|
+
* @returns A JS object based on the response's body
|
|
7570
|
+
*/
|
|
7571
|
+
function formatBlobResponse(response) {
|
|
7572
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7573
|
+
var textResponse;
|
|
7574
|
+
return __generator(this, function (_a) {
|
|
7575
|
+
switch (_a.label) {
|
|
7576
|
+
case 0: return [4 /*yield*/, response.blob()];
|
|
7577
|
+
case 1: return [4 /*yield*/, (_a.sent()).text()];
|
|
7578
|
+
case 2:
|
|
7579
|
+
textResponse = _a.sent();
|
|
7580
|
+
return [2 /*return*/, JSON.parse(textResponse)];
|
|
7581
|
+
}
|
|
7582
|
+
});
|
|
7583
|
+
});
|
|
7584
|
+
}
|
|
7585
|
+
|
|
7586
|
+
/**
|
|
7587
|
+
* Custom HttpClient for cases when is not possible to use the Angular's HttpClient
|
|
7588
|
+
*/
|
|
7589
|
+
var CustomHttpClient = /** @class */ (function () {
|
|
7590
|
+
function CustomHttpClient() {
|
|
7591
|
+
}
|
|
7592
|
+
/**
|
|
7593
|
+
* Executes a Http Get
|
|
7594
|
+
* @param url Url to execute the Get on
|
|
7595
|
+
* @param init Optional additional configs
|
|
7596
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
7597
|
+
*/
|
|
7598
|
+
CustomHttpClient.GET = function (url, init) {
|
|
7599
|
+
if (init === void 0) { init = {}; }
|
|
7600
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7601
|
+
var response;
|
|
7602
|
+
return __generator(this, function (_a) {
|
|
7603
|
+
switch (_a.label) {
|
|
7604
|
+
case 0: return [4 /*yield*/, this.interceptRequest(url, __assign(__assign({}, init), { method: "GET" }))];
|
|
7605
|
+
case 1:
|
|
7606
|
+
response = _a.sent();
|
|
7607
|
+
return [2 /*return*/, this.formatResponse(response)];
|
|
7608
|
+
}
|
|
7609
|
+
});
|
|
7610
|
+
});
|
|
7611
|
+
};
|
|
7612
|
+
/**
|
|
7613
|
+
* Executes a Http Post
|
|
7614
|
+
* @param url Url to execute the Post on
|
|
7615
|
+
* @param body Info to send to server on Post
|
|
7616
|
+
* @param init Optional additional configs
|
|
7617
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
7618
|
+
*/
|
|
7619
|
+
CustomHttpClient.POST = function (url, body, init) {
|
|
7620
|
+
if (init === void 0) { init = {}; }
|
|
7621
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7622
|
+
var headers, response;
|
|
7623
|
+
return __generator(this, function (_a) {
|
|
7624
|
+
switch (_a.label) {
|
|
7625
|
+
case 0:
|
|
7626
|
+
headers = new Headers(init.headers);
|
|
7627
|
+
headers.append("Content-Type", "application/json");
|
|
7628
|
+
headers.append("Accept", "application/json");
|
|
7629
|
+
return [4 /*yield*/, this.interceptRequest(url, __assign(__assign({}, init), { method: "POST", body: JSON.stringify(body), headers: headers }))];
|
|
7630
|
+
case 1:
|
|
7631
|
+
response = _a.sent();
|
|
7632
|
+
return [2 /*return*/, this.formatResponse(response)];
|
|
7633
|
+
}
|
|
7634
|
+
});
|
|
7635
|
+
});
|
|
7636
|
+
};
|
|
7637
|
+
/**
|
|
7638
|
+
* Intercepts the original request to add a required header for Senior in case of a internal request
|
|
7639
|
+
* @param url Url from the original request
|
|
7640
|
+
* @param originalReq Configs from the original request
|
|
7641
|
+
* @returns Whether a Promise<Response> if the request was made successfully or an error
|
|
7642
|
+
*/
|
|
7643
|
+
CustomHttpClient.interceptRequest = function (url, originalReq) {
|
|
7644
|
+
if (originalReq === void 0) { originalReq = {}; }
|
|
7645
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7646
|
+
var restUrl, authHeader, headers, request, err_1;
|
|
7647
|
+
return __generator(this, function (_a) {
|
|
7648
|
+
switch (_a.label) {
|
|
7649
|
+
case 0:
|
|
7650
|
+
_a.trys.push([0, 4, , 5]);
|
|
7651
|
+
if (!!url.includes("://")) return [3 /*break*/, 3];
|
|
7652
|
+
return [4 /*yield*/, seniorPlatformData.service.getRestUrl()];
|
|
7653
|
+
case 1:
|
|
7654
|
+
restUrl = _a.sent();
|
|
7655
|
+
return [4 /*yield*/, seniorPlatformData.user.getAuthHeader()];
|
|
7656
|
+
case 2:
|
|
7657
|
+
authHeader = _a.sent();
|
|
7658
|
+
headers = new Headers(originalReq.headers);
|
|
7659
|
+
headers.append("Authorization", authHeader);
|
|
7660
|
+
request = new Request(restUrl + url, __assign(__assign({}, originalReq), { headers: headers }));
|
|
7661
|
+
return [2 /*return*/, fetch(request)];
|
|
7662
|
+
case 3: return [2 /*return*/, fetch(url, originalReq)];
|
|
7663
|
+
case 4:
|
|
7664
|
+
err_1 = _a.sent();
|
|
7665
|
+
throw new Error("Error fetching requested URL: " + err_1);
|
|
7666
|
+
case 5: return [2 /*return*/];
|
|
7667
|
+
}
|
|
7668
|
+
});
|
|
7669
|
+
});
|
|
7670
|
+
};
|
|
7671
|
+
/**
|
|
7672
|
+
* Formats the request response to an object<T> or {}
|
|
7673
|
+
* @param response The response to be formatted
|
|
7674
|
+
* @returns Whether a Promise<T> if the response status is in the range 200-299 an error
|
|
7675
|
+
*/
|
|
7676
|
+
CustomHttpClient.formatResponse = function (response) {
|
|
7677
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7678
|
+
var contentType, formatter, formattedContentType, _a;
|
|
7679
|
+
return __generator(this, function (_b) {
|
|
7680
|
+
switch (_b.label) {
|
|
7681
|
+
case 0:
|
|
7682
|
+
contentType = response.headers.get("content-type");
|
|
7683
|
+
formatter = CustomHttpClient._responseFormatterMap.get(contentType);
|
|
7684
|
+
if (!formatter) return [3 /*break*/, 2];
|
|
7685
|
+
return [4 /*yield*/, formatter(response)];
|
|
7686
|
+
case 1:
|
|
7687
|
+
_a = _b.sent();
|
|
7688
|
+
return [3 /*break*/, 3];
|
|
7689
|
+
case 2:
|
|
7690
|
+
_a = {};
|
|
7691
|
+
_b.label = 3;
|
|
7692
|
+
case 3:
|
|
7693
|
+
formattedContentType = _a;
|
|
7694
|
+
if (response.ok)
|
|
7695
|
+
return [2 /*return*/, formattedContentType];
|
|
7696
|
+
throw new Error(JSON.stringify(formattedContentType));
|
|
7697
|
+
}
|
|
7698
|
+
});
|
|
7699
|
+
});
|
|
7700
|
+
};
|
|
7701
|
+
CustomHttpClient._responseFormatterMap = new Map([
|
|
7702
|
+
["application/json", formatJsonResponse],
|
|
7703
|
+
["application/octet-stream", formatBlobResponse]
|
|
7704
|
+
]);
|
|
7705
|
+
return CustomHttpClient;
|
|
7706
|
+
}());
|
|
7707
|
+
|
|
7708
|
+
/**
|
|
7709
|
+
* Custom translator for cases when is not possible to use the "TranslateService" from "@ngx-translate/core"
|
|
7710
|
+
*/
|
|
7711
|
+
var CustomTranslationsService = /** @class */ (function () {
|
|
7712
|
+
function CustomTranslationsService() {
|
|
7713
|
+
}
|
|
7714
|
+
/**
|
|
7715
|
+
* Method used to get the translation for an key based on the host project's translations. Always use the first available language
|
|
7716
|
+
* @param key Key used to search the translation
|
|
7717
|
+
* @returns The translation for the informed key or the key in case there is no translation
|
|
7718
|
+
*/
|
|
7719
|
+
CustomTranslationsService.translate = function (key) {
|
|
7720
|
+
var _a, _b;
|
|
7721
|
+
if (key === undefined || key === null)
|
|
7722
|
+
return "";
|
|
7723
|
+
var translationKey = "" + CustomTranslationsService._TRANSLATION_PREFIX + key;
|
|
7724
|
+
var firstLanguageTranslations = (_a = Object.values(CustomTranslationsService._translations)[0]) !== null && _a !== void 0 ? _a : {};
|
|
7725
|
+
return (_b = firstLanguageTranslations[translationKey]) !== null && _b !== void 0 ? _b : translationKey;
|
|
7726
|
+
};
|
|
7727
|
+
/**
|
|
7728
|
+
* Method used to set the translations that will be used as base when calling the "translate" method
|
|
7729
|
+
* @param translations Translations to use as base
|
|
7730
|
+
*/
|
|
7731
|
+
CustomTranslationsService.setTranslations = function (translations) {
|
|
7732
|
+
CustomTranslationsService._translations = translations !== null && translations !== void 0 ? translations : {};
|
|
7733
|
+
};
|
|
7734
|
+
/**
|
|
7735
|
+
* Method used to set the prefix that will be used when calling the "translate" method
|
|
7736
|
+
* @param hostProjectConfigs The host project's configs used to create the prefix
|
|
7737
|
+
*/
|
|
7738
|
+
CustomTranslationsService.setTranslationsPrefix = function (hostProjectConfigs) {
|
|
7739
|
+
var _a = hostProjectConfigs !== null && hostProjectConfigs !== void 0 ? hostProjectConfigs : {}, domain = _a.domain, service = _a.service;
|
|
7740
|
+
var prefix = domain + "." + service + ".";
|
|
7741
|
+
CustomTranslationsService._TRANSLATION_PREFIX = prefix;
|
|
7742
|
+
};
|
|
7743
|
+
CustomTranslationsService._translations = {};
|
|
7744
|
+
CustomTranslationsService._TRANSLATION_PREFIX = "";
|
|
7745
|
+
return CustomTranslationsService;
|
|
7746
|
+
}());
|
|
7747
|
+
|
|
7748
|
+
/**
|
|
7749
|
+
* Responsible for setting up the translations that will be used by the "CustomTranslationsService".
|
|
7750
|
+
* Uses the host project's translations set by using the "TranslationsModule" from "@seniorsistemas/platform-components"
|
|
7751
|
+
*/
|
|
7752
|
+
var CustomTranslationsModule = /** @class */ (function () {
|
|
7753
|
+
function CustomTranslationsModule(translate, hostProjectConfigs) {
|
|
7754
|
+
this.translate = translate;
|
|
7755
|
+
this.hostProjectConfigs = hostProjectConfigs;
|
|
7756
|
+
this.factoryTranslations(this.translate, this.hostProjectConfigs);
|
|
7757
|
+
}
|
|
7758
|
+
CustomTranslationsModule.prototype.factoryTranslations = function (translate, hostProjectConfigs) {
|
|
7759
|
+
CustomTranslationsService.setTranslations(translate.translations);
|
|
7760
|
+
CustomTranslationsService.setTranslationsPrefix(hostProjectConfigs);
|
|
7761
|
+
};
|
|
7762
|
+
CustomTranslationsModule.ctorParameters = function () { return [
|
|
7763
|
+
{ type: core$1.TranslateService },
|
|
7764
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
7765
|
+
]; };
|
|
7766
|
+
CustomTranslationsModule = __decorate([
|
|
7767
|
+
core.NgModule(),
|
|
7768
|
+
__param(1, core.Inject(HostProjectConfigsInjectionToken))
|
|
7769
|
+
], CustomTranslationsModule);
|
|
7770
|
+
return CustomTranslationsModule;
|
|
7771
|
+
}());
|
|
7772
|
+
|
|
7773
|
+
var MarkerSeverity;
|
|
7774
|
+
(function (MarkerSeverity) {
|
|
7775
|
+
MarkerSeverity[MarkerSeverity["Error"] = 0] = "Error";
|
|
7776
|
+
MarkerSeverity[MarkerSeverity["Info"] = 1] = "Info";
|
|
7777
|
+
MarkerSeverity[MarkerSeverity["Warning"] = 2] = "Warning";
|
|
7778
|
+
})(MarkerSeverity || (MarkerSeverity = {}));
|
|
7779
|
+
|
|
7780
|
+
/* Enums */
|
|
7781
|
+
|
|
7782
|
+
var diagnosticSeverityInMarkerSeverityMap = new Map([
|
|
7783
|
+
[MarkerSeverity.Error, "error"],
|
|
7784
|
+
[MarkerSeverity.Info, "info"],
|
|
7785
|
+
[MarkerSeverity.Warning, "warning"]
|
|
7786
|
+
]);
|
|
7787
|
+
function convertMarkersToDiagnostics(markers, textLength) {
|
|
7788
|
+
return markers.map(function (marker) {
|
|
7789
|
+
var _a, _b;
|
|
7790
|
+
return ({
|
|
7791
|
+
from: marker.start || 0,
|
|
7792
|
+
to: marker.end || textLength,
|
|
7793
|
+
message: (_a = marker.message) !== null && _a !== void 0 ? _a : "",
|
|
7794
|
+
severity: (_b = diagnosticSeverityInMarkerSeverityMap.get(marker.severity)) !== null && _b !== void 0 ? _b : "error"
|
|
7795
|
+
});
|
|
7796
|
+
});
|
|
7797
|
+
}
|
|
7798
|
+
|
|
7799
|
+
function isCurrentPositionInsideString(stringBeforeCurrentPosition) {
|
|
7800
|
+
var _a;
|
|
7801
|
+
var doubleQuotesQuantity = ((_a = stringBeforeCurrentPosition.match(/"/g)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
7802
|
+
return doubleQuotesQuantity % 2 !== 0;
|
|
7803
|
+
}
|
|
7804
|
+
|
|
7805
|
+
var AutocompleteService = /** @class */ (function () {
|
|
7806
|
+
function AutocompleteService() {
|
|
7807
|
+
}
|
|
7808
|
+
AutocompleteService.listContextMetadataById = function (request, abortSignal) {
|
|
7809
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7810
|
+
return __generator(this, function (_a) {
|
|
7811
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listContextMetadataById", request, {
|
|
7812
|
+
signal: abortSignal
|
|
7813
|
+
})];
|
|
7814
|
+
});
|
|
7815
|
+
});
|
|
7816
|
+
};
|
|
7817
|
+
AutocompleteService.listExpressionMetadata = function (request, abortSignal) {
|
|
7818
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7819
|
+
return __generator(this, function (_a) {
|
|
7820
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listExpressionMetadata", request, {
|
|
7821
|
+
signal: abortSignal
|
|
7822
|
+
})];
|
|
7823
|
+
});
|
|
7824
|
+
});
|
|
7825
|
+
};
|
|
7826
|
+
AutocompleteService.listFacadeMetadataNames = function (request, abortSignal) {
|
|
7827
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7828
|
+
return __generator(this, function (_a) {
|
|
7829
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listFacadeMetadataNames", request, {
|
|
7830
|
+
signal: abortSignal
|
|
7831
|
+
})];
|
|
7832
|
+
});
|
|
7833
|
+
});
|
|
7834
|
+
};
|
|
7835
|
+
AutocompleteService.getFacadeMetadataByPath = function (request, abortSignal) {
|
|
7836
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7837
|
+
return __generator(this, function (_a) {
|
|
7838
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/getFacadeMetadataByPath", request, {
|
|
7839
|
+
signal: abortSignal
|
|
7840
|
+
})];
|
|
7841
|
+
});
|
|
7842
|
+
});
|
|
7843
|
+
};
|
|
7844
|
+
AutocompleteService.BASE_URL = "platform/rule_metadata";
|
|
7845
|
+
return AutocompleteService;
|
|
7846
|
+
}());
|
|
7847
|
+
|
|
7848
|
+
/**
|
|
7849
|
+
* Adds style to autocomplete's state-wrapper
|
|
7850
|
+
* @returns An extension containing the style
|
|
7851
|
+
*/
|
|
7852
|
+
function style() {
|
|
7853
|
+
return view.EditorView.theme({
|
|
7854
|
+
".s-code-editor-taxCalculation-autocomplete-ul": {
|
|
7855
|
+
"padding": ".75rem !important",
|
|
7856
|
+
},
|
|
7857
|
+
".s-code-editor-taxCalculation-autocomplete-li": {
|
|
7858
|
+
cursor: "default !important",
|
|
7859
|
+
"line-height": "1.375em !important",
|
|
7860
|
+
},
|
|
7861
|
+
});
|
|
7862
|
+
}
|
|
7863
|
+
|
|
7864
|
+
var htmlElementToBeWrapped = null;
|
|
7865
|
+
/**
|
|
7866
|
+
* Adds a view updates's listener that creates an state over the autocomplete
|
|
7867
|
+
* @returns An extension containing everything needed to listen the updates and create the autocomplete's state
|
|
7868
|
+
*/
|
|
7869
|
+
function autocompleteStateWrapper() {
|
|
7870
|
+
return [
|
|
7871
|
+
autocompleteStateWrapperStateField(),
|
|
7872
|
+
style()
|
|
7873
|
+
];
|
|
7874
|
+
}
|
|
7875
|
+
/**
|
|
7876
|
+
* Shows a state on a non-clickable autocomplete item's format with an HTMLElement inside
|
|
7877
|
+
* @param element The HTMLElement to show inside the state
|
|
7878
|
+
*/
|
|
7879
|
+
function showAutocompleteStateWrapper(element) {
|
|
7880
|
+
htmlElementToBeWrapped = element;
|
|
7881
|
+
CodeMirror6Core.updateEditorView();
|
|
7882
|
+
}
|
|
7883
|
+
/**
|
|
7884
|
+
* Removes a possible showed autocomplete state
|
|
7885
|
+
*/
|
|
7886
|
+
function hideAutocompleteStateWrapper() {
|
|
7887
|
+
htmlElementToBeWrapped = null;
|
|
7888
|
+
CodeMirror6Core.updateEditorView();
|
|
7889
|
+
}
|
|
7890
|
+
/*
|
|
7891
|
+
* Creates and returns a StateField responsible for listening the view's change and to add the autocomplete state's wrapper
|
|
7892
|
+
*/
|
|
7893
|
+
function autocompleteStateWrapperStateField() {
|
|
7894
|
+
return state.StateField.define({
|
|
7895
|
+
create: getAutocompleteStateWrapper,
|
|
7896
|
+
update: function (_, transaction) {
|
|
7897
|
+
return getAutocompleteStateWrapper(transaction.state);
|
|
7898
|
+
},
|
|
7899
|
+
provide: function (field) {
|
|
7900
|
+
return tooltip$1.showTooltip.compute([field], function (state) { return state.field(field); });
|
|
7901
|
+
}
|
|
7902
|
+
});
|
|
7903
|
+
}
|
|
7904
|
+
/*
|
|
7905
|
+
* Function responsible for creating the state's wrapper and returning the same as a Tooltip from "@codemirror/tooltip";
|
|
7906
|
+
* Only creates the Tooltip if the theres is element on the "htmlElementToBeWrapped" variable;
|
|
7907
|
+
* The same will also be removed when any view update is emitted;
|
|
7908
|
+
*/
|
|
7909
|
+
function getAutocompleteStateWrapper(state) {
|
|
7910
|
+
if (!htmlElementToBeWrapped)
|
|
7911
|
+
return;
|
|
7912
|
+
var htmlElementToBeWrappedString = htmlElementToBeWrapped.outerHTML;
|
|
7913
|
+
var stateWrapper = {
|
|
7914
|
+
pos: state.selection.ranges[0].head,
|
|
7915
|
+
create: function () { return ({ dom: getAutocompleteStateWrapperDomElement(htmlElementToBeWrappedString) }); }
|
|
7916
|
+
};
|
|
7917
|
+
htmlElementToBeWrapped = null;
|
|
7918
|
+
return stateWrapper;
|
|
7919
|
+
}
|
|
7920
|
+
function getAutocompleteStateWrapperDomElement(elementToBeWrappedString) {
|
|
7921
|
+
var wrapperDiv = document.createElement("div");
|
|
7922
|
+
wrapperDiv.className = "cm-tooltip-autocomplete cm-tooltip";
|
|
7923
|
+
wrapperDiv.innerHTML =
|
|
7924
|
+
"\n <ul class=\"s-code-editor-taxCalculation-autocomplete-ul\">\n <li class=\"s-code-editor-taxCalculation-autocomplete-li\">\n " + elementToBeWrappedString + "\n </li>\n </ul>\n\n ";
|
|
7925
|
+
return wrapperDiv;
|
|
7926
|
+
}
|
|
7927
|
+
|
|
7928
|
+
var autocompleteLoadingStateHTMLElement;
|
|
7929
|
+
/**
|
|
7930
|
+
* Adds a loading-state over the autocomplete
|
|
7931
|
+
* @returns An extension containing everything needed to add the loading-state
|
|
7932
|
+
*/
|
|
7933
|
+
function autocompleteLoadingState() {
|
|
7934
|
+
return [autocompleteStateWrapper()];
|
|
7935
|
+
}
|
|
7936
|
+
/**
|
|
7937
|
+
* Activates the loading state on the autocomplete
|
|
7938
|
+
*/
|
|
7939
|
+
/*
|
|
7940
|
+
* Must set the "autocompleteLoadingStateHTMLElement" here for when the document is loaded we do not have
|
|
7941
|
+
* yet the "CustomTranslationsService" ready
|
|
7942
|
+
*/
|
|
7943
|
+
function showAutocompleteLoadingState() {
|
|
7944
|
+
if (!autocompleteLoadingStateHTMLElement) {
|
|
7945
|
+
autocompleteLoadingStateHTMLElement = getAutocompleteLoadingStateHTMLElement();
|
|
7946
|
+
}
|
|
7947
|
+
showAutocompleteStateWrapper(autocompleteLoadingStateHTMLElement);
|
|
7948
|
+
}
|
|
7949
|
+
function getAutocompleteLoadingStateHTMLElement() {
|
|
7950
|
+
var loadingStateSpanWrapper = document.createElement("span");
|
|
7951
|
+
loadingStateSpanWrapper.innerText = CustomTranslationsService.translate("core_language_tax_calculation_fetching_suggestions");
|
|
7952
|
+
return loadingStateSpanWrapper;
|
|
7953
|
+
}
|
|
7954
|
+
|
|
7955
|
+
var autocompleteEmptyStateHTMLElement;
|
|
7956
|
+
/**
|
|
7957
|
+
* Adds an empty-state over the autocomplete
|
|
7958
|
+
* @returns An extension containing everything needed to add the empty-state
|
|
7959
|
+
*/
|
|
7960
|
+
function autocompleteEmptyState() {
|
|
7961
|
+
return [autocompleteStateWrapper()];
|
|
7962
|
+
}
|
|
7963
|
+
/**
|
|
7964
|
+
* Activates the empty-state on the autocomplete
|
|
7965
|
+
*/
|
|
7966
|
+
/*
|
|
7967
|
+
* Must set the "autocompleteEmptyStateHTMLElement" here for when the document is loaded we do not have
|
|
7968
|
+
* yet the "CustomTranslationsService" ready
|
|
7969
|
+
*/
|
|
7970
|
+
function showAutocompleteEmptyState() {
|
|
7971
|
+
if (!autocompleteEmptyStateHTMLElement) {
|
|
7972
|
+
autocompleteEmptyStateHTMLElement = getAutocompleteEmptyStateHTMLElement();
|
|
7973
|
+
}
|
|
7974
|
+
showAutocompleteStateWrapper(autocompleteEmptyStateHTMLElement);
|
|
7975
|
+
}
|
|
7976
|
+
function getAutocompleteEmptyStateHTMLElement() {
|
|
7977
|
+
var emptyStateSpanWrapper = document.createElement("span");
|
|
7978
|
+
emptyStateSpanWrapper.innerText = CustomTranslationsService.translate("core_language_tax_calculation_no_suggestions");
|
|
7979
|
+
return emptyStateSpanWrapper;
|
|
7980
|
+
}
|
|
7981
|
+
|
|
7982
|
+
var TaxCalculationLanguageConfigs = /** @class */ (function () {
|
|
7983
|
+
function TaxCalculationLanguageConfigs() {
|
|
7984
|
+
}
|
|
7985
|
+
TaxCalculationLanguageConfigs.setConfigs = function (configs) {
|
|
7986
|
+
TaxCalculationLanguageConfigs.CONFIGS = JSON.parse(JSON.stringify(configs));
|
|
7987
|
+
};
|
|
7988
|
+
TaxCalculationLanguageConfigs.getConfigs = function () {
|
|
7989
|
+
return TaxCalculationLanguageConfigs.CONFIGS;
|
|
7990
|
+
};
|
|
7991
|
+
TaxCalculationLanguageConfigs.CONFIGS = { contexts: [] };
|
|
7992
|
+
return TaxCalculationLanguageConfigs;
|
|
7993
|
+
}());
|
|
7994
|
+
|
|
7995
|
+
/**
|
|
7996
|
+
* Gets the configs for the TaxCalculationLanguage
|
|
7997
|
+
* @returns The configs
|
|
7998
|
+
*/
|
|
7999
|
+
function getLanguageConfigs() {
|
|
8000
|
+
var _a;
|
|
8001
|
+
var configs = TaxCalculationLanguageConfigs.getConfigs();
|
|
8002
|
+
if (!((_a = configs.contexts) === null || _a === void 0 ? void 0 : _a.length))
|
|
8003
|
+
throw new Error("In order to use the TaxCalculation Language's autocomplete, "
|
|
8004
|
+
+ "one must inform at least one context by using the "
|
|
8005
|
+
+ "'TaxCalculationLanguageConfigs.setConfigs()'");
|
|
8006
|
+
return configs;
|
|
8007
|
+
}
|
|
8008
|
+
|
|
8009
|
+
/**
|
|
8010
|
+
* Wraps the request to return the same with an identification or undefined in case of error, so the promise will
|
|
8011
|
+
* always trigger the "then"
|
|
8012
|
+
* @param request Request to wrap
|
|
8013
|
+
* @returns The typed request's response
|
|
8014
|
+
*/
|
|
8015
|
+
function getSafeResponse(request) {
|
|
8016
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8017
|
+
var _a, _b, _1;
|
|
8018
|
+
return __generator(this, function (_c) {
|
|
8019
|
+
switch (_c.label) {
|
|
8020
|
+
case 0:
|
|
8021
|
+
_c.trys.push([0, 2, , 3]);
|
|
8022
|
+
_a = [__assign({}, request)];
|
|
8023
|
+
_b = {};
|
|
8024
|
+
return [4 /*yield*/, request.request];
|
|
8025
|
+
case 1: return [2 /*return*/, __assign.apply(void 0, _a.concat([(_b.response = _c.sent(), _b)]))];
|
|
8026
|
+
case 2:
|
|
8027
|
+
_1 = _c.sent();
|
|
8028
|
+
return [3 /*break*/, 3];
|
|
8029
|
+
case 3: return [2 /*return*/];
|
|
8030
|
+
}
|
|
8031
|
+
});
|
|
8032
|
+
});
|
|
8033
|
+
}
|
|
8034
|
+
|
|
8035
|
+
/**
|
|
8036
|
+
* Adds style to the autocomplete
|
|
8037
|
+
* @returns An extension containing the style
|
|
8038
|
+
*/
|
|
8039
|
+
function style$1() {
|
|
8040
|
+
return view.EditorView.theme({
|
|
8041
|
+
".cm-completionIcon": {
|
|
8042
|
+
"font-family": "'Font Awesome 5 Pro'",
|
|
8043
|
+
"font-weight": "900",
|
|
8044
|
+
},
|
|
8045
|
+
".cm-completionIcon-keyword::after": {
|
|
8046
|
+
"content": getIconBasedOnUnicode("f084"),
|
|
8047
|
+
},
|
|
8048
|
+
".cm-completionIcon-context::after": {
|
|
8049
|
+
"content": getIconBasedOnUnicode("f466"),
|
|
8050
|
+
},
|
|
8051
|
+
".cm-completionIcon-expression::after": {
|
|
8052
|
+
"content": getIconBasedOnUnicode("f505"),
|
|
8053
|
+
},
|
|
8054
|
+
".cm-completionIcon-userExpression::after": {
|
|
8055
|
+
"content": getIconBasedOnUnicode("f4ff"),
|
|
8056
|
+
},
|
|
8057
|
+
".cm-completionIcon-entity::after": {
|
|
8058
|
+
"content": getIconBasedOnUnicode("f126"),
|
|
8059
|
+
},
|
|
8060
|
+
".cm-completionIcon-finalValue::after": {
|
|
8061
|
+
"content": getIconBasedOnUnicode("f192"),
|
|
8062
|
+
},
|
|
8063
|
+
});
|
|
8064
|
+
}
|
|
8065
|
+
function getIconBasedOnUnicode(unicode) {
|
|
8066
|
+
return "\"\\" + unicode + "\"";
|
|
8067
|
+
}
|
|
8068
|
+
|
|
8069
|
+
/**
|
|
8070
|
+
* Adds an autocomplete to the editor
|
|
8071
|
+
* @returns An extension containing everything needed to create the autocomplete
|
|
8072
|
+
*/
|
|
8073
|
+
function autocomplete() {
|
|
8074
|
+
return [
|
|
8075
|
+
autocomplete$2.autocompletion({ override: [getCompletionResults] }),
|
|
8076
|
+
autocompleteLoadingState(),
|
|
8077
|
+
autocompleteEmptyState(),
|
|
8078
|
+
style$1(),
|
|
8079
|
+
];
|
|
8080
|
+
}
|
|
8081
|
+
var TRANSLATION_PREFIX = "core_language_tax_calculation";
|
|
8082
|
+
var completionResults;
|
|
8083
|
+
/*
|
|
8084
|
+
* A function to be called when a key is pressed, the ctrl+space is triggered or when the search for completionResults is done.
|
|
8085
|
+
* If there is a completionResult, returns it, otherwise starts a new async search.
|
|
8086
|
+
* Will only execute the autocompletion if the current cursor position is not inside a string
|
|
8087
|
+
*/
|
|
8088
|
+
function getCompletionResults(context) {
|
|
8089
|
+
var isCursorInsideString = isCurrentPositionInsideString(context.state.doc.toString().substring(0, context.pos));
|
|
8090
|
+
if (isCursorInsideString)
|
|
8091
|
+
return;
|
|
8092
|
+
if (completionResults) {
|
|
8093
|
+
var finalCompletionResults = __assign({}, completionResults);
|
|
8094
|
+
var codeLength = context.state.doc.toString().length;
|
|
8095
|
+
finalCompletionResults.from = finalCompletionResults.from > codeLength
|
|
8096
|
+
? codeLength
|
|
8097
|
+
: finalCompletionResults.from;
|
|
8098
|
+
completionResults = null;
|
|
8099
|
+
return finalCompletionResults;
|
|
8100
|
+
}
|
|
8101
|
+
startCompletionResultsSearch(context);
|
|
8102
|
+
}
|
|
8103
|
+
var cancelLastCompletionSearch = function () { };
|
|
8104
|
+
var ɵ0 = cancelLastCompletionSearch;
|
|
8105
|
+
var codeMirrorViewElement;
|
|
8106
|
+
/*
|
|
8107
|
+
* Starts a new completionResults's async search.
|
|
8108
|
+
* Avoids the last search to be finished by calling the "cancelLastCompletionSearch" callback function
|
|
8109
|
+
*/
|
|
8110
|
+
function startCompletionResultsSearch(context) {
|
|
8111
|
+
var token = new AbortController();
|
|
8112
|
+
setTimeout(function () {
|
|
8113
|
+
if (!token.signal.aborted) {
|
|
8114
|
+
showAutocompleteLoadingState();
|
|
8115
|
+
searchCompletionResults(context, token);
|
|
8116
|
+
}
|
|
8117
|
+
}, 500);
|
|
8118
|
+
/*
|
|
8119
|
+
* IMPORTANT: The following lines MUST be the way they are!
|
|
8120
|
+
* Here is being add the listener to any keydown/click event so when any key is downed or mouse clicked, we cancel the last request.
|
|
8121
|
+
* We do this to not show to the user a completionItem in an incorrect place of text, that can be done by either pressing the
|
|
8122
|
+
* arrows, home, end, backspace and etc. The flow is:
|
|
8123
|
+
* 1. We add an eventListener to keydown/click when the autocompletion's request is triggered;
|
|
8124
|
+
* 2. When any key/click is pressed, we remove the listener and cancel the last request by changing the isSearchCanceled on token object
|
|
8125
|
+
* to true;
|
|
8126
|
+
* 3. If any key that requires autocompletion is triggered, the flow repeats;
|
|
8127
|
+
*/
|
|
8128
|
+
codeMirrorViewElement = CodeMirror6Core.getEditorView().contentDOM;
|
|
8129
|
+
cancelLastCompletionSearch = function () {
|
|
8130
|
+
codeMirrorViewElement.removeEventListener("keydown", cancelLastCompletionSearch);
|
|
8131
|
+
codeMirrorViewElement.removeEventListener("click", cancelLastCompletionSearch);
|
|
8132
|
+
token.abort();
|
|
8133
|
+
};
|
|
8134
|
+
codeMirrorViewElement.addEventListener("keydown", cancelLastCompletionSearch);
|
|
8135
|
+
codeMirrorViewElement.addEventListener("click", cancelLastCompletionSearch);
|
|
8136
|
+
}
|
|
8137
|
+
/*
|
|
8138
|
+
* Requests the necessary items to fill the completionResults, although it only really opens the autocomplete
|
|
8139
|
+
* box (by calling the "startCompletion()", that calls the "getCompletionResults") if the current search was not cancelled
|
|
8140
|
+
* by a new one
|
|
8141
|
+
*/
|
|
8142
|
+
function searchCompletionResults(context, token) {
|
|
8143
|
+
var _a, _b, _c, _d;
|
|
8144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8145
|
+
var codeBeforeCursor, filter, path, requests;
|
|
8146
|
+
return __generator(this, function (_e) {
|
|
8147
|
+
codeBeforeCursor = (_d = (_b = (_a = context === null || context === void 0 ? void 0 : context.state) === null || _a === void 0 ? void 0 : _a.doc) === null || _b === void 0 ? void 0 : _b.toString().substring(0, (_c = context === null || context === void 0 ? void 0 : context.pos) !== null && _c !== void 0 ? _c : 0)) !== null && _d !== void 0 ? _d : "";
|
|
8148
|
+
filter = getFilter(codeBeforeCursor);
|
|
8149
|
+
path = getPath(codeBeforeCursor, filter.length);
|
|
8150
|
+
requests = getRequestsBasedOnPath(path, filter, token.signal);
|
|
8151
|
+
Promise
|
|
8152
|
+
.all(requests)
|
|
8153
|
+
.then(function (responses) {
|
|
8154
|
+
if (!token.signal.aborted) {
|
|
8155
|
+
var completions = [].concat(getKeywordsCompletions(path), getContextsCompletions(responses), getExpressionsCompletions(responses), getEntitiesCompletions(responses));
|
|
8156
|
+
var filteredCompletions = getFilteredCompletions(completions, filter);
|
|
8157
|
+
if (filteredCompletions.length) {
|
|
8158
|
+
var formattedCompletions = getFormattedCompletions(filteredCompletions, filter);
|
|
8159
|
+
var sortedCompletions = getSortedCompletions(formattedCompletions);
|
|
8160
|
+
completionResults = {
|
|
8161
|
+
from: context.pos,
|
|
8162
|
+
filter: false,
|
|
8163
|
+
options: sortedCompletions
|
|
8164
|
+
};
|
|
8165
|
+
autocomplete$2.startCompletion(CodeMirror6Core.getEditorView());
|
|
8166
|
+
}
|
|
8167
|
+
else {
|
|
8168
|
+
showAutocompleteEmptyState();
|
|
8169
|
+
}
|
|
8170
|
+
}
|
|
8171
|
+
});
|
|
8172
|
+
return [2 /*return*/];
|
|
8173
|
+
});
|
|
8174
|
+
});
|
|
8175
|
+
}
|
|
8176
|
+
/*
|
|
8177
|
+
* Returns the filter in the code written.
|
|
8178
|
+
* For example in the code "controladoria.empresa", "empresa" would be the filter
|
|
8179
|
+
* and in "controladoria", "controladoria" would be the filter.
|
|
8180
|
+
* Allows only alphanumerics, underscore and hashtag on filter's start.
|
|
8181
|
+
* Does not allow spaces
|
|
8182
|
+
*/
|
|
8183
|
+
function getFilter(string) {
|
|
8184
|
+
var _a, _b;
|
|
8185
|
+
if (string === undefined || string === null)
|
|
8186
|
+
return "";
|
|
8187
|
+
var filter = (_b = (_a = string.match(/(#|\.|)\w*$/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
8188
|
+
return filter.replace(".", "").trim();
|
|
8189
|
+
}
|
|
8190
|
+
/*
|
|
8191
|
+
* Returns the path in the code written based on filter.
|
|
8192
|
+
* For example in the code "controladoria.empresa", "controladoria" would be the path
|
|
8193
|
+
* and in "controladoria", "" would be the path.
|
|
8194
|
+
* Does not allow spaces
|
|
8195
|
+
*/
|
|
8196
|
+
function getPath(string, filterLength) {
|
|
8197
|
+
var _a, _b;
|
|
8198
|
+
if (string === undefined || string === null)
|
|
8199
|
+
return "";
|
|
8200
|
+
var stringWithoutPath = string.substring(0, string.length - filterLength);
|
|
8201
|
+
var path = (_b = (_a = stringWithoutPath.match(/(\w*\.)*$/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
8202
|
+
return path.replace(/\.$/, "");
|
|
8203
|
+
}
|
|
8204
|
+
function getRequestsBasedOnPath(path, filter, abortSignal) {
|
|
8205
|
+
var _a;
|
|
8206
|
+
var languageConfigs = getLanguageConfigs();
|
|
8207
|
+
var requests = [];
|
|
8208
|
+
if (path === "") {
|
|
8209
|
+
requests.push({
|
|
8210
|
+
requestType: RequestTypes.ListContextMetadataById,
|
|
8211
|
+
request: AutocompleteService.listContextMetadataById({
|
|
8212
|
+
id: languageConfigs.contexts,
|
|
8213
|
+
}, abortSignal)
|
|
8214
|
+
});
|
|
8215
|
+
requests.push({
|
|
8216
|
+
requestType: RequestTypes.ListExpressionMetadata,
|
|
8217
|
+
request: AutocompleteService.listExpressionMetadata({
|
|
8218
|
+
context: languageConfigs.contexts,
|
|
8219
|
+
subcontext: (_a = languageConfigs.subContexts) !== null && _a !== void 0 ? _a : [],
|
|
8220
|
+
name: filter,
|
|
8221
|
+
pageRequest: {
|
|
8222
|
+
offset: 0,
|
|
8223
|
+
size: 20
|
|
8224
|
+
}
|
|
8225
|
+
}, abortSignal)
|
|
8226
|
+
});
|
|
8227
|
+
}
|
|
8228
|
+
else if (path.includes(".")) {
|
|
8229
|
+
var splittedPath = path.split(".");
|
|
8230
|
+
requests.push({
|
|
8231
|
+
requestType: RequestTypes.GetFacadeMetadataByPath,
|
|
8232
|
+
request: AutocompleteService.getFacadeMetadataByPath({
|
|
8233
|
+
context: splittedPath[0],
|
|
8234
|
+
entityName: splittedPath[1],
|
|
8235
|
+
fields: splittedPath[2] === undefined ? undefined : splittedPath.slice(2)
|
|
8236
|
+
}, abortSignal)
|
|
8237
|
+
});
|
|
8238
|
+
}
|
|
8239
|
+
else {
|
|
8240
|
+
requests.push({
|
|
8241
|
+
requestType: RequestTypes.ListFacadeMetadataNames,
|
|
8242
|
+
request: AutocompleteService.listFacadeMetadataNames({
|
|
8243
|
+
context: [path],
|
|
8244
|
+
name: filter,
|
|
8245
|
+
pageRequest: {
|
|
8246
|
+
offset: 0,
|
|
8247
|
+
size: 30
|
|
8248
|
+
}
|
|
8249
|
+
}, abortSignal)
|
|
8250
|
+
});
|
|
8251
|
+
}
|
|
8252
|
+
return requests.map(function (request) { return getSafeResponse(request); });
|
|
8253
|
+
}
|
|
8254
|
+
function getKeywordsCompletions(path) {
|
|
8255
|
+
if (path !== "")
|
|
8256
|
+
return [];
|
|
8257
|
+
var completions = [
|
|
8258
|
+
{
|
|
8259
|
+
label: Keywords.SE,
|
|
8260
|
+
apply: "SE ()\nENTAO\n\tacao\nFIM_SE",
|
|
8261
|
+
},
|
|
8262
|
+
{
|
|
8263
|
+
label: Keywords.SENAO,
|
|
8264
|
+
apply: "SENAO\n\tacao",
|
|
8265
|
+
},
|
|
8266
|
+
{
|
|
8267
|
+
label: Keywords.CONTENHA,
|
|
8268
|
+
apply: "CONTENHA(condicao)",
|
|
8269
|
+
},
|
|
8270
|
+
{
|
|
8271
|
+
label: Keywords.ENTAO,
|
|
8272
|
+
apply: "ENTAO\n\tacao",
|
|
8273
|
+
},
|
|
8274
|
+
{
|
|
8275
|
+
label: Keywords.FIM_SE,
|
|
8276
|
+
apply: "FIM_SE ",
|
|
8277
|
+
},
|
|
8278
|
+
{
|
|
8279
|
+
label: Keywords.NAO,
|
|
8280
|
+
apply: "NAO ",
|
|
8281
|
+
},
|
|
8282
|
+
{
|
|
8283
|
+
label: Keywords.E,
|
|
8284
|
+
apply: "E ",
|
|
8285
|
+
},
|
|
8286
|
+
{
|
|
8287
|
+
label: Keywords.OU,
|
|
8288
|
+
apply: "OU "
|
|
8289
|
+
},
|
|
8290
|
+
];
|
|
8291
|
+
return completions.map(function (completionItem) { return (__assign(__assign({}, completionItem), { detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_keyword"), type: CompletionTypes.Keyword })); });
|
|
8292
|
+
}
|
|
8293
|
+
function getContextsCompletions(responses) {
|
|
8294
|
+
var _a, _b;
|
|
8295
|
+
var contextsResponse = responses.find(function (response) {
|
|
8296
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListContextMetadataById;
|
|
8297
|
+
});
|
|
8298
|
+
if (contextsResponse) {
|
|
8299
|
+
return ((_b = (_a = contextsResponse.response) === null || _a === void 0 ? void 0 : _a.contextMetadata) !== null && _b !== void 0 ? _b : [])
|
|
8300
|
+
.map(function (contextMetadata) { return ({
|
|
8301
|
+
label: contextMetadata.name,
|
|
8302
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_context"),
|
|
8303
|
+
apply: contextMetadata.name,
|
|
8304
|
+
type: CompletionTypes.Context
|
|
8305
|
+
}); });
|
|
8306
|
+
}
|
|
8307
|
+
return [];
|
|
8308
|
+
}
|
|
8309
|
+
function getExpressionsCompletions(responses) {
|
|
8310
|
+
var _a, _b;
|
|
8311
|
+
var expressionsResponse = responses.find(function (response) {
|
|
8312
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListExpressionMetadata;
|
|
8313
|
+
});
|
|
8314
|
+
if (expressionsResponse) {
|
|
8315
|
+
return ((_b = (_a = expressionsResponse.response) === null || _a === void 0 ? void 0 : _a.expressionMetadata) !== null && _b !== void 0 ? _b : [])
|
|
8316
|
+
.map(function (expressionMetadata) { return ({
|
|
8317
|
+
label: expressionMetadata.name,
|
|
8318
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_" + (expressionMetadata.type === MetaType.PUBLIC_EXPRESSION
|
|
8319
|
+
? "senior_expression"
|
|
8320
|
+
: "user_expression")),
|
|
8321
|
+
apply: expressionMetadata.name,
|
|
8322
|
+
info: expressionMetadata.description,
|
|
8323
|
+
type: expressionMetadata.type === MetaType.PUBLIC_EXPRESSION ? CompletionTypes.Expression : CompletionTypes.UserExpression
|
|
8324
|
+
}); });
|
|
8325
|
+
}
|
|
8326
|
+
return [];
|
|
8327
|
+
}
|
|
8328
|
+
function getEntitiesCompletions(responses) {
|
|
8329
|
+
var _a, _b, _c, _d, _e;
|
|
8330
|
+
var facadesResponseFromList = responses.find(function (response) {
|
|
8331
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListFacadeMetadataNames;
|
|
8332
|
+
});
|
|
8333
|
+
if (facadesResponseFromList) {
|
|
8334
|
+
return ((_b = (_a = facadesResponseFromList.response) === null || _a === void 0 ? void 0 : _a.facadeMetadataNames) !== null && _b !== void 0 ? _b : [])
|
|
8335
|
+
.map(function (facade) { return ({
|
|
8336
|
+
label: facade.name,
|
|
8337
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_entity"),
|
|
8338
|
+
apply: facade.name,
|
|
8339
|
+
type: CompletionTypes.Entity
|
|
8340
|
+
}); });
|
|
8341
|
+
}
|
|
8342
|
+
var facadesResponseFromGet = responses.find(function (response) {
|
|
8343
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.GetFacadeMetadataByPath;
|
|
8344
|
+
});
|
|
8345
|
+
if (facadesResponseFromGet) {
|
|
8346
|
+
return ((_e = (_d = (_c = facadesResponseFromGet.response) === null || _c === void 0 ? void 0 : _c.facadeMetadata) === null || _d === void 0 ? void 0 : _d.fields) !== null && _e !== void 0 ? _e : [])
|
|
8347
|
+
.map(function (facade) { return ({
|
|
8348
|
+
label: facade.name,
|
|
8349
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_" + (facade.type === MetaType.ENTITY
|
|
8350
|
+
? "entity"
|
|
8351
|
+
: "field")),
|
|
8352
|
+
apply: facade.name,
|
|
8353
|
+
type: facade.type === MetaType.ENTITY ? CompletionTypes.Entity : CompletionTypes.FinalValue
|
|
8354
|
+
}); });
|
|
8355
|
+
}
|
|
8356
|
+
return [];
|
|
8357
|
+
}
|
|
8358
|
+
/*
|
|
8359
|
+
* Filtering the completions to only deal with the necessary items
|
|
8360
|
+
*/
|
|
8361
|
+
function getFilteredCompletions(completions, filter) {
|
|
8362
|
+
return completions
|
|
8363
|
+
.filter(function (completionItem) {
|
|
8364
|
+
return completionItem
|
|
8365
|
+
.label
|
|
8366
|
+
.toLowerCase()
|
|
8367
|
+
.startsWith(filter.toLowerCase());
|
|
8368
|
+
});
|
|
8369
|
+
}
|
|
8370
|
+
/*
|
|
8371
|
+
* Overwriting the completions's apply to remove the entire current written value and apply the the entire completion's apply
|
|
8372
|
+
*/
|
|
8373
|
+
function getFormattedCompletions(completions, filter) {
|
|
8374
|
+
return completions
|
|
8375
|
+
.map(function (completionItem) { return (__assign(__assign({}, completionItem), { apply: getCompletionApply(filter, "" + completionItem.apply) })); });
|
|
8376
|
+
}
|
|
8377
|
+
function getCompletionApply(filter, oldApplyText) {
|
|
8378
|
+
return function (view, completion, from, to) {
|
|
8379
|
+
var newFrom = from - filter.length;
|
|
8380
|
+
view.dispatch({
|
|
8381
|
+
changes: {
|
|
8382
|
+
from: newFrom,
|
|
8383
|
+
to: to,
|
|
8384
|
+
insert: oldApplyText
|
|
8385
|
+
},
|
|
8386
|
+
selection: {
|
|
8387
|
+
anchor: newFrom + oldApplyText.length
|
|
8388
|
+
},
|
|
8389
|
+
userEvent: "input.complete",
|
|
8390
|
+
annotations: autocomplete$2.pickedCompletion.of(completion)
|
|
8391
|
+
});
|
|
8392
|
+
};
|
|
8393
|
+
}
|
|
8394
|
+
var completionsSortOrder = [
|
|
8395
|
+
CompletionTypes.Keyword,
|
|
8396
|
+
CompletionTypes.Context,
|
|
8397
|
+
CompletionTypes.UserExpression,
|
|
8398
|
+
CompletionTypes.Expression,
|
|
8399
|
+
CompletionTypes.Entity,
|
|
8400
|
+
CompletionTypes.FinalValue
|
|
8401
|
+
];
|
|
8402
|
+
/*
|
|
8403
|
+
* Sorts the completions following the "completionsSortOrder" priority order
|
|
8404
|
+
*/
|
|
8405
|
+
function getSortedCompletions(completions) {
|
|
8406
|
+
return completions.sort(function (x, y) {
|
|
8407
|
+
var xPriority = completionsSortOrder.indexOf(x.type);
|
|
8408
|
+
var yPriority = completionsSortOrder.indexOf(y.type);
|
|
8409
|
+
return xPriority - yPriority;
|
|
8410
|
+
});
|
|
8411
|
+
}
|
|
8412
|
+
|
|
8413
|
+
function TaxCalculation() {
|
|
8414
|
+
return new language.LanguageSupport(baseConfigs, [
|
|
8415
|
+
autocomplete(),
|
|
8416
|
+
]);
|
|
8417
|
+
}
|
|
8418
|
+
|
|
8419
|
+
var EditorLanguages = /** @class */ (function () {
|
|
8420
|
+
function EditorLanguages() {
|
|
8421
|
+
}
|
|
8422
|
+
EditorLanguages.getLanguage = function (language) {
|
|
8423
|
+
var languageSupportFactory = EditorLanguages._LANGUAGES.get(language);
|
|
8424
|
+
if (languageSupportFactory)
|
|
8425
|
+
return languageSupportFactory();
|
|
8426
|
+
return [];
|
|
8427
|
+
};
|
|
8428
|
+
EditorLanguages._LANGUAGES = new Map([
|
|
8429
|
+
[exports.Languages.TaxCalculation, TaxCalculation]
|
|
8430
|
+
]);
|
|
8431
|
+
return EditorLanguages;
|
|
8432
|
+
}());
|
|
8433
|
+
|
|
8434
|
+
/**
|
|
8435
|
+
* Adds style to the editor in general
|
|
8436
|
+
* @returns An extension containing the style
|
|
8437
|
+
*/
|
|
8438
|
+
function style$2() {
|
|
8439
|
+
return view.EditorView.theme({
|
|
8440
|
+
"&.cm-editor.cm-focused": {
|
|
8441
|
+
outline: "none",
|
|
8442
|
+
},
|
|
8443
|
+
});
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8446
|
+
var SDSLightHighlightStyle = highlight.HighlightStyle.define([
|
|
8447
|
+
{
|
|
8448
|
+
tag: highlight.tags.keyword,
|
|
8449
|
+
color: "#008080",
|
|
8450
|
+
},
|
|
8451
|
+
{
|
|
8452
|
+
tag: highlight.tags.string,
|
|
8453
|
+
color: "#9C3A3A",
|
|
8454
|
+
},
|
|
8455
|
+
{
|
|
8456
|
+
tag: highlight.tags.number,
|
|
8457
|
+
color: "#400753",
|
|
8458
|
+
},
|
|
8459
|
+
]);
|
|
8460
|
+
|
|
8461
|
+
/**
|
|
8462
|
+
* Adds a vertical scrollbar when the editor's height overflows the parent's height
|
|
8463
|
+
* @returns An extension containing everything needed to add the scrollbar
|
|
8464
|
+
*/
|
|
8465
|
+
function scrollbars() {
|
|
8466
|
+
return [
|
|
8467
|
+
style$3()
|
|
8468
|
+
];
|
|
8469
|
+
}
|
|
8470
|
+
function style$3() {
|
|
8471
|
+
return view.EditorView.baseTheme({
|
|
8472
|
+
"&.cm-editor": {
|
|
8473
|
+
"height": "100%"
|
|
8474
|
+
},
|
|
8475
|
+
});
|
|
8476
|
+
}
|
|
8477
|
+
|
|
8478
|
+
/**
|
|
8479
|
+
* Adds style to editor'font
|
|
8480
|
+
* @returns An extension containing everything needed to add the font style
|
|
8481
|
+
*/
|
|
8482
|
+
function fontStyle() {
|
|
8483
|
+
return [style$4()];
|
|
8484
|
+
}
|
|
8485
|
+
var generalFontStyle = {
|
|
8486
|
+
"font-family": "'Noto Sans Mono', 'sans-serif'",
|
|
8487
|
+
"font-style": "normal",
|
|
8488
|
+
"font-size": "1rem",
|
|
8489
|
+
};
|
|
8490
|
+
function style$4() {
|
|
8491
|
+
return view.EditorView.theme({
|
|
8492
|
+
".cm-scroller": __assign(__assign({}, generalFontStyle), { "letter-spacing": "0", "line-height": "1.5em", "font-variation-settings": "'wght' 400", "color": "#333333" }),
|
|
8493
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul": __assign(__assign({}, generalFontStyle), { "font-variation-settings": "'wght' 300", "color": "#697882" }),
|
|
8494
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionLabel": {
|
|
8495
|
+
"line-height": "1.5em",
|
|
8496
|
+
"font-variation-settings": "'wght' 500",
|
|
8497
|
+
},
|
|
8498
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail": {
|
|
8499
|
+
"font-size": "0.875em",
|
|
8500
|
+
"font-style": "normal",
|
|
8501
|
+
"margin-left": "0.75rem",
|
|
8502
|
+
},
|
|
8503
|
+
});
|
|
8504
|
+
}
|
|
8505
|
+
|
|
8506
|
+
/**
|
|
8507
|
+
* Adds a line counter
|
|
8508
|
+
* @returns An extension containing everything needed to add the line counter
|
|
8509
|
+
*/
|
|
8510
|
+
function lineCounter() {
|
|
8511
|
+
return [
|
|
8512
|
+
gutter.lineNumbers(),
|
|
8513
|
+
style$5()
|
|
8514
|
+
];
|
|
8515
|
+
}
|
|
8516
|
+
function style$5() {
|
|
8517
|
+
return view.EditorView.theme({
|
|
8518
|
+
".cm-gutters": {
|
|
8519
|
+
"background-color": "#fff",
|
|
8520
|
+
"color": "#428BCA",
|
|
8521
|
+
"border-right": "none"
|
|
8522
|
+
},
|
|
8523
|
+
".cm-gutter": {
|
|
8524
|
+
"padding": "0 2rem 0 2rem"
|
|
8525
|
+
}
|
|
8526
|
+
});
|
|
8527
|
+
}
|
|
8528
|
+
|
|
8529
|
+
/**
|
|
8530
|
+
* Adds styles to the autocomplete's tooltip
|
|
8531
|
+
* @returns An extension containing everything needed to add the style
|
|
8532
|
+
*/
|
|
8533
|
+
function autocompleteTooltip() {
|
|
8534
|
+
return [style$6()];
|
|
8535
|
+
}
|
|
8536
|
+
function style$6() {
|
|
8537
|
+
return view.EditorView.baseTheme({
|
|
8538
|
+
".cm-tooltip": {
|
|
8539
|
+
"border": "none !important",
|
|
8540
|
+
"border-radius": "4px",
|
|
8541
|
+
"background-color": "#E5EAEA !important",
|
|
8542
|
+
},
|
|
8543
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul[role='listbox']": {
|
|
8544
|
+
"padding": "1rem",
|
|
8545
|
+
},
|
|
8546
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail": {
|
|
8547
|
+
"margin-left": ".75rem",
|
|
8548
|
+
},
|
|
8549
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail::before": {
|
|
8550
|
+
"content": "'[ '",
|
|
8551
|
+
},
|
|
8552
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail::after": {
|
|
8553
|
+
"content": "' ]'",
|
|
8554
|
+
},
|
|
8555
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionIcon": {
|
|
8556
|
+
"padding-right": 0,
|
|
8557
|
+
"margin-right": ".475rem",
|
|
8558
|
+
"width": "1rem",
|
|
8559
|
+
},
|
|
8560
|
+
".cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
8561
|
+
"border-radius": "4px",
|
|
8562
|
+
"background-color": "#5D96A2 !important",
|
|
8563
|
+
"color": "#fff !important",
|
|
8564
|
+
},
|
|
8565
|
+
".cm-tooltip.cm-completionInfo.cm-completionInfo-right": {
|
|
8566
|
+
"border-radius": "3px",
|
|
8567
|
+
"box-shadow": "0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%)",
|
|
8568
|
+
"background": "#495057 !important",
|
|
8569
|
+
"color": "#fff",
|
|
8570
|
+
"padding": ".5rem",
|
|
8571
|
+
"left": "101.6%",
|
|
8572
|
+
},
|
|
8573
|
+
".cm-tooltip.cm-completionInfo.cm-completionInfo-right::before": {
|
|
8574
|
+
"content": "''",
|
|
8575
|
+
"position": "absolute",
|
|
8576
|
+
"width": 0,
|
|
8577
|
+
"height": 0,
|
|
8578
|
+
"top": ".8125rem",
|
|
8579
|
+
"left": "-.25rem",
|
|
8580
|
+
"margin-top": "-.25rem",
|
|
8581
|
+
"border-color": "transparent",
|
|
8582
|
+
"border-style": "solid",
|
|
8583
|
+
"border-right-color": "#495057",
|
|
8584
|
+
"border-width": ".25rem .25rem .25rem 0",
|
|
8585
|
+
},
|
|
8586
|
+
});
|
|
8587
|
+
}
|
|
8588
|
+
|
|
8589
|
+
/* General Style */
|
|
8590
|
+
function SDSLight() {
|
|
8591
|
+
return [
|
|
8592
|
+
[
|
|
8593
|
+
style$2(),
|
|
8594
|
+
scrollbars(),
|
|
8595
|
+
fontStyle(),
|
|
8596
|
+
lineCounter(),
|
|
8597
|
+
autocompleteTooltip()
|
|
8598
|
+
],
|
|
8599
|
+
SDSLightHighlightStyle
|
|
8600
|
+
];
|
|
8601
|
+
}
|
|
8602
|
+
|
|
8603
|
+
var EditorThemes = /** @class */ (function () {
|
|
8604
|
+
function EditorThemes() {
|
|
8605
|
+
}
|
|
8606
|
+
EditorThemes.getTheme = function (theme) {
|
|
8607
|
+
var EditorThemeFactory = EditorThemes._THEMES.get(theme);
|
|
8608
|
+
if (EditorThemeFactory)
|
|
8609
|
+
return EditorThemeFactory();
|
|
8610
|
+
return [];
|
|
8611
|
+
};
|
|
8612
|
+
EditorThemes._THEMES = new Map([
|
|
8613
|
+
[exports.Themes.SDSLight, SDSLight]
|
|
8614
|
+
]);
|
|
8615
|
+
return EditorThemes;
|
|
8616
|
+
}());
|
|
8617
|
+
|
|
8618
|
+
var CodeMirror6Core = /** @class */ (function (_super) {
|
|
8619
|
+
__extends(CodeMirror6Core, _super);
|
|
8620
|
+
function CodeMirror6Core() {
|
|
8621
|
+
var _this = _super.call(this) || this;
|
|
8622
|
+
/* These are necessary for the setCode and setEditorOptions can be called before view has been created */
|
|
8623
|
+
_this._codeReceivedBeforeViewCreation = "";
|
|
8624
|
+
_this._editorOptionsReceivedBeforeViewCreation = [];
|
|
8625
|
+
return _this;
|
|
8626
|
+
}
|
|
8627
|
+
CodeMirror6Core.getEditorView = function () {
|
|
8628
|
+
return CodeMirror6Core._editorView;
|
|
8629
|
+
};
|
|
8630
|
+
CodeMirror6Core.updateEditorView = function () {
|
|
8631
|
+
var _a;
|
|
8632
|
+
var transactionSpecs = [];
|
|
8633
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8634
|
+
transactionSpecs[_i] = arguments[_i];
|
|
8635
|
+
}
|
|
8636
|
+
(_a = CodeMirror6Core._editorView).dispatch.apply(_a, __spread(transactionSpecs));
|
|
8637
|
+
};
|
|
8638
|
+
CodeMirror6Core.prototype.setCoreWrapperElement = function (element) {
|
|
8639
|
+
this.createEditorView(element);
|
|
8640
|
+
};
|
|
8641
|
+
CodeMirror6Core.prototype.setCode = function (code) {
|
|
8642
|
+
this.changeEditorContent(code);
|
|
8643
|
+
};
|
|
8644
|
+
CodeMirror6Core.prototype.initCore = function () {
|
|
8645
|
+
this.setObservablesListeners();
|
|
8646
|
+
};
|
|
8647
|
+
CodeMirror6Core.prototype.destroyCore = function () {
|
|
8648
|
+
this._codeReceivedBeforeViewCreation = "";
|
|
8649
|
+
CodeMirror6Core._editorView = null;
|
|
8650
|
+
CodeMirror6Core._ngUnsubscribe.next();
|
|
8651
|
+
CodeMirror6Core._ngUnsubscribe.complete();
|
|
8652
|
+
};
|
|
8653
|
+
CodeMirror6Core.prototype.setCoreEditorOptions = function (options) {
|
|
8654
|
+
var language = EditorLanguages.getLanguage(options.language);
|
|
8655
|
+
var theme = EditorThemes.getTheme(options.theme);
|
|
8656
|
+
if (CodeMirror6Core._editorView) {
|
|
8657
|
+
CodeMirror6Core.updateEditorView({
|
|
8658
|
+
effects: state.StateEffect.reconfigure.of([
|
|
8659
|
+
language,
|
|
8660
|
+
theme,
|
|
8661
|
+
this.getCodeChangeListenerExtension()
|
|
8662
|
+
])
|
|
8663
|
+
});
|
|
8664
|
+
}
|
|
8665
|
+
else {
|
|
8666
|
+
this._editorOptionsReceivedBeforeViewCreation = [language, theme];
|
|
8667
|
+
}
|
|
8668
|
+
};
|
|
8669
|
+
CodeMirror6Core.prototype.highlightCode = function (markers) {
|
|
8670
|
+
var diagnostics = convertMarkersToDiagnostics(markers, CodeMirror6Core._editorView.state.doc.length);
|
|
8671
|
+
CodeMirror6Core.updateEditorView(lint.setDiagnostics(CodeMirror6Core._editorView.state, diagnostics));
|
|
8672
|
+
};
|
|
8673
|
+
CodeMirror6Core.prototype.setObservablesListeners = function () {
|
|
8674
|
+
var _this = this;
|
|
8675
|
+
CodeMirror6Core.$onCompletionItemsUpdate
|
|
8676
|
+
.pipe(operators.takeUntil(CodeMirror6Core._ngUnsubscribe))
|
|
8677
|
+
.subscribe(function (items) { return _this.updateCompletionItems(items); });
|
|
8678
|
+
};
|
|
8679
|
+
CodeMirror6Core.prototype.createEditorView = function (parentElement) {
|
|
8680
|
+
CodeMirror6Core._editorView = new view.EditorView({
|
|
8681
|
+
parent: parentElement,
|
|
8682
|
+
state: state.EditorState.create({
|
|
8683
|
+
doc: this._codeReceivedBeforeViewCreation,
|
|
8684
|
+
extensions: [
|
|
8685
|
+
this._editorOptionsReceivedBeforeViewCreation,
|
|
8686
|
+
this.getCodeChangeListenerExtension()
|
|
8687
|
+
]
|
|
8688
|
+
})
|
|
8689
|
+
});
|
|
8690
|
+
this.notifyCoreFinishLoad();
|
|
8691
|
+
};
|
|
8692
|
+
CodeMirror6Core.prototype.getCodeChangeListenerExtension = function () {
|
|
8693
|
+
var _this = this;
|
|
8694
|
+
return view.EditorView.updateListener.of(function (update) { return update.docChanged && _this.notifyCodeChange(update.state.doc.toString()); });
|
|
8695
|
+
};
|
|
8696
|
+
CodeMirror6Core.prototype.changeEditorContent = function (code) {
|
|
8697
|
+
if (CodeMirror6Core._editorView) {
|
|
8698
|
+
CodeMirror6Core.updateEditorView({
|
|
8699
|
+
changes: {
|
|
8700
|
+
from: 0,
|
|
8701
|
+
to: CodeMirror6Core._editorView.state.doc.length,
|
|
8702
|
+
insert: code
|
|
8703
|
+
}
|
|
8704
|
+
});
|
|
8705
|
+
}
|
|
8706
|
+
else {
|
|
8707
|
+
this._codeReceivedBeforeViewCreation = code;
|
|
8708
|
+
}
|
|
8709
|
+
};
|
|
8710
|
+
CodeMirror6Core.$onCompletionItemsUpdate = new rxjs.Subject();
|
|
8711
|
+
CodeMirror6Core._ngUnsubscribe = new rxjs.Subject();
|
|
8712
|
+
CodeMirror6Core._editorView = null;
|
|
8713
|
+
return CodeMirror6Core;
|
|
8714
|
+
}(CoreFacade));
|
|
8715
|
+
|
|
8716
|
+
var CodeEditorModule = /** @class */ (function () {
|
|
8717
|
+
function CodeEditorModule() {
|
|
8718
|
+
}
|
|
8719
|
+
CodeEditorModule = __decorate([
|
|
8720
|
+
core.NgModule({
|
|
8721
|
+
imports: [
|
|
8722
|
+
common.CommonModule,
|
|
8723
|
+
CustomTranslationsModule,
|
|
8724
|
+
],
|
|
8725
|
+
declarations: [CodeEditorComponent],
|
|
8726
|
+
exports: [CodeEditorComponent],
|
|
7237
8727
|
providers: [
|
|
7238
8728
|
{
|
|
7239
|
-
provide:
|
|
7240
|
-
|
|
8729
|
+
provide: CoreFacade,
|
|
8730
|
+
useClass: CodeMirror6Core
|
|
7241
8731
|
}
|
|
7242
8732
|
]
|
|
7243
|
-
}
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
AngularComponentsModule = AngularComponentsModule_1 = __decorate([
|
|
7247
|
-
core.NgModule({})
|
|
7248
|
-
], AngularComponentsModule);
|
|
7249
|
-
return AngularComponentsModule;
|
|
8733
|
+
})
|
|
8734
|
+
], CodeEditorModule);
|
|
8735
|
+
return CodeEditorModule;
|
|
7250
8736
|
}());
|
|
7251
8737
|
|
|
7252
8738
|
exports.AngularComponentsModule = AngularComponentsModule;
|
|
@@ -7266,6 +8752,7 @@
|
|
|
7266
8752
|
exports.CalendarMaskDirective = CalendarMaskDirective;
|
|
7267
8753
|
exports.CalendarMaskModule = CalendarMaskModule;
|
|
7268
8754
|
exports.ChipsField = ChipsField;
|
|
8755
|
+
exports.CodeEditorModule = CodeEditorModule;
|
|
7269
8756
|
exports.CollapseLinkComponent = CollapseLinkComponent;
|
|
7270
8757
|
exports.CollapseLinkModule = CollapseLinkModule;
|
|
7271
8758
|
exports.ControlErrorsComponent = ControlErrorsComponent;
|
|
@@ -7293,6 +8780,7 @@
|
|
|
7293
8780
|
exports.GlobalSearchComponent = GlobalSearchComponent;
|
|
7294
8781
|
exports.GlobalSearchDropdownItemComponent = GlobalSearchDropdownItemComponent;
|
|
7295
8782
|
exports.GlobalSearchModule = GlobalSearchModule;
|
|
8783
|
+
exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
|
|
7296
8784
|
exports.ImageCropperComponent = ImageCropperComponent;
|
|
7297
8785
|
exports.ImageCropperModule = ImageCropperModule;
|
|
7298
8786
|
exports.ImageCropperService = ImageCropperService;
|
|
@@ -7347,6 +8835,7 @@
|
|
|
7347
8835
|
exports.TableHeaderCheckboxComponent = TableHeaderCheckboxComponent;
|
|
7348
8836
|
exports.TableHeaderCheckboxModule = TableHeaderCheckboxModule;
|
|
7349
8837
|
exports.TableModule = TableModule;
|
|
8838
|
+
exports.TaxCalculationLanguageConfigs = TaxCalculationLanguageConfigs;
|
|
7350
8839
|
exports.TextAreaField = TextAreaField;
|
|
7351
8840
|
exports.TextField = TextField;
|
|
7352
8841
|
exports.ThumbnailComponent = ThumbnailComponent;
|
|
@@ -7366,6 +8855,10 @@
|
|
|
7366
8855
|
exports.ɵbg = ThumbnailService;
|
|
7367
8856
|
exports.ɵbh = InfiniteScrollModule;
|
|
7368
8857
|
exports.ɵbi = InfiniteScrollDirective;
|
|
8858
|
+
exports.ɵbj = CustomTranslationsModule;
|
|
8859
|
+
exports.ɵbk = CodeEditorComponent;
|
|
8860
|
+
exports.ɵbl = CoreFacade;
|
|
8861
|
+
exports.ɵbm = CodeMirror6Core;
|
|
7369
8862
|
exports.ɵc = LocalizedBignumberImpurePipe;
|
|
7370
8863
|
exports.ɵd = TokenListModule;
|
|
7371
8864
|
exports.ɵe = TableColumnsComponent;
|