@icure/form 1.0.19 → 1.1.10
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/.eslintrc +34 -0
- package/.prettierrc +8 -0
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -0
- package/.yarn/versions/76a58acc.yml +0 -0
- package/.yarn/versions/c3ca09e7.yml +0 -0
- package/lib/components/common/index.d.ts +4 -0
- package/lib/components/common/index.js.map +1 -0
- package/lib/components/common/labelizedField.d.ts +8 -0
- package/{components/iqr-form/fields/multipleChoice.js → lib/components/common/labelizedField.js} +24 -24
- package/lib/components/common/labelizedField.js.map +1 -0
- package/lib/components/common/optionsField.d.ts +10 -0
- package/lib/components/common/optionsField.js +56 -0
- package/lib/components/common/optionsField.js.map +1 -0
- package/lib/components/common/stylizedField.d.ts +4 -0
- package/lib/components/common/stylizedField.js +801 -0
- package/lib/components/common/stylizedField.js.map +1 -0
- package/lib/components/common/translatedField.d.ts +8 -0
- package/{components/iqr-form/fields/timePicker.js → lib/components/common/translatedField.js} +22 -27
- package/lib/components/common/translatedField.js.map +1 -0
- package/lib/components/common/valuedField.d.ts +10 -0
- package/{components/iqr-form/fields/numberField.js → lib/components/common/valuedField.js} +18 -26
- package/lib/components/common/valuedField.js.map +1 -0
- package/lib/components/index.d.ts +6 -0
- package/{components → lib/components}/index.js +4 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/iqr-dropdown/index.d.ts +1 -0
- package/lib/components/iqr-dropdown/index.js +129 -0
- package/lib/components/iqr-dropdown/index.js.map +1 -0
- package/lib/components/iqr-form/fields/checkbox.d.ts +8 -0
- package/lib/components/iqr-form/fields/checkbox.js +50 -0
- package/lib/components/iqr-form/fields/checkbox.js.map +1 -0
- package/lib/components/iqr-form/fields/datePicker.d.ts +24 -0
- package/lib/components/iqr-form/fields/datePicker.js +101 -0
- package/lib/components/iqr-form/fields/datePicker.js.map +1 -0
- package/lib/components/iqr-form/fields/dateTimePicker.d.ts +24 -0
- package/lib/components/iqr-form/fields/dateTimePicker.js +100 -0
- package/lib/components/iqr-form/fields/dateTimePicker.js.map +1 -0
- package/lib/components/iqr-form/fields/dropdown.d.ts +10 -0
- package/lib/components/iqr-form/fields/dropdown.js +64 -0
- package/lib/components/iqr-form/fields/dropdown.js.map +1 -0
- package/lib/components/iqr-form/fields/label.d.ts +7 -0
- package/lib/components/iqr-form/fields/label.js +23 -0
- package/lib/components/iqr-form/fields/label.js.map +1 -0
- package/lib/components/iqr-form/fields/measureField.d.ts +25 -0
- package/lib/components/iqr-form/fields/measureField.js +107 -0
- package/lib/components/iqr-form/fields/measureField.js.map +1 -0
- package/lib/components/iqr-form/fields/multipleChoice.d.ts +15 -0
- package/lib/components/iqr-form/fields/multipleChoice.js +87 -0
- package/lib/components/iqr-form/fields/multipleChoice.js.map +1 -0
- package/lib/components/iqr-form/fields/numberField.d.ts +24 -0
- package/lib/components/iqr-form/fields/numberField.js +100 -0
- package/lib/components/iqr-form/fields/numberField.js.map +1 -0
- package/lib/components/iqr-form/fields/radioButton.d.ts +8 -0
- package/lib/components/iqr-form/fields/radioButton.js +50 -0
- package/lib/components/iqr-form/fields/radioButton.js.map +1 -0
- package/{components → lib/components}/iqr-form/fields/textfield.js +66 -37
- package/lib/components/iqr-form/fields/textfield.js.map +1 -0
- package/lib/components/iqr-form/fields/timePicker.d.ts +15 -0
- package/lib/components/iqr-form/fields/timePicker.js +90 -0
- package/lib/components/iqr-form/fields/timePicker.js.map +1 -0
- package/{components → lib/components}/iqr-form/index.d.ts +4 -0
- package/{components → lib/components}/iqr-form/index.js +40 -37
- package/lib/components/iqr-form/index.js.map +1 -0
- package/lib/components/iqr-form/model/index.d.ts +130 -0
- package/lib/components/iqr-form/model/index.js +164 -0
- package/lib/components/iqr-form/model/index.js.map +1 -0
- package/{components → lib/components}/iqr-form/renderer/cards.js +23 -9
- package/lib/components/iqr-form/renderer/cards.js.map +1 -0
- package/{components → lib/components}/iqr-form/renderer/form.d.ts +1 -0
- package/lib/components/iqr-form/renderer/form.js +240 -0
- package/lib/components/iqr-form/renderer/form.js.map +1 -0
- package/lib/components/iqr-form/renderer/index.d.ts +7 -0
- package/lib/components/iqr-form/renderer/index.js +3 -0
- package/lib/components/iqr-form/renderer/index.js.map +1 -0
- package/lib/components/iqr-form-loader/fieldsMapper.d.ts +3 -0
- package/lib/components/iqr-form-loader/fieldsMapper.js +16 -0
- package/lib/components/iqr-form-loader/fieldsMapper.js.map +1 -0
- package/lib/components/iqr-form-loader/fieldsValuesProviders.d.ts +38 -0
- package/lib/components/iqr-form-loader/fieldsValuesProviders.js +122 -0
- package/lib/components/iqr-form-loader/fieldsValuesProviders.js.map +1 -0
- package/{components → lib/components}/iqr-form-loader/formValuesContainer.d.ts +12 -4
- package/{components → lib/components}/iqr-form-loader/formValuesContainer.js +52 -3
- package/lib/components/iqr-form-loader/formValuesContainer.js.map +1 -0
- package/{components → lib/components}/iqr-form-loader/models.d.ts +1 -1
- package/lib/components/iqr-label/index.d.ts +1 -0
- package/lib/components/iqr-label/index.js +16 -0
- package/lib/components/iqr-label/index.js.map +1 -0
- package/lib/components/iqr-label/utils.d.ts +4 -0
- package/lib/components/iqr-label/utils.js +19 -0
- package/lib/components/iqr-label/utils.js.map +1 -0
- package/lib/components/iqr-radio-button-group/index.d.ts +1 -0
- package/lib/components/iqr-radio-button-group/index.js +807 -0
- package/lib/components/iqr-radio-button-group/index.js.map +1 -0
- package/{components → lib/components}/iqr-text-field/index.d.ts +10 -0
- package/{components → lib/components}/iqr-text-field/index.js +299 -194
- package/lib/components/iqr-text-field/index.js.map +1 -0
- package/{components → lib/components}/iqr-text-field/plugin/has-content-class-plugin.d.ts +1 -1
- package/{components → lib/components}/iqr-text-field/plugin/mask-plugin.js.map +1 -1
- package/{components → lib/components}/iqr-text-field/prosemirror-utils.d.ts +1 -1
- package/{components → lib/components}/iqr-text-field/prosemirror-utils.js.map +1 -1
- package/{components → lib/components}/iqr-text-field/schema/date-time-schema.d.ts +3 -3
- package/{components → lib/components}/iqr-text-field/schema/decimal-schema.d.ts +1 -1
- package/{components → lib/components}/iqr-text-field/schema/index.d.ts +1 -1
- package/{components → lib/components}/iqr-text-field/schema/markdown-schema.d.ts +3 -3
- package/{components → lib/components}/iqr-text-field/schema/measure-schema.d.ts +1 -1
- package/{components → lib/components}/iqr-text-field/schema/measure-schema.js +2 -1
- package/lib/components/iqr-text-field/schema/measure-schema.js.map +1 -0
- package/{components → lib/components}/iqr-text-field/schema/token-schema.d.ts +1 -1
- package/{components → lib/components}/iqr-text-field/styles/paths.d.ts +2 -0
- package/{components → lib/components}/iqr-text-field/styles/paths.js +7 -1
- package/lib/components/iqr-text-field/styles/paths.js.map +1 -0
- package/{components → lib/components}/iqr-text-field/suggestion-palette.d.ts +1 -1
- package/lib/package.json +32 -0
- package/{utils → lib/utils}/icure-utils.d.ts +3 -0
- package/{utils → lib/utils}/icure-utils.js +15 -1
- package/lib/utils/icure-utils.js.map +1 -0
- package/package.json +96 -19
- package/stats.json +1 -0
- package/tsconfig.tmp.json +39 -0
- package/components/index.d.ts +0 -2
- package/components/index.js.map +0 -1
- package/components/iqr-form/fields/datePicker.d.ts +0 -10
- package/components/iqr-form/fields/datePicker.js +0 -57
- package/components/iqr-form/fields/datePicker.js.map +0 -1
- package/components/iqr-form/fields/dateTimePicker.d.ts +0 -10
- package/components/iqr-form/fields/dateTimePicker.js +0 -49
- package/components/iqr-form/fields/dateTimePicker.js.map +0 -1
- package/components/iqr-form/fields/measureField.d.ts +0 -8
- package/components/iqr-form/fields/measureField.js +0 -44
- package/components/iqr-form/fields/measureField.js.map +0 -1
- package/components/iqr-form/fields/multipleChoice.d.ts +0 -8
- package/components/iqr-form/fields/multipleChoice.js.map +0 -1
- package/components/iqr-form/fields/numberField.d.ts +0 -8
- package/components/iqr-form/fields/numberField.js.map +0 -1
- package/components/iqr-form/fields/textfield.js.map +0 -1
- package/components/iqr-form/fields/timePicker.d.ts +0 -10
- package/components/iqr-form/fields/timePicker.js.map +0 -1
- package/components/iqr-form/index.js.map +0 -1
- package/components/iqr-form/model/index.d.ts +0 -96
- package/components/iqr-form/model/index.js +0 -120
- package/components/iqr-form/model/index.js.map +0 -1
- package/components/iqr-form/renderer/cards.js.map +0 -1
- package/components/iqr-form/renderer/form.js +0 -93
- package/components/iqr-form/renderer/form.js.map +0 -1
- package/components/iqr-form/renderer/index.d.ts +0 -6
- package/components/iqr-form/renderer/index.js.map +0 -1
- package/components/iqr-form-loader/fieldsValuesProviders.d.ts +0 -13
- package/components/iqr-form-loader/fieldsValuesProviders.js +0 -49
- package/components/iqr-form-loader/fieldsValuesProviders.js.map +0 -1
- package/components/iqr-form-loader/formValuesContainer.js.map +0 -1
- package/components/iqr-text-field/index.js.map +0 -1
- package/components/iqr-text-field/schema/measure-schema.js.map +0 -1
- package/components/iqr-text-field/styles/paths.js.map +0 -1
- package/utils/icure-utils.js.map +0 -1
- /package/{components/iqr-form/renderer → lib/components/common}/index.js +0 -0
- /package/{components → lib/components}/iqr-form/fields/textfield.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Content.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Content.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Content.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Data.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Data.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Data.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Editor.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Editor.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Editor.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormColumn.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormColumn.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormColumn.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormDataOption.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormDataOption.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormDataOption.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormLayout.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormLayout.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormLayout.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormLayoutData.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormLayoutData.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormLayoutData.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormPlanning.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormPlanning.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormPlanning.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormSection.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormSection.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/FormSection.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Formula.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Formula.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Formula.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/GuiCode.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/GuiCode.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/GuiCode.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/GuiCodeType.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/GuiCodeType.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/GuiCodeType.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Suggest.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Suggest.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Suggest.js.map +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Tag.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Tag.js +0 -0
- /package/{components → lib/components}/iqr-form/legacy/Tag.js.map +0 -0
- /package/{components → lib/components}/iqr-form/renderer/cards.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/utils.d.ts +0 -0
- /package/{components → lib/components}/iqr-form/utils.js +0 -0
- /package/{components → lib/components}/iqr-form/utils.js.map +0 -0
- /package/{components → lib/components}/iqr-form-loader/index.d.ts +0 -0
- /package/{components → lib/components}/iqr-form-loader/index.js +0 -0
- /package/{components → lib/components}/iqr-form-loader/index.js.map +0 -0
- /package/{components → lib/components}/iqr-form-loader/models.js +0 -0
- /package/{components → lib/components}/iqr-form-loader/models.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/caret-fix-plugin.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/caret-fix-plugin.js +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/caret-fix-plugin.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/has-content-class-plugin.js +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/has-content-class-plugin.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/mask-plugin.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/mask-plugin.js +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/regexp-plugin.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/regexp-plugin.js +0 -0
- /package/{components → lib/components}/iqr-text-field/plugin/regexp-plugin.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/prosemirror-commands.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/prosemirror-commands.js +0 -0
- /package/{components → lib/components}/iqr-text-field/prosemirror-commands.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/prosemirror-utils.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/common-marks.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/common-marks.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/common-marks.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/date-time-schema.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/date-time-schema.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/decimal-schema.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/decimal-schema.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/index.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/index.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/markdown-schema.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/markdown-schema.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/token-schema.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/token-schema.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/utils.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/utils.js +0 -0
- /package/{components → lib/components}/iqr-text-field/schema/utils.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/selection-companion.d.ts +0 -0
- /package/{components → lib/components}/iqr-text-field/selection-companion.js +0 -0
- /package/{components → lib/components}/iqr-text-field/selection-companion.js.map +0 -0
- /package/{components → lib/components}/iqr-text-field/suggestion-palette.js +0 -0
- /package/{components → lib/components}/iqr-text-field/suggestion-palette.js.map +0 -0
- /package/{index.d.ts → lib/index.d.ts} +0 -0
- /package/{index.js → lib/index.js} +0 -0
- /package/{index.js.map → lib/index.js.map} +0 -0
- /package/{utils → lib/utils}/languages.d.ts +0 -0
- /package/{utils → lib/utils}/languages.js +0 -0
- /package/{utils → lib/utils}/languages.js.map +0 -0
- /package/{utils → lib/utils}/no-lodash.d.ts +0 -0
- /package/{utils → lib/utils}/no-lodash.js +0 -0
- /package/{utils → lib/utils}/no-lodash.js.map +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RadioButton = void 0;
|
|
13
|
+
const lit_1 = require("lit");
|
|
14
|
+
require("../../iqr-text-field");
|
|
15
|
+
require("../../iqr-radio-button-group");
|
|
16
|
+
const optionsField_1 = require("../../common/optionsField");
|
|
17
|
+
class RadioButton extends optionsField_1.OptionsField {
|
|
18
|
+
render() {
|
|
19
|
+
var _a;
|
|
20
|
+
const versionedValues = (_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
21
|
+
return ((versionedValues === null || versionedValues === void 0 ? void 0 : versionedValues.length) ? versionedValues : [undefined]).map((versionedValue, idx) => {
|
|
22
|
+
return (0, lit_1.html) `
|
|
23
|
+
<iqr-radio-button
|
|
24
|
+
type="radio"
|
|
25
|
+
.labels="${this.labels}"
|
|
26
|
+
labelPosition="${this.labelPosition}"
|
|
27
|
+
label="${this.label}"
|
|
28
|
+
.options="${this.options}"
|
|
29
|
+
value="${this.value}"
|
|
30
|
+
defaultLanguage="${this.defaultLanguage}"
|
|
31
|
+
.valueProvider=${() => versionedValue}
|
|
32
|
+
.handleValueChanged=${(language, value, serviceId, codes) => { var _a; return (_a = this.handleValueChanged) === null || _a === void 0 ? void 0 : _a.call(this, language, value, (versionedValue === null || versionedValue === void 0 ? void 0 : versionedValue.id) || serviceId, codes !== null && codes !== void 0 ? codes : []); }}
|
|
33
|
+
.translationProvider=${this.translationProvider}
|
|
34
|
+
.codifications=${this.codifications}
|
|
35
|
+
.optionsProvider=${this.optionsProvider}
|
|
36
|
+
></iqr-radio-button>
|
|
37
|
+
`;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
firstUpdated() {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (this.options === undefined || this.options.length === 0) {
|
|
43
|
+
this.options = yield this.fetchInitialsOptions();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.RadioButton = RadioButton;
|
|
49
|
+
customElements.define('iqr-form-radio-button', RadioButton);
|
|
50
|
+
//# sourceMappingURL=radioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radioButton.js","sourceRoot":"","sources":["../../../../tmp/components/iqr-form/fields/radioButton.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA0B;AAC1B,gCAA6B;AAC7B,wCAAqC;AAGrC,4DAAwD;AAExD,MAAa,WAAY,SAAQ,2BAAsC;IACtE,MAAM;;QACL,MAAM,eAAe,GAAG,MAAA,IAAI,CAAC,aAAa,oDAAI,CAAA;QAC9C,OAAO,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,GAAG,EAAE,EAAE;YAC5F,OAAO,IAAA,UAAI,EAAA;;;gBAGE,IAAI,CAAC,MAAM;sBACL,IAAI,CAAC,aAAa;cAC1B,IAAI,CAAC,KAAK;iBACP,IAAI,CAAC,OAAO;cACf,IAAI,CAAC,KAAK;wBACA,IAAI,CAAC,eAAe;sBACtB,GAAG,EAAE,CAAC,cAAc;2BACf,CAAC,QAAgB,EAAE,KAA8C,EAAE,SAA8B,EAAE,KAAkB,EAAE,EAAE,WAC9I,OAAA,MAAA,IAAI,CAAC,kBAAkB,qDAAG,QAAQ,EAAE,KAAK,EAAE,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,EAAE,KAAI,SAAS,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAA,EAAA;4BAClE,IAAI,CAAC,mBAAmB;sBAC9B,IAAI,CAAC,aAAa;wBAChB,IAAI,CAAC,eAAe;;IAExC,CAAA;QACF,CAAC,CAAC,CAAA;IACH,CAAC;IAEY,YAAY;;YACxB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5D,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAA;aAChD;QACF,CAAC;KAAA;CACD;AA7BD,kCA6BC;AAED,cAAc,CAAC,MAAM,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import { html } from 'lit'\nimport '../../iqr-text-field'\nimport '../../iqr-radio-button-group'\nimport { VersionedValue } from '../../iqr-text-field'\nimport { CodeStub, Content } from '@icure/api'\nimport { OptionsField } from '../../common/optionsField'\n\nexport class RadioButton extends OptionsField<string, VersionedValue[]> {\n\trender() {\n\t\tconst versionedValues = this.valueProvider?.()\n\t\treturn (versionedValues?.length ? versionedValues : [undefined]).map((versionedValue, idx) => {\n\t\t\treturn html`\n\t\t\t\t<iqr-radio-button\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t.labels=\"${this.labels}\"\n\t\t\t\t\tlabelPosition=\"${this.labelPosition}\"\n\t\t\t\t\tlabel=\"${this.label}\"\n\t\t\t\t\t.options=\"${this.options}\"\n\t\t\t\t\tvalue=\"${this.value}\"\n\t\t\t\t\tdefaultLanguage=\"${this.defaultLanguage}\"\n\t\t\t\t\t.valueProvider=${() => versionedValue}\n\t\t\t\t\t.handleValueChanged=${(language: string, value: { asString: string; content?: Content }, serviceId?: string | undefined, codes?: CodeStub[]) =>\n\t\t\t\t\t\tthis.handleValueChanged?.(language, value, versionedValue?.id || serviceId, codes ?? [])}\n\t\t\t\t\t.translationProvider=${this.translationProvider}\n\t\t\t\t\t.codifications=${this.codifications}\n\t\t\t\t\t.optionsProvider=${this.optionsProvider}\n\t\t\t\t></iqr-radio-button>\n\t\t\t`\n\t\t})\n\t}\n\n\tpublic async firstUpdated(): Promise<void> {\n\t\tif (this.options === undefined || this.options.length === 0) {\n\t\t\tthis.options = await this.fetchInitialsOptions()\n\t\t}\n\t}\n}\n\ncustomElements.define('iqr-form-radio-button', RadioButton)\n"]}
|
|
@@ -19,20 +19,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
const lit_1 = require("lit");
|
|
22
|
-
const
|
|
22
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
23
23
|
require("../../iqr-text-field");
|
|
24
24
|
class Textfield extends lit_1.LitElement {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
27
|
this.label = '';
|
|
28
|
+
this.labels = undefined;
|
|
29
|
+
//Boolean value is parsed as text, so we also need to use string type
|
|
28
30
|
this.multiline = false;
|
|
29
31
|
this.rows = 1;
|
|
30
32
|
this.grows = false;
|
|
33
|
+
this.value = '';
|
|
34
|
+
this.unit = '';
|
|
31
35
|
this.labelPosition = undefined;
|
|
32
36
|
this.suggestionStopWords = new Set();
|
|
33
37
|
this.linksProvider = () => Promise.resolve(undefined);
|
|
34
38
|
this.suggestionProvider = () => __awaiter(this, void 0, void 0, function* () { return []; });
|
|
35
39
|
this.ownersProvider = () => __awaiter(this, void 0, void 0, function* () { return []; });
|
|
40
|
+
this.translationProvider = (text) => text;
|
|
36
41
|
this.codeColorProvider = () => 'XI';
|
|
37
42
|
this.linkColorProvider = () => 'cat1';
|
|
38
43
|
this.codeContentProvider = (codes) => codes.map((c) => c.code).join(',');
|
|
@@ -40,6 +45,7 @@ class Textfield extends lit_1.LitElement {
|
|
|
40
45
|
this.metaProvider = undefined;
|
|
41
46
|
this.handleValueChanged = undefined;
|
|
42
47
|
this.handleMetaChanged = undefined;
|
|
48
|
+
this.defaultLanguage = 'en';
|
|
43
49
|
}
|
|
44
50
|
static get styles() {
|
|
45
51
|
return [
|
|
@@ -52,92 +58,115 @@ class Textfield extends lit_1.LitElement {
|
|
|
52
58
|
render() {
|
|
53
59
|
var _a;
|
|
54
60
|
const versionedValues = (_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
55
|
-
return (0
|
|
56
|
-
${((versionedValues === null || versionedValues === void 0 ? void 0 : versionedValues.length) ? versionedValues : [undefined]).map((versionedValue, idx) => {
|
|
61
|
+
return ((versionedValues === null || versionedValues === void 0 ? void 0 : versionedValues.length) ? versionedValues : [undefined]).map((versionedValue, idx) => {
|
|
57
62
|
return (0, lit_1.html) `<iqr-text-field
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
labelPosition=${this.labelPosition}
|
|
64
|
+
label="${this.label}"
|
|
65
|
+
labels="${this.labels}"
|
|
66
|
+
value="${this.value}"
|
|
67
|
+
defaultLanguage="${this.defaultLanguage}"
|
|
68
|
+
schema="${this.multiline ? 'text-document' : 'styled-text-with-codes'}"
|
|
69
|
+
?suggestions=${!!this.suggestionProvider}
|
|
70
|
+
?links=${!!this.linksProvider}
|
|
71
|
+
.linksProvider=${this.linksProvider}
|
|
72
|
+
.suggestionProvider=${this.suggestionProvider}
|
|
73
|
+
.ownersProvider=${this.ownersProvider}
|
|
74
|
+
.translationProvider=${this.translationProvider}
|
|
75
|
+
.codeColorProvider=${this.codeColorProvider}
|
|
76
|
+
.linkColorProvider=${this.linkColorProvider}
|
|
77
|
+
.codeContentProvider=${this.codeContentProvider}
|
|
78
|
+
.valueProvider=${() => versionedValue}
|
|
79
|
+
.metaProvider=${() => { var _a, _b; return (_b = (_a = this.metaProvider) === null || _a === void 0 ? void 0 : _a.call(this)) === null || _b === void 0 ? void 0 : _b[idx]; }}
|
|
80
|
+
.handleValueChanged=${(language, value) => { var _a; return (_a = this.handleValueChanged) === null || _a === void 0 ? void 0 : _a.call(this, versionedValue === null || versionedValue === void 0 ? void 0 : versionedValue.id, language, value); }}
|
|
81
|
+
.handleMetaChanged=${this.handleMetaChanged}
|
|
82
|
+
></iqr-text-field>`;
|
|
83
|
+
});
|
|
76
84
|
}
|
|
77
85
|
}
|
|
78
86
|
__decorate([
|
|
79
|
-
(0,
|
|
87
|
+
(0, decorators_js_1.property)(),
|
|
80
88
|
__metadata("design:type", Object)
|
|
81
89
|
], Textfield.prototype, "label", void 0);
|
|
82
90
|
__decorate([
|
|
83
|
-
(0,
|
|
91
|
+
(0, decorators_js_1.property)(),
|
|
92
|
+
__metadata("design:type", Object)
|
|
93
|
+
], Textfield.prototype, "labels", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, decorators_js_1.property)(),
|
|
84
96
|
__metadata("design:type", Object)
|
|
85
97
|
], Textfield.prototype, "multiline", void 0);
|
|
86
98
|
__decorate([
|
|
87
|
-
(0,
|
|
99
|
+
(0, decorators_js_1.property)(),
|
|
88
100
|
__metadata("design:type", Object)
|
|
89
101
|
], Textfield.prototype, "rows", void 0);
|
|
90
102
|
__decorate([
|
|
91
|
-
(0,
|
|
103
|
+
(0, decorators_js_1.property)(),
|
|
92
104
|
__metadata("design:type", Object)
|
|
93
105
|
], Textfield.prototype, "grows", void 0);
|
|
94
106
|
__decorate([
|
|
95
|
-
(0,
|
|
107
|
+
(0, decorators_js_1.property)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], Textfield.prototype, "value", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, decorators_js_1.property)(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], Textfield.prototype, "unit", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, decorators_js_1.property)(),
|
|
96
116
|
__metadata("design:type", String)
|
|
97
117
|
], Textfield.prototype, "labelPosition", void 0);
|
|
98
118
|
__decorate([
|
|
99
|
-
(0,
|
|
119
|
+
(0, decorators_js_1.property)(),
|
|
100
120
|
__metadata("design:type", Set)
|
|
101
121
|
], Textfield.prototype, "suggestionStopWords", void 0);
|
|
102
122
|
__decorate([
|
|
103
|
-
(0,
|
|
123
|
+
(0, decorators_js_1.property)(),
|
|
104
124
|
__metadata("design:type", Function)
|
|
105
125
|
], Textfield.prototype, "linksProvider", void 0);
|
|
106
126
|
__decorate([
|
|
107
|
-
(0,
|
|
127
|
+
(0, decorators_js_1.property)(),
|
|
108
128
|
__metadata("design:type", Function)
|
|
109
129
|
], Textfield.prototype, "suggestionProvider", void 0);
|
|
110
130
|
__decorate([
|
|
111
|
-
(0,
|
|
131
|
+
(0, decorators_js_1.property)(),
|
|
112
132
|
__metadata("design:type", Function)
|
|
113
133
|
], Textfield.prototype, "ownersProvider", void 0);
|
|
114
134
|
__decorate([
|
|
115
|
-
(0,
|
|
135
|
+
(0, decorators_js_1.property)(),
|
|
136
|
+
__metadata("design:type", Function)
|
|
137
|
+
], Textfield.prototype, "translationProvider", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, decorators_js_1.property)(),
|
|
116
140
|
__metadata("design:type", Function)
|
|
117
141
|
], Textfield.prototype, "codeColorProvider", void 0);
|
|
118
142
|
__decorate([
|
|
119
|
-
(0,
|
|
143
|
+
(0, decorators_js_1.property)(),
|
|
120
144
|
__metadata("design:type", Function)
|
|
121
145
|
], Textfield.prototype, "linkColorProvider", void 0);
|
|
122
146
|
__decorate([
|
|
123
|
-
(0,
|
|
147
|
+
(0, decorators_js_1.property)(),
|
|
124
148
|
__metadata("design:type", Function)
|
|
125
149
|
], Textfield.prototype, "codeContentProvider", void 0);
|
|
126
150
|
__decorate([
|
|
127
|
-
(0,
|
|
151
|
+
(0, decorators_js_1.property)(),
|
|
128
152
|
__metadata("design:type", Function)
|
|
129
153
|
], Textfield.prototype, "valueProvider", void 0);
|
|
130
154
|
__decorate([
|
|
131
|
-
(0,
|
|
155
|
+
(0, decorators_js_1.property)(),
|
|
132
156
|
__metadata("design:type", Function)
|
|
133
157
|
], Textfield.prototype, "metaProvider", void 0);
|
|
134
158
|
__decorate([
|
|
135
|
-
(0,
|
|
159
|
+
(0, decorators_js_1.property)(),
|
|
136
160
|
__metadata("design:type", Function)
|
|
137
161
|
], Textfield.prototype, "handleValueChanged", void 0);
|
|
138
162
|
__decorate([
|
|
139
|
-
(0,
|
|
163
|
+
(0, decorators_js_1.property)(),
|
|
140
164
|
__metadata("design:type", Function)
|
|
141
165
|
], Textfield.prototype, "handleMetaChanged", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, decorators_js_1.property)(),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], Textfield.prototype, "defaultLanguage", void 0);
|
|
170
|
+
//.valueProvider=${() => versionedValue}
|
|
142
171
|
customElements.define('iqr-form-textfield', Textfield);
|
|
143
172
|
//# sourceMappingURL=textfield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textfield.js","sourceRoot":"","sources":["../../../../tmp/components/iqr-form/fields/textfield.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6BAA2C;AAC3C,qDAA4C;AAE5C,gCAA6B;AAI7B,MAAM,SAAU,SAAQ,gBAAU;IAAlC;;QACa,UAAK,GAAG,EAAE,CAAA;QACV,WAAM,GAAY,SAAS,CAAA;QACvC,qEAAqE;QACzD,cAAS,GAAqB,KAAK,CAAA;QACnC,SAAI,GAAG,CAAC,CAAA;QACR,UAAK,GAAG,KAAK,CAAA;QACb,UAAK,GAAY,EAAE,CAA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AAG;sDAA4B;AAChE;IAAC,IAAA,wBAAQ,GAAE;;gDACgB;AAC3B;IAAC,IAAA,wBAAQ,GAAE;;qDAAgF;AAC3F;IAAC,IAAA,wBAAQ,GAAE;;iDAA4E;AACvF;IAAC,IAAA,wBAAQ,GAAE;;sDAA+D;AAC1E;IAAC,IAAA,wBAAQ,GAAE;;oDAAuE;AAClF;IAAC,IAAA,wBAAQ,GAAE;;oDAAyE;AACpF;IAAC,IAAA,wBAAQ,GAAE;;sDAAyH;AAEpI;IAAC,IAAA,wBAAQ,GAAE;;gDAAmD;AAC9D;IAAC,IAAA,wBAAQ,GAAE;;+CAAiD;AAC5D;IAAC,IAAA,wBAAQ,GAAE;;qDAAoI;AAC/I;IAAC,IAAA,wBAAQ,GAAE;;oDAAuH;AAClI;IAAC,IAAA,wBAAQ,GAAE;;kDAAgC;AAsC5C,wCAAwC;AAExC,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAA","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport '../../iqr-text-field'\nimport { Labels, Suggestion, VersionedMeta, VersionedValue } from '../../iqr-text-field'\nimport { Content } from '@icure/api'\n\nclass Textfield extends LitElement {\n\t@property() label = ''\n\t@property() labels?: Labels = undefined\n\t//Boolean value is parsed as text, so we also need to use string type\n\t@property() multiline: boolean | string = false\n\t@property() rows = 1\n\t@property() grows = false\n\t@property() value?: string = ''\n\t@property() unit?: string = ''\n\t@property() labelPosition?: string = undefined\n\t@property() suggestionStopWords: Set<string> = new Set<string>()\n\t@property() linksProvider: (sug: { id: string; code: string; text: string; terms: string[] }) => Promise<{ href: string; title: string } | undefined> = () =>\n\t\tPromise.resolve(undefined)\n\t@property() suggestionProvider: (terms: string[]) => Promise<Suggestion[]> = async () => []\n\t@property() ownersProvider: (terms: string[]) => Promise<Suggestion[]> = async () => []\n\t@property() translationProvider: (text: string) => string = (text) => text\n\t@property() codeColorProvider: (type: string, code: string) => string = () => 'XI'\n\t@property() linkColorProvider: (type: string, code: string) => string = () => 'cat1'\n\t@property() codeContentProvider: (codes: { type: string; code: string }[]) => string = (codes) => codes.map((c) => c.code).join(',')\n\n\t@property() valueProvider?: () => VersionedValue[] = undefined\n\t@property() metaProvider?: () => VersionedMeta[] = undefined\n\t@property() handleValueChanged?: (id: string | undefined, language: string, value: { asString: string; content?: Content }) => void = undefined\n\t@property() handleMetaChanged?: (id: string, language: string, value: { asString: string; content?: Content }) => void = undefined\n\t@property() defaultLanguage?: string = 'en'\n\n\tstatic get styles() {\n\t\treturn [\n\t\t\tcss`\n\t\t\t\t:host {\n\t\t\t\t}\n\t\t\t`,\n\t\t]\n\t}\n\n\trender() {\n\t\tconst versionedValues = this.valueProvider?.()\n\t\treturn (versionedValues?.length ? versionedValues : [undefined]).map((versionedValue, idx) => {\n\t\t\treturn html`<iqr-text-field\n\t\t\t\tlabelPosition=${this.labelPosition}\n\t\t\t\tlabel=\"${this.label}\"\n\t\t\t\tlabels=\"${this.labels}\"\n\t\t\t\tvalue=\"${this.value}\"\n\t\t\t\tdefaultLanguage=\"${this.defaultLanguage}\"\n\t\t\t\tschema=\"${this.multiline ? 'text-document' : 'styled-text-with-codes'}\"\n\t\t\t\t?suggestions=${!!this.suggestionProvider}\n\t\t\t\t?links=${!!this.linksProvider}\n\t\t\t\t.linksProvider=${this.linksProvider}\n\t\t\t\t.suggestionProvider=${this.suggestionProvider}\n\t\t\t\t.ownersProvider=${this.ownersProvider}\n\t\t\t\t.translationProvider=${this.translationProvider}\n\t\t\t\t.codeColorProvider=${this.codeColorProvider}\n\t\t\t\t.linkColorProvider=${this.linkColorProvider}\n\t\t\t\t.codeContentProvider=${this.codeContentProvider}\n\t\t\t\t.valueProvider=${() => versionedValue}\n\t\t\t\t.metaProvider=${() => this.metaProvider?.()?.[idx]}\n\t\t\t\t.handleValueChanged=${(language: string, value: { asString: string; content?: Content }) => this.handleValueChanged?.(versionedValue?.id, language, value)}\n\t\t\t\t.handleMetaChanged=${this.handleMetaChanged}\n\t\t\t></iqr-text-field>`\n\t\t})\n\t}\n}\n//.valueProvider=${() => versionedValue}\n\ncustomElements.define('iqr-form-textfield', Textfield)\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from 'lit';
|
|
2
|
+
import '../../iqr-text-field';
|
|
3
|
+
import { Labels, VersionedValue } from '../../iqr-text-field';
|
|
4
|
+
export declare class TimePicker extends LitElement {
|
|
5
|
+
label: string;
|
|
6
|
+
labelPosition?: string;
|
|
7
|
+
valueProvider?: () => VersionedValue[];
|
|
8
|
+
labels?: Labels;
|
|
9
|
+
value?: string;
|
|
10
|
+
handleValueChanged?: (id: string | undefined, language: string, value: string) => void;
|
|
11
|
+
translationProvider: (text: string) => string;
|
|
12
|
+
defaultLanguage?: string;
|
|
13
|
+
static get styles(): CSSResultGroup[];
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TimePicker = void 0;
|
|
13
|
+
const lit_1 = require("lit");
|
|
14
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
15
|
+
require("../../iqr-text-field");
|
|
16
|
+
class TimePicker extends lit_1.LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.label = '';
|
|
20
|
+
this.labelPosition = undefined;
|
|
21
|
+
this.valueProvider = undefined;
|
|
22
|
+
this.labels = undefined;
|
|
23
|
+
this.value = '';
|
|
24
|
+
this.handleValueChanged = undefined;
|
|
25
|
+
this.translationProvider = (text) => text;
|
|
26
|
+
this.defaultLanguage = 'en';
|
|
27
|
+
}
|
|
28
|
+
static get styles() {
|
|
29
|
+
return [
|
|
30
|
+
(0, lit_1.css) `
|
|
31
|
+
:host {
|
|
32
|
+
}
|
|
33
|
+
`,
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
var _a;
|
|
38
|
+
const versionedValues = (_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
39
|
+
return ((versionedValues === null || versionedValues === void 0 ? void 0 : versionedValues.length) ? versionedValues : [undefined]).map((versionedValue, idx) => {
|
|
40
|
+
return (0, lit_1.html) `
|
|
41
|
+
<iqr-text-field
|
|
42
|
+
.labels="${this.labels}"
|
|
43
|
+
labelPosition=${this.labelPosition}
|
|
44
|
+
label="${this.label}"
|
|
45
|
+
schema="time"
|
|
46
|
+
.valueProvider=${() => versionedValue}
|
|
47
|
+
value="${this.value}"
|
|
48
|
+
defaultLanguage="${this.defaultLanguage}"
|
|
49
|
+
.handleValueChanged=${(language, value) => { var _a; return (_a = this.handleValueChanged) === null || _a === void 0 ? void 0 : _a.call(this, versionedValue === null || versionedValue === void 0 ? void 0 : versionedValue.id, language, value); }}
|
|
50
|
+
.translationProvider=${this.translationProvider}
|
|
51
|
+
></iqr-text-field>
|
|
52
|
+
`;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, decorators_js_1.property)(),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], TimePicker.prototype, "label", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, decorators_js_1.property)(),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], TimePicker.prototype, "labelPosition", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, decorators_js_1.property)(),
|
|
66
|
+
__metadata("design:type", Function)
|
|
67
|
+
], TimePicker.prototype, "valueProvider", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, decorators_js_1.property)(),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], TimePicker.prototype, "labels", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, decorators_js_1.property)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], TimePicker.prototype, "value", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, decorators_js_1.property)(),
|
|
78
|
+
__metadata("design:type", Function)
|
|
79
|
+
], TimePicker.prototype, "handleValueChanged", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, decorators_js_1.property)(),
|
|
82
|
+
__metadata("design:type", Function)
|
|
83
|
+
], TimePicker.prototype, "translationProvider", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, decorators_js_1.property)(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], TimePicker.prototype, "defaultLanguage", void 0);
|
|
88
|
+
exports.TimePicker = TimePicker;
|
|
89
|
+
customElements.define('iqr-form-time-picker', TimePicker);
|
|
90
|
+
//# sourceMappingURL=timePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timePicker.js","sourceRoot":"","sources":["../../../../tmp/components/iqr-form/fields/timePicker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA2D;AAC3D,qDAA4C;AAE5C,gCAA6B;AAE7B,MAAa,UAAW,SAAQ,gBAAU;IAA1C;;QACa,UAAK,GAA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,GAAE;;0CAA4B;AACvC;IAAC,IAAA,wBAAQ,GAAE;;yCAAoB;AAC/B;IAAC,IAAA,wBAAQ,GAAE;;sDAAmG;AAC9G;IAAC,IAAA,wBAAQ,GAAE;;uDAA+D;AAC1E;IAAC,IAAA,wBAAQ,GAAE;;mDAAgC;AAR5C,gCAqCC;AAED,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAA","sourcesContent":["import { css, CSSResultGroup, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport '../../iqr-text-field'\nimport { Labels, VersionedValue } from '../../iqr-text-field'\nexport class TimePicker extends LitElement {\n\t@property() label = ''\n\t@property() labelPosition?: string = undefined\n\t@property() valueProvider?: () => VersionedValue[] = undefined\n\t@property() labels?: Labels = undefined\n\t@property() value?: string = ''\n\t@property() handleValueChanged?: (id: string | undefined, language: string, value: string) => void = undefined\n\t@property() translationProvider: (text: string) => string = (text) => text\n\t@property() defaultLanguage?: string = 'en'\n\n\tstatic get styles(): CSSResultGroup[] {\n\t\treturn [\n\t\t\tcss`\n\t\t\t\t:host {\n\t\t\t\t}\n\t\t\t`,\n\t\t]\n\t}\n\n\trender() {\n\t\tconst versionedValues = this.valueProvider?.()\n\t\treturn (versionedValues?.length ? versionedValues : [undefined]).map((versionedValue, idx) => {\n\t\t\treturn html`\n\t\t\t\t<iqr-text-field\n\t\t\t\t\t.labels=\"${this.labels}\"\n\t\t\t\t\tlabelPosition=${this.labelPosition}\n\t\t\t\t\tlabel=\"${this.label}\"\n\t\t\t\t\tschema=\"time\"\n\t\t\t\t\t.valueProvider=${() => versionedValue}\n\t\t\t\t\tvalue=\"${this.value}\"\n\t\t\t\t\tdefaultLanguage=\"${this.defaultLanguage}\"\n\t\t\t\t\t.handleValueChanged=${(language: string, value: string) => this.handleValueChanged?.(versionedValue?.id, language, value)}\n\t\t\t\t\t.translationProvider=${this.translationProvider}\n\t\t\t\t></iqr-text-field>\n\t\t\t`\n\t\t})\n\t}\n}\n\ncustomElements.define('iqr-form-time-picker', TimePicker)\n"]}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
// Import the LitElement base class and html helper function
|
|
13
13
|
const lit_1 = require("lit");
|
|
14
|
-
const
|
|
14
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
15
15
|
const model_1 = require("./model");
|
|
16
16
|
require("./fields/textfield");
|
|
17
17
|
require("./fields/measureField");
|
|
@@ -20,13 +20,16 @@ require("./fields/datePicker");
|
|
|
20
20
|
require("./fields/timePicker");
|
|
21
21
|
require("./fields/dateTimePicker");
|
|
22
22
|
require("./fields/multipleChoice");
|
|
23
|
+
require("./fields/dropdown");
|
|
24
|
+
require("./fields/radioButton");
|
|
25
|
+
require("./fields/checkbox");
|
|
26
|
+
require("./fields/label");
|
|
23
27
|
// @ts-ignore
|
|
24
28
|
const lit_2 = require("lit");
|
|
25
29
|
const baseCss = (0, lit_2.css) `.iqr-form {
|
|
26
30
|
display: flex;
|
|
27
31
|
flex-flow: row wrap;
|
|
28
32
|
align-items: center;
|
|
29
|
-
font-family: "Roboto", Helvetica, sans-serif;
|
|
30
33
|
}
|
|
31
34
|
.iqr-form h2 {
|
|
32
35
|
width: 100%;
|
|
@@ -38,45 +41,30 @@ const baseCss = (0, lit_2.css) `.iqr-form {
|
|
|
38
41
|
font-size: 1.2em;
|
|
39
42
|
font-weight: normal;
|
|
40
43
|
color: #282829;
|
|
41
|
-
margin:
|
|
44
|
+
margin: 1em;
|
|
42
45
|
}
|
|
43
|
-
.iqr-form
|
|
44
|
-
|
|
46
|
+
.iqr-form iqr-form-textfield, .iqr-form iqr-form-date-picker, .iqr-form iqr-form-number-field, .iqr-form iqr-form-measure-field, .iqr-form iqr-form-time-picker, .iqr-form iqr-form-date-time-picker, .iqr-form iqr-form-multiple-choice, .iqr-form iqr-form-dropdown-field, .iqr-form iqr-form-dropdown-field, .iqr-form iqr-form-radio-button, .iqr-form iqr-form-checkbox {
|
|
47
|
+
flex: var(--grows) 1 calc(var(--width) - 20px);
|
|
48
|
+
margin: 0em 10PX 10PX 10PX;
|
|
45
49
|
}
|
|
46
|
-
.iqr-form iqr-form-
|
|
47
|
-
flex:
|
|
50
|
+
.iqr-form iqr-form-radio-button {
|
|
51
|
+
flex: var(--grows) 1 calc(var(--width) - 20px);
|
|
52
|
+
margin: 0em 10px 8px 10px;
|
|
48
53
|
}
|
|
49
|
-
.iqr-form iqr-form-
|
|
50
|
-
flex:
|
|
51
|
-
|
|
52
|
-
.iqr-form iqr-form-number-field {
|
|
53
|
-
flex: 1 1 25%;
|
|
54
|
-
}
|
|
55
|
-
.iqr-form iqr-form-measure-field {
|
|
56
|
-
flex: 1 1 25%;
|
|
57
|
-
}
|
|
58
|
-
.iqr-form iqr-form-time-picker {
|
|
59
|
-
flex: 1 1 25%;
|
|
60
|
-
}
|
|
61
|
-
.iqr-form iqr-form-date-time-picker {
|
|
62
|
-
flex: 1 1 25%;
|
|
63
|
-
}
|
|
64
|
-
.iqr-form iqr-form-multiple-choice {
|
|
65
|
-
flex: 2 1 50%;
|
|
54
|
+
.iqr-form iqr-form-checkbox {
|
|
55
|
+
flex: var(--grows) 1 calc(var(--width) - 20px);
|
|
56
|
+
margin: 0em 10px 11px 10px;
|
|
66
57
|
}
|
|
67
58
|
.iqr-form .group {
|
|
59
|
+
flex: 1 1 calc(var(--width) - 2em);
|
|
60
|
+
margin: 1em;
|
|
68
61
|
background: #f6f6f6;
|
|
69
|
-
padding: 12px 0 12px 8px;
|
|
70
62
|
border-radius: 12px;
|
|
71
|
-
margin: 4px 0;
|
|
72
63
|
width: 100%;
|
|
73
64
|
display: flex;
|
|
74
65
|
flex-flow: row wrap;
|
|
75
66
|
align-items: center;
|
|
76
67
|
justify-content: flex-start;
|
|
77
|
-
}
|
|
78
|
-
.iqr-form .group > * {
|
|
79
|
-
margin: 0 24px 0 0;
|
|
80
68
|
}`;
|
|
81
69
|
// @ts-ignore
|
|
82
70
|
const kendoCss = (0, lit_2.css) ``;
|
|
@@ -90,8 +78,11 @@ class IqrForm extends lit_1.LitElement {
|
|
|
90
78
|
this.theme = 'default';
|
|
91
79
|
this.renderer = 'form';
|
|
92
80
|
this.labelPosition = undefined;
|
|
81
|
+
this.defaultLanguage = undefined;
|
|
93
82
|
this.formValuesContainer = undefined;
|
|
94
83
|
this.formValuesContainerChanged = undefined;
|
|
84
|
+
this.translationProvider = (text) => text;
|
|
85
|
+
this.codesProvider = () => Promise.resolve([]);
|
|
95
86
|
}
|
|
96
87
|
connectedCallback() {
|
|
97
88
|
super.connectedCallback();
|
|
@@ -105,7 +96,7 @@ class IqrForm extends lit_1.LitElement {
|
|
|
105
96
|
render() {
|
|
106
97
|
const renderer = this.renderer === 'form' ? form_1.render : this.renderer === 'form' ? cards_1.render : undefined;
|
|
107
98
|
return renderer && this.form
|
|
108
|
-
? renderer(this.form, { labelPosition: this.labelPosition }, this.formValuesContainer, this.formValuesContainerChanged)
|
|
99
|
+
? renderer(this.form, { labelPosition: this.labelPosition, defaultLanguage: this.defaultLanguage }, this.formValuesContainer, (newValue) => { var _a; return (_a = this.formValuesContainerChanged) === null || _a === void 0 ? void 0 : _a.call(this, newValue); }, this.translationProvider, () => [], this.codesProvider)
|
|
109
100
|
: this.form
|
|
110
101
|
? (0, lit_1.html) `<p>unknown renderer</p>`
|
|
111
102
|
: (0, lit_1.html) `<p>missing form</p>`;
|
|
@@ -115,33 +106,45 @@ class IqrForm extends lit_1.LitElement {
|
|
|
115
106
|
}
|
|
116
107
|
}
|
|
117
108
|
__decorate([
|
|
118
|
-
(0,
|
|
109
|
+
(0, decorators_js_1.property)(),
|
|
119
110
|
__metadata("design:type", model_1.Form)
|
|
120
111
|
], IqrForm.prototype, "form", void 0);
|
|
121
112
|
__decorate([
|
|
122
|
-
(0,
|
|
113
|
+
(0, decorators_js_1.property)(),
|
|
123
114
|
__metadata("design:type", Object)
|
|
124
115
|
], IqrForm.prototype, "skin", void 0);
|
|
125
116
|
__decorate([
|
|
126
|
-
(0,
|
|
117
|
+
(0, decorators_js_1.property)(),
|
|
127
118
|
__metadata("design:type", Object)
|
|
128
119
|
], IqrForm.prototype, "theme", void 0);
|
|
129
120
|
__decorate([
|
|
130
|
-
(0,
|
|
121
|
+
(0, decorators_js_1.property)(),
|
|
131
122
|
__metadata("design:type", Object)
|
|
132
123
|
], IqrForm.prototype, "renderer", void 0);
|
|
133
124
|
__decorate([
|
|
134
|
-
(0,
|
|
125
|
+
(0, decorators_js_1.property)(),
|
|
135
126
|
__metadata("design:type", String)
|
|
136
127
|
], IqrForm.prototype, "labelPosition", void 0);
|
|
137
128
|
__decorate([
|
|
138
|
-
(0,
|
|
129
|
+
(0, decorators_js_1.property)(),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], IqrForm.prototype, "defaultLanguage", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, decorators_js_1.property)(),
|
|
139
134
|
__metadata("design:type", Object)
|
|
140
135
|
], IqrForm.prototype, "formValuesContainer", void 0);
|
|
141
136
|
__decorate([
|
|
142
|
-
(0,
|
|
137
|
+
(0, decorators_js_1.property)(),
|
|
143
138
|
__metadata("design:type", Function)
|
|
144
139
|
], IqrForm.prototype, "formValuesContainerChanged", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, decorators_js_1.property)(),
|
|
142
|
+
__metadata("design:type", Function)
|
|
143
|
+
], IqrForm.prototype, "translationProvider", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, decorators_js_1.property)(),
|
|
146
|
+
__metadata("design:type", Function)
|
|
147
|
+
], IqrForm.prototype, "codesProvider", void 0);
|
|
145
148
|
// Register the new element with the browser.
|
|
146
149
|
customElements.define('iqr-form', IqrForm);
|
|
147
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../tmp/components/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ent":["// Import the LitElement base class and html helper function\nimport { html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Form } from './model'\n\nimport './fields/textfield'\nimport './fields/measureField'\nimport './fields/numberField'\nimport './fields/datePicker'\nimport './fields/timePicker'\nimport './fields/dateTimePicker'\nimport './fields/multipleChoice'\nimport './fields/dropdown'\nimport './fields/radioButton'\nimport './fields/checkbox'\nimport './fields/label'\n// @ts-ignore\nimport { css } from 'lit';\nconst baseCss = css`.iqr-form {\n display: flex;\n flex-flow: row wrap;\n align-items: center;\n}\n.iqr-form h2 {\n width: 100%;\n font-size: 2em;\n margin-top: 1em;\n}\n.iqr-form h3 {\n width: 100%;\n font-size: 1.2em;\n font-weight: normal;\n color: #282829;\n margin: 1em;\n}\n.iqr-form iqr-form-textfield, .iqr-form iqr-form-date-picker, .iqr-form iqr-form-number-field, .iqr-form iqr-form-measure-field, .iqr-form iqr-form-time-picker, .iqr-form iqr-form-date-time-picker, .iqr-form iqr-form-multiple-choice, .iqr-form iqr-form-dropdown-field, .iqr-form iqr-form-dropdown-field, .iqr-form iqr-form-radio-button, .iqr-form iqr-form-checkbox {\n flex: var(--grows) 1 calc(var(--width) - 20px);\n margin: 0em 10PX 10PX 10PX;\n}\n.iqr-form iqr-form-radio-button {\n flex: var(--grows) 1 calc(var(--width) - 20px);\n margin: 0em 10px 8px 10px;\n}\n.iqr-form iqr-form-checkbox {\n flex: var(--grows) 1 calc(var(--width) - 20px);\n margin: 0em 10px 11px 10px;\n}\n.iqr-form .group {\n flex: 1 1 calc(var(--width) - 2em);\n margin: 1em;\n background: #f6f6f6;\n border-radius: 12px;\n width: 100%;\n display: flex;\n flex-flow: row wrap;\n align-items: center;\n justify-content: flex-start;\n}` \n// @ts-ignore\nconst kendoCss = css`` \nimport { Renderer } from './renderer'\n\nimport { render as renderAsCard } from './renderer/cards'\nimport { render as renderAsForm } from './renderer/form'\nimport { FormValuesContainer } from '../iqr-form-loader/formValuesContainer'\nimport { CodeStub } from '@icure/api'\n\n// Extend the LitElement base class\nclass IqrForm extends LitElement {\n\t@property() form?: Form\n\t@property() skin = 'material'\n\t@property() theme = 'default'\n\t@property() renderer = 'form'\n\t@property() labelPosition?: string = undefined\n\t@property() defaultLanguage?: string = undefined\n\t@property() formValuesContainer?: FormValuesContainer = undefined\n\t@property() formValuesContainerChanged?: (newValue: FormValuesContainer) => void = undefined\n\t@property() translationProvider: (text: string) => string = (text) => text\n\t@property() codesProvider: (codifications: string[], searchTerm: string) => Promise<CodeStub[]> = () => Promise.resolve([])\n\n\tconstructor() {\n\t\tsuper()\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t}\n\n\tstatic get styles() {\n\t\treturn [baseCss, kendoCss]\n\t}\n\n\trender() {\n\t\tconst renderer: Renderer | undefined = this.renderer === 'form' ? renderAsForm : this.renderer === 'form' ? renderAsCard : undefined\n\n\t\treturn renderer && this.form\n\t\t\t? renderer(\n\t\t\t\t\tthis.form,\n\t\t\t\t\t{ labelPosition: this.labelPosition, defaultLanguage: this.defaultLanguage },\n\t\t\t\t\tthis.formValuesContainer,\n\t\t\t\t\t(newValue) => this.formValuesContainerChanged?.(newValue),\n\t\t\t\t\tthis.translationProvider,\n\t\t\t\t\t() => [],\n\t\t\t\t\tthis.codesProvider,\n\t\t\t )\n\t\t\t: this.form\n\t\t\t? html`<p>unknown renderer</p>`\n\t\t\t: html`<p>missing form</p>`\n\t}\n\n\tfirstUpdated() {\n\t\t//Do nothing\n\t}\n}\n\n// Register the new element with the browser.\ncustomElements.define('iqr-form', IqrForm)\n"]}
|