@ptsecurity/mosaic 13.7.1 → 13.9.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/_theming.scss +186 -53
- package/_visual.scss +55 -13
- package/core/formatters/date/formatter.d.ts +13 -4
- package/core/formatters/date/templates/en-US.d.ts +2 -74
- package/core/formatters/date/templates/ru-RU.d.ts +2 -74
- package/design-tokens/legacy-2017/tokens/components/checkbox.json5 +4 -0
- package/design-tokens/legacy-2017/tokens/components/radio.json5 +11 -10
- package/design-tokens/legacy-2017/tokens/components/toast.json5 +54 -0
- package/design-tokens/legacy-2017/tokens.d.ts +49 -8
- package/design-tokens/pt-2022/tokens/components/button.json5 +1 -1
- package/design-tokens/pt-2022/tokens/components/checkbox.json5 +4 -0
- package/design-tokens/pt-2022/tokens/components/link.json5 +3 -3
- package/design-tokens/pt-2022/tokens/components/radio.json5 +6 -3
- package/design-tokens/pt-2022/tokens/components/tags.json5 +1 -1
- package/design-tokens/pt-2022/tokens/components/toast.json5 +54 -0
- package/design-tokens/pt-2022/tokens/properties/colors.json5 +1 -1
- package/design-tokens/pt-2022/tokens.d.ts +55 -13
- package/design-tokens/style-dictionary/figma-types.js +41 -0
- package/design-tokens/style-dictionary/formats/figma.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-border.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-color.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-default.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-font.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-opacity.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-shadow.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-sizing.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-spacing.js +1 -1
- package/design-tokens/style-dictionary/transforms/attribute/figma-typography.js +1 -1
- package/esm2020/button/button.component.mjs +2 -2
- package/esm2020/core/formatters/date/formatter.mjs +22 -16
- package/esm2020/core/formatters/date/templates/en-US.mjs +1 -1
- package/esm2020/core/formatters/date/templates/ru-RU.mjs +1 -1
- package/esm2020/design-tokens/legacy-2017/tokens.mjs +50 -9
- package/esm2020/design-tokens/pt-2022/tokens.mjs +56 -14
- package/esm2020/navbar/navbar-item.component.mjs +29 -6
- package/esm2020/navbar/vertical-navbar.component.mjs +3 -3
- package/esm2020/radio/radio.component.mjs +3 -3
- package/esm2020/textarea/textarea.component.mjs +3 -4
- package/esm2020/toast/index.mjs +2 -0
- package/esm2020/toast/ptsecurity-mosaic-toast.mjs +5 -0
- package/esm2020/toast/public-api.mjs +6 -0
- package/esm2020/toast/toast-animations.mjs +9 -0
- package/esm2020/toast/toast-container.component.mjs +44 -0
- package/esm2020/toast/toast.component.mjs +89 -0
- package/esm2020/toast/toast.module.mjs +42 -0
- package/esm2020/toast/toast.service.mjs +178 -0
- package/esm2020/toast/toast.type.mjs +15 -0
- package/esm2020/tooltip/tooltip.component.mjs +2 -1
- package/esm2020/tree/tree-option.component.mjs +3 -2
- package/esm2020/tree/tree-selection.component.mjs +3 -2
- package/esm2020/tree-select/tree-select.component.mjs +10 -9
- package/fesm2015/ptsecurity-mosaic-button.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-core.mjs +21 -15
- package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-design-tokens.mjs +147 -23
- package/fesm2015/ptsecurity-mosaic-design-tokens.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-navbar.mjs +33 -9
- package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-radio.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-radio.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-textarea.mjs +2 -3
- package/fesm2015/ptsecurity-mosaic-textarea.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-toast.mjs +363 -0
- package/fesm2015/ptsecurity-mosaic-toast.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-tooltip.mjs +1 -0
- package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs +9 -8
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree.mjs +4 -2
- package/fesm2015/ptsecurity-mosaic-tree.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-button.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-core.mjs +21 -15
- package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-design-tokens.mjs +147 -23
- package/fesm2020/ptsecurity-mosaic-design-tokens.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-navbar.mjs +30 -7
- package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-radio.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-radio.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-textarea.mjs +2 -3
- package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-toast.mjs +361 -0
- package/fesm2020/ptsecurity-mosaic-toast.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-tooltip.mjs +1 -0
- package/fesm2020/ptsecurity-mosaic-tooltip.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs +9 -8
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-tree.mjs +4 -2
- package/fesm2020/ptsecurity-mosaic-tree.mjs.map +1 -1
- package/navbar/navbar-item.component.d.ts +9 -3
- package/package.json +12 -4
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
- package/toast/index.d.ts +1 -0
- package/toast/package.json +10 -0
- package/toast/ptsecurity-mosaic-toast.d.ts +5 -0
- package/toast/public-api.d.ts +5 -0
- package/toast/toast-animations.d.ts +4 -0
- package/toast/toast-container.component.d.ts +15 -0
- package/toast/toast.component.d.ts +35 -0
- package/toast/toast.module.d.ts +13 -0
- package/toast/toast.service.d.ts +49 -0
- package/toast/toast.type.d.ts +27 -0
- package/tooltip/tooltip.component.d.ts +1 -1
- package/tree/tree-selection.component.d.ts +1 -0
@@ -933,13 +933,13 @@ class DateFormatter {
|
|
933
933
|
* @param datetime - should time be shown as well
|
934
934
|
* @param seconds - should time with seconds be shown as well
|
935
935
|
* @param milliseconds - should time with milliseconds be shown as well
|
936
|
-
* @
|
936
|
+
* @param currYear - should current year be shown as well
|
937
937
|
*/
|
938
|
-
absoluteDate(date, params, datetime = false, seconds = false, milliseconds = false) {
|
938
|
+
absoluteDate(date, params, datetime = false, seconds = false, milliseconds = false, currYear = false) {
|
939
939
|
if (!this.adapter.isDateInstance(date)) {
|
940
940
|
throw new Error(this.invalidDateErrorText);
|
941
941
|
}
|
942
|
-
const variables = this.compileVariables(date, Object.assign(Object.assign({}, this.adapter.config.variables), params.variables));
|
942
|
+
const variables = this.compileVariables(date, Object.assign(Object.assign({}, this.adapter.config.variables), params.variables), currYear);
|
943
943
|
variables.SHOW_SECONDS = seconds ? 'yes' : 'no';
|
944
944
|
variables.SHOW_MILLISECONDS = milliseconds ? 'yes' : 'no';
|
945
945
|
const template = datetime ? params.DATETIME : params.DATE;
|
@@ -947,10 +947,11 @@ class DateFormatter {
|
|
947
947
|
}
|
948
948
|
/**
|
949
949
|
* @param date - date
|
950
|
+
* @param currYear - should the year be shown forced
|
950
951
|
* @returns absolute date in short format
|
951
952
|
*/
|
952
|
-
absoluteShortDate(date) {
|
953
|
-
return this.absoluteDate(date, this.config.absoluteTemplates.short);
|
953
|
+
absoluteShortDate(date, currYear = false) {
|
954
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.short, false, false, false, currYear);
|
954
955
|
}
|
955
956
|
/**
|
956
957
|
* @param date - date
|
@@ -958,14 +959,15 @@ class DateFormatter {
|
|
958
959
|
* @returns absolute date in short format with time
|
959
960
|
*/
|
960
961
|
absoluteShortDateTime(date, options) {
|
961
|
-
return this.absoluteDate(date, this.config.absoluteTemplates.short, true, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
962
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.short, true, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds, options === null || options === void 0 ? void 0 : options.currYear);
|
962
963
|
}
|
963
964
|
/**
|
964
965
|
* @param date - date
|
966
|
+
* @param currYear - should the year be shown forced
|
965
967
|
* @returns absolute date in long format
|
966
968
|
*/
|
967
|
-
absoluteLongDate(date) {
|
968
|
-
return this.absoluteDate(date, this.config.absoluteTemplates.long);
|
969
|
+
absoluteLongDate(date, currYear = false) {
|
970
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.long, false, false, false, currYear);
|
969
971
|
}
|
970
972
|
/**
|
971
973
|
* @param date - date
|
@@ -973,7 +975,7 @@ class DateFormatter {
|
|
973
975
|
* @returns absolute date in long format with time
|
974
976
|
*/
|
975
977
|
absoluteLongDateTime(date, options) {
|
976
|
-
return this.absoluteDate(date, this.config.absoluteTemplates.long, true, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
978
|
+
return this.absoluteDate(date, this.config.absoluteTemplates.long, true, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds, options === null || options === void 0 ? void 0 : options.currYear);
|
977
979
|
}
|
978
980
|
/**
|
979
981
|
* @param startDate - start date
|
@@ -1135,7 +1137,13 @@ class DateFormatter {
|
|
1135
1137
|
rangeMiddleDateTime(startDate, endDate, options) {
|
1136
1138
|
return this.rangeDateTime(startDate, endDate, this.config.rangeTemplates.closedRange.middle, options === null || options === void 0 ? void 0 : options.seconds, options === null || options === void 0 ? void 0 : options.milliseconds);
|
1137
1139
|
}
|
1138
|
-
|
1140
|
+
/**
|
1141
|
+
* @param date
|
1142
|
+
* @param variables - date template variables
|
1143
|
+
* @param currYearForced - param for absolute days formatting
|
1144
|
+
* @private
|
1145
|
+
*/
|
1146
|
+
compileVariables(date, variables, currYearForced = false) {
|
1139
1147
|
const compiledVariables = {};
|
1140
1148
|
// tslint:disable-next-line:no-for-in
|
1141
1149
|
for (const key in variables) {
|
@@ -1145,22 +1153,20 @@ class DateFormatter {
|
|
1145
1153
|
const value = variables[key];
|
1146
1154
|
compiledVariables[key] = this.adapter.format(date, value);
|
1147
1155
|
}
|
1148
|
-
compiledVariables.CURRENT_YEAR = this.hasSame(date, this.adapter.today(), 'year');
|
1156
|
+
compiledVariables.CURRENT_YEAR = (currYearForced && 'no') || this.hasSame(date, this.adapter.today(), 'year');
|
1149
1157
|
return compiledVariables;
|
1150
1158
|
}
|
1151
1159
|
isBeforeYesterday(date) {
|
1152
1160
|
return this.adapter.daysFromToday(date) <= -2;
|
1153
1161
|
}
|
1154
1162
|
isYesterday(date) {
|
1155
|
-
|
1156
|
-
return interval > -2 && interval <= -1;
|
1163
|
+
return this.adapter.daysFromToday(date) === -1;
|
1157
1164
|
}
|
1158
1165
|
isToday(date) {
|
1159
1166
|
return this.adapter.daysFromToday(date) === 0;
|
1160
1167
|
}
|
1161
1168
|
isTomorrow(date) {
|
1162
|
-
|
1163
|
-
return interval >= 1 && interval < 2;
|
1169
|
+
return this.adapter.daysFromToday(date) === 1;
|
1164
1170
|
}
|
1165
1171
|
isAfterTomorrow(date) {
|
1166
1172
|
return this.adapter.daysFromToday(date) >= 2;
|