@seniorsistemas/angular-components 14.9.12 → 14.10.0
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 +1840 -24
- 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 +30 -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 +25 -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/extensions/on-paste-completion-items-updater/models/index.d.ts +1 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/interfaces/request-extra-info.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/on-paste-completion-items-updater.d.ts +6 -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 +3 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/update-core-completion-items.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/linters/tax-calculation/models/index.d.ts +1 -0
- package/components/code-editor/infra/linters/tax-calculation/models/interfaces/validation.d.ts +4 -0
- package/components/code-editor/infra/linters/tax-calculation/tax-calculation-linter.d.ts +11 -0
- package/components/code-editor/infra/linters/tax-calculation/validation-compositors/index.d.ts +2 -0
- package/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-composite.d.ts +6 -0
- package/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-workers-compositor/validations-workers-composite.d.ts +6 -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 +3 -0
- package/components/code-editor/infra/utils/regex-index-of.d.ts +8 -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/components/dynamic-form/configurations/fields/chips-field.d.ts +2 -0
- package/components/dynamic-form/configurations/form-field.d.ts +1 -1
- package/esm2015/angular-components.module.js +4 -3
- package/esm2015/components/code-editor/core/facades/core-facade.js +80 -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 +12 -0
- package/esm2015/components/code-editor/index.js +5 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.js +94 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.js +12 -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 +342 -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/extensions/on-paste-completion-items-updater/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/interfaces/request-extra-info.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/on-paste-completion-items-updater.js +164 -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 +11 -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 +4 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/update-core-completion-items.js +30 -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 +12 -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/linters/tax-calculation/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/models/interfaces/validation.js +1 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/tax-calculation-linter.js +19 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/validation-compositors/index.js +3 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-composite.js +16 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-workers-compositor/validations-workers-composite.js +25 -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 +4 -0
- package/esm2015/components/code-editor/infra/utils/regex-index-of.js +12 -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 +90 -0
- package/esm2015/components/code-editor/presentation/code-editor-module.js +27 -0
- package/esm2015/components/dynamic-form/components/fields/chips/chips-field.component.js +2 -2
- package/esm2015/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
- package/esm2015/components/dynamic-form/configurations/fields/chips-field.js +2 -1
- package/esm2015/components/dynamic-form/configurations/form-field.js +1 -1
- 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 +91 -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 +16 -0
- package/esm5/components/code-editor/index.js +5 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.js +106 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.js +16 -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 +356 -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/extensions/on-paste-completion-items-updater/models/index.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/interfaces/request-extra-info.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/on-paste-completion-items-updater.js +191 -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 +11 -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 +4 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/update-core-completion-items.js +34 -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 +16 -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/linters/tax-calculation/models/index.js +1 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/models/interfaces/validation.js +1 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/tax-calculation-linter.js +21 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/validation-compositors/index.js +3 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-composite.js +49 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-workers-compositor/validations-workers-composite.js +42 -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 +4 -0
- package/esm5/components/code-editor/infra/utils/regex-index-of.js +12 -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 +100 -0
- package/esm5/components/code-editor/presentation/code-editor-module.js +30 -0
- package/esm5/components/dynamic-form/components/fields/chips/chips-field.component.js +2 -2
- package/esm5/components/dynamic-form/components/fields/select/select-field.component.js +2 -2
- package/esm5/components/dynamic-form/configurations/fields/chips-field.js +2 -1
- package/esm5/components/dynamic-form/configurations/form-field.js +1 -1
- 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 +1682 -42
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +1861 -43
- 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;
|
|
@@ -1720,6 +1720,7 @@
|
|
|
1720
1720
|
__extends(ChipsField, _super);
|
|
1721
1721
|
function ChipsField(config) {
|
|
1722
1722
|
var _this = _super.call(this, config) || this;
|
|
1723
|
+
_this.keyFilter = config.keyFilter;
|
|
1723
1724
|
_this.onAdd = config.onAdd;
|
|
1724
1725
|
_this.onRemove = config.onRemove;
|
|
1725
1726
|
_this.onChipClick = config.onChipClick;
|
|
@@ -2504,7 +2505,7 @@
|
|
|
2504
2505
|
core.ViewChild(dialog.Dialog, { static: false })
|
|
2505
2506
|
], LookupComponent.prototype, "dialog", void 0);
|
|
2506
2507
|
__decorate([
|
|
2507
|
-
core.ViewChild(autocomplete.AutoComplete, { static: false })
|
|
2508
|
+
core.ViewChild(autocomplete$1.AutoComplete, { static: false })
|
|
2508
2509
|
], LookupComponent.prototype, "autocomplete", void 0);
|
|
2509
2510
|
LookupComponent = LookupComponent_1 = __decorate([
|
|
2510
2511
|
core.Component({
|
|
@@ -3876,6 +3877,29 @@
|
|
|
3876
3877
|
EnumBadgeColors["BLUE"] = "sds-semantic-blue";
|
|
3877
3878
|
})(exports.EnumBadgeColors || (exports.EnumBadgeColors = {}));
|
|
3878
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
|
+
|
|
3879
3903
|
var TableColumnsComponent = /** @class */ (function () {
|
|
3880
3904
|
function TableColumnsComponent(viewContainerRef, translate, hostProjectConfigs) {
|
|
3881
3905
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -4067,7 +4091,7 @@
|
|
|
4067
4091
|
TableColumnsComponent.ctorParameters = function () { return [
|
|
4068
4092
|
{ type: core.ViewContainerRef },
|
|
4069
4093
|
{ type: core$1.TranslateService },
|
|
4070
|
-
{ type: undefined, decorators: [{ type: core.Inject, args: [
|
|
4094
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
4071
4095
|
]; };
|
|
4072
4096
|
__decorate([
|
|
4073
4097
|
core.ViewChild("columnsTemplate", { static: true })
|
|
@@ -4087,7 +4111,7 @@
|
|
|
4087
4111
|
selector: "s-table-columns",
|
|
4088
4112
|
styles: [":host{display:none}"]
|
|
4089
4113
|
}),
|
|
4090
|
-
__param(2, core.Inject(
|
|
4114
|
+
__param(2, core.Inject(HostProjectConfigsInjectionToken))
|
|
4091
4115
|
], TableColumnsComponent);
|
|
4092
4116
|
return TableColumnsComponent;
|
|
4093
4117
|
}());
|
|
@@ -4240,7 +4264,7 @@
|
|
|
4240
4264
|
], ChipsFieldComponent.prototype, "formControl", void 0);
|
|
4241
4265
|
ChipsFieldComponent = __decorate([
|
|
4242
4266
|
core.Component({
|
|
4243
|
-
template: "<p-chips\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n></p-chips>\n"
|
|
4267
|
+
template: "<p-chips\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\"\n></p-chips>\n"
|
|
4244
4268
|
})
|
|
4245
4269
|
], ChipsFieldComponent);
|
|
4246
4270
|
return ChipsFieldComponent;
|
|
@@ -4441,7 +4465,7 @@
|
|
|
4441
4465
|
], SelectFieldComponent.prototype, "formControl", void 0);
|
|
4442
4466
|
SelectFieldComponent = __decorate([
|
|
4443
4467
|
core.Component({
|
|
4444
|
-
template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo ? field.appendTo : 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n emptyFilterMessage=\"Nenhum registro encontrado\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-multiSelect>\n\n"
|
|
4468
|
+
template: "<p-dropdown\n *ngIf=\"!field.multiple\"\n [inputId]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [placeholder]=\"field.placeholder || ' '\"\n [formControl]=\"formControl\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [showClear]=\"field.showClear\"\n dataKey=\"{{field.dataKey}}\"\n optionLabel=\"{{field.optionLabel}}\"\n [autoDisplayFirst]=\"field.autoDisplayFirst\"\n [appendTo]=\"field.appendTo ? field.appendTo : 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-dropdown>\n<p-multiSelect\n *ngIf=\"field.multiple\"\n [formControl]=\"formControl\"\n [name]=\"field.name\"\n [inputId]=\"(field.id || field.name)\"\n [options]=\"isFunction(field.options) ? field.options() : field.options\"\n [defaultLabel]=\"field.placeholder\"\n [pTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n emptyFilterMessage=\"Nenhum registro encontrado\"\n [showDelay]=\"500\"\n [selectedItemsLabel]=\"field.multipleSelectedLabel\"\n [appendTo]=\"field.appendTo ? field.appendTo : 'body'\"\n (onClick)=\"field.onClick ? field.onClick($event) : null\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\"\n>\n</p-multiSelect>\n\n"
|
|
4445
4469
|
})
|
|
4446
4470
|
], SelectFieldComponent);
|
|
4447
4471
|
return SelectFieldComponent;
|
|
@@ -4947,7 +4971,7 @@
|
|
|
4947
4971
|
LocalizedNumberInputModule,
|
|
4948
4972
|
ControlErrorsModule,
|
|
4949
4973
|
LocaleModule,
|
|
4950
|
-
autocomplete.AutoCompleteModule,
|
|
4974
|
+
autocomplete$1.AutoCompleteModule,
|
|
4951
4975
|
multiselect.MultiSelectModule,
|
|
4952
4976
|
button.ButtonModule,
|
|
4953
4977
|
ButtonModule,
|
|
@@ -7226,26 +7250,1811 @@
|
|
|
7226
7250
|
return GlobalSearchModule;
|
|
7227
7251
|
}());
|
|
7228
7252
|
|
|
7229
|
-
|
|
7230
|
-
|
|
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 ValidationWorkersComposite = /** @class */ (function () {
|
|
7266
|
+
function ValidationWorkersComposite() {
|
|
7267
|
+
this._validations = [];
|
|
7268
|
+
}
|
|
7269
|
+
ValidationWorkersComposite.prototype.validate = function (code, completionItems) {
|
|
7270
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7271
|
+
var _this = this;
|
|
7272
|
+
return __generator(this, function (_a) {
|
|
7273
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
7274
|
+
var e_1, _a;
|
|
7275
|
+
var markers = [];
|
|
7276
|
+
var finishedWorkers = 0;
|
|
7277
|
+
try {
|
|
7278
|
+
for (var _b = __values(_this._validations), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7279
|
+
var worker = _c.value;
|
|
7280
|
+
worker.onmessage = function (_a) {
|
|
7281
|
+
var data = _a.data;
|
|
7282
|
+
markers.concat(data);
|
|
7283
|
+
finishedWorkers++;
|
|
7284
|
+
if (finishedWorkers === _this._validations.length) {
|
|
7285
|
+
resolve(markers);
|
|
7286
|
+
}
|
|
7287
|
+
};
|
|
7288
|
+
worker.postMessage({ code: code, completionItems: completionItems });
|
|
7289
|
+
}
|
|
7290
|
+
}
|
|
7291
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7292
|
+
finally {
|
|
7293
|
+
try {
|
|
7294
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7295
|
+
}
|
|
7296
|
+
finally { if (e_1) throw e_1.error; }
|
|
7297
|
+
}
|
|
7298
|
+
})];
|
|
7299
|
+
});
|
|
7300
|
+
});
|
|
7301
|
+
};
|
|
7302
|
+
return ValidationWorkersComposite;
|
|
7303
|
+
}());
|
|
7304
|
+
|
|
7305
|
+
var ValidationComposite = /** @class */ (function () {
|
|
7306
|
+
function ValidationComposite() {
|
|
7307
|
+
this._validations = [];
|
|
7308
|
+
}
|
|
7309
|
+
ValidationComposite.prototype.validate = function (code, completionItems) {
|
|
7310
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7311
|
+
var markers, _a, _b, validation, _c, _d, e_1_1;
|
|
7312
|
+
var e_1, _e;
|
|
7313
|
+
return __generator(this, function (_f) {
|
|
7314
|
+
switch (_f.label) {
|
|
7315
|
+
case 0:
|
|
7316
|
+
markers = [];
|
|
7317
|
+
_f.label = 1;
|
|
7318
|
+
case 1:
|
|
7319
|
+
_f.trys.push([1, 6, 7, 8]);
|
|
7320
|
+
_a = __values(this._validations), _b = _a.next();
|
|
7321
|
+
_f.label = 2;
|
|
7322
|
+
case 2:
|
|
7323
|
+
if (!!_b.done) return [3 /*break*/, 5];
|
|
7324
|
+
validation = _b.value;
|
|
7325
|
+
_d = (_c = markers).concat;
|
|
7326
|
+
return [4 /*yield*/, validation.validate(code, completionItems)];
|
|
7327
|
+
case 3:
|
|
7328
|
+
_d.apply(_c, [_f.sent()]);
|
|
7329
|
+
_f.label = 4;
|
|
7330
|
+
case 4:
|
|
7331
|
+
_b = _a.next();
|
|
7332
|
+
return [3 /*break*/, 2];
|
|
7333
|
+
case 5: return [3 /*break*/, 8];
|
|
7334
|
+
case 6:
|
|
7335
|
+
e_1_1 = _f.sent();
|
|
7336
|
+
e_1 = { error: e_1_1 };
|
|
7337
|
+
return [3 /*break*/, 8];
|
|
7338
|
+
case 7:
|
|
7339
|
+
try {
|
|
7340
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
7341
|
+
}
|
|
7342
|
+
finally { if (e_1) throw e_1.error; }
|
|
7343
|
+
return [7 /*endfinally*/];
|
|
7344
|
+
case 8: return [2 /*return*/, markers];
|
|
7345
|
+
}
|
|
7346
|
+
});
|
|
7347
|
+
});
|
|
7348
|
+
};
|
|
7349
|
+
return ValidationComposite;
|
|
7350
|
+
}());
|
|
7351
|
+
|
|
7352
|
+
/**
|
|
7353
|
+
* Linter for the "TaxCalculation" Language
|
|
7354
|
+
*/
|
|
7355
|
+
var TaxCalculationLinter = /** @class */ (function () {
|
|
7356
|
+
function TaxCalculationLinter() {
|
|
7357
|
+
this.setValidation();
|
|
7231
7358
|
}
|
|
7232
|
-
|
|
7233
|
-
|
|
7359
|
+
TaxCalculationLinter.prototype.lint = function (code, completionItems) {
|
|
7360
|
+
return this._validation.validate(code, completionItems || []);
|
|
7361
|
+
};
|
|
7362
|
+
TaxCalculationLinter.prototype.setValidation = function () {
|
|
7363
|
+
var browserSupportsWorkers = typeof Worker !== "undefined";
|
|
7364
|
+
this._validation = browserSupportsWorkers
|
|
7365
|
+
? new ValidationWorkersComposite()
|
|
7366
|
+
: new ValidationComposite();
|
|
7367
|
+
};
|
|
7368
|
+
return TaxCalculationLinter;
|
|
7369
|
+
}());
|
|
7370
|
+
|
|
7371
|
+
var CoreLinters = /** @class */ (function () {
|
|
7372
|
+
function CoreLinters() {
|
|
7373
|
+
}
|
|
7374
|
+
CoreLinters.getLinter = function (language) {
|
|
7375
|
+
return CoreLinters._LINTERS.get(language);
|
|
7376
|
+
};
|
|
7377
|
+
CoreLinters._LINTERS = new Map([
|
|
7378
|
+
[exports.Languages.TaxCalculation, new TaxCalculationLinter()]
|
|
7379
|
+
]);
|
|
7380
|
+
return CoreLinters;
|
|
7381
|
+
}());
|
|
7382
|
+
|
|
7383
|
+
var CoreFacade = /** @class */ (function () {
|
|
7384
|
+
function CoreFacade() {
|
|
7385
|
+
this.$onCoreFinishLoad = new rxjs.ReplaySubject(1);
|
|
7386
|
+
this.$onCodeChange = new rxjs.Subject();
|
|
7387
|
+
this.$onCodeValidityChange = new rxjs.Subject();
|
|
7388
|
+
this._completionItems = [];
|
|
7389
|
+
}
|
|
7390
|
+
CoreFacade.prototype.changeEditorOptions = function (options) {
|
|
7391
|
+
if (options) {
|
|
7392
|
+
if (typeof options !== "object")
|
|
7393
|
+
throw new Error("Editor's options must be an EditorOptions object");
|
|
7394
|
+
this.validateLanguage(options.language);
|
|
7395
|
+
this.validateTheme(options.theme);
|
|
7396
|
+
this.setLinter(options.language);
|
|
7397
|
+
this.setCoreEditorOptions(options);
|
|
7398
|
+
}
|
|
7399
|
+
};
|
|
7400
|
+
CoreFacade.prototype.changeCode = function (code) {
|
|
7401
|
+
if (code !== this._lastCodeEmitted) {
|
|
7402
|
+
this.setCode(code);
|
|
7403
|
+
}
|
|
7404
|
+
};
|
|
7405
|
+
CoreFacade.prototype.destroyObservables = function () { };
|
|
7406
|
+
CoreFacade.prototype.getOnCoreFinishLoadObservable = function () {
|
|
7407
|
+
return this.$onCoreFinishLoad.asObservable();
|
|
7408
|
+
};
|
|
7409
|
+
CoreFacade.prototype.getOnCodeChangeObservable = function () {
|
|
7410
|
+
return this.$onCodeChange.asObservable();
|
|
7411
|
+
};
|
|
7412
|
+
CoreFacade.prototype.getOnCodeValidityChangeObservable = function () {
|
|
7413
|
+
return this.$onCodeValidityChange.asObservable();
|
|
7414
|
+
};
|
|
7415
|
+
CoreFacade.prototype.notifyCoreFinishLoad = function () {
|
|
7416
|
+
this.$onCoreFinishLoad.next();
|
|
7417
|
+
};
|
|
7418
|
+
CoreFacade.prototype.notifyCodeChange = function (code) {
|
|
7419
|
+
if (code !== this._lastCodeEmitted) {
|
|
7420
|
+
this._lastCodeEmitted = code;
|
|
7421
|
+
this.$onCodeChange.next(code);
|
|
7422
|
+
this.validateCode(code);
|
|
7423
|
+
}
|
|
7424
|
+
};
|
|
7425
|
+
CoreFacade.prototype.updateCompletionItems = function (items) {
|
|
7426
|
+
this._completionItems = items;
|
|
7427
|
+
this.validateCode(this._lastCodeEmitted);
|
|
7428
|
+
};
|
|
7429
|
+
CoreFacade.prototype.setLinter = function (language) {
|
|
7430
|
+
this._linter = CoreLinters.getLinter(language);
|
|
7431
|
+
};
|
|
7432
|
+
CoreFacade.prototype.validateCode = function (code) {
|
|
7433
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7434
|
+
var markers;
|
|
7435
|
+
return __generator(this, function (_a) {
|
|
7436
|
+
switch (_a.label) {
|
|
7437
|
+
case 0:
|
|
7438
|
+
if (!this._linter) return [3 /*break*/, 2];
|
|
7439
|
+
return [4 /*yield*/, this._linter.lint(code, this._completionItems)];
|
|
7440
|
+
case 1:
|
|
7441
|
+
markers = _a.sent();
|
|
7442
|
+
this.highlightCode(markers);
|
|
7443
|
+
this.notifyCodeValidityChange(!!markers.length);
|
|
7444
|
+
_a.label = 2;
|
|
7445
|
+
case 2: return [2 /*return*/];
|
|
7446
|
+
}
|
|
7447
|
+
});
|
|
7448
|
+
});
|
|
7449
|
+
};
|
|
7450
|
+
CoreFacade.prototype.notifyCodeValidityChange = function (validity) {
|
|
7451
|
+
if (validity !== this._lastCodeValidityEmitted) {
|
|
7452
|
+
this._lastCodeValidityEmitted = validity;
|
|
7453
|
+
this.$onCodeValidityChange.next(validity);
|
|
7454
|
+
}
|
|
7455
|
+
};
|
|
7456
|
+
CoreFacade.prototype.validateLanguage = function (language) {
|
|
7457
|
+
var languages = Object.values(exports.Languages);
|
|
7458
|
+
if (language && !languages.includes(language))
|
|
7459
|
+
throw new Error("The informed language \"" + language + "\" is not supported");
|
|
7460
|
+
};
|
|
7461
|
+
CoreFacade.prototype.validateTheme = function (theme) {
|
|
7462
|
+
var themes = Object.values(exports.Themes);
|
|
7463
|
+
if (theme && !themes.includes(theme))
|
|
7464
|
+
throw new Error("The informed theme \"" + theme + "\" is not supported");
|
|
7465
|
+
};
|
|
7466
|
+
return CoreFacade;
|
|
7467
|
+
}());
|
|
7468
|
+
|
|
7469
|
+
var CodeEditorComponent = /** @class */ (function () {
|
|
7470
|
+
function CodeEditorComponent(coreFacade) {
|
|
7471
|
+
this.coreFacade = coreFacade;
|
|
7472
|
+
this._ngUnsubscribe = new rxjs.Subject();
|
|
7473
|
+
this.codeChange = new core.EventEmitter();
|
|
7474
|
+
this.isCodeValidChange = new core.EventEmitter();
|
|
7475
|
+
this.onCodeChange = new core.EventEmitter();
|
|
7476
|
+
this.onComponentFinishLoad = new core.EventEmitter();
|
|
7477
|
+
}
|
|
7478
|
+
Object.defineProperty(CodeEditorComponent.prototype, "editorOptions", {
|
|
7479
|
+
set: function (options) {
|
|
7480
|
+
this.coreFacade.changeEditorOptions(options);
|
|
7481
|
+
},
|
|
7482
|
+
enumerable: true,
|
|
7483
|
+
configurable: true
|
|
7484
|
+
});
|
|
7485
|
+
Object.defineProperty(CodeEditorComponent.prototype, "code", {
|
|
7486
|
+
set: function (code) {
|
|
7487
|
+
this.coreFacade.changeCode(code);
|
|
7488
|
+
},
|
|
7489
|
+
enumerable: true,
|
|
7490
|
+
configurable: true
|
|
7491
|
+
});
|
|
7492
|
+
CodeEditorComponent.prototype.ngOnInit = function () {
|
|
7493
|
+
this.setupCoreListeners();
|
|
7494
|
+
};
|
|
7495
|
+
CodeEditorComponent.prototype.ngAfterViewInit = function () {
|
|
7496
|
+
this.setCoreWrapperElement();
|
|
7497
|
+
};
|
|
7498
|
+
CodeEditorComponent.prototype.ngOnDestroy = function () {
|
|
7499
|
+
this.coreFacade.destroyObservables();
|
|
7500
|
+
this._ngUnsubscribe.next();
|
|
7501
|
+
this._ngUnsubscribe.complete();
|
|
7502
|
+
};
|
|
7503
|
+
CodeEditorComponent.prototype.setCoreWrapperElement = function () {
|
|
7504
|
+
this.coreFacade.setCoreWrapperElement(this.coreWrapperElement.nativeElement);
|
|
7505
|
+
};
|
|
7506
|
+
CodeEditorComponent.prototype.setupCoreListeners = function () {
|
|
7507
|
+
var _this = this;
|
|
7508
|
+
this.coreFacade
|
|
7509
|
+
.getOnCoreFinishLoadObservable()
|
|
7510
|
+
.pipe(operators.take(1))
|
|
7511
|
+
.subscribe(function () { return _this.onComponentFinishLoad.emit(); });
|
|
7512
|
+
this.coreFacade
|
|
7513
|
+
.getOnCodeChangeObservable()
|
|
7514
|
+
.pipe(operators.takeUntil(this._ngUnsubscribe))
|
|
7515
|
+
.subscribe(function (code) {
|
|
7516
|
+
_this.codeChange.emit(code);
|
|
7517
|
+
_this.onCodeChange.emit(code);
|
|
7518
|
+
});
|
|
7519
|
+
this.coreFacade
|
|
7520
|
+
.getOnCodeValidityChangeObservable()
|
|
7521
|
+
.pipe(operators.takeUntil(this._ngUnsubscribe))
|
|
7522
|
+
.subscribe(function (validity) {
|
|
7523
|
+
_this.isCodeValidChange.emit(validity);
|
|
7524
|
+
});
|
|
7525
|
+
};
|
|
7526
|
+
CodeEditorComponent.ctorParameters = function () { return [
|
|
7527
|
+
{ type: CoreFacade }
|
|
7528
|
+
]; };
|
|
7529
|
+
__decorate([
|
|
7530
|
+
core.ViewChild("coreWrapper")
|
|
7531
|
+
], CodeEditorComponent.prototype, "coreWrapperElement", void 0);
|
|
7532
|
+
__decorate([
|
|
7533
|
+
core.Input()
|
|
7534
|
+
], CodeEditorComponent.prototype, "editorOptions", null);
|
|
7535
|
+
__decorate([
|
|
7536
|
+
core.Input()
|
|
7537
|
+
], CodeEditorComponent.prototype, "code", null);
|
|
7538
|
+
__decorate([
|
|
7539
|
+
core.Output()
|
|
7540
|
+
], CodeEditorComponent.prototype, "codeChange", void 0);
|
|
7541
|
+
__decorate([
|
|
7542
|
+
core.Input()
|
|
7543
|
+
], CodeEditorComponent.prototype, "isCodeValid", void 0);
|
|
7544
|
+
__decorate([
|
|
7545
|
+
core.Output()
|
|
7546
|
+
], CodeEditorComponent.prototype, "isCodeValidChange", void 0);
|
|
7547
|
+
__decorate([
|
|
7548
|
+
core.Output()
|
|
7549
|
+
], CodeEditorComponent.prototype, "onCodeChange", void 0);
|
|
7550
|
+
__decorate([
|
|
7551
|
+
core.Output()
|
|
7552
|
+
], CodeEditorComponent.prototype, "onComponentFinishLoad", void 0);
|
|
7553
|
+
CodeEditorComponent = __decorate([
|
|
7554
|
+
core.Component({
|
|
7555
|
+
selector: "s-code-editor",
|
|
7556
|
+
template: "<div #coreWrapper class=\"core-wrapper\"></div>",
|
|
7557
|
+
styles: [".core-wrapper{height:100%}"]
|
|
7558
|
+
})
|
|
7559
|
+
], CodeEditorComponent);
|
|
7560
|
+
return CodeEditorComponent;
|
|
7561
|
+
}());
|
|
7562
|
+
|
|
7563
|
+
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";
|
|
7564
|
+
|
|
7565
|
+
var EnumTypeOrder;
|
|
7566
|
+
(function (EnumTypeOrder) {
|
|
7567
|
+
// Tipo de ordenação - Crescente
|
|
7568
|
+
EnumTypeOrder["ASC"] = "ASC";
|
|
7569
|
+
// Tipo de ordenação - Decrescente
|
|
7570
|
+
EnumTypeOrder["DESC"] = "DESC";
|
|
7571
|
+
})(EnumTypeOrder || (EnumTypeOrder = {}));
|
|
7572
|
+
|
|
7573
|
+
var MetaType;
|
|
7574
|
+
(function (MetaType) {
|
|
7575
|
+
// Entity
|
|
7576
|
+
MetaType["ENTITY"] = "ENTITY";
|
|
7577
|
+
// String
|
|
7578
|
+
MetaType["STRING"] = "STRING";
|
|
7579
|
+
// Integer
|
|
7580
|
+
MetaType["INTEGER"] = "INTEGER";
|
|
7581
|
+
// Double
|
|
7582
|
+
MetaType["DOUBLE"] = "DOUBLE";
|
|
7583
|
+
// Long
|
|
7584
|
+
MetaType["LONG"] = "LONG";
|
|
7585
|
+
// BigDecimal
|
|
7586
|
+
MetaType["BIGDECIMAL"] = "BIGDECIMAL";
|
|
7587
|
+
// UUID
|
|
7588
|
+
MetaType["UUID"] = "UUID";
|
|
7589
|
+
// Date
|
|
7590
|
+
MetaType["DATE"] = "DATE";
|
|
7591
|
+
// DateTime
|
|
7592
|
+
MetaType["DATETIME"] = "DATETIME";
|
|
7593
|
+
// Time
|
|
7594
|
+
MetaType["TIME"] = "TIME";
|
|
7595
|
+
// Boolean
|
|
7596
|
+
MetaType["BOOLEAN"] = "BOOLEAN";
|
|
7597
|
+
// List
|
|
7598
|
+
MetaType["LIST"] = "LIST";
|
|
7599
|
+
// Enum
|
|
7600
|
+
MetaType["ENUM"] = "ENUM";
|
|
7601
|
+
// CustomExpression
|
|
7602
|
+
MetaType["CUSTOM_EXPRESSION"] = "CUSTOM_EXPRESSION";
|
|
7603
|
+
// PublicExpression
|
|
7604
|
+
MetaType["PUBLIC_EXPRESSION"] = "PUBLIC_EXPRESSION";
|
|
7605
|
+
})(MetaType || (MetaType = {}));
|
|
7606
|
+
|
|
7607
|
+
var RequestTypes;
|
|
7608
|
+
(function (RequestTypes) {
|
|
7609
|
+
RequestTypes[RequestTypes["ListContextMetadataById"] = 0] = "ListContextMetadataById";
|
|
7610
|
+
RequestTypes[RequestTypes["ListExpressionMetadata"] = 1] = "ListExpressionMetadata";
|
|
7611
|
+
RequestTypes[RequestTypes["ListFacadeMetadataNames"] = 2] = "ListFacadeMetadataNames";
|
|
7612
|
+
RequestTypes[RequestTypes["GetFacadeMetadataByPath"] = 3] = "GetFacadeMetadataByPath";
|
|
7613
|
+
})(RequestTypes || (RequestTypes = {}));
|
|
7614
|
+
|
|
7615
|
+
var CompletionTypes;
|
|
7616
|
+
(function (CompletionTypes) {
|
|
7617
|
+
CompletionTypes["Keyword"] = "keyword";
|
|
7618
|
+
CompletionTypes["Context"] = "context";
|
|
7619
|
+
CompletionTypes["Expression"] = "expression";
|
|
7620
|
+
CompletionTypes["UserExpression"] = "userExpression";
|
|
7621
|
+
CompletionTypes["Entity"] = "entity";
|
|
7622
|
+
CompletionTypes["FinalValue"] = "finalValue";
|
|
7623
|
+
})(CompletionTypes || (CompletionTypes = {}));
|
|
7624
|
+
|
|
7625
|
+
var Keywords;
|
|
7626
|
+
(function (Keywords) {
|
|
7627
|
+
Keywords["SE"] = "SE";
|
|
7628
|
+
Keywords["SENAO"] = "SENAO";
|
|
7629
|
+
Keywords["CONTENHA"] = "CONTENHA";
|
|
7630
|
+
Keywords["ENTAO"] = "ENTAO";
|
|
7631
|
+
Keywords["FIM_SE"] = "FIM_SE";
|
|
7632
|
+
Keywords["NAO"] = "NAO";
|
|
7633
|
+
Keywords["E"] = "E";
|
|
7634
|
+
Keywords["OU"] = "OU";
|
|
7635
|
+
})(Keywords || (Keywords = {}));
|
|
7636
|
+
|
|
7637
|
+
/* Enums */
|
|
7638
|
+
|
|
7639
|
+
var _a;
|
|
7640
|
+
var baseConfigs = language.LRLanguage.define({
|
|
7641
|
+
parser: generator.buildParser(parserGrammar)
|
|
7642
|
+
.configure({
|
|
7643
|
+
props: [
|
|
7644
|
+
highlight.styleTags((_a = {},
|
|
7645
|
+
_a[Object.values(Keywords).join(" ")] = highlight.tags.keyword,
|
|
7646
|
+
_a["String"] = highlight.tags.string,
|
|
7647
|
+
_a["Number"] = highlight.tags.number,
|
|
7648
|
+
_a))
|
|
7649
|
+
]
|
|
7650
|
+
})
|
|
7651
|
+
});
|
|
7652
|
+
|
|
7653
|
+
/**
|
|
7654
|
+
* Formats a JSON response to a JS object
|
|
7655
|
+
* @param response The response to format
|
|
7656
|
+
* @returns A JS object based on the response's body
|
|
7657
|
+
*/
|
|
7658
|
+
function formatJsonResponse(response) {
|
|
7659
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7660
|
+
return __generator(this, function (_a) {
|
|
7661
|
+
return [2 /*return*/, response.json()];
|
|
7662
|
+
});
|
|
7663
|
+
});
|
|
7664
|
+
}
|
|
7665
|
+
|
|
7666
|
+
/**
|
|
7667
|
+
* Formats a Blob response to a JS object
|
|
7668
|
+
* @param response The response to format
|
|
7669
|
+
* @returns A JS object based on the response's body
|
|
7670
|
+
*/
|
|
7671
|
+
function formatBlobResponse(response) {
|
|
7672
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7673
|
+
var textResponse;
|
|
7674
|
+
return __generator(this, function (_a) {
|
|
7675
|
+
switch (_a.label) {
|
|
7676
|
+
case 0: return [4 /*yield*/, response.blob()];
|
|
7677
|
+
case 1: return [4 /*yield*/, (_a.sent()).text()];
|
|
7678
|
+
case 2:
|
|
7679
|
+
textResponse = _a.sent();
|
|
7680
|
+
return [2 /*return*/, JSON.parse(textResponse)];
|
|
7681
|
+
}
|
|
7682
|
+
});
|
|
7683
|
+
});
|
|
7684
|
+
}
|
|
7685
|
+
|
|
7686
|
+
/**
|
|
7687
|
+
* Custom HttpClient for cases when is not possible to use the Angular's HttpClient
|
|
7688
|
+
*/
|
|
7689
|
+
var CustomHttpClient = /** @class */ (function () {
|
|
7690
|
+
function CustomHttpClient() {
|
|
7691
|
+
}
|
|
7692
|
+
/**
|
|
7693
|
+
* Executes a Http Get
|
|
7694
|
+
* @param url Url to execute the Get on
|
|
7695
|
+
* @param init Optional additional configs
|
|
7696
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
7697
|
+
*/
|
|
7698
|
+
CustomHttpClient.GET = function (url, init) {
|
|
7699
|
+
if (init === void 0) { init = {}; }
|
|
7700
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7701
|
+
var response;
|
|
7702
|
+
return __generator(this, function (_a) {
|
|
7703
|
+
switch (_a.label) {
|
|
7704
|
+
case 0: return [4 /*yield*/, this.interceptRequest(url, __assign(__assign({}, init), { method: "GET" }))];
|
|
7705
|
+
case 1:
|
|
7706
|
+
response = _a.sent();
|
|
7707
|
+
return [2 /*return*/, this.formatResponse(response)];
|
|
7708
|
+
}
|
|
7709
|
+
});
|
|
7710
|
+
});
|
|
7711
|
+
};
|
|
7712
|
+
/**
|
|
7713
|
+
* Executes a Http Post
|
|
7714
|
+
* @param url Url to execute the Post on
|
|
7715
|
+
* @param body Info to send to server on Post
|
|
7716
|
+
* @param init Optional additional configs
|
|
7717
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
7718
|
+
*/
|
|
7719
|
+
CustomHttpClient.POST = function (url, body, init) {
|
|
7720
|
+
if (init === void 0) { init = {}; }
|
|
7721
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7722
|
+
var headers, response;
|
|
7723
|
+
return __generator(this, function (_a) {
|
|
7724
|
+
switch (_a.label) {
|
|
7725
|
+
case 0:
|
|
7726
|
+
headers = new Headers(init.headers);
|
|
7727
|
+
headers.append("Content-Type", "application/json");
|
|
7728
|
+
headers.append("Accept", "application/json");
|
|
7729
|
+
return [4 /*yield*/, this.interceptRequest(url, __assign(__assign({}, init), { method: "POST", body: JSON.stringify(body), headers: headers }))];
|
|
7730
|
+
case 1:
|
|
7731
|
+
response = _a.sent();
|
|
7732
|
+
return [2 /*return*/, this.formatResponse(response)];
|
|
7733
|
+
}
|
|
7734
|
+
});
|
|
7735
|
+
});
|
|
7736
|
+
};
|
|
7737
|
+
/**
|
|
7738
|
+
* Intercepts the original request to add a required header for Senior in case of a internal request
|
|
7739
|
+
* @param url Url from the original request
|
|
7740
|
+
* @param originalReq Configs from the original request
|
|
7741
|
+
* @returns Whether a Promise<Response> if the request was made successfully or an error
|
|
7742
|
+
*/
|
|
7743
|
+
CustomHttpClient.interceptRequest = function (url, originalReq) {
|
|
7744
|
+
if (originalReq === void 0) { originalReq = {}; }
|
|
7745
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7746
|
+
var restUrl, authHeader, headers, request, err_1;
|
|
7747
|
+
return __generator(this, function (_a) {
|
|
7748
|
+
switch (_a.label) {
|
|
7749
|
+
case 0:
|
|
7750
|
+
_a.trys.push([0, 4, , 5]);
|
|
7751
|
+
if (!!url.includes("://")) return [3 /*break*/, 3];
|
|
7752
|
+
return [4 /*yield*/, seniorPlatformData.service.getRestUrl()];
|
|
7753
|
+
case 1:
|
|
7754
|
+
restUrl = _a.sent();
|
|
7755
|
+
return [4 /*yield*/, seniorPlatformData.user.getAuthHeader()];
|
|
7756
|
+
case 2:
|
|
7757
|
+
authHeader = _a.sent();
|
|
7758
|
+
headers = new Headers(originalReq.headers);
|
|
7759
|
+
headers.append("Authorization", authHeader);
|
|
7760
|
+
request = new Request(restUrl + url, __assign(__assign({}, originalReq), { headers: headers }));
|
|
7761
|
+
return [2 /*return*/, fetch(request)];
|
|
7762
|
+
case 3: return [2 /*return*/, fetch(url, originalReq)];
|
|
7763
|
+
case 4:
|
|
7764
|
+
err_1 = _a.sent();
|
|
7765
|
+
throw new Error("Error fetching requested URL: " + err_1);
|
|
7766
|
+
case 5: return [2 /*return*/];
|
|
7767
|
+
}
|
|
7768
|
+
});
|
|
7769
|
+
});
|
|
7770
|
+
};
|
|
7771
|
+
/**
|
|
7772
|
+
* Formats the request response to an object<T> or {}
|
|
7773
|
+
* @param response The response to be formatted
|
|
7774
|
+
* @returns Whether a Promise<T> if the response status is in the range 200-299 an error
|
|
7775
|
+
*/
|
|
7776
|
+
CustomHttpClient.formatResponse = function (response) {
|
|
7777
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7778
|
+
var contentType, formatter, formattedContentType, _a;
|
|
7779
|
+
return __generator(this, function (_b) {
|
|
7780
|
+
switch (_b.label) {
|
|
7781
|
+
case 0:
|
|
7782
|
+
contentType = response.headers.get("content-type");
|
|
7783
|
+
formatter = CustomHttpClient._responseFormatterMap.get(contentType);
|
|
7784
|
+
if (!formatter) return [3 /*break*/, 2];
|
|
7785
|
+
return [4 /*yield*/, formatter(response)];
|
|
7786
|
+
case 1:
|
|
7787
|
+
_a = _b.sent();
|
|
7788
|
+
return [3 /*break*/, 3];
|
|
7789
|
+
case 2:
|
|
7790
|
+
_a = {};
|
|
7791
|
+
_b.label = 3;
|
|
7792
|
+
case 3:
|
|
7793
|
+
formattedContentType = _a;
|
|
7794
|
+
if (response.ok)
|
|
7795
|
+
return [2 /*return*/, formattedContentType];
|
|
7796
|
+
throw new Error(JSON.stringify(formattedContentType));
|
|
7797
|
+
}
|
|
7798
|
+
});
|
|
7799
|
+
});
|
|
7800
|
+
};
|
|
7801
|
+
CustomHttpClient._responseFormatterMap = new Map([
|
|
7802
|
+
["application/json", formatJsonResponse],
|
|
7803
|
+
["application/octet-stream", formatBlobResponse]
|
|
7804
|
+
]);
|
|
7805
|
+
return CustomHttpClient;
|
|
7806
|
+
}());
|
|
7807
|
+
|
|
7808
|
+
/**
|
|
7809
|
+
* Custom translator for cases when is not possible to use the "TranslateService" from "@ngx-translate/core"
|
|
7810
|
+
*/
|
|
7811
|
+
var CustomTranslationsService = /** @class */ (function () {
|
|
7812
|
+
function CustomTranslationsService() {
|
|
7813
|
+
}
|
|
7814
|
+
/**
|
|
7815
|
+
* Method used to get the translation for an key based on the host project's translations. Always use the first available language
|
|
7816
|
+
* @param key Key used to search the translation
|
|
7817
|
+
* @returns The translation for the informed key or the key in case there is no translation
|
|
7818
|
+
*/
|
|
7819
|
+
CustomTranslationsService.translate = function (key) {
|
|
7820
|
+
var _a, _b;
|
|
7821
|
+
if (key === undefined || key === null)
|
|
7822
|
+
return "";
|
|
7823
|
+
var translationKey = "" + CustomTranslationsService._TRANSLATION_PREFIX + key;
|
|
7824
|
+
var firstLanguageTranslations = (_a = Object.values(CustomTranslationsService._translations)[0]) !== null && _a !== void 0 ? _a : {};
|
|
7825
|
+
return (_b = firstLanguageTranslations[translationKey]) !== null && _b !== void 0 ? _b : translationKey;
|
|
7826
|
+
};
|
|
7827
|
+
/**
|
|
7828
|
+
* Method used to set the translations that will be used as base when calling the "translate" method
|
|
7829
|
+
* @param translations Translations to use as base
|
|
7830
|
+
*/
|
|
7831
|
+
CustomTranslationsService.setTranslations = function (translations) {
|
|
7832
|
+
CustomTranslationsService._translations = translations !== null && translations !== void 0 ? translations : {};
|
|
7833
|
+
};
|
|
7834
|
+
/**
|
|
7835
|
+
* Method used to set the prefix that will be used when calling the "translate" method
|
|
7836
|
+
* @param hostProjectConfigs The host project's configs used to create the prefix
|
|
7837
|
+
*/
|
|
7838
|
+
CustomTranslationsService.setTranslationsPrefix = function (hostProjectConfigs) {
|
|
7839
|
+
var _a = hostProjectConfigs !== null && hostProjectConfigs !== void 0 ? hostProjectConfigs : {}, domain = _a.domain, service = _a.service;
|
|
7840
|
+
var prefix = domain + "." + service + ".";
|
|
7841
|
+
CustomTranslationsService._TRANSLATION_PREFIX = prefix;
|
|
7842
|
+
};
|
|
7843
|
+
CustomTranslationsService._translations = {};
|
|
7844
|
+
CustomTranslationsService._TRANSLATION_PREFIX = "";
|
|
7845
|
+
return CustomTranslationsService;
|
|
7846
|
+
}());
|
|
7847
|
+
|
|
7848
|
+
/**
|
|
7849
|
+
* Responsible for setting up the translations that will be used by the "CustomTranslationsService".
|
|
7850
|
+
* Uses the host project's translations set by using the "TranslationsModule" from "@seniorsistemas/platform-components"
|
|
7851
|
+
*/
|
|
7852
|
+
var CustomTranslationsModule = /** @class */ (function () {
|
|
7853
|
+
function CustomTranslationsModule(translate, hostProjectConfigs) {
|
|
7854
|
+
this.translate = translate;
|
|
7855
|
+
this.hostProjectConfigs = hostProjectConfigs;
|
|
7856
|
+
this.factoryTranslations(this.translate, this.hostProjectConfigs);
|
|
7857
|
+
}
|
|
7858
|
+
CustomTranslationsModule.prototype.factoryTranslations = function (translate, hostProjectConfigs) {
|
|
7859
|
+
CustomTranslationsService.setTranslations(translate.translations);
|
|
7860
|
+
CustomTranslationsService.setTranslationsPrefix(hostProjectConfigs);
|
|
7861
|
+
};
|
|
7862
|
+
CustomTranslationsModule.ctorParameters = function () { return [
|
|
7863
|
+
{ type: core$1.TranslateService },
|
|
7864
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
7865
|
+
]; };
|
|
7866
|
+
CustomTranslationsModule = __decorate([
|
|
7867
|
+
core.NgModule(),
|
|
7868
|
+
__param(1, core.Inject(HostProjectConfigsInjectionToken))
|
|
7869
|
+
], CustomTranslationsModule);
|
|
7870
|
+
return CustomTranslationsModule;
|
|
7871
|
+
}());
|
|
7872
|
+
|
|
7873
|
+
/**
|
|
7874
|
+
* Function to get the position of the first occurrence of a regex in a string
|
|
7875
|
+
* @param string The string to search into
|
|
7876
|
+
* @param regex The regex to search into the string
|
|
7877
|
+
* @param position The index at which to begin searching the string. If omitted, search starts at the index 0.
|
|
7878
|
+
* @returns the position of the first occurrence of the informed regex.
|
|
7879
|
+
*/
|
|
7880
|
+
function regexIndexOf(string, regex, position) {
|
|
7881
|
+
var indexOf = string.substring(position || 0).search(regex);
|
|
7882
|
+
return (indexOf >= 0) ? (indexOf + (position || 0)) : indexOf;
|
|
7883
|
+
}
|
|
7884
|
+
|
|
7885
|
+
var MarkerSeverity;
|
|
7886
|
+
(function (MarkerSeverity) {
|
|
7887
|
+
MarkerSeverity[MarkerSeverity["Error"] = 0] = "Error";
|
|
7888
|
+
MarkerSeverity[MarkerSeverity["Info"] = 1] = "Info";
|
|
7889
|
+
MarkerSeverity[MarkerSeverity["Warning"] = 2] = "Warning";
|
|
7890
|
+
})(MarkerSeverity || (MarkerSeverity = {}));
|
|
7891
|
+
|
|
7892
|
+
/* Enums */
|
|
7893
|
+
|
|
7894
|
+
var diagnosticSeverityInMarkerSeverityMap = new Map([
|
|
7895
|
+
[MarkerSeverity.Error, "error"],
|
|
7896
|
+
[MarkerSeverity.Info, "info"],
|
|
7897
|
+
[MarkerSeverity.Warning, "warning"]
|
|
7898
|
+
]);
|
|
7899
|
+
function convertMarkersToDiagnostics(markers, textLength) {
|
|
7900
|
+
return markers.map(function (marker) {
|
|
7901
|
+
var _a, _b;
|
|
7902
|
+
return ({
|
|
7903
|
+
from: marker.start || 0,
|
|
7904
|
+
to: marker.end || textLength,
|
|
7905
|
+
message: (_a = marker.message) !== null && _a !== void 0 ? _a : "",
|
|
7906
|
+
severity: (_b = diagnosticSeverityInMarkerSeverityMap.get(marker.severity)) !== null && _b !== void 0 ? _b : "error"
|
|
7907
|
+
});
|
|
7908
|
+
});
|
|
7909
|
+
}
|
|
7910
|
+
|
|
7911
|
+
function isCurrentPositionInsideString(stringBeforeCurrentPosition) {
|
|
7912
|
+
var _a;
|
|
7913
|
+
var doubleQuotesQuantity = ((_a = stringBeforeCurrentPosition.match(/"/g)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
7914
|
+
return doubleQuotesQuantity % 2 !== 0;
|
|
7915
|
+
}
|
|
7916
|
+
|
|
7917
|
+
var AutocompleteService = /** @class */ (function () {
|
|
7918
|
+
function AutocompleteService() {
|
|
7919
|
+
}
|
|
7920
|
+
AutocompleteService.listContextMetadataById = function (request, abortSignal) {
|
|
7921
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7922
|
+
return __generator(this, function (_a) {
|
|
7923
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listContextMetadataById", request, {
|
|
7924
|
+
signal: abortSignal
|
|
7925
|
+
})];
|
|
7926
|
+
});
|
|
7927
|
+
});
|
|
7928
|
+
};
|
|
7929
|
+
AutocompleteService.listExpressionMetadata = function (request, abortSignal) {
|
|
7930
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7931
|
+
return __generator(this, function (_a) {
|
|
7932
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listExpressionMetadata", request, {
|
|
7933
|
+
signal: abortSignal
|
|
7934
|
+
})];
|
|
7935
|
+
});
|
|
7936
|
+
});
|
|
7937
|
+
};
|
|
7938
|
+
AutocompleteService.listFacadeMetadataNames = function (request, abortSignal) {
|
|
7939
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7940
|
+
return __generator(this, function (_a) {
|
|
7941
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listFacadeMetadataNames", request, {
|
|
7942
|
+
signal: abortSignal
|
|
7943
|
+
})];
|
|
7944
|
+
});
|
|
7945
|
+
});
|
|
7946
|
+
};
|
|
7947
|
+
AutocompleteService.getFacadeMetadataByPath = function (request, abortSignal) {
|
|
7948
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7949
|
+
return __generator(this, function (_a) {
|
|
7950
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/getFacadeMetadataByPath", request, {
|
|
7951
|
+
signal: abortSignal
|
|
7952
|
+
})];
|
|
7953
|
+
});
|
|
7954
|
+
});
|
|
7955
|
+
};
|
|
7956
|
+
AutocompleteService.BASE_URL = "platform/rule_metadata";
|
|
7957
|
+
return AutocompleteService;
|
|
7958
|
+
}());
|
|
7959
|
+
|
|
7960
|
+
/**
|
|
7961
|
+
* Adds style to autocomplete's state-wrapper
|
|
7962
|
+
* @returns An extension containing the style
|
|
7963
|
+
*/
|
|
7964
|
+
function style() {
|
|
7965
|
+
return view.EditorView.theme({
|
|
7966
|
+
".s-code-editor-taxCalculation-autocomplete-ul": {
|
|
7967
|
+
"padding": ".75rem !important",
|
|
7968
|
+
},
|
|
7969
|
+
".s-code-editor-taxCalculation-autocomplete-li": {
|
|
7970
|
+
cursor: "default !important",
|
|
7971
|
+
"line-height": "1.375em !important",
|
|
7972
|
+
},
|
|
7973
|
+
});
|
|
7974
|
+
}
|
|
7975
|
+
|
|
7976
|
+
var htmlElementToBeWrapped = null;
|
|
7977
|
+
/**
|
|
7978
|
+
* Adds a view updates's listener that creates an state over the autocomplete
|
|
7979
|
+
* @returns An extension containing everything needed to listen the updates and create the autocomplete's state
|
|
7980
|
+
*/
|
|
7981
|
+
function autocompleteStateWrapper() {
|
|
7982
|
+
return [
|
|
7983
|
+
autocompleteStateWrapperStateField(),
|
|
7984
|
+
style()
|
|
7985
|
+
];
|
|
7986
|
+
}
|
|
7987
|
+
/**
|
|
7988
|
+
* Shows a state on a non-clickable autocomplete item's format with an HTMLElement inside
|
|
7989
|
+
* @param element The HTMLElement to show inside the state
|
|
7990
|
+
*/
|
|
7991
|
+
function showAutocompleteStateWrapper(element) {
|
|
7992
|
+
htmlElementToBeWrapped = element;
|
|
7993
|
+
CodeMirror6Core.updateEditorView();
|
|
7994
|
+
}
|
|
7995
|
+
/**
|
|
7996
|
+
* Removes a possible showed autocomplete state
|
|
7997
|
+
*/
|
|
7998
|
+
function hideAutocompleteStateWrapper() {
|
|
7999
|
+
htmlElementToBeWrapped = null;
|
|
8000
|
+
CodeMirror6Core.updateEditorView();
|
|
8001
|
+
}
|
|
8002
|
+
/*
|
|
8003
|
+
* Creates and returns a StateField responsible for listening the view's change and to add the autocomplete state's wrapper
|
|
8004
|
+
*/
|
|
8005
|
+
function autocompleteStateWrapperStateField() {
|
|
8006
|
+
return state.StateField.define({
|
|
8007
|
+
create: getAutocompleteStateWrapper,
|
|
8008
|
+
update: function (_, transaction) {
|
|
8009
|
+
return getAutocompleteStateWrapper(transaction.state);
|
|
8010
|
+
},
|
|
8011
|
+
provide: function (field) {
|
|
8012
|
+
return tooltip$1.showTooltip.compute([field], function (state) { return state.field(field); });
|
|
8013
|
+
}
|
|
8014
|
+
});
|
|
8015
|
+
}
|
|
8016
|
+
/*
|
|
8017
|
+
* Function responsible for creating the state's wrapper and returning the same as a Tooltip from "@codemirror/tooltip";
|
|
8018
|
+
* Only creates the Tooltip if the theres is element on the "htmlElementToBeWrapped" variable;
|
|
8019
|
+
* The same will also be removed when any view update is emitted;
|
|
8020
|
+
*/
|
|
8021
|
+
function getAutocompleteStateWrapper(state) {
|
|
8022
|
+
if (!htmlElementToBeWrapped)
|
|
8023
|
+
return;
|
|
8024
|
+
var htmlElementToBeWrappedString = htmlElementToBeWrapped.outerHTML;
|
|
8025
|
+
var stateWrapper = {
|
|
8026
|
+
pos: state.selection.ranges[0].head,
|
|
8027
|
+
create: function () { return ({ dom: getAutocompleteStateWrapperDomElement(htmlElementToBeWrappedString) }); }
|
|
8028
|
+
};
|
|
8029
|
+
htmlElementToBeWrapped = null;
|
|
8030
|
+
return stateWrapper;
|
|
8031
|
+
}
|
|
8032
|
+
function getAutocompleteStateWrapperDomElement(elementToBeWrappedString) {
|
|
8033
|
+
var wrapperDiv = document.createElement("div");
|
|
8034
|
+
wrapperDiv.className = "cm-tooltip-autocomplete cm-tooltip";
|
|
8035
|
+
wrapperDiv.innerHTML =
|
|
8036
|
+
"\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 ";
|
|
8037
|
+
return wrapperDiv;
|
|
8038
|
+
}
|
|
8039
|
+
|
|
8040
|
+
var autocompleteLoadingStateHTMLElement;
|
|
8041
|
+
/**
|
|
8042
|
+
* Adds a loading-state over the autocomplete
|
|
8043
|
+
* @returns An extension containing everything needed to add the loading-state
|
|
8044
|
+
*/
|
|
8045
|
+
function autocompleteLoadingState() {
|
|
8046
|
+
return [autocompleteStateWrapper()];
|
|
8047
|
+
}
|
|
8048
|
+
/**
|
|
8049
|
+
* Activates the loading state on the autocomplete
|
|
8050
|
+
*/
|
|
8051
|
+
/*
|
|
8052
|
+
* Must set the "autocompleteLoadingStateHTMLElement" here for when the document is loaded we do not have
|
|
8053
|
+
* yet the "CustomTranslationsService" ready
|
|
8054
|
+
*/
|
|
8055
|
+
function showAutocompleteLoadingState() {
|
|
8056
|
+
if (!autocompleteLoadingStateHTMLElement) {
|
|
8057
|
+
autocompleteLoadingStateHTMLElement = getAutocompleteLoadingStateHTMLElement();
|
|
8058
|
+
}
|
|
8059
|
+
showAutocompleteStateWrapper(autocompleteLoadingStateHTMLElement);
|
|
8060
|
+
}
|
|
8061
|
+
function getAutocompleteLoadingStateHTMLElement() {
|
|
8062
|
+
var loadingStateSpanWrapper = document.createElement("span");
|
|
8063
|
+
loadingStateSpanWrapper.innerText = CustomTranslationsService.translate("core_language_tax_calculation_fetching_suggestions");
|
|
8064
|
+
return loadingStateSpanWrapper;
|
|
8065
|
+
}
|
|
8066
|
+
|
|
8067
|
+
var autocompleteEmptyStateHTMLElement;
|
|
8068
|
+
/**
|
|
8069
|
+
* Adds an empty-state over the autocomplete
|
|
8070
|
+
* @returns An extension containing everything needed to add the empty-state
|
|
8071
|
+
*/
|
|
8072
|
+
function autocompleteEmptyState() {
|
|
8073
|
+
return [autocompleteStateWrapper()];
|
|
8074
|
+
}
|
|
8075
|
+
/**
|
|
8076
|
+
* Activates the empty-state on the autocomplete
|
|
8077
|
+
*/
|
|
8078
|
+
/*
|
|
8079
|
+
* Must set the "autocompleteEmptyStateHTMLElement" here for when the document is loaded we do not have
|
|
8080
|
+
* yet the "CustomTranslationsService" ready
|
|
8081
|
+
*/
|
|
8082
|
+
function showAutocompleteEmptyState() {
|
|
8083
|
+
if (!autocompleteEmptyStateHTMLElement) {
|
|
8084
|
+
autocompleteEmptyStateHTMLElement = getAutocompleteEmptyStateHTMLElement();
|
|
8085
|
+
}
|
|
8086
|
+
showAutocompleteStateWrapper(autocompleteEmptyStateHTMLElement);
|
|
8087
|
+
}
|
|
8088
|
+
function getAutocompleteEmptyStateHTMLElement() {
|
|
8089
|
+
var emptyStateSpanWrapper = document.createElement("span");
|
|
8090
|
+
emptyStateSpanWrapper.innerText = CustomTranslationsService.translate("core_language_tax_calculation_no_suggestions");
|
|
8091
|
+
return emptyStateSpanWrapper;
|
|
8092
|
+
}
|
|
8093
|
+
|
|
8094
|
+
var TaxCalculationLanguageConfigs = /** @class */ (function () {
|
|
8095
|
+
function TaxCalculationLanguageConfigs() {
|
|
8096
|
+
}
|
|
8097
|
+
TaxCalculationLanguageConfigs.setConfigs = function (configs) {
|
|
8098
|
+
TaxCalculationLanguageConfigs.CONFIGS = JSON.parse(JSON.stringify(configs));
|
|
8099
|
+
};
|
|
8100
|
+
TaxCalculationLanguageConfigs.getConfigs = function () {
|
|
8101
|
+
return TaxCalculationLanguageConfigs.CONFIGS;
|
|
8102
|
+
};
|
|
8103
|
+
TaxCalculationLanguageConfigs.CONFIGS = { contexts: [] };
|
|
8104
|
+
return TaxCalculationLanguageConfigs;
|
|
8105
|
+
}());
|
|
8106
|
+
|
|
8107
|
+
/**
|
|
8108
|
+
* Gets the configs for the TaxCalculationLanguage
|
|
8109
|
+
* @returns The configs
|
|
8110
|
+
*/
|
|
8111
|
+
function getLanguageConfigs() {
|
|
8112
|
+
var _a;
|
|
8113
|
+
var configs = TaxCalculationLanguageConfigs.getConfigs();
|
|
8114
|
+
if (!((_a = configs.contexts) === null || _a === void 0 ? void 0 : _a.length))
|
|
8115
|
+
throw new Error("In order to use the TaxCalculation Language's autocomplete, "
|
|
8116
|
+
+ "one must inform at least one context by using the "
|
|
8117
|
+
+ "'TaxCalculationLanguageConfigs.setConfigs()'");
|
|
8118
|
+
return configs;
|
|
8119
|
+
}
|
|
8120
|
+
|
|
8121
|
+
/**
|
|
8122
|
+
* Wraps the request to return the same with an identification or undefined in case of error, so the promise will
|
|
8123
|
+
* always trigger the "then"
|
|
8124
|
+
* @param request Request to wrap
|
|
8125
|
+
* @returns The typed request's response
|
|
8126
|
+
*/
|
|
8127
|
+
function getSafeResponse(request) {
|
|
8128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8129
|
+
var _a, _b, _1;
|
|
8130
|
+
return __generator(this, function (_c) {
|
|
8131
|
+
switch (_c.label) {
|
|
8132
|
+
case 0:
|
|
8133
|
+
_c.trys.push([0, 2, , 3]);
|
|
8134
|
+
_a = [__assign({}, request)];
|
|
8135
|
+
_b = {};
|
|
8136
|
+
return [4 /*yield*/, request.request];
|
|
8137
|
+
case 1: return [2 /*return*/, __assign.apply(void 0, _a.concat([(_b.response = _c.sent(), _b)]))];
|
|
8138
|
+
case 2:
|
|
8139
|
+
_1 = _c.sent();
|
|
8140
|
+
return [3 /*break*/, 3];
|
|
8141
|
+
case 3: return [2 /*return*/];
|
|
8142
|
+
}
|
|
8143
|
+
});
|
|
8144
|
+
});
|
|
8145
|
+
}
|
|
8146
|
+
|
|
8147
|
+
var completionItemsMap = new Map();
|
|
8148
|
+
var usefulToCompletionItemsCompletionTypes = [
|
|
8149
|
+
CompletionTypes.Expression,
|
|
8150
|
+
CompletionTypes.UserExpression,
|
|
8151
|
+
CompletionTypes.FinalValue
|
|
8152
|
+
];
|
|
8153
|
+
/*
|
|
8154
|
+
* Updates the completionItems used by the core.
|
|
8155
|
+
* Utilizes the path and filter to create a key and store the results from the search to the given "path.filter" on a map.
|
|
8156
|
+
* Must save the results to each different filter for the search does not bring all the results, so the user must do a more
|
|
8157
|
+
* specific filter to achieve its objective
|
|
8158
|
+
*/
|
|
8159
|
+
function updateCoreCompletionItems(completionItem) {
|
|
8160
|
+
var path = completionItem.path, filter = completionItem.filter, completions = completionItem.completions;
|
|
8161
|
+
var mapPath = path + "." + filter;
|
|
8162
|
+
var filteredCompletions = (completions || []).filter(function (completion) {
|
|
8163
|
+
return usefulToCompletionItemsCompletionTypes.includes(completion === null || completion === void 0 ? void 0 : completion.type);
|
|
8164
|
+
});
|
|
8165
|
+
var formattedSearchResults = filteredCompletions.map(function (completion) {
|
|
8166
|
+
return path === "" ? completion === null || completion === void 0 ? void 0 : completion.label : path + "." + (completion === null || completion === void 0 ? void 0 : completion.label);
|
|
8167
|
+
});
|
|
8168
|
+
completionItemsMap.delete(mapPath);
|
|
8169
|
+
if (formattedSearchResults.length) {
|
|
8170
|
+
completionItemsMap.set(mapPath, formattedSearchResults);
|
|
8171
|
+
}
|
|
8172
|
+
var allArraysFromMap = Array.from(completionItemsMap.values());
|
|
8173
|
+
var unrepeatedCompletionItems = new Set(allArraysFromMap.flat());
|
|
8174
|
+
CodeMirror6Core
|
|
8175
|
+
.$onCompletionItemsUpdate
|
|
8176
|
+
.next(Array.from(unrepeatedCompletionItems));
|
|
8177
|
+
}
|
|
8178
|
+
|
|
8179
|
+
/**
|
|
8180
|
+
* Adds style to the autocomplete
|
|
8181
|
+
* @returns An extension containing the style
|
|
8182
|
+
*/
|
|
8183
|
+
function style$1() {
|
|
8184
|
+
return view.EditorView.theme({
|
|
8185
|
+
".cm-completionIcon": {
|
|
8186
|
+
"font-family": "'Font Awesome 5 Pro'",
|
|
8187
|
+
"font-weight": "900",
|
|
8188
|
+
},
|
|
8189
|
+
".cm-completionIcon-keyword::after": {
|
|
8190
|
+
"content": getIconBasedOnUnicode("f084"),
|
|
8191
|
+
},
|
|
8192
|
+
".cm-completionIcon-context::after": {
|
|
8193
|
+
"content": getIconBasedOnUnicode("f466"),
|
|
8194
|
+
},
|
|
8195
|
+
".cm-completionIcon-expression::after": {
|
|
8196
|
+
"content": getIconBasedOnUnicode("f505"),
|
|
8197
|
+
},
|
|
8198
|
+
".cm-completionIcon-userExpression::after": {
|
|
8199
|
+
"content": getIconBasedOnUnicode("f4ff"),
|
|
8200
|
+
},
|
|
8201
|
+
".cm-completionIcon-entity::after": {
|
|
8202
|
+
"content": getIconBasedOnUnicode("f126"),
|
|
8203
|
+
},
|
|
8204
|
+
".cm-completionIcon-finalValue::after": {
|
|
8205
|
+
"content": getIconBasedOnUnicode("f192"),
|
|
8206
|
+
},
|
|
8207
|
+
});
|
|
8208
|
+
}
|
|
8209
|
+
function getIconBasedOnUnicode(unicode) {
|
|
8210
|
+
return "\"\\" + unicode + "\"";
|
|
8211
|
+
}
|
|
8212
|
+
|
|
8213
|
+
/**
|
|
8214
|
+
* Adds an autocomplete to the editor
|
|
8215
|
+
* @returns An extension containing everything needed to create the autocomplete
|
|
8216
|
+
*/
|
|
8217
|
+
function autocomplete() {
|
|
8218
|
+
return [
|
|
8219
|
+
autocomplete$2.autocompletion({ override: [getCompletionResults] }),
|
|
8220
|
+
autocompleteLoadingState(),
|
|
8221
|
+
autocompleteEmptyState(),
|
|
8222
|
+
style$1(),
|
|
8223
|
+
];
|
|
8224
|
+
}
|
|
8225
|
+
var TRANSLATION_PREFIX = "core_language_tax_calculation";
|
|
8226
|
+
var completionResults;
|
|
8227
|
+
/*
|
|
8228
|
+
* A function to be called when a key is pressed, the ctrl+space is triggered or when the search for completionResults is done.
|
|
8229
|
+
* If there is a completionResult, returns it, otherwise starts a new async search.
|
|
8230
|
+
* Will only execute the autocompletion if the current cursor position is not inside a string
|
|
8231
|
+
*/
|
|
8232
|
+
function getCompletionResults(context) {
|
|
8233
|
+
var isCursorInsideString = isCurrentPositionInsideString(context.state.doc.toString().substring(0, context.pos));
|
|
8234
|
+
if (isCursorInsideString)
|
|
8235
|
+
return;
|
|
8236
|
+
if (completionResults) {
|
|
8237
|
+
var finalCompletionResults = __assign({}, completionResults);
|
|
8238
|
+
var codeLength = context.state.doc.toString().length;
|
|
8239
|
+
finalCompletionResults.from = finalCompletionResults.from > codeLength
|
|
8240
|
+
? codeLength
|
|
8241
|
+
: finalCompletionResults.from;
|
|
8242
|
+
completionResults = null;
|
|
8243
|
+
return finalCompletionResults;
|
|
8244
|
+
}
|
|
8245
|
+
startCompletionResultsSearch(context);
|
|
8246
|
+
}
|
|
8247
|
+
var cancelLastCompletionSearch = function () { };
|
|
8248
|
+
var ɵ0 = cancelLastCompletionSearch;
|
|
8249
|
+
var codeMirrorViewElement;
|
|
8250
|
+
/*
|
|
8251
|
+
* Starts a new completionResults's async search.
|
|
8252
|
+
* Avoids the last search to be finished by calling the "cancelLastCompletionSearch" callback function
|
|
8253
|
+
*/
|
|
8254
|
+
function startCompletionResultsSearch(context) {
|
|
8255
|
+
var token = new AbortController();
|
|
8256
|
+
setTimeout(function () {
|
|
8257
|
+
if (!token.signal.aborted) {
|
|
8258
|
+
showAutocompleteLoadingState();
|
|
8259
|
+
searchCompletionResults(context, token);
|
|
8260
|
+
}
|
|
8261
|
+
}, 500);
|
|
8262
|
+
/*
|
|
8263
|
+
* IMPORTANT: The following lines MUST be the way they are!
|
|
8264
|
+
* 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.
|
|
8265
|
+
* 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
|
|
8266
|
+
* arrows, home, end, backspace and etc. The flow is:
|
|
8267
|
+
* 1. We add an eventListener to keydown/click when the autocompletion's request is triggered;
|
|
8268
|
+
* 2. When any key/click is pressed, we remove the listener and cancel the last request by changing the isSearchCanceled on token object
|
|
8269
|
+
* to true;
|
|
8270
|
+
* 3. If any key that requires autocompletion is triggered, the flow repeats;
|
|
8271
|
+
*/
|
|
8272
|
+
codeMirrorViewElement = CodeMirror6Core.getEditorView().contentDOM;
|
|
8273
|
+
cancelLastCompletionSearch = function () {
|
|
8274
|
+
codeMirrorViewElement.removeEventListener("keydown", cancelLastCompletionSearch);
|
|
8275
|
+
codeMirrorViewElement.removeEventListener("click", cancelLastCompletionSearch);
|
|
8276
|
+
token.abort();
|
|
8277
|
+
};
|
|
8278
|
+
codeMirrorViewElement.addEventListener("keydown", cancelLastCompletionSearch);
|
|
8279
|
+
codeMirrorViewElement.addEventListener("click", cancelLastCompletionSearch);
|
|
8280
|
+
}
|
|
8281
|
+
/*
|
|
8282
|
+
* Requests the necessary items to fill the completionResults, although it only really opens the autocomplete
|
|
8283
|
+
* box (by calling the "startCompletion()", that calls the "getCompletionResults") if the current search was not cancelled
|
|
8284
|
+
* by a new one
|
|
8285
|
+
*/
|
|
8286
|
+
function searchCompletionResults(context, token) {
|
|
8287
|
+
var _a, _b, _c, _d;
|
|
8288
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8289
|
+
var codeBeforeCursor, filter, path, requests;
|
|
8290
|
+
return __generator(this, function (_e) {
|
|
8291
|
+
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 : "";
|
|
8292
|
+
filter = getFilter(codeBeforeCursor);
|
|
8293
|
+
path = getPath(codeBeforeCursor, filter.length);
|
|
8294
|
+
requests = getRequestsBasedOnPath(path, filter, token.signal);
|
|
8295
|
+
Promise
|
|
8296
|
+
.all(requests)
|
|
8297
|
+
.then(function (responses) {
|
|
8298
|
+
if (!token.signal.aborted) {
|
|
8299
|
+
var completions = [].concat(getKeywordsCompletions(path), getContextsCompletions(responses), getExpressionsCompletions(responses), getEntitiesCompletions(responses));
|
|
8300
|
+
var filteredCompletions = getFilteredCompletions(completions, filter);
|
|
8301
|
+
if (filteredCompletions.length) {
|
|
8302
|
+
var formattedCompletions = getFormattedCompletions(filteredCompletions, filter);
|
|
8303
|
+
var sortedCompletions = getSortedCompletions(formattedCompletions);
|
|
8304
|
+
completionResults = {
|
|
8305
|
+
from: context.pos,
|
|
8306
|
+
filter: false,
|
|
8307
|
+
options: sortedCompletions
|
|
8308
|
+
};
|
|
8309
|
+
updateCoreCompletionItems({ path: path, filter: filter, completions: sortedCompletions });
|
|
8310
|
+
autocomplete$2.startCompletion(CodeMirror6Core.getEditorView());
|
|
8311
|
+
}
|
|
8312
|
+
else {
|
|
8313
|
+
showAutocompleteEmptyState();
|
|
8314
|
+
}
|
|
8315
|
+
}
|
|
8316
|
+
});
|
|
8317
|
+
return [2 /*return*/];
|
|
8318
|
+
});
|
|
8319
|
+
});
|
|
8320
|
+
}
|
|
8321
|
+
/*
|
|
8322
|
+
* Returns the filter in the code written.
|
|
8323
|
+
* For example in the code "controladoria.empresa", "empresa" would be the filter
|
|
8324
|
+
* and in "controladoria", "controladoria" would be the filter.
|
|
8325
|
+
* Allows only alphanumerics, underscore and hashtag on filter's start.
|
|
8326
|
+
* Does not allow spaces
|
|
8327
|
+
*/
|
|
8328
|
+
function getFilter(string) {
|
|
8329
|
+
var _a, _b;
|
|
8330
|
+
if (string === undefined || string === null)
|
|
8331
|
+
return "";
|
|
8332
|
+
var filter = (_b = (_a = string.match(/(#|\.|)\w*$/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
8333
|
+
return filter.replace(".", "").trim();
|
|
8334
|
+
}
|
|
8335
|
+
/*
|
|
8336
|
+
* Returns the path in the code written based on filter.
|
|
8337
|
+
* For example in the code "controladoria.empresa", "controladoria" would be the path
|
|
8338
|
+
* and in "controladoria", "" would be the path.
|
|
8339
|
+
* Does not allow spaces
|
|
8340
|
+
*/
|
|
8341
|
+
function getPath(string, filterLength) {
|
|
8342
|
+
var _a, _b;
|
|
8343
|
+
if (string === undefined || string === null)
|
|
8344
|
+
return "";
|
|
8345
|
+
var stringWithoutPath = string.substring(0, string.length - filterLength);
|
|
8346
|
+
var path = (_b = (_a = stringWithoutPath.match(/(\w*\.)*$/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
8347
|
+
return path.replace(/\.$/, "");
|
|
8348
|
+
}
|
|
8349
|
+
function getRequestsBasedOnPath(path, filter, abortSignal) {
|
|
8350
|
+
var _a;
|
|
8351
|
+
var languageConfigs = getLanguageConfigs();
|
|
8352
|
+
var requests = [];
|
|
8353
|
+
if (path === "") {
|
|
8354
|
+
requests.push({
|
|
8355
|
+
requestType: RequestTypes.ListContextMetadataById,
|
|
8356
|
+
request: AutocompleteService.listContextMetadataById({
|
|
8357
|
+
id: languageConfigs.contexts,
|
|
8358
|
+
}, abortSignal)
|
|
8359
|
+
});
|
|
8360
|
+
requests.push({
|
|
8361
|
+
requestType: RequestTypes.ListExpressionMetadata,
|
|
8362
|
+
request: AutocompleteService.listExpressionMetadata({
|
|
8363
|
+
context: languageConfigs.contexts,
|
|
8364
|
+
subcontext: (_a = languageConfigs.subContexts) !== null && _a !== void 0 ? _a : [],
|
|
8365
|
+
name: filter,
|
|
8366
|
+
pageRequest: {
|
|
8367
|
+
offset: 0,
|
|
8368
|
+
size: 20
|
|
8369
|
+
}
|
|
8370
|
+
}, abortSignal)
|
|
8371
|
+
});
|
|
8372
|
+
}
|
|
8373
|
+
else if (path.includes(".")) {
|
|
8374
|
+
var splittedPath = path.split(".");
|
|
8375
|
+
requests.push({
|
|
8376
|
+
requestType: RequestTypes.GetFacadeMetadataByPath,
|
|
8377
|
+
request: AutocompleteService.getFacadeMetadataByPath({
|
|
8378
|
+
context: splittedPath[0],
|
|
8379
|
+
entityName: splittedPath[1],
|
|
8380
|
+
fields: splittedPath[2] === undefined ? undefined : splittedPath.slice(2)
|
|
8381
|
+
}, abortSignal)
|
|
8382
|
+
});
|
|
8383
|
+
}
|
|
8384
|
+
else {
|
|
8385
|
+
requests.push({
|
|
8386
|
+
requestType: RequestTypes.ListFacadeMetadataNames,
|
|
8387
|
+
request: AutocompleteService.listFacadeMetadataNames({
|
|
8388
|
+
context: [path],
|
|
8389
|
+
name: filter,
|
|
8390
|
+
pageRequest: {
|
|
8391
|
+
offset: 0,
|
|
8392
|
+
size: 30
|
|
8393
|
+
}
|
|
8394
|
+
}, abortSignal)
|
|
8395
|
+
});
|
|
8396
|
+
}
|
|
8397
|
+
return requests.map(function (request) { return getSafeResponse(request); });
|
|
8398
|
+
}
|
|
8399
|
+
function getKeywordsCompletions(path) {
|
|
8400
|
+
if (path !== "")
|
|
8401
|
+
return [];
|
|
8402
|
+
var completions = [
|
|
8403
|
+
{
|
|
8404
|
+
label: Keywords.SE,
|
|
8405
|
+
apply: "SE ()\nENTAO\n\tacao\nFIM_SE",
|
|
8406
|
+
},
|
|
8407
|
+
{
|
|
8408
|
+
label: Keywords.SENAO,
|
|
8409
|
+
apply: "SENAO\n\tacao",
|
|
8410
|
+
},
|
|
8411
|
+
{
|
|
8412
|
+
label: Keywords.CONTENHA,
|
|
8413
|
+
apply: "CONTENHA(condicao)",
|
|
8414
|
+
},
|
|
8415
|
+
{
|
|
8416
|
+
label: Keywords.ENTAO,
|
|
8417
|
+
apply: "ENTAO\n\tacao",
|
|
8418
|
+
},
|
|
8419
|
+
{
|
|
8420
|
+
label: Keywords.FIM_SE,
|
|
8421
|
+
apply: "FIM_SE ",
|
|
8422
|
+
},
|
|
8423
|
+
{
|
|
8424
|
+
label: Keywords.NAO,
|
|
8425
|
+
apply: "NAO ",
|
|
8426
|
+
},
|
|
8427
|
+
{
|
|
8428
|
+
label: Keywords.E,
|
|
8429
|
+
apply: "E ",
|
|
8430
|
+
},
|
|
8431
|
+
{
|
|
8432
|
+
label: Keywords.OU,
|
|
8433
|
+
apply: "OU "
|
|
8434
|
+
},
|
|
8435
|
+
];
|
|
8436
|
+
return completions.map(function (completionItem) { return (__assign(__assign({}, completionItem), { detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_keyword"), type: CompletionTypes.Keyword })); });
|
|
8437
|
+
}
|
|
8438
|
+
function getContextsCompletions(responses) {
|
|
8439
|
+
var _a, _b;
|
|
8440
|
+
var contextsResponse = responses.find(function (response) {
|
|
8441
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListContextMetadataById;
|
|
8442
|
+
});
|
|
8443
|
+
if (contextsResponse) {
|
|
8444
|
+
return ((_b = (_a = contextsResponse.response) === null || _a === void 0 ? void 0 : _a.contextMetadata) !== null && _b !== void 0 ? _b : [])
|
|
8445
|
+
.map(function (contextMetadata) { return ({
|
|
8446
|
+
label: contextMetadata.name,
|
|
8447
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_context"),
|
|
8448
|
+
apply: contextMetadata.name,
|
|
8449
|
+
type: CompletionTypes.Context
|
|
8450
|
+
}); });
|
|
8451
|
+
}
|
|
8452
|
+
return [];
|
|
8453
|
+
}
|
|
8454
|
+
function getExpressionsCompletions(responses) {
|
|
8455
|
+
var _a, _b;
|
|
8456
|
+
var expressionsResponse = responses.find(function (response) {
|
|
8457
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListExpressionMetadata;
|
|
8458
|
+
});
|
|
8459
|
+
if (expressionsResponse) {
|
|
8460
|
+
return ((_b = (_a = expressionsResponse.response) === null || _a === void 0 ? void 0 : _a.expressionMetadata) !== null && _b !== void 0 ? _b : [])
|
|
8461
|
+
.map(function (expressionMetadata) { return ({
|
|
8462
|
+
label: expressionMetadata.name,
|
|
8463
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_" + (expressionMetadata.type === MetaType.PUBLIC_EXPRESSION
|
|
8464
|
+
? "senior_expression"
|
|
8465
|
+
: "user_expression")),
|
|
8466
|
+
apply: expressionMetadata.name,
|
|
8467
|
+
info: expressionMetadata.description,
|
|
8468
|
+
type: expressionMetadata.type === MetaType.PUBLIC_EXPRESSION ? CompletionTypes.Expression : CompletionTypes.UserExpression
|
|
8469
|
+
}); });
|
|
8470
|
+
}
|
|
8471
|
+
return [];
|
|
8472
|
+
}
|
|
8473
|
+
function getEntitiesCompletions(responses) {
|
|
8474
|
+
var _a, _b, _c, _d, _e;
|
|
8475
|
+
var facadesResponseFromList = responses.find(function (response) {
|
|
8476
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListFacadeMetadataNames;
|
|
8477
|
+
});
|
|
8478
|
+
if (facadesResponseFromList) {
|
|
8479
|
+
return ((_b = (_a = facadesResponseFromList.response) === null || _a === void 0 ? void 0 : _a.facadeMetadataNames) !== null && _b !== void 0 ? _b : [])
|
|
8480
|
+
.map(function (facade) { return ({
|
|
8481
|
+
label: facade.name,
|
|
8482
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_entity"),
|
|
8483
|
+
apply: facade.name,
|
|
8484
|
+
type: CompletionTypes.Entity
|
|
8485
|
+
}); });
|
|
8486
|
+
}
|
|
8487
|
+
var facadesResponseFromGet = responses.find(function (response) {
|
|
8488
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.GetFacadeMetadataByPath;
|
|
8489
|
+
});
|
|
8490
|
+
if (facadesResponseFromGet) {
|
|
8491
|
+
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 : [])
|
|
8492
|
+
.map(function (facade) { return ({
|
|
8493
|
+
label: facade.name,
|
|
8494
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_" + (facade.type === MetaType.ENTITY
|
|
8495
|
+
? "entity"
|
|
8496
|
+
: "field")),
|
|
8497
|
+
apply: facade.name,
|
|
8498
|
+
type: facade.type === MetaType.ENTITY ? CompletionTypes.Entity : CompletionTypes.FinalValue
|
|
8499
|
+
}); });
|
|
8500
|
+
}
|
|
8501
|
+
return [];
|
|
8502
|
+
}
|
|
8503
|
+
/*
|
|
8504
|
+
* Filtering the completions to only deal with the necessary items
|
|
8505
|
+
*/
|
|
8506
|
+
function getFilteredCompletions(completions, filter) {
|
|
8507
|
+
return completions
|
|
8508
|
+
.filter(function (completionItem) {
|
|
8509
|
+
return completionItem
|
|
8510
|
+
.label
|
|
8511
|
+
.toLowerCase()
|
|
8512
|
+
.startsWith(filter.toLowerCase());
|
|
8513
|
+
});
|
|
8514
|
+
}
|
|
8515
|
+
/*
|
|
8516
|
+
* Overwriting the completions's apply to remove the entire current written value and apply the the entire completion's apply
|
|
8517
|
+
*/
|
|
8518
|
+
function getFormattedCompletions(completions, filter) {
|
|
8519
|
+
return completions
|
|
8520
|
+
.map(function (completionItem) { return (__assign(__assign({}, completionItem), { apply: getCompletionApply(filter, "" + completionItem.apply) })); });
|
|
8521
|
+
}
|
|
8522
|
+
function getCompletionApply(filter, oldApplyText) {
|
|
8523
|
+
return function (view, completion, from, to) {
|
|
8524
|
+
var newFrom = from - filter.length;
|
|
8525
|
+
view.dispatch({
|
|
8526
|
+
changes: {
|
|
8527
|
+
from: newFrom,
|
|
8528
|
+
to: to,
|
|
8529
|
+
insert: oldApplyText
|
|
8530
|
+
},
|
|
8531
|
+
selection: {
|
|
8532
|
+
anchor: newFrom + oldApplyText.length
|
|
8533
|
+
},
|
|
8534
|
+
userEvent: "input.complete",
|
|
8535
|
+
annotations: autocomplete$2.pickedCompletion.of(completion)
|
|
8536
|
+
});
|
|
8537
|
+
};
|
|
8538
|
+
}
|
|
8539
|
+
var completionsSortOrder = [
|
|
8540
|
+
CompletionTypes.Keyword,
|
|
8541
|
+
CompletionTypes.Context,
|
|
8542
|
+
CompletionTypes.UserExpression,
|
|
8543
|
+
CompletionTypes.Expression,
|
|
8544
|
+
CompletionTypes.Entity,
|
|
8545
|
+
CompletionTypes.FinalValue
|
|
8546
|
+
];
|
|
8547
|
+
/*
|
|
8548
|
+
* Sorts the completions following the "completionsSortOrder" priority order
|
|
8549
|
+
*/
|
|
8550
|
+
function getSortedCompletions(completions) {
|
|
8551
|
+
return completions.sort(function (x, y) {
|
|
8552
|
+
var xPriority = completionsSortOrder.indexOf(x.type);
|
|
8553
|
+
var yPriority = completionsSortOrder.indexOf(y.type);
|
|
8554
|
+
return xPriority - yPriority;
|
|
8555
|
+
});
|
|
8556
|
+
}
|
|
8557
|
+
|
|
8558
|
+
/**
|
|
8559
|
+
* Adds an watcher to the paste command that updates the core's completions items
|
|
8560
|
+
* @returns An extension containing everything needed to create the the updater
|
|
8561
|
+
*/
|
|
8562
|
+
function onPasteCompletionItemsUpdater() {
|
|
8563
|
+
return [
|
|
8564
|
+
view.keymap.of([
|
|
8565
|
+
{
|
|
8566
|
+
key: "Ctrl-v",
|
|
8567
|
+
run: searchCompletionResultsCommand,
|
|
8568
|
+
}
|
|
8569
|
+
])
|
|
8570
|
+
];
|
|
8571
|
+
}
|
|
8572
|
+
var cancelLastCompletionSearch$1 = function () { };
|
|
8573
|
+
var ɵ0$1 = cancelLastCompletionSearch$1;
|
|
8574
|
+
/*
|
|
8575
|
+
* Must use the setTimeout for we does not have access to the code pasted on the current state, so we need to wait codemirror
|
|
8576
|
+
* remake the state, also it would be way more difficult to work with the clipboard
|
|
8577
|
+
*/
|
|
8578
|
+
function searchCompletionResultsCommand(view) {
|
|
8579
|
+
cancelLastCompletionSearch$1();
|
|
8580
|
+
var token = new AbortController();
|
|
8581
|
+
setTimeout(function () {
|
|
8582
|
+
if (!token.signal.aborted) {
|
|
8583
|
+
searchCompletionResults$1(view.state.doc.toString(), token);
|
|
8584
|
+
}
|
|
8585
|
+
}, 200);
|
|
8586
|
+
cancelLastCompletionSearch$1 = function () { return token.abort(); };
|
|
8587
|
+
return false;
|
|
8588
|
+
}
|
|
8589
|
+
/*
|
|
8590
|
+
* Requests the necessary items to update the core's completionItems when the user uses the ctrl+v
|
|
8591
|
+
*/
|
|
8592
|
+
function searchCompletionResults$1(code, token) {
|
|
8593
|
+
var codeWithoutStrings = getCodeWithoutStringedCode(code);
|
|
8594
|
+
var variablesToVerify = getVariablesToVerify(codeWithoutStrings);
|
|
8595
|
+
var requests = getRequestsBasedOnVariables(variablesToVerify, token.signal);
|
|
8596
|
+
Promise
|
|
8597
|
+
.all(requests)
|
|
8598
|
+
.then(function (responses) {
|
|
8599
|
+
if (!token.signal.aborted) {
|
|
8600
|
+
var expressionsCompletionItems = getExpressionsCompletionsItems(responses);
|
|
8601
|
+
var entitiesCompletionItems = getEntitiesCompletionsItems(responses);
|
|
8602
|
+
var completionItems = expressionsCompletionItems.concat(entitiesCompletionItems);
|
|
8603
|
+
updateCompletionItems(completionItems);
|
|
8604
|
+
}
|
|
8605
|
+
});
|
|
8606
|
+
}
|
|
8607
|
+
/*
|
|
8608
|
+
* Returns the code itself without its inside double quotes parts, e.g
|
|
8609
|
+
* on string `return this "here not" code`, the return value will be `return this code`;
|
|
8610
|
+
*/
|
|
8611
|
+
function getCodeWithoutStringedCode(code) {
|
|
8612
|
+
return (code !== null && code !== void 0 ? code : "").replace(/"([^"])*["]?/g, " ");
|
|
8613
|
+
}
|
|
8614
|
+
/*
|
|
8615
|
+
* Returns the code's parts that need to be verified by requests, excluding the keywords,
|
|
8616
|
+
* special character (except dot/`.` in middle of two regex's \w and at the end and hashtag in sentence's start)
|
|
8617
|
+
* e.g on string `SE (something.another OU expression E something.another.)`, the variables array would be
|
|
8618
|
+
* ["something.another", "expression", "something.another."]
|
|
8619
|
+
*/
|
|
8620
|
+
function getVariablesToVerify(code) {
|
|
8621
|
+
var _a;
|
|
8622
|
+
var keywordsRegex = Object
|
|
8623
|
+
.values(Keywords)
|
|
8624
|
+
.map(function (keyword) { return "(?!" + keyword + "\\b)"; })
|
|
8625
|
+
.join("");
|
|
8626
|
+
return (_a = (code !== null && code !== void 0 ? code : "").match(new RegExp("[#]?\\b(" + keywordsRegex + ")(\\w+\\.)*\\w+[\\.]?", "g"))) !== null && _a !== void 0 ? _a : [];
|
|
8627
|
+
}
|
|
8628
|
+
/*
|
|
8629
|
+
* Only needs to request the expressions and the fields from an entity;
|
|
8630
|
+
* Creates an request to every variable;
|
|
8631
|
+
* Uses the AutocompleteService for the requests needed here are Autocomplete's usage, so we are just
|
|
8632
|
+
* borrowing from it
|
|
8633
|
+
*/
|
|
8634
|
+
function getRequestsBasedOnVariables(variables, abortSignal) {
|
|
8635
|
+
var e_1, _a;
|
|
8636
|
+
var _b;
|
|
8637
|
+
var languageConfigs = getLanguageConfigs();
|
|
8638
|
+
var requests = [];
|
|
8639
|
+
try {
|
|
8640
|
+
for (var variables_1 = __values(variables), variables_1_1 = variables_1.next(); !variables_1_1.done; variables_1_1 = variables_1.next()) {
|
|
8641
|
+
var variable = variables_1_1.value;
|
|
8642
|
+
var splittedVariable = variable.split(".");
|
|
8643
|
+
if (splittedVariable.length === 1) {
|
|
8644
|
+
var extraInfo = {
|
|
8645
|
+
path: "",
|
|
8646
|
+
filter: splittedVariable[0]
|
|
8647
|
+
};
|
|
8648
|
+
requests.push({
|
|
8649
|
+
requestType: RequestTypes.ListExpressionMetadata,
|
|
8650
|
+
request: AutocompleteService.listExpressionMetadata({
|
|
8651
|
+
context: languageConfigs.contexts,
|
|
8652
|
+
subcontext: (_b = languageConfigs.subContexts) !== null && _b !== void 0 ? _b : [],
|
|
8653
|
+
name: splittedVariable[0]
|
|
8654
|
+
}, abortSignal),
|
|
8655
|
+
extraInfo: extraInfo
|
|
8656
|
+
});
|
|
8657
|
+
}
|
|
8658
|
+
else if (splittedVariable.length > 2) {
|
|
8659
|
+
var extraInfo = {
|
|
8660
|
+
path: splittedVariable
|
|
8661
|
+
.slice(0, splittedVariable.length - 1)
|
|
8662
|
+
.join("."),
|
|
8663
|
+
filter: ""
|
|
8664
|
+
};
|
|
8665
|
+
requests.push({
|
|
8666
|
+
requestType: RequestTypes.GetFacadeMetadataByPath,
|
|
8667
|
+
request: AutocompleteService.getFacadeMetadataByPath({
|
|
8668
|
+
context: splittedVariable[0],
|
|
8669
|
+
entityName: splittedVariable[1],
|
|
8670
|
+
fields: splittedVariable.slice(2, splittedVariable.length - 1)
|
|
8671
|
+
}, abortSignal),
|
|
8672
|
+
extraInfo: extraInfo
|
|
8673
|
+
});
|
|
8674
|
+
}
|
|
8675
|
+
}
|
|
8676
|
+
}
|
|
8677
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8678
|
+
finally {
|
|
8679
|
+
try {
|
|
8680
|
+
if (variables_1_1 && !variables_1_1.done && (_a = variables_1.return)) _a.call(variables_1);
|
|
8681
|
+
}
|
|
8682
|
+
finally { if (e_1) throw e_1.error; }
|
|
8683
|
+
}
|
|
8684
|
+
return requests.map(function (request) { return getSafeResponse(request); });
|
|
8685
|
+
}
|
|
8686
|
+
function getExpressionsCompletionsItems(responses) {
|
|
8687
|
+
var expressionsResponses = responses.filter(function (response) {
|
|
8688
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListExpressionMetadata;
|
|
8689
|
+
});
|
|
8690
|
+
return expressionsResponses
|
|
8691
|
+
.map(function (expressionsResponse) {
|
|
8692
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7234
8693
|
return {
|
|
7235
|
-
|
|
8694
|
+
path: (_b = (_a = expressionsResponse.extraInfo) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : "",
|
|
8695
|
+
filter: (_d = (_c = expressionsResponse.extraInfo) === null || _c === void 0 ? void 0 : _c.filter) !== null && _d !== void 0 ? _d : "",
|
|
8696
|
+
completions: ((_f = (_e = expressionsResponse.response) === null || _e === void 0 ? void 0 : _e.expressionMetadata) !== null && _f !== void 0 ? _f : [])
|
|
8697
|
+
.map(function (expressionMetadata) { return ({
|
|
8698
|
+
label: expressionMetadata.name,
|
|
8699
|
+
type: expressionMetadata.type === MetaType.PUBLIC_EXPRESSION
|
|
8700
|
+
? CompletionTypes.Expression
|
|
8701
|
+
: CompletionTypes.UserExpression
|
|
8702
|
+
}); })
|
|
8703
|
+
};
|
|
8704
|
+
})
|
|
8705
|
+
.flat();
|
|
8706
|
+
}
|
|
8707
|
+
function getEntitiesCompletionsItems(responses) {
|
|
8708
|
+
var facadesResponsesFromGet = responses.filter(function (response) {
|
|
8709
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.GetFacadeMetadataByPath;
|
|
8710
|
+
});
|
|
8711
|
+
return facadesResponsesFromGet
|
|
8712
|
+
.map(function (facadesResponseFromGet) {
|
|
8713
|
+
var _a, _b, _c;
|
|
8714
|
+
return {
|
|
8715
|
+
path: facadesResponseFromGet.extraInfo.path,
|
|
8716
|
+
filter: facadesResponseFromGet.extraInfo.filter,
|
|
8717
|
+
completions: ((_c = (_b = (_a = facadesResponseFromGet.response) === null || _a === void 0 ? void 0 : _a.facadeMetadata) === null || _b === void 0 ? void 0 : _b.fields) !== null && _c !== void 0 ? _c : [])
|
|
8718
|
+
.map(function (facade) { return ({
|
|
8719
|
+
label: facade.name,
|
|
8720
|
+
type: facade.type === MetaType.ENTITY ? CompletionTypes.Entity : CompletionTypes.FinalValue
|
|
8721
|
+
}); })
|
|
8722
|
+
};
|
|
8723
|
+
})
|
|
8724
|
+
.flat();
|
|
8725
|
+
}
|
|
8726
|
+
function updateCompletionItems(completionItems) {
|
|
8727
|
+
var e_2, _a;
|
|
8728
|
+
try {
|
|
8729
|
+
for (var completionItems_1 = __values(completionItems), completionItems_1_1 = completionItems_1.next(); !completionItems_1_1.done; completionItems_1_1 = completionItems_1.next()) {
|
|
8730
|
+
var completionItem = completionItems_1_1.value;
|
|
8731
|
+
updateCoreCompletionItems(completionItem);
|
|
8732
|
+
}
|
|
8733
|
+
}
|
|
8734
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
8735
|
+
finally {
|
|
8736
|
+
try {
|
|
8737
|
+
if (completionItems_1_1 && !completionItems_1_1.done && (_a = completionItems_1.return)) _a.call(completionItems_1);
|
|
8738
|
+
}
|
|
8739
|
+
finally { if (e_2) throw e_2.error; }
|
|
8740
|
+
}
|
|
8741
|
+
}
|
|
8742
|
+
|
|
8743
|
+
function TaxCalculation() {
|
|
8744
|
+
return new language.LanguageSupport(baseConfigs, [
|
|
8745
|
+
autocomplete(),
|
|
8746
|
+
onPasteCompletionItemsUpdater(),
|
|
8747
|
+
]);
|
|
8748
|
+
}
|
|
8749
|
+
|
|
8750
|
+
var EditorLanguages = /** @class */ (function () {
|
|
8751
|
+
function EditorLanguages() {
|
|
8752
|
+
}
|
|
8753
|
+
EditorLanguages.getLanguage = function (language) {
|
|
8754
|
+
return EditorLanguages._LANGUAGES.get(language) || [];
|
|
8755
|
+
};
|
|
8756
|
+
EditorLanguages._LANGUAGES = new Map([
|
|
8757
|
+
[exports.Languages.TaxCalculation, TaxCalculation()]
|
|
8758
|
+
]);
|
|
8759
|
+
return EditorLanguages;
|
|
8760
|
+
}());
|
|
8761
|
+
|
|
8762
|
+
/**
|
|
8763
|
+
* Adds style to the editor in general
|
|
8764
|
+
* @returns An extension containing the style
|
|
8765
|
+
*/
|
|
8766
|
+
function style$2() {
|
|
8767
|
+
return view.EditorView.theme({
|
|
8768
|
+
"&.cm-editor.cm-focused": {
|
|
8769
|
+
outline: "none",
|
|
8770
|
+
},
|
|
8771
|
+
});
|
|
8772
|
+
}
|
|
8773
|
+
|
|
8774
|
+
var SDSLightHighlightStyle = highlight.HighlightStyle.define([
|
|
8775
|
+
{
|
|
8776
|
+
tag: highlight.tags.keyword,
|
|
8777
|
+
color: "blue",
|
|
8778
|
+
},
|
|
8779
|
+
{
|
|
8780
|
+
tag: highlight.tags.string,
|
|
8781
|
+
color: "red",
|
|
8782
|
+
},
|
|
8783
|
+
{
|
|
8784
|
+
tag: highlight.tags.number,
|
|
8785
|
+
color: "green",
|
|
8786
|
+
},
|
|
8787
|
+
]);
|
|
8788
|
+
|
|
8789
|
+
/**
|
|
8790
|
+
* Adds a vertical scrollbar when the editor's height overflows the parent's height
|
|
8791
|
+
* @returns An extension containing everything needed to add the scrollbar
|
|
8792
|
+
*/
|
|
8793
|
+
function scrollbars() {
|
|
8794
|
+
return [
|
|
8795
|
+
style$3()
|
|
8796
|
+
];
|
|
8797
|
+
}
|
|
8798
|
+
function style$3() {
|
|
8799
|
+
return view.EditorView.baseTheme({
|
|
8800
|
+
"&.cm-editor": {
|
|
8801
|
+
"height": "100%"
|
|
8802
|
+
},
|
|
8803
|
+
});
|
|
8804
|
+
}
|
|
8805
|
+
|
|
8806
|
+
/**
|
|
8807
|
+
* Adds style to editor'font
|
|
8808
|
+
* @returns An extension containing everything needed to add the font style
|
|
8809
|
+
*/
|
|
8810
|
+
function fontStyle() {
|
|
8811
|
+
return [style$4()];
|
|
8812
|
+
}
|
|
8813
|
+
var generalFontStyle = {
|
|
8814
|
+
"font-family": "'Noto Sans Mono', 'sans-serif'",
|
|
8815
|
+
"font-style": "normal",
|
|
8816
|
+
"font-size": "1rem",
|
|
8817
|
+
};
|
|
8818
|
+
function style$4() {
|
|
8819
|
+
return view.EditorView.theme({
|
|
8820
|
+
".cm-scroller": __assign(__assign({}, generalFontStyle), { "letter-spacing": "0", "line-height": "1.5em", "font-variation-settings": "'wght' 400", "color": "#333333" }),
|
|
8821
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul": __assign(__assign({}, generalFontStyle), { "font-variation-settings": "'wght' 300", "color": "#697882" }),
|
|
8822
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionLabel": {
|
|
8823
|
+
"line-height": "1.5em",
|
|
8824
|
+
"font-variation-settings": "'wght' 500",
|
|
8825
|
+
},
|
|
8826
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail": {
|
|
8827
|
+
"font-size": "0.875em",
|
|
8828
|
+
"font-style": "normal",
|
|
8829
|
+
"margin-left": "0.75rem",
|
|
8830
|
+
},
|
|
8831
|
+
});
|
|
8832
|
+
}
|
|
8833
|
+
|
|
8834
|
+
/**
|
|
8835
|
+
* Adds a line counter
|
|
8836
|
+
* @returns An extension containing everything needed to add the line counter
|
|
8837
|
+
*/
|
|
8838
|
+
function lineCounter() {
|
|
8839
|
+
return [
|
|
8840
|
+
gutter.lineNumbers(),
|
|
8841
|
+
style$5()
|
|
8842
|
+
];
|
|
8843
|
+
}
|
|
8844
|
+
function style$5() {
|
|
8845
|
+
return view.EditorView.theme({
|
|
8846
|
+
".cm-gutters": {
|
|
8847
|
+
"background-color": "#fff",
|
|
8848
|
+
"color": "#428BCA",
|
|
8849
|
+
"border-right": "none"
|
|
8850
|
+
},
|
|
8851
|
+
".cm-gutter": {
|
|
8852
|
+
"padding": "0 2rem 0 2rem"
|
|
8853
|
+
}
|
|
8854
|
+
});
|
|
8855
|
+
}
|
|
8856
|
+
|
|
8857
|
+
/**
|
|
8858
|
+
* Adds styles to the autocomplete's tooltip
|
|
8859
|
+
* @returns An extension containing everything needed to add the style
|
|
8860
|
+
*/
|
|
8861
|
+
function autocompleteTooltip() {
|
|
8862
|
+
return [style$6()];
|
|
8863
|
+
}
|
|
8864
|
+
function style$6() {
|
|
8865
|
+
return view.EditorView.baseTheme({
|
|
8866
|
+
".cm-tooltip": {
|
|
8867
|
+
"border": "none !important",
|
|
8868
|
+
"border-radius": "4px",
|
|
8869
|
+
"background-color": "#E5EAEA !important",
|
|
8870
|
+
},
|
|
8871
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul[role='listbox']": {
|
|
8872
|
+
"padding": "1rem",
|
|
8873
|
+
},
|
|
8874
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail": {
|
|
8875
|
+
"margin-left": ".75rem",
|
|
8876
|
+
},
|
|
8877
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail::before": {
|
|
8878
|
+
"content": "'[ '",
|
|
8879
|
+
},
|
|
8880
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail::after": {
|
|
8881
|
+
"content": "' ]'",
|
|
8882
|
+
},
|
|
8883
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionIcon": {
|
|
8884
|
+
"padding-right": 0,
|
|
8885
|
+
"margin-right": ".475rem",
|
|
8886
|
+
"width": "1rem",
|
|
8887
|
+
},
|
|
8888
|
+
".cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
8889
|
+
"border-radius": "4px",
|
|
8890
|
+
"background-color": "#5D96A2 !important",
|
|
8891
|
+
"color": "#fff !important",
|
|
8892
|
+
},
|
|
8893
|
+
".cm-tooltip.cm-completionInfo.cm-completionInfo-right": {
|
|
8894
|
+
"border-radius": "3px",
|
|
8895
|
+
"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%)",
|
|
8896
|
+
"background": "#495057 !important",
|
|
8897
|
+
"color": "#fff",
|
|
8898
|
+
"padding": ".5rem",
|
|
8899
|
+
"left": "101.6%",
|
|
8900
|
+
},
|
|
8901
|
+
".cm-tooltip.cm-completionInfo.cm-completionInfo-right::before": {
|
|
8902
|
+
"content": "''",
|
|
8903
|
+
"position": "absolute",
|
|
8904
|
+
"width": 0,
|
|
8905
|
+
"height": 0,
|
|
8906
|
+
"top": ".8125rem",
|
|
8907
|
+
"left": "-.25rem",
|
|
8908
|
+
"margin-top": "-.25rem",
|
|
8909
|
+
"border-color": "transparent",
|
|
8910
|
+
"border-style": "solid",
|
|
8911
|
+
"border-right-color": "#495057",
|
|
8912
|
+
"border-width": ".25rem .25rem .25rem 0",
|
|
8913
|
+
},
|
|
8914
|
+
});
|
|
8915
|
+
}
|
|
8916
|
+
|
|
8917
|
+
/* General Style */
|
|
8918
|
+
function SDSLight() {
|
|
8919
|
+
return [
|
|
8920
|
+
[
|
|
8921
|
+
style$2(),
|
|
8922
|
+
scrollbars(),
|
|
8923
|
+
fontStyle(),
|
|
8924
|
+
lineCounter(),
|
|
8925
|
+
autocompleteTooltip()
|
|
8926
|
+
],
|
|
8927
|
+
SDSLightHighlightStyle
|
|
8928
|
+
];
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8931
|
+
var EditorThemes = /** @class */ (function () {
|
|
8932
|
+
function EditorThemes() {
|
|
8933
|
+
}
|
|
8934
|
+
EditorThemes.getTheme = function (theme) {
|
|
8935
|
+
return EditorThemes._THEMES.get(theme) || [];
|
|
8936
|
+
};
|
|
8937
|
+
EditorThemes._THEMES = new Map([
|
|
8938
|
+
[exports.Themes.SDSLight, SDSLight()]
|
|
8939
|
+
]);
|
|
8940
|
+
return EditorThemes;
|
|
8941
|
+
}());
|
|
8942
|
+
|
|
8943
|
+
var CodeMirror6Core = /** @class */ (function (_super) {
|
|
8944
|
+
__extends(CodeMirror6Core, _super);
|
|
8945
|
+
function CodeMirror6Core() {
|
|
8946
|
+
var _this = _super.call(this) || this;
|
|
8947
|
+
/* These are necessary for the setCode and setEditorOptions can be called before view has been created */
|
|
8948
|
+
_this._codeReceivedBeforeViewCreation = "";
|
|
8949
|
+
_this._editorOptionsReceivedBeforeViewCreation = [];
|
|
8950
|
+
_this.setObservablesListeners();
|
|
8951
|
+
return _this;
|
|
8952
|
+
}
|
|
8953
|
+
CodeMirror6Core.getEditorView = function () {
|
|
8954
|
+
return CodeMirror6Core._editorView;
|
|
8955
|
+
};
|
|
8956
|
+
CodeMirror6Core.updateEditorView = function () {
|
|
8957
|
+
var _a;
|
|
8958
|
+
var transactionSpecs = [];
|
|
8959
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8960
|
+
transactionSpecs[_i] = arguments[_i];
|
|
8961
|
+
}
|
|
8962
|
+
(_a = CodeMirror6Core._editorView).dispatch.apply(_a, __spread(transactionSpecs));
|
|
8963
|
+
};
|
|
8964
|
+
CodeMirror6Core.prototype.setCoreWrapperElement = function (element) {
|
|
8965
|
+
this.createEditorView(element);
|
|
8966
|
+
};
|
|
8967
|
+
CodeMirror6Core.prototype.setCode = function (code) {
|
|
8968
|
+
this.changeEditorContent(code);
|
|
8969
|
+
};
|
|
8970
|
+
// @Override
|
|
8971
|
+
CodeMirror6Core.prototype.destroyObservables = function () {
|
|
8972
|
+
CodeMirror6Core._ngUnsubscribe.next();
|
|
8973
|
+
CodeMirror6Core._ngUnsubscribe.complete();
|
|
8974
|
+
};
|
|
8975
|
+
CodeMirror6Core.prototype.setCoreEditorOptions = function (options) {
|
|
8976
|
+
var language = EditorLanguages.getLanguage(options.language);
|
|
8977
|
+
var theme = EditorThemes.getTheme(options.theme);
|
|
8978
|
+
if (CodeMirror6Core._editorView) {
|
|
8979
|
+
CodeMirror6Core.updateEditorView({
|
|
8980
|
+
effects: state.StateEffect.reconfigure.of([
|
|
8981
|
+
language,
|
|
8982
|
+
theme,
|
|
8983
|
+
this.getCodeChangeListenerExtension()
|
|
8984
|
+
])
|
|
8985
|
+
});
|
|
8986
|
+
}
|
|
8987
|
+
else {
|
|
8988
|
+
this._editorOptionsReceivedBeforeViewCreation = [language, theme];
|
|
8989
|
+
}
|
|
8990
|
+
};
|
|
8991
|
+
CodeMirror6Core.prototype.highlightCode = function (markers) {
|
|
8992
|
+
var diagnostics = convertMarkersToDiagnostics(markers, CodeMirror6Core._editorView.state.doc.length);
|
|
8993
|
+
CodeMirror6Core.updateEditorView(lint.setDiagnostics(CodeMirror6Core._editorView.state, diagnostics));
|
|
8994
|
+
};
|
|
8995
|
+
CodeMirror6Core.prototype.setObservablesListeners = function () {
|
|
8996
|
+
var _this = this;
|
|
8997
|
+
CodeMirror6Core.$onCompletionItemsUpdate
|
|
8998
|
+
.pipe(operators.takeUntil(CodeMirror6Core._ngUnsubscribe))
|
|
8999
|
+
.subscribe(function (items) { return _this.updateCompletionItems(items); });
|
|
9000
|
+
};
|
|
9001
|
+
CodeMirror6Core.prototype.createEditorView = function (parentElement) {
|
|
9002
|
+
CodeMirror6Core._editorView = new view.EditorView({
|
|
9003
|
+
parent: parentElement,
|
|
9004
|
+
state: state.EditorState.create({
|
|
9005
|
+
doc: this._codeReceivedBeforeViewCreation,
|
|
9006
|
+
extensions: [
|
|
9007
|
+
this._editorOptionsReceivedBeforeViewCreation,
|
|
9008
|
+
this.getCodeChangeListenerExtension()
|
|
9009
|
+
]
|
|
9010
|
+
})
|
|
9011
|
+
});
|
|
9012
|
+
this.notifyCoreFinishLoad();
|
|
9013
|
+
};
|
|
9014
|
+
CodeMirror6Core.prototype.getCodeChangeListenerExtension = function () {
|
|
9015
|
+
var _this = this;
|
|
9016
|
+
return view.EditorView.updateListener.of(function (update) { return update.docChanged && _this.notifyCodeChange(update.state.doc.toString()); });
|
|
9017
|
+
};
|
|
9018
|
+
CodeMirror6Core.prototype.changeEditorContent = function (code) {
|
|
9019
|
+
if (CodeMirror6Core._editorView) {
|
|
9020
|
+
CodeMirror6Core.updateEditorView({
|
|
9021
|
+
changes: {
|
|
9022
|
+
from: 0,
|
|
9023
|
+
to: CodeMirror6Core._editorView.state.doc.length,
|
|
9024
|
+
insert: code
|
|
9025
|
+
}
|
|
9026
|
+
});
|
|
9027
|
+
}
|
|
9028
|
+
else {
|
|
9029
|
+
this._codeReceivedBeforeViewCreation = code;
|
|
9030
|
+
}
|
|
9031
|
+
};
|
|
9032
|
+
CodeMirror6Core.$onCompletionItemsUpdate = new rxjs.Subject();
|
|
9033
|
+
CodeMirror6Core._ngUnsubscribe = new rxjs.Subject();
|
|
9034
|
+
CodeMirror6Core._editorView = null;
|
|
9035
|
+
return CodeMirror6Core;
|
|
9036
|
+
}(CoreFacade));
|
|
9037
|
+
|
|
9038
|
+
var CodeEditorModule = /** @class */ (function () {
|
|
9039
|
+
function CodeEditorModule() {
|
|
9040
|
+
}
|
|
9041
|
+
CodeEditorModule = __decorate([
|
|
9042
|
+
core.NgModule({
|
|
9043
|
+
imports: [
|
|
9044
|
+
common.CommonModule,
|
|
9045
|
+
CustomTranslationsModule,
|
|
9046
|
+
],
|
|
9047
|
+
declarations: [CodeEditorComponent],
|
|
9048
|
+
exports: [CodeEditorComponent],
|
|
7236
9049
|
providers: [
|
|
7237
9050
|
{
|
|
7238
|
-
provide:
|
|
7239
|
-
|
|
9051
|
+
provide: CoreFacade,
|
|
9052
|
+
useClass: CodeMirror6Core
|
|
7240
9053
|
}
|
|
7241
9054
|
]
|
|
7242
|
-
}
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
AngularComponentsModule = AngularComponentsModule_1 = __decorate([
|
|
7246
|
-
core.NgModule({})
|
|
7247
|
-
], AngularComponentsModule);
|
|
7248
|
-
return AngularComponentsModule;
|
|
9055
|
+
})
|
|
9056
|
+
], CodeEditorModule);
|
|
9057
|
+
return CodeEditorModule;
|
|
7249
9058
|
}());
|
|
7250
9059
|
|
|
7251
9060
|
exports.AngularComponentsModule = AngularComponentsModule;
|
|
@@ -7265,6 +9074,7 @@
|
|
|
7265
9074
|
exports.CalendarMaskDirective = CalendarMaskDirective;
|
|
7266
9075
|
exports.CalendarMaskModule = CalendarMaskModule;
|
|
7267
9076
|
exports.ChipsField = ChipsField;
|
|
9077
|
+
exports.CodeEditorModule = CodeEditorModule;
|
|
7268
9078
|
exports.CollapseLinkComponent = CollapseLinkComponent;
|
|
7269
9079
|
exports.CollapseLinkModule = CollapseLinkModule;
|
|
7270
9080
|
exports.ControlErrorsComponent = ControlErrorsComponent;
|
|
@@ -7292,6 +9102,7 @@
|
|
|
7292
9102
|
exports.GlobalSearchComponent = GlobalSearchComponent;
|
|
7293
9103
|
exports.GlobalSearchDropdownItemComponent = GlobalSearchDropdownItemComponent;
|
|
7294
9104
|
exports.GlobalSearchModule = GlobalSearchModule;
|
|
9105
|
+
exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
|
|
7295
9106
|
exports.ImageCropperComponent = ImageCropperComponent;
|
|
7296
9107
|
exports.ImageCropperModule = ImageCropperModule;
|
|
7297
9108
|
exports.ImageCropperService = ImageCropperService;
|
|
@@ -7346,6 +9157,7 @@
|
|
|
7346
9157
|
exports.TableHeaderCheckboxComponent = TableHeaderCheckboxComponent;
|
|
7347
9158
|
exports.TableHeaderCheckboxModule = TableHeaderCheckboxModule;
|
|
7348
9159
|
exports.TableModule = TableModule;
|
|
9160
|
+
exports.TaxCalculationLanguageConfigs = TaxCalculationLanguageConfigs;
|
|
7349
9161
|
exports.TextAreaField = TextAreaField;
|
|
7350
9162
|
exports.TextField = TextField;
|
|
7351
9163
|
exports.ThumbnailComponent = ThumbnailComponent;
|
|
@@ -7365,6 +9177,10 @@
|
|
|
7365
9177
|
exports.ɵbg = ThumbnailService;
|
|
7366
9178
|
exports.ɵbh = InfiniteScrollModule;
|
|
7367
9179
|
exports.ɵbi = InfiniteScrollDirective;
|
|
9180
|
+
exports.ɵbj = CustomTranslationsModule;
|
|
9181
|
+
exports.ɵbk = CodeEditorComponent;
|
|
9182
|
+
exports.ɵbl = CoreFacade;
|
|
9183
|
+
exports.ɵbm = CodeMirror6Core;
|
|
7368
9184
|
exports.ɵc = LocalizedBignumberImpurePipe;
|
|
7369
9185
|
exports.ɵd = TokenListModule;
|
|
7370
9186
|
exports.ɵe = TableColumnsComponent;
|