tosijs-ui 1.5.4 → 1.5.5

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.
@@ -1192,39 +1192,39 @@ export class TosiTable extends WebComponent {
1192
1192
  if (menu.length) {
1193
1193
  menu.push(null);
1194
1194
  }
1195
- if (options.pinned) {
1196
- menu.push({
1197
- caption: this.localized
1198
- ? localize('Unpin')
1199
- : 'Unpin',
1200
- icon: 'unlock',
1201
- action() {
1202
- delete options.pinned;
1203
- queueRender();
1195
+ menu.push({
1196
+ caption: this.localized ? localize('Pin') : 'Pin',
1197
+ icon: 'lock',
1198
+ menuItems: [
1199
+ {
1200
+ caption: this.localized ? localize('Left') : 'Left',
1201
+ icon: 'arrowLeft',
1202
+ enabled: () => options.pinned !== 'left',
1203
+ action() {
1204
+ options.pinned = 'left';
1205
+ queueRender();
1206
+ },
1204
1207
  },
1205
- });
1206
- }
1207
- else {
1208
- menu.push({
1209
- caption: this.localized
1210
- ? `${localize('Pin')} ${localize('Left')}`
1211
- : 'Pin Left',
1212
- icon: 'lock',
1213
- action() {
1214
- options.pinned = 'left';
1215
- queueRender();
1208
+ {
1209
+ caption: this.localized ? localize('Right') : 'Right',
1210
+ icon: 'arrowRight',
1211
+ enabled: () => options.pinned !== 'right',
1212
+ action() {
1213
+ options.pinned = 'right';
1214
+ queueRender();
1215
+ },
1216
1216
  },
1217
- }, {
1218
- caption: this.localized
1219
- ? `${localize('Pin')} ${localize('Right')}`
1220
- : 'Pin Right',
1221
- icon: 'lock',
1222
- action() {
1223
- options.pinned = 'right';
1224
- queueRender();
1217
+ {
1218
+ caption: this.localized ? localize('Unpin') : 'Unpin',
1219
+ icon: 'unlock',
1220
+ enabled: () => !!options.pinned,
1221
+ action() {
1222
+ delete options.pinned;
1223
+ queueRender();
1224
+ },
1225
1225
  },
1226
- });
1227
- }
1226
+ ],
1227
+ });
1228
1228
  popMenu({
1229
1229
  target,
1230
1230
  localized: this.localized,