@simai-studio/view 1.0.0 → 1.1.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/README.md +1 -1
- package/dist/package-receipt.json +97 -96
- package/dist/smart/view/component.json +10 -2
- package/dist/smart/view/component.json.gz +0 -0
- package/dist/smart/view/js/view.js +23 -6
- package/dist/smart/view/js/view.js.gz +0 -0
- package/dist/smart/view/js/view.min.js +1 -1
- package/dist/smart/view/js/view.min.js.gz +0 -0
- package/dist/smart/view/smart.manifest.json +10 -3
- package/dist/smart/view/smart.manifest.json.gz +0 -0
- package/dist/smart/view/static/default/open-record.html +11 -16
- package/dist/smart/view/static/default/open-record.html.gz +0 -0
- package/dist/smart/view/static/default/reference.html +11 -16
- package/dist/smart/view/static/default/reference.html.gz +0 -0
- package/dist/smart/view-properties/component.json +10 -2
- package/dist/smart/view-properties/component.json.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.css +24 -19
- package/dist/smart/view-properties/css/view-properties.css.gz +0 -0
- package/dist/smart/view-properties/css/view-properties.min.css +1 -1
- package/dist/smart/view-properties/css/view-properties.min.css.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.js +306 -171
- package/dist/smart/view-properties/js/view-properties.js.gz +0 -0
- package/dist/smart/view-properties/js/view-properties.min.js +92 -121
- package/dist/smart/view-properties/js/view-properties.min.js.gz +0 -0
- package/dist/smart/view-properties/lang/en.json +0 -7
- package/dist/smart/view-properties/lang/en.json.gz +0 -0
- package/dist/smart/view-properties/lang/ru.json +0 -7
- package/dist/smart/view-properties/lang/ru.json.gz +0 -0
- package/dist/smart/view-properties/smart.manifest.json +12 -9
- package/dist/smart/view-properties/smart.manifest.json.gz +0 -0
- package/dist/smart/view-properties/template/default.css +22 -19
- package/dist/smart/view-properties/template/default.css.gz +0 -0
- package/dist/smart/view-properties/template/default.js +8 -10
- package/dist/smart/view-properties/template/default.js.gz +0 -0
- package/dist/smart/view-table/component.json +10 -2
- package/dist/smart/view-table/component.json.gz +0 -0
- package/dist/smart/view-table/js/view-table.js +375 -88
- package/dist/smart/view-table/js/view-table.js.gz +0 -0
- package/dist/smart/view-table/js/view-table.min.js +56 -56
- package/dist/smart/view-table/js/view-table.min.js.gz +0 -0
- package/dist/smart/view-table/smart.manifest.json +11 -4
- package/dist/smart/view-table/smart.manifest.json.gz +0 -0
- package/dist/smart/view-table/template/default.js +1 -1
- package/dist/smart/view-table/template/default.js.gz +0 -0
- package/package.json +1 -1
|
@@ -69,6 +69,184 @@ function normalizeBadgeContract({
|
|
|
69
69
|
|
|
70
70
|
/***/ },
|
|
71
71
|
|
|
72
|
+
/***/ "e577837dd70a"
|
|
73
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
74
|
+
|
|
75
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
76
|
+
__webpack_require__.r(__webpack_exports__);
|
|
77
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
78
|
+
/* harmony export */ calendarDayOffset: () => (/* binding */ calendarDayOffset),
|
|
79
|
+
/* harmony export */ formatDate: () => (/* binding */ formatDate),
|
|
80
|
+
/* harmony export */ msUntilNextDay: () => (/* binding */ msUntilNextDay),
|
|
81
|
+
/* harmony export */ toDate: () => (/* reexport safe */ _format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)
|
|
82
|
+
/* harmony export */ });
|
|
83
|
+
/* harmony import */ var _format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
84
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
85
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
86
|
+
_format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
87
|
+
// Dates in the page's language: formatDate, the calendar day offset and the
|
|
88
|
+
// next midnight, with no top-level side effects (format-intl.js). The same
|
|
89
|
+
// functions as core/js/format.js and SF.format; relative days and times are
|
|
90
|
+
// format-relative.js, so a bundle that writes a date does not carry them.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
const DAY_MS = 86400000;
|
|
94
|
+
|
|
95
|
+
function hasDateStyle(style) {
|
|
96
|
+
return style === 'short' || style === 'medium' || style === 'long' || style === 'full';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A date, a time or both in the locale.
|
|
100
|
+
*
|
|
101
|
+
* formatDate(at) 3 нояб. 2026 г. / Nov 3, 2026
|
|
102
|
+
* formatDate(at, {date: 'short'}) 03.11.2026 / 11/3/26
|
|
103
|
+
* formatDate(at, {date: 'long'}) 3 ноября 2026 г. / November 3, 2026
|
|
104
|
+
* formatDate(at, {time: 'short'}) 3 нояб. 2026 г., 14:05
|
|
105
|
+
* formatDate(at, {date: null, time: 'short'}) 14:05 / 2:05 PM
|
|
106
|
+
*
|
|
107
|
+
* `date` and `time` are Intl styles (short, medium, long, full); `intl` gives
|
|
108
|
+
* Intl.DateTimeFormat options outright, for a form the styles do not name (a
|
|
109
|
+
* chart's tick, «14:05» with two-digit hours). Anything that is not a date is
|
|
110
|
+
* `gap`, '' by default.
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
function formatDate(value, {
|
|
115
|
+
date = 'medium',
|
|
116
|
+
time = null,
|
|
117
|
+
intl = null,
|
|
118
|
+
gap = '',
|
|
119
|
+
...where
|
|
120
|
+
} = {}) {
|
|
121
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
122
|
+
if (!moment) return gap;
|
|
123
|
+
let options = intl;
|
|
124
|
+
|
|
125
|
+
if (!options) {
|
|
126
|
+
options = {};
|
|
127
|
+
if (hasDateStyle(date)) options.dateStyle = date;
|
|
128
|
+
if (hasDateStyle(time)) options.timeStyle = time;
|
|
129
|
+
if (!options.dateStyle && !options.timeStyle) options.dateStyle = 'medium';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('DateTimeFormat', (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale)(where), options).format(moment);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Calendar days from `now` to the value in the reader's time zone: 0 today,
|
|
136
|
+
* -1 yesterday, 1 tomorrow; NaN when the value is no date. Counted on
|
|
137
|
+
* calendar dates, not 24-hour spans, so 23:59 yesterday is -1 at 00:01 and a
|
|
138
|
+
* day of a clock change is still one day.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
function calendarDayOffset(value, {
|
|
142
|
+
now = new Date()
|
|
143
|
+
} = {}) {
|
|
144
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
145
|
+
const today = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(now);
|
|
146
|
+
if (!moment || !today) return Number.NaN;
|
|
147
|
+
const day = Date.UTC(moment.getFullYear(), moment.getMonth(), moment.getDate());
|
|
148
|
+
const base = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate());
|
|
149
|
+
return Math.round((day - base) / DAY_MS);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Milliseconds from `now` to the reader's next midnight, when every relative
|
|
153
|
+
* day on the screen moves by one. A component that shows them sets a timer
|
|
154
|
+
* for this long (plus a second's margin, so it wakes in the new day) and
|
|
155
|
+
* draws them again; «сегодня» said yesterday is wrong by morning.
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
function msUntilNextDay(now = new Date()) {
|
|
159
|
+
const today = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(now) ?? new Date();
|
|
160
|
+
const next = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
|
|
161
|
+
return next.getTime() - today.getTime();
|
|
162
|
+
}
|
|
163
|
+
__webpack_async_result__();
|
|
164
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
165
|
+
|
|
166
|
+
/***/ },
|
|
167
|
+
|
|
168
|
+
/***/ "15b4e93ff6ed"
|
|
169
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
170
|
+
|
|
171
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
172
|
+
__webpack_require__.r(__webpack_exports__);
|
|
173
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
174
|
+
/* harmony export */ formatLocale: () => (/* binding */ formatLocale),
|
|
175
|
+
/* harmony export */ intlFormatter: () => (/* binding */ intlFormatter),
|
|
176
|
+
/* harmony export */ toDate: () => (/* binding */ toDate)
|
|
177
|
+
/* harmony export */ });
|
|
178
|
+
/* harmony import */ var _page_language_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("43090d1c8307");
|
|
179
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_page_language_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
180
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
181
|
+
_page_language_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
182
|
+
/* harmony import */ var _page_language_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_page_language_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
183
|
+
// The part every format module shares (core/js/format.js says what the
|
|
184
|
+
// helpers are): the locale a call formats in, a Date from what a host gives,
|
|
185
|
+
// and the Intl formatters, kept on a global every copy of these modules shares
|
|
186
|
+
// (bundles each carry their own module copy; page-language.js says why).
|
|
187
|
+
//
|
|
188
|
+
// No top-level side effects, here or in format-number.js, format-date.js,
|
|
189
|
+
// format-relative.js and format-file-size.js (ui-chart, 2026-11-05): a bundle
|
|
190
|
+
// that imports one function carries that function and what it calls, nothing
|
|
191
|
+
// else. The global is made on the first format, not on load, and SF.format is
|
|
192
|
+
// published by core's entry (index.js, publishFormat in format.js).
|
|
193
|
+
|
|
194
|
+
/** The locale a call formats in: the one it names, else its node's page language. */
|
|
195
|
+
|
|
196
|
+
function formatLocale({
|
|
197
|
+
locale,
|
|
198
|
+
node
|
|
199
|
+
} = {}) {
|
|
200
|
+
return String(locale || '').trim() || (0,_page_language_js__WEBPACK_IMPORTED_MODULE_0__.pageLocale)(node);
|
|
201
|
+
}
|
|
202
|
+
/** A Date from a Date, a time in milliseconds or a date string; null when it is none. */
|
|
203
|
+
|
|
204
|
+
function toDate(value) {
|
|
205
|
+
if (value === null || value === undefined || value === '') return null;
|
|
206
|
+
const date = value instanceof Date ? new Date(value.getTime()) : new Date(typeof value === 'string' && /^\d+$/u.test(value) ? Number(value) : value);
|
|
207
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
208
|
+
} // The formatters every copy shares, made on the first call.
|
|
209
|
+
|
|
210
|
+
function formatterCache() {
|
|
211
|
+
const root = typeof globalThis !== 'undefined' ? globalThis : {};
|
|
212
|
+
if (!root.__sfFormat) root.__sfFormat = {
|
|
213
|
+
formatters: new Map()
|
|
214
|
+
};
|
|
215
|
+
return root.__sfFormat.formatters;
|
|
216
|
+
} // One formatter per kind, locale and options. An unknown locale falls back to
|
|
217
|
+
// the browser's, and options the platform refuses (an unknown unit or
|
|
218
|
+
// currency) to a plain number, so a typo in a page never throws at a reader.
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
function intlFormatter(kind, locale, options) {
|
|
222
|
+
const key = `${kind}|${locale}|${JSON.stringify(options)}`;
|
|
223
|
+
const cache = formatterCache();
|
|
224
|
+
if (cache.has(key)) return cache.get(key);
|
|
225
|
+
const Make = Intl[kind];
|
|
226
|
+
let made;
|
|
227
|
+
|
|
228
|
+
try {
|
|
229
|
+
made = new Make(locale || undefined, options);
|
|
230
|
+
} catch {
|
|
231
|
+
try {
|
|
232
|
+
made = new Make(undefined, options);
|
|
233
|
+
} catch {
|
|
234
|
+
made = new Make(locale || undefined, kind === 'NumberFormat' ? {
|
|
235
|
+
maximumFractionDigits: 2
|
|
236
|
+
} : {});
|
|
237
|
+
}
|
|
238
|
+
} // A page that formats in many locales does not grow the cache for ever.
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
if (cache.size >= 256) cache.delete(cache.keys().next().value);
|
|
242
|
+
cache.set(key, made);
|
|
243
|
+
return made;
|
|
244
|
+
}
|
|
245
|
+
__webpack_async_result__();
|
|
246
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
247
|
+
|
|
248
|
+
/***/ },
|
|
249
|
+
|
|
72
250
|
/***/ "1b42c5117087"
|
|
73
251
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
74
252
|
|
|
@@ -3191,10 +3369,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3191
3369
|
/* harmony import */ var _core_js_page_language__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("43090d1c8307");
|
|
3192
3370
|
/* harmony import */ var _core_js_layer_stack__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("18003344cff0");
|
|
3193
3371
|
/* harmony import */ var _js_templates_default__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("40b137e60526");
|
|
3194
|
-
/* harmony import */ var
|
|
3195
|
-
/* harmony import */ var
|
|
3196
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_8__, _core_js_layer_stack__WEBPACK_IMPORTED_MODULE_9__, _js_templates_default__WEBPACK_IMPORTED_MODULE_10__]);
|
|
3197
|
-
([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_8__, _core_js_layer_stack__WEBPACK_IMPORTED_MODULE_9__, _js_templates_default__WEBPACK_IMPORTED_MODULE_10__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
3372
|
+
/* harmony import */ var _js_conditions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("844bdc4d24eb");
|
|
3373
|
+
/* harmony import */ var _view_table_js_format_value_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("2f31b00ad99a");
|
|
3374
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_8__, _core_js_layer_stack__WEBPACK_IMPORTED_MODULE_9__, _js_templates_default__WEBPACK_IMPORTED_MODULE_10__, _view_table_js_format_value_js__WEBPACK_IMPORTED_MODULE_12__]);
|
|
3375
|
+
([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_8__, _core_js_layer_stack__WEBPACK_IMPORTED_MODULE_9__, _js_templates_default__WEBPACK_IMPORTED_MODULE_10__, _view_table_js_format_value_js__WEBPACK_IMPORTED_MODULE_12__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
3198
3376
|
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__);
|
|
3199
3377
|
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__);
|
|
3200
3378
|
/* harmony import */ var _core_js_page_language__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_core_js_page_language__WEBPACK_IMPORTED_MODULE_8__);
|
|
@@ -3715,13 +3893,10 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
3715
3893
|
|
|
3716
3894
|
this.editing = null;
|
|
3717
3895
|
this.changed = new Map();
|
|
3718
|
-
this.errors = new Map(); // What
|
|
3719
|
-
//
|
|
3720
|
-
//
|
|
3721
|
-
// The view's own, so a host's refusal does not replace them; a save
|
|
3722
|
-
// waits until they are put right.
|
|
3896
|
+
this.errors = new Map(); // What is wrong with an entry a field control reports it cannot write
|
|
3897
|
+
// yet (inputErrors). The view's own, so a host's refusal does not
|
|
3898
|
+
// replace them; a save waits until they are put right.
|
|
3723
3899
|
|
|
3724
|
-
this.inputDrafts = new Map();
|
|
3725
3900
|
this.inputErrors = new Map(); // The keys of inputErrors a field control reported itself (port 1.16.0:
|
|
3726
3901
|
// a masked string that does not fill its mask, through the renderer
|
|
3727
3902
|
// set's setFieldError). The control draws that message under itself, so
|
|
@@ -4894,7 +5069,7 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
4894
5069
|
return (Array.isArray(entries) ? entries : []).filter(entry => entry && entry.hidden !== true).filter(entry => this.showRare || entry.rare !== true) // A field its condition hides is not drawn (port 1.14.0). Not while
|
|
4895
5070
|
// the view is arranged -- the template lists every entry then -- and
|
|
4896
5071
|
// not by the view: `hidden` is the arrangement's, `when` the values'.
|
|
4897
|
-
.filter(entry => !values || !entry.when || (0,
|
|
5072
|
+
.filter(entry => !values || !entry.when || (0,_js_conditions_js__WEBPACK_IMPORTED_MODULE_11__.fieldConditions)(entry, values).visible);
|
|
4898
5073
|
} // Every field's value as it stands on screen: what the record holds, or what
|
|
4899
5074
|
// the person changed it to and has not saved. The conditions read these, so
|
|
4900
5075
|
// a field appears the moment the value it waits for is chosen, before any
|
|
@@ -4924,7 +5099,7 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
4924
5099
|
|
|
4925
5100
|
conditionedField(field, values = this.fieldValues()) {
|
|
4926
5101
|
if (!field?.when) return field;
|
|
4927
|
-
const decided = (0,
|
|
5102
|
+
const decided = (0,_js_conditions_js__WEBPACK_IMPORTED_MODULE_11__.fieldConditions)(field, values);
|
|
4928
5103
|
return { ...field,
|
|
4929
5104
|
required: decided.required,
|
|
4930
5105
|
readonly: field.readonly === true || !decided.enabled
|
|
@@ -4937,7 +5112,7 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
4937
5112
|
const hidden = new Set();
|
|
4938
5113
|
|
|
4939
5114
|
const check = field => {
|
|
4940
|
-
if (field?.when && !(0,
|
|
5115
|
+
if (field?.when && !(0,_js_conditions_js__WEBPACK_IMPORTED_MODULE_11__.fieldConditions)(field, values).visible) hidden.add(String(field.key));
|
|
4941
5116
|
};
|
|
4942
5117
|
|
|
4943
5118
|
for (const section of this.sections ?? []) {
|
|
@@ -4958,6 +5133,31 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
4958
5133
|
const hidden = this._hiddenByCondition();
|
|
4959
5134
|
|
|
4960
5135
|
return Object.fromEntries([...this.changed].filter(([key]) => !hidden.has(key)));
|
|
5136
|
+
} // The host as the renderer set reads a field shown: its formatFieldValue
|
|
5137
|
+
// first, and for a date it did not format, the date in the page's language
|
|
5138
|
+
// (format-date), as sf-view-table's cells read it. A date stood in the card
|
|
5139
|
+
// as stored -- «2026-11-02» -- unless the host formatted it (2026-11-05).
|
|
5140
|
+
|
|
5141
|
+
|
|
5142
|
+
get viewHost() {
|
|
5143
|
+
const host = this.hostPort ?? null;
|
|
5144
|
+
if (this._viewHost?.host === host) return this._viewHost.view; // Everything else the host offers the renderer set (its words, say) is
|
|
5145
|
+
// reached through it unchanged.
|
|
5146
|
+
|
|
5147
|
+
const view = Object.create(host && typeof host === "object" ? host : null);
|
|
5148
|
+
Object.assign(view, {
|
|
5149
|
+
formatFieldValue: (field, value) => {
|
|
5150
|
+
const own = host?.formatFieldValue?.(field, value);
|
|
5151
|
+
if (typeof own === "string") return own;
|
|
5152
|
+
const type = field?.propertyType ?? field?.property_type ?? field?.type ?? field?.dataType;
|
|
5153
|
+
return (0,_view_table_js_format_value_js__WEBPACK_IMPORTED_MODULE_12__.formatDateValue)(type, value, this) || undefined;
|
|
5154
|
+
}
|
|
5155
|
+
});
|
|
5156
|
+
this._viewHost = {
|
|
5157
|
+
host,
|
|
5158
|
+
view
|
|
5159
|
+
};
|
|
5160
|
+
return view;
|
|
4961
5161
|
}
|
|
4962
5162
|
|
|
4963
5163
|
templateContext() {
|
|
@@ -4965,6 +5165,7 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
4965
5165
|
return this.createTemplateContext({ ...props,
|
|
4966
5166
|
component: this,
|
|
4967
5167
|
hostPort: this.hostPort,
|
|
5168
|
+
viewHost: this.viewHost,
|
|
4968
5169
|
size: this.size,
|
|
4969
5170
|
mode: this.mode,
|
|
4970
5171
|
mayEdit: this.mayEdit,
|
|
@@ -5001,11 +5202,6 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
5001
5202
|
// is wrong beside it and each message under its field.
|
|
5002
5203
|
inputsInvalid: this.inputErrors.size > 0,
|
|
5003
5204
|
controlErrors: this.controlErrors,
|
|
5004
|
-
dateTimeText: {
|
|
5005
|
-
dateLabel: (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_8__.pageText)(PROPERTY_VIEW_TEXT, "dateTimeDateLabel", this),
|
|
5006
|
-
timeLabel: (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_8__.pageText)(PROPERTY_VIEW_TEXT, "dateTimeTimeLabel", this),
|
|
5007
|
-
placeholder: (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_8__.pageText)(PROPERTY_VIEW_TEXT, "timePlaceholderText", this)
|
|
5008
|
-
},
|
|
5009
5205
|
canPickRecords: this.canPickRecords,
|
|
5010
5206
|
canUploadFiles: this.canUploadFiles,
|
|
5011
5207
|
// The base captures the host's slot content in connectedCallback,
|
|
@@ -5586,9 +5782,9 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
5586
5782
|
reason: "prevented"
|
|
5587
5783
|
};
|
|
5588
5784
|
} // What would be lost by closing: every changed field, and every entry that
|
|
5589
|
-
// is not a value yet -- a
|
|
5590
|
-
//
|
|
5591
|
-
//
|
|
5785
|
+
// is not a value yet -- a masked text not filled in is work the person did,
|
|
5786
|
+
// though there is nothing to save (Larena acceptance, 2026-10-22: Esc after
|
|
5787
|
+
// an entry closed without asking).
|
|
5592
5788
|
|
|
5593
5789
|
|
|
5594
5790
|
get unsavedFields() {
|
|
@@ -5808,62 +6004,28 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
5808
6004
|
|
|
5809
6005
|
|
|
5810
6006
|
changeField(field, value) {
|
|
5811
|
-
const key = String(field.key ?? "");
|
|
5812
|
-
|
|
6007
|
+
const key = String(field.key ?? ""); // Back to what the record holds is no change. A control is drawn with
|
|
6008
|
+
// the change it made, so it compares a later entry with that and not
|
|
6009
|
+
// with the record: a time put back to the stored one was written.
|
|
6010
|
+
|
|
6011
|
+
const stored = Object.hasOwn(field ?? {}, "value") && value !== undefined && JSON.stringify(value) === JSON.stringify(field.value ?? null);
|
|
6012
|
+
if (value === undefined || stored) this.changed.delete(key);else this.changed.set(key, value);
|
|
5813
6013
|
this.errors.delete(key); // A confirmation described the save as it stood; an entry changed after
|
|
5814
6014
|
// it is a different save, and the question goes until save is pressed again.
|
|
5815
6015
|
|
|
5816
6016
|
this.confirmation = null;
|
|
5817
6017
|
this.requestComponentUpdate("changed");
|
|
5818
6018
|
return this;
|
|
5819
|
-
} // A datetime's day or time, as the person entered it (js/datetime-edit.js).
|
|
5820
|
-
// The two make one value; until they do, the entry is held as a draft and
|
|
5821
|
-
// what is missing is said under the field, as a host's error would be.
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
dateTimeDraft(key) {
|
|
5825
|
-
return this.inputDrafts.get(String(key)) ?? null;
|
|
5826
|
-
}
|
|
5827
|
-
|
|
5828
|
-
changeDateTime(field, value, part, text) {
|
|
5829
|
-
const key = String(field.key ?? ""); // What the record holds, and what the controls show now: the draft,
|
|
5830
|
-
// or the value the field is drawn with (a change not yet saved).
|
|
5831
|
-
|
|
5832
|
-
const original = (0,_field_renderers_datetime_js__WEBPACK_IMPORTED_MODULE_11__.splitDateTime)(field.value);
|
|
5833
|
-
const current = this.inputDrafts.get(key) ?? (0,_field_renderers_datetime_js__WEBPACK_IMPORTED_MODULE_11__.splitDateTime)(value); // A time that reads as one is kept as hh:mm, so «0930» typed without
|
|
5834
|
-
// the mask shows as 09:30; anything else stays as typed, to be put right.
|
|
5835
|
-
|
|
5836
|
-
const typed = String(text ?? "");
|
|
5837
|
-
const draft = { ...current,
|
|
5838
|
-
[part]: part === "time" ? (0,_field_renderers_datetime_js__WEBPACK_IMPORTED_MODULE_11__.normalizeTime)(typed) ?? typed : typed
|
|
5839
|
-
};
|
|
5840
|
-
this.inputDrafts.set(key, draft);
|
|
5841
|
-
const result = (0,_field_renderers_datetime_js__WEBPACK_IMPORTED_MODULE_11__.composeDateTime)(original, draft);
|
|
5842
|
-
|
|
5843
|
-
if (result.error) {
|
|
5844
|
-
this.changed.delete(key);
|
|
5845
|
-
this.errors.delete(key);
|
|
5846
|
-
this.inputErrors.set(key, (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_8__.pageText)(PROPERTY_VIEW_TEXT, `${result.error}Text`, this));
|
|
5847
|
-
this.requestComponentUpdate("errors");
|
|
5848
|
-
return this;
|
|
5849
|
-
}
|
|
5850
|
-
|
|
5851
|
-
this.inputErrors.delete(key); // Back to what the record holds is no change: nothing is written.
|
|
5852
|
-
|
|
5853
|
-
const same = result.value === null ? original.known && !original.date : result.value === original.raw;
|
|
5854
|
-
return this.changeField(field, same ? undefined : result.value);
|
|
5855
6019
|
}
|
|
5856
6020
|
|
|
5857
6021
|
_clearInputs() {
|
|
5858
|
-
this.inputDrafts.clear();
|
|
5859
6022
|
this.inputErrors.clear();
|
|
5860
6023
|
this.controlErrors.clear();
|
|
5861
6024
|
} // A field control that knows its entry is not a value yet (port 1.16.0,
|
|
5862
6025
|
// consumer simai.main): a masked string that does not fill its mask. The
|
|
5863
6026
|
// renderer set tells the host through setFieldError(field, message) on
|
|
5864
6027
|
// every keystroke, and null once the text is complete or cleared. Such an
|
|
5865
|
-
// entry is held
|
|
5866
|
-
// inputErrors, so the same rule stops both saves -- group.save and
|
|
6028
|
+
// entry is held in inputErrors, so the same rule stops both saves -- group.save and
|
|
5867
6029
|
// record.save («Изменить всё») -- and Save is drawn disabled while any field
|
|
5868
6030
|
// of the surface is incomplete. Each field is its own key, so one masked
|
|
5869
6031
|
// field completed does not release another still incomplete. What was typed
|
|
@@ -5892,7 +6054,7 @@ class SfPropertyView extends PropertyViewElement {
|
|
|
5892
6054
|
|
|
5893
6055
|
|
|
5894
6056
|
fieldDisabled(field, values = this.fieldValues()) {
|
|
5895
|
-
return Boolean(field?.when) && !(0,
|
|
6057
|
+
return Boolean(field?.when) && !(0,_js_conditions_js__WEBPACK_IMPORTED_MODULE_11__.fieldConditions)(field, values).enabled;
|
|
5896
6058
|
} // An entry that is not a value yet stops a save, and says so where it is.
|
|
5897
6059
|
|
|
5898
6060
|
|
|
@@ -7419,100 +7581,6 @@ function fieldConditions(field, values) {
|
|
|
7419
7581
|
|
|
7420
7582
|
/***/ },
|
|
7421
7583
|
|
|
7422
|
-
/***/ "d577a2a824ab"
|
|
7423
|
-
(module, __webpack_exports__, __webpack_require__) {
|
|
7424
|
-
|
|
7425
|
-
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
7426
|
-
__webpack_require__.r(__webpack_exports__);
|
|
7427
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7428
|
-
/* harmony export */ renderDateTimeEdit: () => (/* binding */ renderDateTimeEdit)
|
|
7429
|
-
/* harmony export */ });
|
|
7430
|
-
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a080a730149");
|
|
7431
|
-
/* harmony import */ var _field_renderers_datetime_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9ce1a42b2a85");
|
|
7432
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit__WEBPACK_IMPORTED_MODULE_0__]);
|
|
7433
|
-
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
7434
|
-
lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
7435
|
-
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lit__WEBPACK_IMPORTED_MODULE_0__);
|
|
7436
|
-
|
|
7437
|
-
// A datetime field edited as what it is: a day and a time of day (Larena
|
|
7438
|
-
// acceptance, 2026-10-22: «Дата и время» kept only the day, so a new record
|
|
7439
|
-
// could not get a time and «15.11.2026 10:30» was saved as «15.11.2026»).
|
|
7440
|
-
//
|
|
7441
|
-
// The shared renderer set edits a datetime with sf-input-date alone, which has
|
|
7442
|
-
// no clock, and puts the record's old time back on the way out. This view
|
|
7443
|
-
// draws the pair itself: the Framework's sf-input-date for the day and the
|
|
7444
|
-
// Framework's sf-input, masked to hh:mm, for the time -- sf-input has no
|
|
7445
|
-
// input-type="time" (its types are text, email, password, search, tel, url),
|
|
7446
|
-
// and a raw <input type="time"> would be the one unstyled control in the panel.
|
|
7447
|
-
// Both are drawn at the view's size, on one row, each named for assistive
|
|
7448
|
-
// technology («Начало: дата», «Начало: время»).
|
|
7449
|
-
//
|
|
7450
|
-
// The value is the host's text, in the site's time zone, as it reads it. The
|
|
7451
|
-
// round trip is lossless: an untouched field is not written at all, and a
|
|
7452
|
-
// field whose day and time come back to what they were writes back exactly
|
|
7453
|
-
// the text it read. A changed day keeps the record's clock (seconds, fraction)
|
|
7454
|
-
// and zone; a changed time is hh:mm:00 with the record's zone; a new value has
|
|
7455
|
-
// no zone and is the site's time, which is how the host sends and reads it.
|
|
7456
|
-
// The pair. `draft` is what the person has entered so far, kept by the view so
|
|
7457
|
-
// a half-typed time survives a render; without one the stored value shows.
|
|
7458
|
-
|
|
7459
|
-
function renderDateTimeEdit(context, field, value) {
|
|
7460
|
-
const key = String(field.key ?? '');
|
|
7461
|
-
const stored = (0,_field_renderers_datetime_js__WEBPACK_IMPORTED_MODULE_1__.splitDateTime)(value);
|
|
7462
|
-
const draft = context.component.dateTimeDraft(key) ?? stored;
|
|
7463
|
-
const label = String(field.label || field.key || '');
|
|
7464
|
-
const words = context.dateTimeText;
|
|
7465
|
-
const size = context.size === '1/2' ? '1/2' : '1';
|
|
7466
|
-
const name = `sf_field_${field.key || 'value'}`;
|
|
7467
|
-
const invalid = context.errors.has(key);
|
|
7468
|
-
|
|
7469
|
-
const change = (part, text) => context.component.changeDateTime(field, value, part, text); // The day is bound as a property, not as the value attribute: sf-input-date
|
|
7470
|
-
// reads a value attribute back after the person empties the field, so an
|
|
7471
|
-
// attribute-bound day could not be cleared (its date getter falls back to
|
|
7472
|
-
// the attribute once its own state is empty).
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
7476
|
-
<div class="sf-property-view-datetime" role="group" aria-label=${label} data-datetime=${key}>
|
|
7477
|
-
<sf-input-date
|
|
7478
|
-
class="sf-property-view-datetime-date"
|
|
7479
|
-
size=${size}
|
|
7480
|
-
name=${`${name}_date`}
|
|
7481
|
-
.value=${draft.date}
|
|
7482
|
-
aria-label=${words.dateLabel.replace('{label}', label)}
|
|
7483
|
-
?required=${Boolean(field.required)}
|
|
7484
|
-
@change=${event => {
|
|
7485
|
-
// The datepicker's own change, not a bubbling native one
|
|
7486
|
-
// from its text field: only the first carries the ISO day.
|
|
7487
|
-
if (event.target !== event.currentTarget) return;
|
|
7488
|
-
change('date', event.detail?.value ?? event.currentTarget?.value ?? '');
|
|
7489
|
-
}}
|
|
7490
|
-
></sf-input-date>
|
|
7491
|
-
<sf-input
|
|
7492
|
-
class="sf-property-view-datetime-time"
|
|
7493
|
-
size=${size}
|
|
7494
|
-
appearance="bordered"
|
|
7495
|
-
root-class="sf-property-view-datetime-time-field"
|
|
7496
|
-
name=${`${name}_time`}
|
|
7497
|
-
value=${draft.time}
|
|
7498
|
-
inputmode="numeric"
|
|
7499
|
-
autocomplete="off"
|
|
7500
|
-
placeholder=${words.placeholder}
|
|
7501
|
-
mask
|
|
7502
|
-
mask-pattern="00:00"
|
|
7503
|
-
?invalid=${invalid}
|
|
7504
|
-
?required=${Boolean(field.required)}
|
|
7505
|
-
aria-label=${words.timeLabel.replace('{label}', label)}
|
|
7506
|
-
@change=${event => change('time', event.currentTarget?.value ?? '')}
|
|
7507
|
-
></sf-input>
|
|
7508
|
-
</div>
|
|
7509
|
-
`;
|
|
7510
|
-
}
|
|
7511
|
-
__webpack_async_result__();
|
|
7512
|
-
} catch(e) { __webpack_async_result__(e); } });
|
|
7513
|
-
|
|
7514
|
-
/***/ },
|
|
7515
|
-
|
|
7516
7584
|
/***/ "40b137e60526"
|
|
7517
7585
|
(module, __webpack_exports__, __webpack_require__) {
|
|
7518
7586
|
|
|
@@ -7524,13 +7592,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7524
7592
|
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a080a730149");
|
|
7525
7593
|
/* harmony import */ var _default_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9e9dad7bcc09");
|
|
7526
7594
|
/* harmony import */ var _field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("e5483002f3ea");
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
([lit__WEBPACK_IMPORTED_MODULE_0__, _field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__, _datetime_edit_js__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
7595
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit__WEBPACK_IMPORTED_MODULE_0__, _field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__]);
|
|
7596
|
+
([lit__WEBPACK_IMPORTED_MODULE_0__, _field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
7530
7597
|
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lit__WEBPACK_IMPORTED_MODULE_0__);
|
|
7531
7598
|
|
|
7532
7599
|
|
|
7533
|
-
|
|
7534
7600
|
// The arrangement, drawn in the component's own light DOM. Not in a shadow root:
|
|
7535
7601
|
// the field controls are Smart elements whose stylesheets are document-level, and
|
|
7536
7602
|
// a document stylesheet does not cross a shadow boundary. sf-view slots its
|
|
@@ -7559,19 +7625,20 @@ function renderFieldValue(context, field, editing, {
|
|
|
7559
7625
|
setFieldOptionSearch: (target, text) => context.component.setFieldOptionSearch(target, text),
|
|
7560
7626
|
loadFieldOptions: (target, request) => context.component.loadFieldOptions(target, request)
|
|
7561
7627
|
} : {})
|
|
7562
|
-
}; // A datetime
|
|
7563
|
-
//
|
|
7564
|
-
//
|
|
7628
|
+
}; // A datetime and a time of day are the renderer set's: sf-input-date in
|
|
7629
|
+
// mode datetime and time, one control each (SIMAI Framework duplication
|
|
7630
|
+
// audit A-14). This view drew its own pair -- the day in a datepicker and
|
|
7631
|
+
// the time in a masked field -- which cut the day short in a half-width
|
|
7632
|
+
// field and held half-typed entries of its own.
|
|
7565
7633
|
|
|
7566
|
-
const
|
|
7567
|
-
const content = editing && type === 'datetime' && field.readonly !== true ? (0,_datetime_edit_js__WEBPACK_IMPORTED_MODULE_3__.renderDateTimeEdit)(context, field, context.changed.has(key) ? context.changed.get(key) : field.value) : editing ? (0,_field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__.renderEditField)(field, context.changed.has(key) ? context.changed.get(key) : field.value, editHost, // A field its condition turns off is drawn disabled where the set
|
|
7634
|
+
const content = editing ? (0,_field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__.renderEditField)(field, context.changed.has(key) ? context.changed.get(key) : field.value, editHost, // A field its condition turns off is drawn disabled where the set
|
|
7568
7635
|
// draws disabled apart from read-only (a choice as buttons).
|
|
7569
7636
|
{
|
|
7570
7637
|
size: context.size,
|
|
7571
7638
|
...(disabled ? {
|
|
7572
7639
|
disabled: true
|
|
7573
7640
|
} : {})
|
|
7574
|
-
}) : (0,_field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__.renderViewField)(field, field.value, context.
|
|
7641
|
+
}) : (0,_field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__.renderViewField)(field, field.value, context.viewHost, {
|
|
7575
7642
|
size: context.size
|
|
7576
7643
|
});
|
|
7577
7644
|
const reference = ['record', 'relation', 'user'].includes(field.propertyType || field.type) && field.value && typeof field.value === 'object';
|
|
@@ -7598,7 +7665,7 @@ function renderFieldValue(context, field, editing, {
|
|
|
7598
7665
|
|
|
7599
7666
|
|
|
7600
7667
|
if (editing && (content === null || typeof content === 'undefined' || content === lit__WEBPACK_IMPORTED_MODULE_0__.nothing)) {
|
|
7601
|
-
const shown = (0,_field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__.renderViewField)(field, field.value, context.
|
|
7668
|
+
const shown = (0,_field_renderers_index_js__WEBPACK_IMPORTED_MODULE_2__.renderViewField)(field, field.value, context.viewHost, {
|
|
7602
7669
|
size: context.size
|
|
7603
7670
|
});
|
|
7604
7671
|
|
|
@@ -9111,6 +9178,74 @@ __webpack_async_result__();
|
|
|
9111
9178
|
|
|
9112
9179
|
/***/ },
|
|
9113
9180
|
|
|
9181
|
+
/***/ "2f31b00ad99a"
|
|
9182
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
9183
|
+
|
|
9184
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
9185
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9186
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9187
|
+
/* harmony export */ DATE_TYPES: () => (/* binding */ DATE_TYPES),
|
|
9188
|
+
/* harmony export */ formatDateValue: () => (/* binding */ formatDateValue)
|
|
9189
|
+
/* harmony export */ });
|
|
9190
|
+
/* harmony import */ var _core_js_format_date_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("e577837dd70a");
|
|
9191
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_format_date_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
9192
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
9193
|
+
_core_js_format_date_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
9194
|
+
// A date, a date and time or a time of day in the page's language, through
|
|
9195
|
+
// the SIMAI Framework's format-date module, for a value the host did not
|
|
9196
|
+
// format (formatFieldValue). The host's own text still wins; without one, a
|
|
9197
|
+
// date read «2026-11-02» where a person expects «2 нояб. 2026 г.».
|
|
9198
|
+
//
|
|
9199
|
+
// The forms are read as a host stores them: a day «YYYY-MM-DD» is that day on
|
|
9200
|
+
// the reader's calendar (not UTC midnight, which is the day before west of
|
|
9201
|
+
// Greenwich); a date and time with a zone is that moment in the reader's zone
|
|
9202
|
+
// and one without a zone is the wall clock as written; a time «hh:mm[:ss]» is
|
|
9203
|
+
// a time of day. Anything else is left for the caller to print as it came.
|
|
9204
|
+
|
|
9205
|
+
const DAY = /^(\d{4})-(\d{2})-(\d{2})$/u;
|
|
9206
|
+
const TIME = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/u;
|
|
9207
|
+
const DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?$/u;
|
|
9208
|
+
const DATE_TYPES = new Set(['date', 'datetime', 'time']);
|
|
9209
|
+
|
|
9210
|
+
function readMoment(type, text) {
|
|
9211
|
+
const day = DAY.exec(text);
|
|
9212
|
+
if (day) return new Date(Number(day[1]), Number(day[2]) - 1, Number(day[3]));
|
|
9213
|
+
const time = TIME.exec(text);
|
|
9214
|
+
if (time) return type === 'time' ? new Date(2000, 0, 1, Number(time[1]), Number(time[2]), Number(time[3] ?? 0)) : null;
|
|
9215
|
+
const stamp = DATE_TIME.exec(text);
|
|
9216
|
+
if (!stamp) return null;
|
|
9217
|
+
|
|
9218
|
+
if (stamp[7]) {
|
|
9219
|
+
const moment = new Date(text.replace(' ', 'T'));
|
|
9220
|
+
return Number.isNaN(moment.getTime()) ? null : moment;
|
|
9221
|
+
}
|
|
9222
|
+
|
|
9223
|
+
return new Date(Number(stamp[1]), Number(stamp[2]) - 1, Number(stamp[3]), Number(stamp[4]), Number(stamp[5]), Number(stamp[6] ?? 0));
|
|
9224
|
+
} // The text for a value of a date type, or '' when it is not one this reads.
|
|
9225
|
+
|
|
9226
|
+
|
|
9227
|
+
function formatDateValue(type, value, node) {
|
|
9228
|
+
if (!DATE_TYPES.has(type) || typeof value !== 'string' || !value.trim()) return '';
|
|
9229
|
+
const text = value.trim();
|
|
9230
|
+
const moment = readMoment(type, text);
|
|
9231
|
+
if (!moment) return '';
|
|
9232
|
+
const hasTime = type !== 'date' && !DAY.test(text);
|
|
9233
|
+
if (type === 'time') return (0,_core_js_format_date_js__WEBPACK_IMPORTED_MODULE_0__.formatDate)(moment, {
|
|
9234
|
+
date: null,
|
|
9235
|
+
time: 'short',
|
|
9236
|
+
node
|
|
9237
|
+
});
|
|
9238
|
+
return (0,_core_js_format_date_js__WEBPACK_IMPORTED_MODULE_0__.formatDate)(moment, {
|
|
9239
|
+
date: 'medium',
|
|
9240
|
+
time: hasTime ? 'short' : null,
|
|
9241
|
+
node
|
|
9242
|
+
});
|
|
9243
|
+
}
|
|
9244
|
+
__webpack_async_result__();
|
|
9245
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
9246
|
+
|
|
9247
|
+
/***/ },
|
|
9248
|
+
|
|
9114
9249
|
/***/ "17828be41e75"
|
|
9115
9250
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9116
9251
|
|
|
@@ -10223,21 +10358,21 @@ module.exports = /*#__PURE__*/JSON.parse('{"$comment":"Dated aliases of sf-view-
|
|
|
10223
10358
|
/***/ "3ea81f4c3c20"
|
|
10224
10359
|
(module) {
|
|
10225
10360
|
|
|
10226
|
-
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.
|
|
10361
|
+
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.view-properties","tag":"sf-view-properties","version":"1.10.0","kind":"leaf","implements":["record-view@1"],"settings":{"add-field-text":{"type":"string","default-from":"runtime.add-field-text"},"add-group-text":{"type":"string","default-from":"runtime.add-group-text"},"add-section-text":{"type":"string","default-from":"runtime.add-section-text"},"back-label":{"type":"string","default-from":"runtime.back-label"},"cancel-configuring-text":{"type":"string","default-from":"runtime.cancel-configuring-text"},"cancel-name-text":{"type":"string","default-from":"runtime.cancel-name-text"},"cancel-text":{"type":"string","default-from":"runtime.cancel-text"},"changed-text":{"type":"string","default-from":"runtime.changed-text"},"close-label":{"type":"string","default-from":"runtime.close-label"},"collection":{"type":"string","default":""},"collection-icon":{"type":"icon","default":""},"collection-label":{"type":"string","default":""},"configure-hint-narrow-text":{"type":"string","default-from":"runtime.configure-hint-narrow-text"},"configure-hint-text":{"type":"string","default-from":"runtime.configure-hint-text"},"configure-text":{"type":"string","default-from":"runtime.configure-text"},"conflict-text":{"type":"string","default-from":"runtime.conflict-text"},"copy-link-label":{"type":"string","default-from":"runtime.copy-link-label"},"delete-text":{"type":"string","default-from":"runtime.delete-text"},"done-configuring-text":{"type":"string","default-from":"runtime.done-configuring-text"},"edit-text":{"type":"string","default-from":"runtime.edit-text"},"empty-record-text":{"type":"string","default-from":"runtime.empty-record-text"},"empty-text":{"type":"string","default-from":"runtime.empty-text"},"errors-text":{"type":"string","default-from":"runtime.errors-text"},"favourite":{"type":"boolean","default":false},"favourite-label":{"type":"string","default-from":"runtime.favourite-label"},"field-label-text":{"type":"string","default-from":"runtime.field-label-text"},"field-settings-text":{"type":"string","default-from":"runtime.field-settings-text"},"hidden-text":{"type":"string","default-from":"runtime.hidden-text"},"hide-rare-text":{"type":"string","default-from":"runtime.hide-rare-text"},"hint-text":{"type":"string","default-from":"runtime.hint-text"},"in-this-group-text":{"type":"string","default-from":"runtime.in-this-group-text"},"inherited-text":{"type":"string","default-from":"runtime.inherited-text"},"link-copied-label":{"type":"string","default-from":"runtime.link-copied-label"},"menu-label":{"type":"string","default-from":"runtime.menu-label"},"move-down-text":{"type":"string","default-from":"runtime.move-down-text"},"move-up-text":{"type":"string","default-from":"runtime.move-up-text"},"new-group-title":{"type":"string","default-from":"runtime.new-group-title"},"new-section-title":{"type":"string","default-from":"runtime.new-section-title"},"no-match-text":{"type":"string","default-from":"runtime.no-match-text"},"open-full-label":{"type":"string","default-from":"runtime.open-full-label"},"panel":{"type":"boolean","default":false},"panel-label":{"type":"string","default":""},"panel-size":{"type":"enum","values":["1/2","1","2","full"],"default":"1"},"size":{"type":"enum","values":["1","1/2"],"default":"1"},"mode":{"type":"enum","values":["view","auto","edit","create"],"default":"auto"},"panel-width":{"type":"string","default":""},"personal-layer-text":{"type":"string","default-from":"runtime.personal-layer-text"},"rare-text":{"type":"string","default-from":"runtime.rare-text"},"record-id":{"type":"id","default":""},"remove-field-text":{"type":"string","default-from":"runtime.remove-field-text"},"remove-group-text":{"type":"string","default-from":"runtime.remove-group-text"},"remove-section-text":{"type":"string","default-from":"runtime.remove-section-text"},"rename-text":{"type":"string","default-from":"runtime.rename-text"},"reset-view-ask-text":{"type":"string","default-from":"runtime.reset-view-ask-text"},"reset-view-text":{"type":"string","default-from":"runtime.reset-view-text"},"save-name-text":{"type":"string","default-from":"runtime.save-name-text"},"save-text":{"type":"string","default-from":"runtime.save-text"},"section-icon-text":{"type":"string","default-from":"runtime.section-icon-text"},"section-icons":{"type":"string","default":""},"sections-as":{"type":"enum","values":["list","tabs"],"default":"list"},"sections-label":{"type":"string","default-from":"runtime.sections-label"},"shared-layer-text":{"type":"string","default-from":"runtime.shared-layer-text"},"show-rare":{"type":"boolean","default":false},"show-rare-text":{"type":"string","default-from":"runtime.show-rare-text"},"shown-text":{"type":"string","default-from":"runtime.shown-text"},"unplaced-hint-text":{"type":"string","default-from":"runtime.unplaced-hint-text"},"unplaced-title":{"type":"string","default-from":"runtime.unplaced-title"},"variant-text":{"type":"string","default-from":"runtime.variant-text"},"view-conflict-text":{"type":"string","default-from":"runtime.view-conflict-text"},"view-denied-text":{"type":"string","default-from":"runtime.view-denied-text"},"width-text":{"type":"string","default-from":"runtime.width-text"},"view-profile-label":{"type":"string","default-from":"runtime.view-profile-label"},"add-view-text":{"type":"string","default-from":"runtime.add-view-text"},"new-view-text":{"type":"string","default-from":"runtime.new-view-text"},"delete-view-text":{"type":"string","default-from":"runtime.delete-view-text"},"last-shared-view-text":{"type":"string","default-from":"runtime.last-shared-view-text"},"full":{"type":"boolean","default":false},"open":{"type":"boolean","default":true}},"values":{"revision":{"type":"string"},"section":{"type":"string"}},"events":{"close":{"carries":{"reason":{"type":"enum","values":["close","escape","cancelled","deleted","api"]},"record_id":{"type":"id","nullable":true},"unsaved_fields":{"type":"list"}},"cancelable":true},"open-full":{"carries":{"id":"id","address":"string","record_id":{"type":"id","nullable":true}}},"saved":{"carries":{"id":"id","revision":{"type":"string","optional":true}}},"failed":{"carries":{"reason":"string","message":{"type":"string","optional":true}}},"open":{"carries":{"field":"string","value":"object","answer":"string"}},"delete":{"carries":{"collection":"string","revision":"string","answer":"string","record_id":{"type":"id","nullable":true}}},"created":{"carries":{"collection":{"type":"string","nullable":true},"record_id":{"type":"id","nullable":true}}},"cancel":{"carries":{"mode":{"type":"enum","values":["auto","edit","create"]},"scope":{"type":"enum","values":["group"],"optional":true},"section":{"type":"string","optional":true},"group":{"type":"string","optional":true}}},"state":{"carries":{"state":"string","message":"string"},"own-verb":true},"address-copy":{"carries":{},"own-verb":true},"favourite":{"carries":{"collection":{"type":"string","nullable":true},"favourite":"boolean","record_id":{"type":"id","nullable":true}},"own-verb":true}},"actions":{"refresh":{},"load":{"with":{"reason":{"type":"string","optional":true}}},"edit-group":{"with":{"section":"string","group":"string"}},"cancel-edit":{},"save-group":{"with":{"options":{"type":"object","optional":true}},"concurrency":"drop"},"select-section":{"with":{"key":"string"}},"close-panel":{"with":{"reason":{"type":"string","optional":true}}},"copy-address":{},"open-full-page":{},"confirm-save":{},"cancel-confirmation":{}},"port":{"id":"simai.property-view-port","version":"1.17.0","contract":"src/core/contracts/ports/simai.property-view-port/1.17.0/port.json"},"presentation":{"skeleton":{"file":"skeleton.html","late":[]}},"css-variables":{"--sf-property-view--sections-width":{"type":"length","state":"default"},"--sf-property-view--title-size":{"type":"length","state":"default"},"--sf-property-view--label-size":{"type":"length","state":"default"},"--sf-property-view--value-size":{"type":"length","state":"default"},"--sf-property-view--group-size":{"type":"length","state":"default"},"--sf-property-view--edge-room":{"type":"length","state":"open"}},"host-states":{"data-state":"string","aria-busy":"string"}}');
|
|
10227
10362
|
|
|
10228
10363
|
/***/ },
|
|
10229
10364
|
|
|
10230
10365
|
/***/ "99fb492b7fba"
|
|
10231
10366
|
(module) {
|
|
10232
10367
|
|
|
10233
|
-
module.exports = /*#__PURE__*/JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","
|
|
10368
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Property view","events":{"state":{"label":"Record state"},"address-copy":{"label":"Address copied"},"favourite":{"label":"Favourite"}},"runtime":{"add-field-text":"Add a field","add-group-text":"Add an area","add-section-text":"Add a section","add-view-text":"Add a view","back-label":"Back","cancel-configuring-text":"Cancel","cancel-name-text":"Leave the name","cancel-text":"Cancel","changed-text":"Fields changed","close-label":"Close","configure-hint-narrow-text":"Drag fields between groups. Applied at once.","configure-hint-text":"Drag fields between groups and onto a section on the left. Applied at once.","configure-text":"Arrange the view","confirm-save-text":"Confirm and save","conflict-text":"The record changed; read it again","copy-link-label":"Copy link","create-text":"Create","delete-text":"Delete","delete-view-text":"Remove the view","done-configuring-text":"Done","edit-text":"edit","empty-record-text":"This record has nothing to show","empty-text":"not filled in","errors-text":"Errors","favourite-label":"Favourite","field-label-text":"Name","field-settings-text":"Field settings","hidden-text":"Hide","hide-rare-text":"Hide rare fields","hint-text":"Hint","in-this-group-text":"In this area","inherited-text":"by default","keep-editing-text":"Keep editing","last-shared-view-text":"The only view everyone has","link-copied-label":"Link copied","menu-label":"More","move-down-text":"Move down","move-up-text":"Move up","new-group-title":"New area","new-section-title":"New section","new-view-text":"New view","no-match-text":"Nothing matches","open-full-label":"Open as a page","personal-layer-text":"Personal","rare-text":"rare","read-only-text":"You can only view this record","remove-field-text":"Remove from this area","remove-group-text":"Remove this area","remove-section-text":"Remove this section","rename-text":"Rename","reset-view-ask-text":"Reset the whole view?","reset-view-text":"Reset","save-failed-text":"The save failed","save-name-text":"Save the name","save-text":"Save","section-icon-text":"Section glyph","sections-label":"Sections","shared-layer-text":"Everyone\'s","show-rare-text":"Show rare fields","shown-text":"Shown","state-load-failed":"The record could not be read","state-loading":"Reading the record","state-port-not-connected":"The record port is not connected","state-unavailable":"The record is unavailable","unplaced-hint-text":"Fields this view does not show. Drag one into a group to place it, or drag a field here to take it out.","unplaced-title":"Not placed","variant-text":"Template","view-conflict-text":"The view changed and was read again","view-denied-text":"You may not change this layer","view-profile-label":"View","view-reset-failed-text":"The view could not be reset","view-save-failed-text":"The view could not be saved","width-text":"Full width"}}');
|
|
10234
10369
|
|
|
10235
10370
|
/***/ },
|
|
10236
10371
|
|
|
10237
10372
|
/***/ "d614908e644f"
|
|
10238
10373
|
(module) {
|
|
10239
10374
|
|
|
10240
|
-
module.exports = /*#__PURE__*/JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","
|
|
10375
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Запись","events":{"state":{"label":"Состояние записи"},"address-copy":{"label":"Адрес скопирован"},"favourite":{"label":"Избранное"}},"runtime":{"add-field-text":"Добавить поле","add-group-text":"Добавить область","add-section-text":"Добавить раздел","add-view-text":"Добавить вид","back-label":"Назад","cancel-configuring-text":"Отменить","cancel-name-text":"Оставить название","cancel-text":"Отменить","changed-text":"Изменено полей","close-label":"Закрыть","configure-hint-narrow-text":"Перетаскивайте поля между группами. Применяется сразу.","configure-hint-text":"Перетаскивайте поля между группами и на разделы слева. Применяется сразу.","configure-text":"Настроить вид","confirm-save-text":"Подтвердить и сохранить","conflict-text":"Запись изменилась, обновите её","copy-link-label":"Копировать ссылку","create-text":"Создать","delete-text":"Удалить","delete-view-text":"Удалить вид","done-configuring-text":"Готово","edit-text":"изменить","empty-record-text":"В этой записи нечего показать","empty-text":"не заполнено","errors-text":"Ошибок","favourite-label":"В избранное","field-label-text":"Название","field-settings-text":"Настройки поля","hidden-text":"Скрыть","hide-rare-text":"Скрыть редкие поля","hint-text":"Подсказка","in-this-group-text":"В этой области","inherited-text":"по умолчанию","keep-editing-text":"Вернуться к правке","last-shared-view-text":"Единственный общий вид","link-copied-label":"Ссылка скопирована","menu-label":"Ещё","move-down-text":"Ниже","move-up-text":"Выше","new-group-title":"Новая область","new-section-title":"Новый раздел","new-view-text":"Новый вид","no-match-text":"Ничего не найдено","open-full-label":"Открыть на всю страницу","personal-layer-text":"Персональный","rare-text":"редкое","read-only-text":"Эту запись можно только смотреть","remove-field-text":"Убрать из области","remove-group-text":"Удалить область","remove-section-text":"Удалить раздел","rename-text":"Переименовать","reset-view-ask-text":"Сбросить весь вид?","reset-view-text":"Сбросить","save-failed-text":"Не удалось сохранить","save-name-text":"Сохранить название","save-text":"Сохранить","section-icon-text":"Значок раздела","sections-label":"Разделы","shared-layer-text":"Для всех","show-rare-text":"Показать редкие поля","shown-text":"Показывать","state-load-failed":"Не удалось загрузить запись","state-loading":"Загрузка записи","state-port-not-connected":"Порт записи не подключён","state-unavailable":"Запись недоступна","unplaced-hint-text":"Поля, которых нет в этом виде. Перетащите поле в группу, чтобы разместить, или сюда, чтобы убрать.","unplaced-title":"Не размещённые","variant-text":"Вид","view-conflict-text":"Вид изменился, он перезагружен","view-denied-text":"Нет права менять этот слой","view-profile-label":"Вид","view-reset-failed-text":"Не удалось сбросить вид","view-save-failed-text":"Не удалось сохранить вид","width-text":"На всю ширину"}}');
|
|
10241
10376
|
|
|
10242
10377
|
/***/ }
|
|
10243
10378
|
|