@venite/components 0.16.48 → 0.16.49

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.
Files changed (26) hide show
  1. package/dist/cjs/index-01fdec29.js +2 -2
  2. package/dist/cjs/{ion-segment_16.cjs.entry.js → ion-segment_17.cjs.entry.js} +98 -28
  3. package/dist/cjs/ldf.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +1 -0
  6. package/dist/collection/components/editable-metadata-buttons/editable-metadata-buttons.js +2 -2
  7. package/dist/collection/components/liturgical-document/dist/liturgical-document.js +3 -0
  8. package/dist/collection/components/liturgical-document/liturgical-document.js +3 -0
  9. package/dist/collection/components/parallel/dist/option.js +318 -0
  10. package/dist/collection/components/parallel/dist/parallel.js +146 -0
  11. package/dist/collection/components/parallel/parallel.css +8 -0
  12. package/dist/collection/components/parallel/parallel.i18n.en.json +3 -0
  13. package/dist/collection/components/parallel/parallel.js +213 -0
  14. package/dist/collection/i18n/parallel.i18n.en.json +3 -0
  15. package/dist/esm/index-034add74.js +2 -2
  16. package/dist/esm/{ion-segment_16.entry.js → ion-segment_17.entry.js} +99 -30
  17. package/dist/esm/ldf.js +1 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/ldf/i18n/parallel.i18n.en.json +3 -0
  20. package/dist/ldf/ldf.esm.js +1 -1
  21. package/dist/ldf/p-177719a0.entry.js +1 -0
  22. package/dist/types/components/editable-metadata-buttons/editable-metadata-buttons.d.ts +1 -1
  23. package/dist/types/components/parallel/parallel.d.ts +41 -0
  24. package/dist/types/components.d.ts +56 -3
  25. package/package.json +1 -1
  26. package/dist/ldf/p-5c897bef.entry.js +0 -1
@@ -0,0 +1,146 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
+ return new (P || (P = Promise))(function (resolve, reject) {
11
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
15
+ });
16
+ };
17
+ var __generator = (this && this.__generator) || function (thisArg, body) {
18
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
19
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
20
+ function verb(n) { return function (v) { return step([n, v]); }; }
21
+ function step(op) {
22
+ if (f) throw new TypeError("Generator is already executing.");
23
+ while (_) try {
24
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
25
+ if (y = 0, t) op = [op[0] & 2, t.value];
26
+ switch (op[0]) {
27
+ case 0: case 1: t = op; break;
28
+ case 4: _.label++; return { value: op[1], done: false };
29
+ case 5: _.label++; y = op[1]; op = [0]; continue;
30
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
31
+ default:
32
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
34
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
35
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
36
+ if (t[2]) _.ops.pop();
37
+ _.trys.pop(); continue;
38
+ }
39
+ op = body.call(thisArg, _);
40
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
41
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
42
+ }
43
+ };
44
+ exports.__esModule = true;
45
+ exports.ParallelComponent = void 0;
46
+ var core_1 = require("@stencil/core");
47
+ var ldf_1 = require("@venite/ldf");
48
+ var locale_1 = require("../../utils/locale");
49
+ var parallel_i18n_en_json_1 = require("./parallel.i18n.en.json");
50
+ var LOCALE = {
51
+ 'en': parallel_i18n_en_json_1["default"]
52
+ };
53
+ var ParallelComponent = /** @class */ (function () {
54
+ function ParallelComponent() {
55
+ }
56
+ ParallelComponent.prototype.docChanged = function (newDoc) {
57
+ try {
58
+ if (typeof newDoc == 'string') {
59
+ this.obj = new ldf_1.Parallel(JSON.parse(newDoc));
60
+ }
61
+ else {
62
+ this.obj = new ldf_1.Parallel(newDoc);
63
+ }
64
+ }
65
+ catch (e) {
66
+ console.warn(e);
67
+ this.obj = new ldf_1.Parallel();
68
+ }
69
+ };
70
+ // Lifecycle events
71
+ ParallelComponent.prototype.componentWillLoad = function () {
72
+ this.docChanged(this.doc);
73
+ this.loadLocaleStrings();
74
+ this.ldfOptionAskForStoredSelection.emit({ el: this.el });
75
+ };
76
+ /** Asynchronously load localization strings */
77
+ ParallelComponent.prototype.loadLocaleStrings = function () {
78
+ return __awaiter(this, void 0, Promise, function () {
79
+ return __generator(this, function (_a) {
80
+ try {
81
+ this.localeStrings = LOCALE[locale_1.getComponentClosestLanguage(this.el)];
82
+ }
83
+ catch (e) {
84
+ console.warn(e);
85
+ }
86
+ return [2 /*return*/];
87
+ });
88
+ });
89
+ };
90
+ // Render
91
+ ParallelComponent.prototype.render = function () {
92
+ var _this = this;
93
+ var _a;
94
+ return (React.createElement(core_1.Host, { lang: this.obj.language },
95
+ React.createElement("tr", null, (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.value) || []).map(function (obj, ii) { return React.createElement("td", null,
96
+ React.createElement("ldf-liturgical-document", { doc: obj, path: _this.path + "/value/" + ii, base: _this.path + "/value", index: ii, editable: _this.editable, parentType: 'option' })); }))));
97
+ };
98
+ __decorate([
99
+ core_1.Element()
100
+ ], ParallelComponent.prototype, "el");
101
+ __decorate([
102
+ core_1.State()
103
+ ], ParallelComponent.prototype, "obj");
104
+ __decorate([
105
+ core_1.State()
106
+ ], ParallelComponent.prototype, "localeStrings");
107
+ __decorate([
108
+ core_1.State()
109
+ ], ParallelComponent.prototype, "filteredOptions");
110
+ __decorate([
111
+ core_1.Prop()
112
+ ], ParallelComponent.prototype, "doc");
113
+ __decorate([
114
+ core_1.Watch('doc')
115
+ ], ParallelComponent.prototype, "docChanged");
116
+ __decorate([
117
+ core_1.Prop({ reflect: true })
118
+ ], ParallelComponent.prototype, "path");
119
+ __decorate([
120
+ core_1.Prop()
121
+ ], ParallelComponent.prototype, "editable");
122
+ __decorate([
123
+ core_1.Prop()
124
+ ], ParallelComponent.prototype, "preview");
125
+ __decorate([
126
+ core_1.Event({ bubbles: true })
127
+ ], ParallelComponent.prototype, "ldfAddOptionToDoc");
128
+ __decorate([
129
+ core_1.Event({ bubbles: true })
130
+ ], ParallelComponent.prototype, "ldfDocShouldChange");
131
+ __decorate([
132
+ core_1.Event({ bubbles: true })
133
+ ], ParallelComponent.prototype, "ldfOptionAskForStoredSelection");
134
+ __decorate([
135
+ core_1.Event({ bubbles: true })
136
+ ], ParallelComponent.prototype, "ldfOptionMakeSelection");
137
+ ParallelComponent = __decorate([
138
+ core_1.Component({
139
+ tag: 'ldf-parallel',
140
+ styleUrl: 'parallel.scss',
141
+ scoped: true
142
+ })
143
+ ], ParallelComponent);
144
+ return ParallelComponent;
145
+ }());
146
+ exports.ParallelComponent = ParallelComponent;
@@ -0,0 +1,8 @@
1
+ .select-control {
2
+ margin-top: var(--ldf-select-control-margin-top);
3
+ }
4
+
5
+ ion-select {
6
+ width: 75vw;
7
+ max-width: 300px;
8
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "parallel": "Parallel"
3
+ }
@@ -0,0 +1,213 @@
1
+ import { Component, Prop, Watch, State, Host, Event, Element, h } from '@stencil/core';
2
+ import { Parallel } from '@venite/ldf';
3
+ import { getComponentClosestLanguage } from '../../utils/locale';
4
+ import EN from './parallel.i18n.en.json';
5
+ const LOCALE = {
6
+ 'en': EN
7
+ };
8
+ export class ParallelComponent {
9
+ docChanged(newDoc) {
10
+ try {
11
+ if (typeof newDoc == 'string') {
12
+ this.obj = new Parallel(JSON.parse(newDoc));
13
+ }
14
+ else {
15
+ this.obj = new Parallel(newDoc);
16
+ }
17
+ }
18
+ catch (e) {
19
+ console.warn(e);
20
+ this.obj = new Parallel();
21
+ }
22
+ }
23
+ // Lifecycle events
24
+ componentWillLoad() {
25
+ this.docChanged(this.doc);
26
+ this.loadLocaleStrings();
27
+ this.ldfOptionAskForStoredSelection.emit({ el: this.el });
28
+ }
29
+ /** Asynchronously load localization strings */
30
+ async loadLocaleStrings() {
31
+ try {
32
+ this.localeStrings = LOCALE[getComponentClosestLanguage(this.el)];
33
+ }
34
+ catch (e) {
35
+ console.warn(e);
36
+ }
37
+ }
38
+ // Render
39
+ render() {
40
+ var _a;
41
+ return (h(Host, { lang: this.obj.language },
42
+ h("tr", null, (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.value) || []).map((obj, ii) => h("td", null,
43
+ h("ldf-liturgical-document", { doc: obj, path: `${this.path}/value/${ii}`, base: `${this.path}/value`, index: ii, editable: this.editable, parentType: 'option' }))))));
44
+ }
45
+ static get is() { return "ldf-parallel"; }
46
+ static get encapsulation() { return "scoped"; }
47
+ static get originalStyleUrls() { return {
48
+ "$": ["parallel.scss"]
49
+ }; }
50
+ static get styleUrls() { return {
51
+ "$": ["parallel.css"]
52
+ }; }
53
+ static get properties() { return {
54
+ "doc": {
55
+ "type": "string",
56
+ "mutable": false,
57
+ "complexType": {
58
+ "original": "Parallel | string",
59
+ "resolved": "Parallel | string",
60
+ "references": {
61
+ "Parallel": {
62
+ "location": "import",
63
+ "path": "@venite/ldf"
64
+ }
65
+ }
66
+ },
67
+ "required": false,
68
+ "optional": false,
69
+ "docs": {
70
+ "tags": [],
71
+ "text": "An LDF Option object."
72
+ },
73
+ "attribute": "doc",
74
+ "reflect": false
75
+ },
76
+ "path": {
77
+ "type": "string",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "string",
81
+ "resolved": "string",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": false,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": "A JSON Pointer that points to the Option being edited"
89
+ },
90
+ "attribute": "path",
91
+ "reflect": true
92
+ },
93
+ "editable": {
94
+ "type": "boolean",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "boolean",
98
+ "resolved": "boolean",
99
+ "references": {}
100
+ },
101
+ "required": false,
102
+ "optional": false,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": "Whether the object is editable"
106
+ },
107
+ "attribute": "editable",
108
+ "reflect": false
109
+ },
110
+ "preview": {
111
+ "type": "boolean",
112
+ "mutable": false,
113
+ "complexType": {
114
+ "original": "boolean",
115
+ "resolved": "boolean",
116
+ "references": {}
117
+ },
118
+ "required": false,
119
+ "optional": false,
120
+ "docs": {
121
+ "tags": [],
122
+ "text": "Whether the object is in preview mode"
123
+ },
124
+ "attribute": "preview",
125
+ "reflect": false
126
+ }
127
+ }; }
128
+ static get states() { return {
129
+ "obj": {},
130
+ "localeStrings": {},
131
+ "filteredOptions": {}
132
+ }; }
133
+ static get events() { return [{
134
+ "method": "ldfAddOptionToDoc",
135
+ "name": "ldfAddOptionToDoc",
136
+ "bubbles": true,
137
+ "cancelable": true,
138
+ "composed": true,
139
+ "docs": {
140
+ "tags": [],
141
+ "text": ""
142
+ },
143
+ "complexType": {
144
+ "original": "AddOptionToDoc",
145
+ "resolved": "AddOptionToDoc",
146
+ "references": {
147
+ "AddOptionToDoc": {
148
+ "location": "import",
149
+ "path": "../../interfaces/add-option-to-doc"
150
+ }
151
+ }
152
+ }
153
+ }, {
154
+ "method": "ldfDocShouldChange",
155
+ "name": "ldfDocShouldChange",
156
+ "bubbles": true,
157
+ "cancelable": true,
158
+ "composed": true,
159
+ "docs": {
160
+ "tags": [],
161
+ "text": ""
162
+ },
163
+ "complexType": {
164
+ "original": "Change",
165
+ "resolved": "Change",
166
+ "references": {
167
+ "Change": {
168
+ "location": "import",
169
+ "path": "@venite/ldf"
170
+ }
171
+ }
172
+ }
173
+ }, {
174
+ "method": "ldfOptionAskForStoredSelection",
175
+ "name": "ldfOptionAskForStoredSelection",
176
+ "bubbles": true,
177
+ "cancelable": true,
178
+ "composed": true,
179
+ "docs": {
180
+ "tags": [],
181
+ "text": ""
182
+ },
183
+ "complexType": {
184
+ "original": "{ el: HTMLElement }",
185
+ "resolved": "{ el: HTMLElement; }",
186
+ "references": {
187
+ "HTMLElement": {
188
+ "location": "global"
189
+ }
190
+ }
191
+ }
192
+ }, {
193
+ "method": "ldfOptionMakeSelection",
194
+ "name": "ldfOptionMakeSelection",
195
+ "bubbles": true,
196
+ "cancelable": true,
197
+ "composed": true,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": ""
201
+ },
202
+ "complexType": {
203
+ "original": "{ slug: string; index: number; }",
204
+ "resolved": "{ slug: string; index: number; }",
205
+ "references": {}
206
+ }
207
+ }]; }
208
+ static get elementRef() { return "el"; }
209
+ static get watchers() { return [{
210
+ "propName": "doc",
211
+ "methodName": "docChanged"
212
+ }]; }
213
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "parallel": "Parallel"
3
+ }
@@ -2066,10 +2066,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2066
2066
  return import(
2067
2067
  /* webpackMode: "lazy" */
2068
2068
  './ldf-editable-string-list.entry.js').then(processMod, consoleError);
2069
- case 'ion-segment_16':
2069
+ case 'ion-segment_17':
2070
2070
  return import(
2071
2071
  /* webpackMode: "lazy" */
2072
- './ion-segment_16.entry.js').then(processMod, consoleError);
2072
+ './ion-segment_17.entry.js').then(processMod, consoleError);
2073
2073
  case 'ldf-editable-boolean_2':
2074
2074
  return import(
2075
2075
  /* webpackMode: "lazy" */